@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,89 @@
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
+ /** @typedef {import('./theme-edit.type.mjs').ThemeEditChangeOptions} ChangeOptions */
5
+ /**
6
+ * Start a theme in themes/<name>/, optionally on a built-in theme.
7
+ * @experimental
8
+ * @param {string} name
9
+ * @param {import('./theme-edit.type.mjs').ThemeEditNewOptions} [options]
10
+ * @returns {Promise<import('./theme-edit.type.mjs').ThemeEditNewResponse>}
11
+ */
12
+ export function themeEditNew(name: string, options?: import("./theme-edit.type.mjs").ThemeEditNewOptions): Promise<import("./theme-edit.type.mjs").ThemeEditNewResponse>;
13
+ /**
14
+ * Change one thing in a theme: checked, built, previewed.
15
+ * @experimental
16
+ * @param {string} theme
17
+ * @param {string} thing a dial, a token, or a CSS property
18
+ * @param {string} value
19
+ * @param {ChangeOptions} [options]
20
+ * @returns {Promise<import('./theme-edit.type.mjs').ThemeEditChangeResponse>}
21
+ */
22
+ export function themeEditSet(theme: string, thing: string, value: string, options?: ChangeOptions): Promise<import("./theme-edit.type.mjs").ThemeEditChangeResponse>;
23
+ /**
24
+ * Return one setting to the base theme's value: the setting is removed,
25
+ * and the theme is rebuilt and previewed.
26
+ * @experimental
27
+ * @param {string} theme
28
+ * @param {string} thing
29
+ * @param {ChangeOptions & {value?: string}} [options] `value` names which half of
30
+ * the `headings` dial to reset (`weight` or `tracking`)
31
+ * @returns {Promise<import('./theme-edit.type.mjs').ThemeEditChangeResponse>}
32
+ */
33
+ export function themeEditReset(theme: string, thing: string, options?: ChangeOptions & {
34
+ value?: string;
35
+ }): Promise<import("./theme-edit.type.mjs").ThemeEditChangeResponse>;
36
+ /**
37
+ * Every setting of a theme, key resolved values, problems it caused, the
38
+ * sample page and the theme-building page with every component.
39
+ * @experimental
40
+ * @param {string} theme
41
+ * @param {{cwd?: string, png?: boolean, group?: string}} [options]
42
+ * @returns {Promise<import('./theme-edit.type.mjs').ThemeEditShowResponse>}
43
+ */
44
+ export function themeEditShow(theme: string, options?: {
45
+ cwd?: string;
46
+ png?: boolean;
47
+ group?: string;
48
+ }): Promise<import("./theme-edit.type.mjs").ThemeEditShowResponse>;
49
+ /**
50
+ * Put the theme back as it was before its last change.
51
+ * @experimental
52
+ * @param {string} theme
53
+ * @param {{cwd?: string, png?: boolean}} [options]
54
+ * @returns {Promise<import('./theme-edit.type.mjs').ThemeEditUndoResponse>}
55
+ */
56
+ export function themeEditUndo(theme: string, options?: {
57
+ cwd?: string;
58
+ png?: boolean;
59
+ }): Promise<import("./theme-edit.type.mjs").ThemeEditUndoResponse>;
60
+ /**
61
+ * The theme-building page: every component grouped, each variant side by
62
+ * side, overlays open, and full template pages. Rendered to one HTML file,
63
+ * or with `write` written into the app as a page module.
64
+ * @experimental
65
+ * @param {string} theme
66
+ * @param {{cwd?: string, write?: string, group?: string, png?: boolean}} [options]
67
+ * @returns {Promise<import('./theme-edit.type.mjs').ThemeEditPreviewResponse>}
68
+ */
69
+ export function themeEditPreview(theme: string, options?: {
70
+ cwd?: string;
71
+ write?: string;
72
+ group?: string;
73
+ png?: boolean;
74
+ }): Promise<import("./theme-edit.type.mjs").ThemeEditPreviewResponse>;
75
+ /**
76
+ * Explain anything a theme change can name, or answer a question about one:
77
+ * a part (what it reads for each aspect, its variants, states and the parts
78
+ * inside it), a family (its members), a setting (a dial's rungs, a token's
79
+ * type and readers, a CSS property), an aspect (colors, text, corners...: the
80
+ * whole-theme tokens and dial), a plain-words question (exact commands), a
81
+ * PNG picture (its main colors, or the color at points), or with `list` a
82
+ * list of dials, tokens, parts, families or CSS properties.
83
+ * @experimental
84
+ * @param {string} subject a part, family, setting, aspect, question, or PNG file; with `list`, a filter
85
+ * @param {import('./theme-edit.type.mjs').ThemeEditExplainOptions} [options]
86
+ * @returns {Promise<import('./theme-edit.type.mjs').ThemeEditExplainResponse>}
87
+ */
88
+ export function themeEditExplain(subject: string, options?: import("./theme-edit.type.mjs").ThemeEditExplainOptions): Promise<import("./theme-edit.type.mjs").ThemeEditExplainResponse>;
89
+ export type ChangeOptions = import("./theme-edit.type.mjs").ThemeEditChangeOptions;
@@ -0,0 +1,119 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ /**
4
+ * @file Programmatic API for `astryx experimental theme`: make and change a
5
+ * theme one checked change at a time.
6
+ *
7
+ * themeEditNew('brand', {like: 'neutral'}) themeEdit.new
8
+ * themeEditSet('brand', 'corners', 'pill') themeEdit.set
9
+ * themeEditReset('brand', 'corners') themeEdit.reset
10
+ * themeEditShow('brand') themeEdit.show
11
+ * themeEditUndo('brand') themeEdit.undo
12
+ * themeEditPreview('brand', {write: 'src/app/theme'}) themeEdit.preview
13
+ * themeEditExplain('banner') themeEdit.explain
14
+ *
15
+ * Every change is checked first against what the installed Core's parts
16
+ * really read; a change that cannot take effect is refused and nothing is
17
+ * written. An accepted change rebuilds the theme with the theme build and
18
+ * writes a preview.
19
+ *
20
+ * @input a theme name and a change, a question, or a picture
21
+ * @output themeEdit.* envelopes
22
+ * @position api/theme-edit — command wrapper in
23
+ * clients/cli/commands/experimental/theme.mjs; the work is in _adapter.mjs
24
+ */
25
+
26
+ import * as adapter from './_adapter.mjs';
27
+
28
+ /** @typedef {import('./theme-edit.type.mjs').ThemeEditChangeOptions} ChangeOptions */
29
+
30
+ /**
31
+ * Start a theme in themes/<name>/, optionally on a built-in theme.
32
+ * @experimental
33
+ * @param {string} name
34
+ * @param {import('./theme-edit.type.mjs').ThemeEditNewOptions} [options]
35
+ * @returns {Promise<import('./theme-edit.type.mjs').ThemeEditNewResponse>}
36
+ */
37
+ export async function themeEditNew(name, options = {}) {
38
+ return adapter.themeEditNew(name, options);
39
+ }
40
+
41
+ /**
42
+ * Change one thing in a theme: checked, built, previewed.
43
+ * @experimental
44
+ * @param {string} theme
45
+ * @param {string} thing a dial, a token, or a CSS property
46
+ * @param {string} value
47
+ * @param {ChangeOptions} [options]
48
+ * @returns {Promise<import('./theme-edit.type.mjs').ThemeEditChangeResponse>}
49
+ */
50
+ export async function themeEditSet(theme, thing, value, options = {}) {
51
+ return adapter.themeEditSet(theme, thing, value, options);
52
+ }
53
+
54
+ /**
55
+ * Return one setting to the base theme's value: the setting is removed,
56
+ * and the theme is rebuilt and previewed.
57
+ * @experimental
58
+ * @param {string} theme
59
+ * @param {string} thing
60
+ * @param {ChangeOptions & {value?: string}} [options] `value` names which half of
61
+ * the `headings` dial to reset (`weight` or `tracking`)
62
+ * @returns {Promise<import('./theme-edit.type.mjs').ThemeEditChangeResponse>}
63
+ */
64
+ export async function themeEditReset(theme, thing, options = {}) {
65
+ return adapter.themeEditReset(theme, thing, options);
66
+ }
67
+
68
+ /**
69
+ * Every setting of a theme, key resolved values, problems it caused, the
70
+ * sample page and the theme-building page with every component.
71
+ * @experimental
72
+ * @param {string} theme
73
+ * @param {{cwd?: string, png?: boolean, group?: string}} [options]
74
+ * @returns {Promise<import('./theme-edit.type.mjs').ThemeEditShowResponse>}
75
+ */
76
+ export async function themeEditShow(theme, options = {}) {
77
+ return adapter.themeEditShow(theme, options);
78
+ }
79
+
80
+ /**
81
+ * Put the theme back as it was before its last change.
82
+ * @experimental
83
+ * @param {string} theme
84
+ * @param {{cwd?: string, png?: boolean}} [options]
85
+ * @returns {Promise<import('./theme-edit.type.mjs').ThemeEditUndoResponse>}
86
+ */
87
+ export async function themeEditUndo(theme, options = {}) {
88
+ return adapter.themeEditUndo(theme, options);
89
+ }
90
+
91
+ /**
92
+ * The theme-building page: every component grouped, each variant side by
93
+ * side, overlays open, and full template pages. Rendered to one HTML file,
94
+ * or with `write` written into the app as a page module.
95
+ * @experimental
96
+ * @param {string} theme
97
+ * @param {{cwd?: string, write?: string, group?: string, png?: boolean}} [options]
98
+ * @returns {Promise<import('./theme-edit.type.mjs').ThemeEditPreviewResponse>}
99
+ */
100
+ export async function themeEditPreview(theme, options = {}) {
101
+ return adapter.themeEditPreview(theme, options);
102
+ }
103
+
104
+ /**
105
+ * Explain anything a theme change can name, or answer a question about one:
106
+ * a part (what it reads for each aspect, its variants, states and the parts
107
+ * inside it), a family (its members), a setting (a dial's rungs, a token's
108
+ * type and readers, a CSS property), an aspect (colors, text, corners...: the
109
+ * whole-theme tokens and dial), a plain-words question (exact commands), a
110
+ * PNG picture (its main colors, or the color at points), or with `list` a
111
+ * list of dials, tokens, parts, families or CSS properties.
112
+ * @experimental
113
+ * @param {string} subject a part, family, setting, aspect, question, or PNG file; with `list`, a filter
114
+ * @param {import('./theme-edit.type.mjs').ThemeEditExplainOptions} [options]
115
+ * @returns {Promise<import('./theme-edit.type.mjs').ThemeEditExplainResponse>}
116
+ */
117
+ export async function themeEditExplain(subject, options = {}) {
118
+ return adapter.themeEditExplain(subject, options);
119
+ }
@@ -0,0 +1,270 @@
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
+ /**
5
+ * One setting a theme made by `experimental theme` holds.
6
+ */
7
+ export type ThemeEditSetting = {
8
+ /**
9
+ * - A dial (`corners`), a design token (`--color-accent`), or a CSS property (`background`).
10
+ */
11
+ thing: string;
12
+ /**
13
+ * - The value as stored (a dial step is stored as the rung it reached).
14
+ */
15
+ value: string;
16
+ /**
17
+ * - What kind of thing it is.
18
+ */
19
+ source: "dial" | "token" | "property";
20
+ /**
21
+ * - The part, family, or typography role it applies to; absent for the whole theme.
22
+ */
23
+ on?: string | undefined;
24
+ /**
25
+ * - `<prop>:<value>`: only that variant.
26
+ */
27
+ when?: string | undefined;
28
+ /**
29
+ * - Only that state.
30
+ */
31
+ state?: string | undefined;
32
+ /**
33
+ * - Only that color mode.
34
+ */
35
+ mode?: "light" | "dark" | undefined;
36
+ /**
37
+ * - One member of an always-alike family, not the whole family.
38
+ */
39
+ only?: boolean | undefined;
40
+ /**
41
+ * - For the `headings` dial: `weight` or `tracking`.
42
+ */
43
+ axis?: string | undefined;
44
+ /**
45
+ * - What the check found worth saying (what the token feeds, parts it misses).
46
+ */
47
+ note?: string | undefined;
48
+ };
49
+ export type ThemeEditNewOptions = {
50
+ /**
51
+ * - The app folder (default: process.cwd()).
52
+ */
53
+ cwd?: string | undefined;
54
+ /**
55
+ * - A built-in theme to build on: neutral, stone, matcha, y2k, gothic, chocolate, or butter.
56
+ */
57
+ like?: string | undefined;
58
+ /**
59
+ * - Also take PNG pictures of the preview with a Playwright or Chrome found on the machine.
60
+ */
61
+ png?: boolean | undefined;
62
+ };
63
+ export type ThemeEditChangeOptions = {
64
+ /**
65
+ * - The app folder (default: process.cwd()).
66
+ */
67
+ cwd?: string | undefined;
68
+ /**
69
+ * - A part (`button`), a family (`inputs`), or for `font` a role (`heading`).
70
+ */
71
+ on?: string | undefined;
72
+ /**
73
+ * - `<prop>:<value>`: only that variant, such as `variant:primary`.
74
+ */
75
+ when?: string | undefined;
76
+ /**
77
+ * - Only that state, such as `hover`.
78
+ */
79
+ state?: string | undefined;
80
+ /**
81
+ * - `light` or `dark`: only that color mode (colors and shadows only).
82
+ */
83
+ mode?: string | undefined;
84
+ /**
85
+ * - With a member of an always-alike family (inputs, checks), style just that part.
86
+ */
87
+ only?: boolean | undefined;
88
+ /**
89
+ * - Also take PNG pictures of the preview.
90
+ */
91
+ png?: boolean | undefined;
92
+ };
93
+ export type ThemeEditPreviewFields = {
94
+ /**
95
+ * - The sample app page with the theme, one self-contained HTML file.
96
+ */
97
+ preview: string;
98
+ /**
99
+ * - PNG pictures taken (only with `png`).
100
+ */
101
+ pictures: string[];
102
+ /**
103
+ * - Why no picture was taken, and how to get a browser for it.
104
+ */
105
+ pictureProblem: string | null;
106
+ };
107
+ /**
108
+ * `astryx --json experimental theme new <theme>`.
109
+ */
110
+ export type ThemeEditNewResponse = {
111
+ type: "themeEdit.new";
112
+ data: {
113
+ theme: string;
114
+ like: string | null;
115
+ files: {
116
+ settings: string;
117
+ source: string;
118
+ css: string;
119
+ module: string;
120
+ };
121
+ problems: string[];
122
+ } & ThemeEditPreviewFields;
123
+ };
124
+ /**
125
+ * `astryx --json experimental theme set|reset <theme> <thing> ...`.
126
+ */
127
+ export type ThemeEditChangeResponse = {
128
+ type: "themeEdit.set" | "themeEdit.reset";
129
+ data: ThemeEditChangeData;
130
+ };
131
+ export type ThemeEditChangeData = {
132
+ theme: string;
133
+ action: "set" | "reset";
134
+ /**
135
+ * - The setting written, or for `reset` the one removed.
136
+ */
137
+ setting: ThemeEditSetting;
138
+ /**
139
+ * - The setting this one replaced.
140
+ */
141
+ replaced: ThemeEditSetting | null;
142
+ /**
143
+ * - For `base` and `mode`: the value before.
144
+ */
145
+ was: string | null;
146
+ /**
147
+ * - The parts it styles (a family's members when it spread).
148
+ */
149
+ parts: string[];
150
+ /**
151
+ * - The family it spread to; `onlyHint` when `--only` would style one member.
152
+ */
153
+ family: {
154
+ name: string;
155
+ members: string[];
156
+ onlyHint: boolean;
157
+ } | null;
158
+ /**
159
+ * - Resolved token changes, `name (mode): before -> after`.
160
+ */
161
+ changedTokens: string[];
162
+ /**
163
+ * - Part styles and typography the change wrote.
164
+ */
165
+ styled: string[];
166
+ /**
167
+ * - Part settings a whole-theme dial left in place (a part setting wins).
168
+ */
169
+ kept: string[];
170
+ /**
171
+ * - Variant keys the setting was newly repeated on, so a more specific base rule cannot beat it.
172
+ */
173
+ lifted: string[];
174
+ /**
175
+ * - What else to know: accent text per mode, font loading, what a token feeds.
176
+ */
177
+ notes: string[];
178
+ /**
179
+ * - Text this theme made unreadable (below 4.5:1, and not that low in the base theme).
180
+ */
181
+ problems: string[];
182
+ /**
183
+ * - Warnings from the theme build.
184
+ */
185
+ warnings: string[];
186
+ preview: string;
187
+ pictures: string[];
188
+ pictureProblem: string | null;
189
+ };
190
+ /**
191
+ * `astryx --json experimental theme show <theme>`.
192
+ */
193
+ export type ThemeEditShowResponse = {
194
+ type: "themeEdit.show";
195
+ data: {
196
+ theme: string;
197
+ like: string | null;
198
+ mode: string;
199
+ settings: Array<ThemeEditSetting & {
200
+ parts: string[];
201
+ }>;
202
+ resolved: Record<string, Record<string, string | null>>;
203
+ problems: string[];
204
+ notes: string[];
205
+ preview: string;
206
+ sheet: string;
207
+ sheetComponents: number;
208
+ skipped: string[];
209
+ pictures: string[];
210
+ pictureProblem: string | null;
211
+ };
212
+ };
213
+ /**
214
+ * `astryx --json experimental theme undo <theme>`.
215
+ */
216
+ export type ThemeEditUndoResponse = {
217
+ type: "themeEdit.undo";
218
+ data: {
219
+ theme: string;
220
+ undone: string[];
221
+ settings: number;
222
+ stepsLeft: number;
223
+ } & ThemeEditPreviewFields;
224
+ };
225
+ /**
226
+ * `astryx --json experimental theme preview <theme>`.
227
+ */
228
+ export type ThemeEditPreviewResponse = {
229
+ type: "themeEdit.preview";
230
+ data: {
231
+ theme: string;
232
+ group: string | null;
233
+ mode: "html" | "page";
234
+ files: string[];
235
+ html: string | null;
236
+ components: number;
237
+ skipped: string[];
238
+ pictures: string[];
239
+ pictureProblem: string | null;
240
+ };
241
+ };
242
+ export type ThemeEditExplainOptions = {
243
+ /**
244
+ * - The app folder (default: process.cwd()).
245
+ */
246
+ cwd?: string | undefined;
247
+ /**
248
+ * - List what a change can name: dials, tokens, parts, families, or properties; the subject filters it.
249
+ */
250
+ list?: string | undefined;
251
+ /**
252
+ * - With a PNG picture: pixel points x,y ("40,20;300,180", "40,20 300,180", several entries, or a flat "40,20,300,180").
253
+ */
254
+ at?: string[] | undefined;
255
+ /**
256
+ * - With a PNG picture: how many main colors (default 14).
257
+ */
258
+ count?: number | undefined;
259
+ };
260
+ /**
261
+ * `astryx --json experimental theme explain ...`. `kind` says which answer it is.
262
+ */
263
+ export type ThemeEditExplainResponse = {
264
+ type: "themeEdit.explain";
265
+ data: {
266
+ kind: "part" | "family" | "setting" | "aspect" | "question" | "picture" | "list";
267
+ subject: string;
268
+ [key: string]: any;
269
+ };
270
+ };
@@ -0,0 +1,155 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ /**
4
+ * @file Colocated types for `astryx experimental theme`: the source of truth
5
+ * for its option and response shapes.
6
+ *
7
+ * @position api/theme-edit — typedefs for api/theme-edit/theme-edit.mjs
8
+ */
9
+
10
+ /**
11
+ * One setting a theme made by `experimental theme` holds.
12
+ * @experimental May change or be removed in a patch release.
13
+ * @typedef {object} ThemeEditSetting
14
+ * @property {string} thing - A dial (`corners`), a design token (`--color-accent`), or a CSS property (`background`).
15
+ * @property {string} value - The value as stored (a dial step is stored as the rung it reached).
16
+ * @property {'dial' | 'token' | 'property'} source - What kind of thing it is.
17
+ * @property {string} [on] - The part, family, or typography role it applies to; absent for the whole theme.
18
+ * @property {string} [when] - `<prop>:<value>`: only that variant.
19
+ * @property {string} [state] - Only that state.
20
+ * @property {'light' | 'dark'} [mode] - Only that color mode.
21
+ * @property {boolean} [only] - One member of an always-alike family, not the whole family.
22
+ * @property {string} [axis] - For the `headings` dial: `weight` or `tracking`.
23
+ * @property {string} [note] - What the check found worth saying (what the token feeds, parts it misses).
24
+ */
25
+
26
+ /**
27
+ * @experimental May change or be removed in a patch release.
28
+ * @typedef {object} ThemeEditNewOptions
29
+ * @property {string} [cwd] - The app folder (default: process.cwd()).
30
+ * @property {string} [like] - A built-in theme to build on: neutral, stone, matcha, y2k, gothic, chocolate, or butter.
31
+ * @property {boolean} [png] - Also take PNG pictures of the preview with a Playwright or Chrome found on the machine.
32
+ */
33
+
34
+ /**
35
+ * @experimental May change or be removed in a patch release.
36
+ * @typedef {object} ThemeEditChangeOptions
37
+ * @property {string} [cwd] - The app folder (default: process.cwd()).
38
+ * @property {string} [on] - A part (`button`), a family (`inputs`), or for `font` a role (`heading`).
39
+ * @property {string} [when] - `<prop>:<value>`: only that variant, such as `variant:primary`.
40
+ * @property {string} [state] - Only that state, such as `hover`.
41
+ * @property {string} [mode] - `light` or `dark`: only that color mode (colors and shadows only).
42
+ * @property {boolean} [only] - With a member of an always-alike family (inputs, checks), style just that part.
43
+ * @property {boolean} [png] - Also take PNG pictures of the preview.
44
+ */
45
+
46
+ /**
47
+ * @experimental May change or be removed in a patch release.
48
+ * @typedef {object} ThemeEditPreviewFields
49
+ * @property {string} preview - The sample app page with the theme, one self-contained HTML file.
50
+ * @property {string[]} pictures - PNG pictures taken (only with `png`).
51
+ * @property {string | null} pictureProblem - Why no picture was taken, and how to get a browser for it.
52
+ */
53
+
54
+ /**
55
+ * `astryx --json experimental theme new <theme>`.
56
+ * @experimental May change or be removed in a patch release.
57
+ * @typedef {object} ThemeEditNewResponse
58
+ * @property {'themeEdit.new'} type
59
+ * @property {{theme: string, like: string | null, files: {settings: string, source: string, css: string, module: string}, problems: string[]} & ThemeEditPreviewFields} data
60
+ */
61
+
62
+ /**
63
+ * `astryx --json experimental theme set|reset <theme> <thing> ...`.
64
+ * @experimental May change or be removed in a patch release.
65
+ * @typedef {object} ThemeEditChangeResponse
66
+ * @property {'themeEdit.set' | 'themeEdit.reset'} type
67
+ * @property {ThemeEditChangeData} data
68
+ */
69
+
70
+ /**
71
+ * @experimental May change or be removed in a patch release.
72
+ * @typedef {object} ThemeEditChangeData
73
+ * @property {string} theme
74
+ * @property {'set' | 'reset'} action
75
+ * @property {ThemeEditSetting} setting - The setting written, or for `reset` the one removed.
76
+ * @property {ThemeEditSetting | null} replaced - The setting this one replaced.
77
+ * @property {string | null} was - For `base` and `mode`: the value before.
78
+ * @property {string[]} parts - The parts it styles (a family's members when it spread).
79
+ * @property {{name: string, members: string[], onlyHint: boolean} | null} family - The family it spread to; `onlyHint` when `--only` would style one member.
80
+ * @property {string[]} changedTokens - Resolved token changes, `name (mode): before -> after`.
81
+ * @property {string[]} styled - Part styles and typography the change wrote.
82
+ * @property {string[]} kept - Part settings a whole-theme dial left in place (a part setting wins).
83
+ * @property {string[]} lifted - Variant keys the setting was newly repeated on, so a more specific base rule cannot beat it.
84
+ * @property {string[]} notes - What else to know: accent text per mode, font loading, what a token feeds.
85
+ * @property {string[]} problems - Text this theme made unreadable (below 4.5:1, and not that low in the base theme).
86
+ * @property {string[]} warnings - Warnings from the theme build.
87
+ * @property {string} preview
88
+ * @property {string[]} pictures
89
+ * @property {string | null} pictureProblem
90
+ */
91
+
92
+ /**
93
+ * `astryx --json experimental theme show <theme>`.
94
+ * @experimental May change or be removed in a patch release.
95
+ * @typedef {object} ThemeEditShowResponse
96
+ * @property {'themeEdit.show'} type
97
+ * @property {object} data
98
+ * @property {string} data.theme
99
+ * @property {string | null} data.like
100
+ * @property {string} data.mode
101
+ * @property {Array<ThemeEditSetting & {parts: string[]}>} data.settings
102
+ * @property {Record<string, Record<string, string | null>>} data.resolved - Key tokens, per mode.
103
+ * @property {string[]} data.problems
104
+ * @property {string[]} data.notes
105
+ * @property {string} data.preview
106
+ * @property {string} data.sheet - The theme-building page with every component.
107
+ * @property {number} data.sheetComponents
108
+ * @property {string[]} data.skipped - Template pages left out, with the install line each needs.
109
+ * @property {string[]} data.pictures
110
+ * @property {string | null} data.pictureProblem
111
+ */
112
+
113
+ /**
114
+ * `astryx --json experimental theme undo <theme>`.
115
+ * @experimental May change or be removed in a patch release.
116
+ * @typedef {object} ThemeEditUndoResponse
117
+ * @property {'themeEdit.undo'} type
118
+ * @property {{theme: string, undone: string[], settings: number, stepsLeft: number} & ThemeEditPreviewFields} data
119
+ */
120
+
121
+ /**
122
+ * `astryx --json experimental theme preview <theme>`.
123
+ * @experimental May change or be removed in a patch release.
124
+ * @typedef {object} ThemeEditPreviewResponse
125
+ * @property {'themeEdit.preview'} type
126
+ * @property {object} data
127
+ * @property {string} data.theme
128
+ * @property {string | null} data.group
129
+ * @property {'html' | 'page'} data.mode - `html`: one rendered file; `page`: page modules written into the app.
130
+ * @property {string[]} data.files
131
+ * @property {string | null} data.html
132
+ * @property {number} data.components
133
+ * @property {string[]} data.skipped
134
+ * @property {string[]} data.pictures
135
+ * @property {string | null} data.pictureProblem
136
+ */
137
+
138
+ /**
139
+ * @experimental May change or be removed in a patch release.
140
+ * @typedef {object} ThemeEditExplainOptions
141
+ * @property {string} [cwd] - The app folder (default: process.cwd()).
142
+ * @property {string} [list] - List what a change can name: dials, tokens, parts, families, or properties; the subject filters it.
143
+ * @property {string[]} [at] - With a PNG picture: pixel points x,y ("40,20;300,180", "40,20 300,180", several entries, or a flat "40,20,300,180").
144
+ * @property {number} [count] - With a PNG picture: how many main colors (default 14).
145
+ */
146
+
147
+ /**
148
+ * `astryx --json experimental theme explain ...`. `kind` says which answer it is.
149
+ * @experimental May change or be removed in a patch release.
150
+ * @typedef {object} ThemeEditExplainResponse
151
+ * @property {'themeEdit.explain'} type
152
+ * @property {{kind: 'part' | 'family' | 'setting' | 'aspect' | 'question' | 'picture' | 'list', subject: string, [key: string]: any}} data
153
+ */
154
+
155
+ export {};
@@ -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 `themeEditExplain()` / `astryx experimental theme explain`. */
5
+ /** @type {import('@astryxdesign/cli/authoring').FunctionDoc} */
6
+ export const doc: import("@astryxdesign/cli/authoring").FunctionDoc;