@astryxdesign/cli 0.7.17 → 0.7.18-canary.g170df15

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 (255) hide show
  1. package/README.md +1 -1
  2. package/api/discover/_adapter.d.mts +7 -5
  3. package/api/discover/_adapter.mjs +12 -11
  4. package/api/docs/_adapter.d.mts +19 -2
  5. package/api/docs/_adapter.mjs +66 -5
  6. package/api/doctor/_adapter.d.mts +11 -62
  7. package/api/doctor/_adapter.mjs +242 -472
  8. package/api/doctor/doctor.d.mts +1 -1
  9. package/api/doctor/doctor.mjs +3 -3
  10. package/api/doctor/theme-checks.mjs +37 -45
  11. package/api/error.d.mts +21 -0
  12. package/api/error.mjs +89 -0
  13. package/api/hook/list/list.d.mts +1 -1
  14. package/api/icon/_adapter.d.mts +8 -0
  15. package/api/icon/_adapter.mjs +17 -0
  16. package/api/icon/_authoring.mjs +6 -6
  17. package/api/icon/_default-look.mjs +16 -16
  18. package/api/icon/add/add.mjs +3 -3
  19. package/api/icon/exportIconIndex.doc.mjs +2 -2
  20. package/api/icon/icon.doc.mjs +2 -2
  21. package/api/icon/icon.type.d.mts +4 -0
  22. package/api/icon/icon.type.mjs +2 -1
  23. package/api/icon/search/icon-index.mjs +16 -3
  24. package/api/icon/search/search.d.mts +15 -5
  25. package/api/icon/search/search.mjs +74 -16
  26. package/api/icon/use/use.mjs +4 -4
  27. package/api/render/_adapter.mjs +233 -40
  28. package/api/render/render.type.d.mts +1 -1
  29. package/api/render/render.type.mjs +1 -1
  30. package/api/search/ORDERING.md +2 -2
  31. package/api/search/_adapter.mjs +4 -0
  32. package/api/search/_candidate-score.mjs +32 -8
  33. package/api/search/_cards.json +1 -1
  34. package/api/search/_compound.d.mts +0 -1
  35. package/api/search/_compound.mjs +93 -2
  36. package/api/search/_icons.d.mts +4 -2
  37. package/api/search/_icons.mjs +4 -2
  38. package/api/search/_lexical.mjs +177 -17
  39. package/api/search/_order.d.mts +3 -1
  40. package/api/search/_order.mjs +16 -5
  41. package/api/search/_result.d.mts +9 -0
  42. package/api/search/_result.mjs +10 -0
  43. package/api/search/_score.mjs +21 -3
  44. package/api/swizzle/_moduleGraph.d.mts +8 -0
  45. package/api/swizzle/_moduleGraph.mjs +61 -3
  46. package/api/template/copy/copy.mjs +5 -3
  47. package/api/template/template.type.d.mts +3 -3
  48. package/api/template/template.type.mjs +3 -3
  49. package/api/theme/_adapter.mjs +48 -12
  50. package/api/theme/build/build.d.mts +4 -0
  51. package/api/theme/build/build.mjs +69 -18
  52. package/api/theme/build/style-keys.mjs +4 -5
  53. package/api/theme/build/theme-object.mjs +5 -0
  54. package/api/theme/palette/generate/color.d.mts +47 -0
  55. package/api/theme/palette/generate/color.mjs +58 -1
  56. package/api/theme/palette/generate/derive-look.d.mts +293 -0
  57. package/api/theme/palette/generate/derive-look.mjs +1362 -0
  58. package/api/theme/palette/generate/editor-look.d.mts +62 -0
  59. package/api/theme/palette/generate/editor-look.mjs +550 -0
  60. package/api/theme/palette/generate/mapping.d.mts +94 -9
  61. package/api/theme/palette/generate/mapping.mjs +94 -22
  62. package/api/theme-edit/_adapter.mjs +13 -2
  63. package/api/theme-edit/_catalog.d.mts +13 -13
  64. package/api/theme-edit/_catalog.mjs +66 -28
  65. package/api/theme-edit/_check.d.mts +82 -6
  66. package/api/theme-edit/_check.mjs +1270 -238
  67. package/api/theme-edit/_color.d.mts +74 -0
  68. package/api/theme-edit/_color.mjs +168 -3
  69. package/api/theme-edit/_compiler.d.mts +3 -5
  70. package/api/theme-edit/_compiler.mjs +122 -23
  71. package/api/theme-edit/_context.d.mts +55 -12
  72. package/api/theme-edit/_context.mjs +114 -60
  73. package/api/theme-edit/_css.d.mts +11 -0
  74. package/api/theme-edit/_css.mjs +40 -0
  75. package/api/theme-edit/_edit.d.mts +15 -2
  76. package/api/theme-edit/_edit.mjs +1469 -133
  77. package/api/theme-edit/_how-commands.d.mts +116 -0
  78. package/api/theme-edit/_how-commands.mjs +227 -115
  79. package/api/theme-edit/_how-question.d.mts +74 -29
  80. package/api/theme-edit/_how-question.mjs +8514 -1256
  81. package/api/theme-edit/_how-sides.d.mts +22 -0
  82. package/api/theme-edit/_how-sides.mjs +173 -0
  83. package/api/theme-edit/_how-steps.d.mts +42 -0
  84. package/api/theme-edit/_how-steps.mjs +208 -0
  85. package/api/theme-edit/_how-values.d.mts +29 -0
  86. package/api/theme-edit/_how-values.mjs +111 -0
  87. package/api/theme-edit/_how-words.d.mts +15 -0
  88. package/api/theme-edit/_how-words.mjs +239 -0
  89. package/api/theme-edit/_how.d.mts +1 -1
  90. package/api/theme-edit/_how.mjs +422 -37
  91. package/api/theme-edit/_missed.d.mts +2 -1
  92. package/api/theme-edit/_missed.mjs +125 -13
  93. package/api/theme-edit/_normal.d.mts +5 -3
  94. package/api/theme-edit/_normal.mjs +54 -14
  95. package/api/theme-edit/_palette.d.mts +204 -4
  96. package/api/theme-edit/_palette.mjs +901 -25
  97. package/api/theme-edit/_part-pieces.d.mts +54 -0
  98. package/api/theme-edit/_part-pieces.mjs +179 -0
  99. package/api/theme-edit/_part-words.mjs +33 -5
  100. package/api/theme-edit/_parts.d.mts +133 -0
  101. package/api/theme-edit/_parts.mjs +599 -10
  102. package/api/theme-edit/_picture-traits.d.mts +259 -0
  103. package/api/theme-edit/_picture-traits.mjs +1030 -0
  104. package/api/theme-edit/_preview.d.mts +95 -4
  105. package/api/theme-edit/_preview.mjs +284 -31
  106. package/api/theme-edit/_project.d.mts +14 -4
  107. package/api/theme-edit/_project.mjs +95 -26
  108. package/api/theme-edit/_resolved.d.mts +46 -0
  109. package/api/theme-edit/_resolved.mjs +800 -0
  110. package/api/theme-edit/_set-line.d.mts +29 -0
  111. package/api/theme-edit/_set-line.mjs +100 -0
  112. package/api/theme-edit/_settings.d.mts +625 -28
  113. package/api/theme-edit/_settings.mjs +4867 -888
  114. package/api/theme-edit/_tables.d.mts +25 -1
  115. package/api/theme-edit/_tables.mjs +115 -11
  116. package/api/theme-edit/_text-looks.d.mts +78 -0
  117. package/api/theme-edit/_text-looks.mjs +376 -0
  118. package/api/theme-edit/_vet.d.mts +3 -26
  119. package/api/theme-edit/_vet.mjs +5 -89
  120. package/api/theme-edit/how/how.d.mts +1 -1
  121. package/api/theme-edit/how/how.mjs +1 -1
  122. package/api/theme-edit/show/show.d.mts +4 -3
  123. package/api/theme-edit/show/show.mjs +3 -2
  124. package/api/theme-edit/theme-edit.type.d.mts +117 -1
  125. package/api/theme-edit/theme-edit.type.mjs +46 -3
  126. package/api/theme-edit/themeEditHow.doc.mjs +3 -3
  127. package/api/theme-edit/themeEditNew.doc.mjs +4 -0
  128. package/api/theme-edit/themeEditSet.doc.mjs +6 -2
  129. package/api/theme-edit/themeEditShow.doc.mjs +22 -3
  130. package/api/theme-edit/themeEditUndo.doc.mjs +4 -0
  131. package/assets/component-list.generated.json +1 -1
  132. package/assets/docs/author-a-theme.doc.mjs +7 -4
  133. package/assets/docs/icons.doc.mjs +7 -6
  134. package/assets/docs/theme.doc.dense.mjs +10 -0
  135. package/assets/docs/theme.doc.mjs +10 -0
  136. package/assets/docs/theme.doc.zh.mjs +10 -0
  137. package/assets/docs/tree/export-pages.doc.mjs +1 -1
  138. package/assets/docs/tree/icon-sets.doc.mjs +1 -1
  139. package/assets/docs/use-a-theme.doc.mjs +89 -17
  140. package/assets/docs-routes.generated.json +1 -1
  141. package/assets/docs.generated.json +2 -2
  142. package/assets/icons/definitions/article.doc.mjs +9 -0
  143. package/assets/icons/template-icons.json +5 -0
  144. package/assets/search-catalog.generated.json +2 -2
  145. package/assets/self-audit.generated.json +1 -1
  146. package/assets/templates/blocks/components/Citation/CitationInlineText.doc.mjs +1 -1
  147. package/assets/templates/blocks/components/Citation/CitationInlineText.tsx +3 -1
  148. package/assets/templates/blocks/components/Citation/CitationShowcase.doc.mjs +1 -1
  149. package/assets/templates/blocks/components/Citation/CitationShowcase.tsx +3 -1
  150. package/assets/templates/blocks/components/Citation/CitationSourceList.doc.mjs +1 -1
  151. package/assets/templates/blocks/components/Citation/CitationSourceList.tsx +7 -3
  152. package/assets/templates/blocks/components/Markdown/MarkdownCitedContent.doc.mjs +1 -1
  153. package/assets/templates/blocks/components/Markdown/MarkdownCitedContent.tsx +5 -2
  154. package/assets/templates/components.generated.json +1 -1
  155. package/assets/templates/pages/ide/page.tsx +5 -10
  156. package/assets/templates/pages/payment-form/page.tsx +16 -60
  157. package/assets/templates/themes/neutral/neutralTheme.ts +4 -3
  158. package/authoring/config/parse.mjs +1 -1
  159. package/authoring/debug/parse.d.mts +1 -1
  160. package/authoring/doctypes/_schema.d.mts +13 -13
  161. package/authoring/doctypes/icon-definition/parse.mjs +2 -2
  162. package/authoring/doctypes/icon-set/parse.mjs +1 -1
  163. package/authoring/doctypes/template/parse.mjs +1 -4
  164. package/authoring/gap-report/parse.d.mts +1 -1
  165. package/clients/cli/build-id.generated.json +1 -1
  166. package/clients/cli/commands/ensure-core-built.mjs +17 -10
  167. package/clients/cli/commands/experimental/icon.mjs +7 -7
  168. package/clients/cli/commands/experimental/theme.mjs +175 -13
  169. package/clients/cli/commands/experimental-icon.doc.mjs +1 -1
  170. package/clients/cli/commands/experimental-theme-compile.doc.mjs +1 -1
  171. package/clients/cli/commands/experimental-theme-editor-how.doc.mjs +11 -3
  172. package/clients/cli/commands/experimental-theme-editor-set.doc.mjs +3 -3
  173. package/clients/cli/commands/experimental-theme-editor-show.doc.mjs +15 -5
  174. package/clients/cli/commands/experimental-theme-editor-undo.doc.mjs +1 -1
  175. package/clients/cli/commands/hook.mjs +7 -0
  176. package/clients/cli/commands/template.mjs +1 -1
  177. package/clients/cli/commands/theme-build.doc.mjs +1 -1
  178. package/clients/cli/index.mjs +6 -2
  179. package/clients/cli/lib/hook-format.mjs +41 -1
  180. package/clients/cli/lib/json-shim.mjs +34 -14
  181. package/clients/cli/lib/other-cli-words.mjs +7 -0
  182. package/clients/cli/lib/unknown-command.mjs +345 -46
  183. package/clients/cli/manifest.generated.json +1 -1
  184. package/foundation/agent-docs/agent-docs.d.mts +11 -2
  185. package/foundation/agent-docs/agent-docs.mjs +51 -8
  186. package/foundation/config/project.d.mts +11 -1
  187. package/foundation/config/project.mjs +11 -2
  188. package/foundation/discovery/component-replacement.d.mts +5 -8
  189. package/foundation/discovery/component-replacement.mjs +12 -14
  190. package/foundation/discovery/core-augmentation-points.d.mts +35 -0
  191. package/foundation/discovery/core-augmentation-points.mjs +410 -9
  192. package/foundation/discovery/core-elements.d.mts +6 -0
  193. package/foundation/discovery/core-elements.mjs +10 -2
  194. package/foundation/discovery/core-prop-types.d.mts +5 -0
  195. package/foundation/discovery/core-prop-types.mjs +10 -3
  196. package/foundation/discovery/core-props.d.mts +8 -0
  197. package/foundation/discovery/core-props.mjs +29 -13
  198. package/foundation/discovery/icon-ranking.d.mts +5 -2
  199. package/foundation/discovery/icon-ranking.mjs +101 -18
  200. package/foundation/discovery/icon-set-checks.mjs +1 -1
  201. package/foundation/discovery/icon-set-writer.mjs +1 -1
  202. package/foundation/discovery/official-list.d.mts +17 -0
  203. package/foundation/discovery/official-list.mjs +77 -0
  204. package/foundation/discovery/template-icon-notes.mjs +3 -3
  205. package/foundation/discovery/template-icons.mjs +2 -2
  206. package/foundation/discovery/template-placeholders.mjs +1 -1
  207. package/foundation/discovery/unknown-core-props.d.mts +130 -0
  208. package/foundation/discovery/unknown-core-props.mjs +601 -0
  209. package/foundation/discovery/written-prop-values.d.mts +35 -0
  210. package/foundation/discovery/written-prop-values.mjs +258 -0
  211. package/foundation/fonts/fontsource-families.generated.d.mts +5 -0
  212. package/foundation/fonts/fontsource-families.generated.mjs +2110 -0
  213. package/foundation/fs/package-name.d.mts +10 -0
  214. package/foundation/fs/package-name.mjs +37 -0
  215. package/foundation/fs/project-source-files.d.mts +27 -0
  216. package/foundation/fs/project-source-files.mjs +115 -0
  217. package/foundation/fs/project-sources.d.mts +25 -0
  218. package/foundation/fs/project-sources.mjs +83 -0
  219. package/foundation/fs/read-record.d.mts +18 -0
  220. package/foundation/fs/read-record.mjs +36 -2
  221. package/foundation/integrations/integration-warnings.d.mts +39 -7
  222. package/foundation/integrations/integration-warnings.mjs +141 -19
  223. package/foundation/integrations/missing-dependency.d.mts +11 -0
  224. package/foundation/integrations/missing-dependency.mjs +20 -5
  225. package/foundation/release/folder-lock.d.mts +5 -2
  226. package/foundation/release/folder-lock.mjs +9 -3
  227. package/foundation/release/notices.mjs +2 -8
  228. package/foundation/render/cut-short.d.mts +8 -2
  229. package/foundation/render/cut-short.mjs +50 -5
  230. package/foundation/render/drawn-contrast.d.mts +40 -0
  231. package/foundation/render/drawn-contrast.mjs +355 -0
  232. package/foundation/render/file-header.mjs +4 -0
  233. package/foundation/render/layers.d.mts +2 -1
  234. package/foundation/render/layers.mjs +22 -1
  235. package/foundation/render/package-resolve-hooks.d.mts +38 -9
  236. package/foundation/render/package-resolve-hooks.mjs +124 -32
  237. package/foundation/render/page-worker.mjs +95 -23
  238. package/foundation/render/part-boxes.d.mts +27 -0
  239. package/foundation/render/part-boxes.mjs +45 -0
  240. package/foundation/render/picture-chrome.mjs +36 -4
  241. package/foundation/render/picture-playwright.mjs +26 -2
  242. package/foundation/render/picture-window.d.mts +29 -2
  243. package/foundation/render/picture-window.mjs +99 -1
  244. package/foundation/render/render-page.d.mts +39 -6
  245. package/foundation/render/render-page.mjs +26 -10
  246. package/foundation/render/ts-paths.mjs +2 -1
  247. package/foundation/response/error-codes.doc.mjs +1 -1
  248. package/foundation/response/error-codes.mjs +1 -1
  249. package/foundation/response/response-types.doc.mjs +9 -5
  250. package/foundation/suggest/other-command.mjs +25 -1
  251. package/foundation/text/icon-set-next.d.mts +1 -1
  252. package/foundation/text/icon-set-next.mjs +2 -2
  253. package/foundation/text/written-string.d.mts +4 -1
  254. package/foundation/text/written-string.mjs +4 -1
  255. package/package.json +8 -7
@@ -2,7 +2,7 @@
2
2
  // DO NOT EDIT — run `pnpm sync:api-types` to regenerate.
3
3
 
4
4
  /**
5
- * @typedef {{thing: string, value: string, on?: string, when?: string, state?: string, mode?: string}} MissedStep
5
+ * @typedef {{thing: string, value: string, on?: string, when?: string, state?: string, mode?: string, only?: boolean}} MissedStep
6
6
  * @typedef {{kind: number, part: string, state?: string, when?: string, why: string, steps: MissedStep[], aspect: string}} Missed
7
7
  */
8
8
  /**
@@ -43,6 +43,7 @@ export type MissedStep = {
43
43
  when?: string;
44
44
  state?: string;
45
45
  mode?: string;
46
+ only?: boolean;
46
47
  };
47
48
  export type Missed = {
48
49
  kind: number;
@@ -9,7 +9,7 @@
9
9
  * @position api/theme-edit — imported by _edit.mjs and _how.mjs
10
10
  */
11
11
 
12
- import {COMMON_STATES} from './_tables.mjs';
12
+ import {COMMON_STATES, P} from './_tables.mjs';
13
13
  import {
14
14
  autoMediaSide,
15
15
  baseComponent,
@@ -17,13 +17,17 @@ import {
17
17
  modesOf,
18
18
  partsOf,
19
19
  roleReach,
20
+ cornersPlain,
21
+ pillShapes,
22
+ controlHeightSplits,
20
23
  } from './_settings.mjs';
21
- import {borderlessSurfaces, pillParts} from './_check.mjs';
22
- import {parseColor, ratio, splitTop} from './_color.mjs';
23
- import {blurScaled} from './_how-question.mjs';
24
+ import {borderlessSurfaces} from './_check.mjs';
25
+ import {hex, parseColor, ratio, splitTop} from './_color.mjs';
26
+ import {hexToOklch} from '../theme/palette/generate/color.mjs';
27
+ import {blurScaled} from './_how-steps.mjs';
24
28
 
25
29
  /**
26
- * @typedef {{thing: string, value: string, on?: string, when?: string, state?: string, mode?: string}} MissedStep
30
+ * @typedef {{thing: string, value: string, on?: string, when?: string, state?: string, mode?: string, only?: boolean}} MissedStep
27
31
  * @typedef {{kind: number, part: string, state?: string, when?: string, why: string, steps: MissedStep[], aspect: string}} Missed
28
32
  */
29
33
 
@@ -45,6 +49,40 @@ export function missedSteps(ctx, data, res, base) {
45
49
  // The modes the theme draws (a dark-only theme's dark), each one res
46
50
  // holds.
47
51
  const modes = modesOf(data).filter(m => res[m]);
52
+ /**
53
+ * What the accent tint a selected look takes draws in dark, said with
54
+ * the line: a dark tint can be a strong block of the accent (a soft
55
+ * coral's is a deep red). A strong one (OKLCH chroma 0.1 or more) the
56
+ * theme does not set itself comes with the line for a softer one: the
57
+ * tint halfway to the dark page.
58
+ */
59
+ const darkTintWords = () => {
60
+ if (!modes.includes('dark')) return '';
61
+ const tint = parseColor(String(res.dark?.['--color-accent-muted'] ?? ''));
62
+ const page = parseColor(
63
+ String(res.dark?.['--color-background-body'] ?? ''),
64
+ );
65
+ if (!tint || !page) return '';
66
+ const set = data.settings.some(
67
+ x =>
68
+ x.source === 'token' &&
69
+ x.thing === '--color-accent-muted' &&
70
+ !x.on &&
71
+ !x.state &&
72
+ !x.when,
73
+ );
74
+ const strong = !set && hexToOklch(hex(tint)).C >= 0.1;
75
+ const soft = hex(
76
+ /** @type {[number, number, number]} */ (
77
+ tint.map((v, i) => Math.round((v + page[i]) / 2))
78
+ ),
79
+ );
80
+ return `; in dark the accent tint draws ${hex(tint)}${
81
+ strong
82
+ ? `, a strong block of the accent; for a softer one first: ${P} set ${data.name} --color-accent-muted '${soft}' --mode dark`
83
+ : ''
84
+ }`;
85
+ };
48
86
  /** @param {string} token */
49
87
  const changed = token =>
50
88
  modes.some(m => String(res[m]?.[token]) !== String(base[m]?.[token]));
@@ -739,7 +777,7 @@ export function missedSteps(ctx, data, res, base) {
739
777
  kind: 2,
740
778
  part: p,
741
779
  state: st,
742
- why: `${st}, it keeps the base's fill (${inState[0].token})`,
780
+ why: `${st}, it keeps the base's fill (${inState[0].token})${darkTintWords()}`,
743
781
  aspect: 'background',
744
782
  steps: [
745
783
  {
@@ -752,16 +790,57 @@ export function missedSteps(ctx, data, res, base) {
752
790
  });
753
791
  }
754
792
  }
755
- // A pill part (a switch, an avatar, a badge) stays round under rounded
756
- // corners by design, as nearly every look wants: it is missed only when
757
- // the theme's corners go square (its element corners at 0), where a
758
- // round pill keeps the base's look beside the theme's square one.
793
+ // A pill part (a switch, an avatar) stays round under rounded corners by
794
+ // design, as nearly every look wants: it is missed only when the theme's
795
+ // corners go square (its element corners at 0), where a round pill keeps
796
+ // the base's look beside the theme's square one. A badge is a small box:
797
+ // it is missed when the element corners change, as a button's corners
798
+ // follow them.
759
799
  const squareCorners = modes.every(
760
800
  m => Number.parseFloat(String(res[m]?.['--radius-element'] ?? '')) === 0,
761
801
  );
762
- if (corners && squareCorners)
763
- for (const p of pillParts(C).filter(
764
- x => has(x) && !covers(x, /^(border-radius|corners|--radius-[\w-]+)$/),
802
+ // (The corners dial at square squares them itself.)
803
+ const squaresPills = data.settings.some(
804
+ x =>
805
+ x.source === 'dial' &&
806
+ x.thing === 'corners' &&
807
+ !x.on &&
808
+ /^(?:square|0px)$/.test(cornersPlain(String(x.value)) ?? ''),
809
+ );
810
+ // (Only a pill that is a styling choice: a circle keeps its shape.)
811
+ // (The corners dial gives a badge the element corners itself below pill,
812
+ // and leaves it a pill at pill; square element corners under it are the
813
+ // square case above. A badge the base theme rounds itself keeps its
814
+ // shape.)
815
+ // (A pill badge is listed only when the element corners are less than a
816
+ // pill in some mode: at pill corners it matches the buttons.)
817
+ const elementCorners =
818
+ changed('--radius-element') &&
819
+ modes.some(m => {
820
+ const v = Number.parseFloat(String(res[m]?.['--radius-element'] ?? ''));
821
+ return Number.isFinite(v) && v < 1000;
822
+ });
823
+ const cornersBelowPill = data.settings.some(
824
+ x =>
825
+ x.source === 'dial' &&
826
+ x.thing === 'corners' &&
827
+ !x.on &&
828
+ cornersPlain(String(x.value)) !== 'pill',
829
+ );
830
+ const baseRoundsBadge = Object.values(
831
+ /** @type {any} */ (base)?.components?.badge ?? {},
832
+ ).some(r => r && typeof r === 'object' && 'borderRadius' in r);
833
+ if (corners)
834
+ for (const p of pillShapes(C).pills.filter(
835
+ x =>
836
+ has(x) &&
837
+ !covers(x, /^(border-radius|corners|--radius-[\w-]+)$/) &&
838
+ (x === 'badge'
839
+ ? // (A corners dial below pill already gives it the element
840
+ // corners, square ones included.)
841
+ (squareCorners && !squaresPills && !cornersBelowPill) ||
842
+ (elementCorners && !cornersBelowPill && !baseRoundsBadge)
843
+ : squareCorners && !squaresPills),
765
844
  ))
766
845
  found.push({
767
846
  kind: 4,
@@ -895,6 +974,27 @@ export function missedSteps(ctx, data, res, base) {
895
974
  ))
896
975
  found.push({...x, kind: 5, aspect: 'border'});
897
976
 
977
+ // A control that keeps a height of its own at a size while the other
978
+ // controls take another: controls share one height at each size, and
979
+ // the line that set it, set again, makes it every control's height.
980
+ for (const split of controlHeightSplits(ctx, data, res[modes[0]] ?? {}))
981
+ found.push({
982
+ kind: 9,
983
+ part: split.part,
984
+ why: `${split.reaches.includes(split.part) ? `${split.part} is` : `${split.setting.thing} ${split.setting.value} on ${split.part} reaches ${split.reaches.join(', ')}, so ${split.reaches.length > 1 ? 'they are' : 'it is'}`} ${sizesText(split.at.map(a => [a.size, a.value]))}, while the other controls are ${sizesText(split.at.map(a => [a.size, a.others.join(' or ')]))}: buttons, inputs, selectors and input groups share one height at each size`,
985
+ aspect: 'size',
986
+ steps: [
987
+ {
988
+ thing: split.line.thing,
989
+ value: String(split.line.value),
990
+ on: String(split.line.on),
991
+ ...(split.line.when ? {when: split.line.when} : {}),
992
+ ...(split.line.only ? {only: true} : {}),
993
+ ...(split.line.mode ? {mode: split.line.mode} : {}),
994
+ },
995
+ ],
996
+ });
997
+
898
998
  // What the theme's role colors reach on their own (the compiler writes
899
999
  // them onto the parts where the base theme draws the role itself) is
900
1000
  // not missed.
@@ -933,6 +1033,18 @@ export function missedSteps(ctx, data, res, base) {
933
1033
  return ordered;
934
1034
  }
935
1035
 
1036
+ /**
1037
+ * Heights by size in words: one value at every size once, else each with
1038
+ * its size (`31px at every size`, `28px at sm, 32px at md`).
1039
+ * @param {Array<[string, string]>} bySize
1040
+ */
1041
+ function sizesText(bySize) {
1042
+ const values = [...new Set(bySize.map(([, v]) => v))];
1043
+ return values.length === 1 && bySize.length === 3
1044
+ ? `${values[0]} at every size`
1045
+ : bySize.map(([size, v]) => `${v} at ${size}`).join(', ');
1046
+ }
1047
+
936
1048
  /**
937
1049
  * The surfaces a border width does not reach that draw a box of their own
938
1050
  * (a dialog, a banner, a filled button's variants), each with the steps
@@ -263,7 +263,8 @@ export function documentRange(things: string[], min: number, max: number): void;
263
263
  * The declared sources: (1) the value typed, under the exact readings of
264
264
  * typedReading, sameToken and numbersEqual, the words joined into a CSS
265
265
  * color name (`dark red` is darkred), or the color the typed color is
266
- * (rgb() as its hex, a see-through color opaque); (2) a documented table
266
+ * (rgb() as its hex, a see-through color opaque, Tailwind's `black/5` as
267
+ * rgb(0 0 0 / 0.05)); (2) a documented table
267
268
  * registered with documentReadings, documentNumericTable or documentRange;
268
269
  * (3) the theme's own saved value of the line's setting, for a setting
269
270
  * other than the one typed (a keep or unlock line); (4) the setting's
@@ -299,7 +300,8 @@ export function readsTyped(line: {
299
300
  * token. A part alone (`all` for `all 200`, `bold` for `extra bold`) is not
300
301
  * offered.
301
302
  * A line read whole that offers one of several typed values (`padding-top
302
- * 2px` for `2px 15px 3px`) carries the tokens it offers.
303
+ * 2px` for `2px 15px 3px`) carries the tokens it offers; a line that reads
304
+ * the whole value carries none, so a part alone is still not offered.
303
305
  * @param {Array<true | number[] | {oneOf: number[]} | false>} reads
304
306
  * @param {string} typed
305
307
  * @param {string} [thing] the setting typed (its numbers' reading)
@@ -349,7 +351,7 @@ export function allowedLine(line: {
349
351
  saved?: Map<string, string[]>;
350
352
  mode?: string;
351
353
  }): boolean;
352
- export function typoLimit(typed: string): 0 | 2 | 1;
354
+ export function typoLimit(typed: string): 1 | 0 | 2;
353
355
  /**
354
356
  * `label`: a pasted line's label that names no mode word (see labelScope)
355
357
  */
@@ -17,7 +17,7 @@ import {
17
17
  fontStack,
18
18
  wordTable,
19
19
  } from './_tables.mjs';
20
- import {colorProblem, hex, parseColor} from './_color.mjs';
20
+ import {colorOpacitiesAsCss, colorProblem, hex, parseColor} from './_color.mjs';
21
21
  import {sameKindValues, takesWholeNumbersOnly, unitsJoined} from './_css.mjs';
22
22
  import {levenshteinDistance} from '../../foundation/text/levenshtein.mjs';
23
23
 
@@ -1401,7 +1401,8 @@ const SCALED_DIALS = Object.keys(DIALS).filter(d =>
1401
1401
  * The declared sources: (1) the value typed, under the exact readings of
1402
1402
  * typedReading, sameToken and numbersEqual, the words joined into a CSS
1403
1403
  * color name (`dark red` is darkred), or the color the typed color is
1404
- * (rgb() as its hex, a see-through color opaque); (2) a documented table
1404
+ * (rgb() as its hex, a see-through color opaque, Tailwind's `black/5` as
1405
+ * rgb(0 0 0 / 0.05)); (2) a documented table
1405
1406
  * registered with documentReadings, documentNumericTable or documentRange;
1406
1407
  * (3) the theme's own saved value of the line's setting, for a setting
1407
1408
  * other than the one typed (a keep or unlock line); (4) the setting's
@@ -1420,10 +1421,40 @@ const SCALED_DIALS = Object.keys(DIALS).filter(d =>
1420
1421
  export function readsTyped(line) {
1421
1422
  const read = readsTypedValue(line);
1422
1423
  if (read === true || !line.scope?.on) return read;
1423
- const rest = withoutScopeWords(String(line.typed), line.scope);
1424
- return rest != null && rest !== String(line.typed).trim()
1425
- ? readsTypedValue({...line, typed: rest}) === true || read
1426
- : read;
1424
+ const typed = String(line.typed).trim();
1425
+ const on = String(line.scope.on).toLowerCase();
1426
+ const typedThing = String(line.typedThing ?? '').toLowerCase();
1427
+ const esc = (/** @type {string} */ x) =>
1428
+ x.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
1429
+ // The part typed in the setting's place (`card padding 20px`): the
1430
+ // line's --on carries the part, and its setting the name typed first in
1431
+ // the value, so the rest is the value read.
1432
+ const partFirst =
1433
+ typedThing &&
1434
+ [
1435
+ typedThing,
1436
+ typedThing.replace(/e?s$/, ''),
1437
+ typedThing.replace(/s$/, ''),
1438
+ ].includes(on) &&
1439
+ line.thing
1440
+ ? typed.replace(
1441
+ new RegExp(`^${esc(String(line.thing))}\\s*(?:[:=]\\s*|\\s+)`, 'i'),
1442
+ '',
1443
+ )
1444
+ : null;
1445
+ for (const rest of [withoutScopeWords(typed, line.scope), partFirst])
1446
+ if (
1447
+ rest != null &&
1448
+ rest !== typed &&
1449
+ rest.trim() &&
1450
+ readsTypedValue({
1451
+ ...line,
1452
+ typed: rest.replace(/\s*;\s*$/, ''),
1453
+ typedThing: line.thing,
1454
+ }) === true
1455
+ )
1456
+ return true;
1457
+ return read;
1427
1458
  }
1428
1459
 
1429
1460
  /**
@@ -1571,6 +1602,11 @@ function readsTypedValue({
1571
1602
  (color ? hex(color) === o : colorProblem(t)?.opaque === o)
1572
1603
  )
1573
1604
  return true;
1605
+ // A color with an opacity after its slash, as Tailwind writes it
1606
+ // (`black/5`), is that color at that opacity, as CSS writes it.
1607
+ const clear = colorOpacitiesAsCss(t);
1608
+ if (clear && !clear.unread.length && clear.css.trim().toLowerCase() === o)
1609
+ return true;
1574
1610
  // One half of a light and a dark pair: for the line that sets that mode,
1575
1611
  // or, as the light one, for a color dial, which makes both modes from
1576
1612
  // one color.
@@ -1816,7 +1852,8 @@ function dialWords(key) {
1816
1852
  * token. A part alone (`all` for `all 200`, `bold` for `extra bold`) is not
1817
1853
  * offered.
1818
1854
  * A line read whole that offers one of several typed values (`padding-top
1819
- * 2px` for `2px 15px 3px`) carries the tokens it offers.
1855
+ * 2px` for `2px 15px 3px`) carries the tokens it offers; a line that reads
1856
+ * the whole value carries none, so a part alone is still not offered.
1820
1857
  * @param {Array<true | number[] | {oneOf: number[]} | false>} reads
1821
1858
  * @param {string} typed
1822
1859
  * @param {string} [thing] the setting typed (its numbers' reading)
@@ -1838,13 +1875,16 @@ export function coversTyped(reads, typed, thing = '', offered = []) {
1838
1875
  const typedCount = new Map();
1839
1876
  for (const w of T) typedCount.set(w, (typedCount.get(w) ?? 0) + 1);
1840
1877
  for (const r of reads) if (Array.isArray(r)) r.forEach(carry);
1841
- for (const [i, r] of reads.entries())
1842
- if (r === true && offered[i] != null)
1843
- for (const w of tokensOf(
1844
- String(offered[i]).replace(/^(["'])(.*)\1$/, '$2'),
1845
- ))
1846
- if ((carried.get(w) ?? 0) < (typedCount.get(w) ?? 0))
1847
- carried.set(w, (carried.get(w) ?? 0) + 1);
1878
+ // (Only a line that offers fewer tokens than were typed: a line that
1879
+ // reads the whole value never makes a part alone offerable beside it.)
1880
+ for (const [i, r] of reads.entries()) {
1881
+ if (r !== true || offered[i] == null) continue;
1882
+ const own = tokensOf(String(offered[i]).replace(/^(["'])(.*)\1$/, '$2'));
1883
+ if (own.length >= T.length) continue;
1884
+ for (const w of own)
1885
+ if ((carried.get(w) ?? 0) < (typedCount.get(w) ?? 0))
1886
+ carried.set(w, (carried.get(w) ?? 0) + 1);
1887
+ }
1848
1888
  // A line whose one token may be any of several takes one the others
1849
1889
  // left.
1850
1890
  for (const r of reads)
@@ -74,6 +74,130 @@ export function modesOf(data: {
74
74
  export function seedsInEffect(cwd: string, slug: string, data: {
75
75
  settings: Setting[];
76
76
  }): DialFamily[];
77
+ /**
78
+ * The seeds of a theme's color settings, its own source's values read:
79
+ * what seedsInEffect returns, for a caller that holds those values.
80
+ * @param {{settings: Setting[]}} data
81
+ * @param {Record<string, string>} own the theme source's own token values
82
+ */
83
+ export function seedsOfSettings(data: {
84
+ settings: Setting[];
85
+ }, own: Record<string, string>): DialFamily[];
86
+ /**
87
+ * Whether `set <theme> vibrancy` changes anything: a color setting's seed
88
+ * that vibrancy moves, the check set runs.
89
+ * @param {{settings: Setting[]}} data
90
+ * @param {Record<string, string>} own the theme source's own token values
91
+ */
92
+ export function vibrancyTakes(data: {
93
+ settings: Setting[];
94
+ }, own: Record<string, string>): boolean;
95
+ /**
96
+ * Whether vibrancy changes any of these seeds: the one test `set <theme>
97
+ * vibrancy`, `how` and the color notes share.
98
+ * @param {DialFamily[]} seeds
99
+ */
100
+ export function vibrancyMovesAny(seeds: DialFamily[]): boolean;
101
+ /**
102
+ * The token words of the status roles a theme's look derives: every role
103
+ * it leaves unset, once it sets a color.
104
+ * @param {{settings: Setting[]}} data
105
+ * @returns {string[]}
106
+ */
107
+ export function derivedStatusWords(data: {
108
+ settings: Setting[];
109
+ }): string[];
110
+ /**
111
+ * The tokens a theme sets to a value of its own for the whole theme: the
112
+ * change names each, apart from the colors that move with the look.
113
+ * @param {{settings: Setting[]}} data
114
+ * @returns {string[]}
115
+ */
116
+ export function exactTokens(data: {
117
+ settings: Setting[];
118
+ }): string[];
119
+ /**
120
+ * A change's token lines with the look's own (category and chart colors)
121
+ * said in one line each, as counts: they move together with every look
122
+ * change, and one line per value would bury the rest.
123
+ * @param {unknown[]} lines - `token (mode): before -> after` lines.
124
+ * @param {string[]} [statusWords] - The status words whose colors the look derives (derivedStatusWords): theirs are counted too.
125
+ * @param {string[]} [exact] - Tokens the theme sets to a value of its own (exactTokens): each is named, never counted, as it did not move with the look.
126
+ */
127
+ export function lookCollapsed(lines: unknown[], statusWords?: string[], exact?: string[]): {
128
+ lines: string[];
129
+ look: string[];
130
+ };
131
+ /**
132
+ * What the config writer decided: the config, what it kept or replaced of
133
+ * a hand edit, and for each accent or status color the stop of its exact
134
+ * color and whether dark mode holds it too (why not, when not).
135
+ * @typedef {object} PalettePlan
136
+ * @property {any} config
137
+ * @property {string[]} notes
138
+ * @property {Record<string, {stop: number, dark: boolean, why: string, ratio: number}>} fills
139
+ * @property {boolean} [stored] the saved palette, kept as it is (a recipe this CLI does not know)
140
+ */
141
+ /**
142
+ * Whether a theme's palette names a recipe this CLI does not know (its
143
+ * colors are kept as saved, made by a newer CLI).
144
+ * @param {string} cwd
145
+ * @param {string} slug
146
+ */
147
+ export function paletteRecipeUnknown(cwd: string, slug: string): boolean;
148
+ /**
149
+ * Note what a theme's colors come from as saved, read as the settings
150
+ * reader reads the file (its base word, its field and entry names).
151
+ * @param {string} cwd
152
+ * @param {string} slug
153
+ * @param {any} data the settings as read, before any change
154
+ */
155
+ export function noteSavedColors(cwd: string, slug: string, data: any): void;
156
+ /**
157
+ * A theme's settings as read before any change (the ones its settings
158
+ * module was built from), else as the file holds them now.
159
+ * @param {string} cwd
160
+ * @param {string} slug
161
+ * @returns {any}
162
+ */
163
+ export function settingsBeforeChange(cwd: string, slug: string): any;
164
+ /**
165
+ * What a palette is made from, as one key to compare: the color dials and
166
+ * vibrancy, and a whole-theme accent token, as {@link dialFamilies} reads
167
+ * them. A change to these makes the palette again; the mode, the base and
168
+ * any other color token only map it.
169
+ * @param {{settings?: Setting[]} | null} d
170
+ */
171
+ export function paletteMadeFromKey(d: {
172
+ settings?: Setting[];
173
+ } | null): string | null;
174
+ /**
175
+ * What a theme's colors come from, as one key to compare: its mode, its
176
+ * base, its color dials (and vibrancy) and its color tokens. A change that
177
+ * leaves this as it was leaves the palette's colors alone.
178
+ * @param {{mode?: string | null, like?: string | null, settings?: Setting[]} | null} d
179
+ */
180
+ export function paletteColorKey(d: {
181
+ mode?: string | null;
182
+ like?: string | null;
183
+ settings?: Setting[];
184
+ } | null): string | null;
185
+ /**
186
+ * Whether a theme's palette is kept exactly as saved, as one made with a
187
+ * recipe this CLI does not know is ({@link planPalette}): its build keeps
188
+ * what that palette made.
189
+ * @param {string} cwd
190
+ * @param {string} slug
191
+ * @param {{mode?: string, settings: Setting[]}} data
192
+ * @param {{light: Record<string, string>, dark: Record<string, string>}} [base]
193
+ */
194
+ export function paletteKeptAsSaved(cwd: string, slug: string, data: {
195
+ mode?: string;
196
+ settings: Setting[];
197
+ }, base?: {
198
+ light: Record<string, string>;
199
+ dark: Record<string, string>;
200
+ }): boolean;
77
201
  /**
78
202
  * The palette config a theme's settings ask for (see {@link planPalette}),
79
203
  * or null when it would hold no family.
@@ -213,12 +337,15 @@ export function familyRamp(cwd: string, slug: string, data: import("./_settings.
213
337
  * in memory, so it matches the palette file `syncPalette` writes.
214
338
  * @param {string} cwd
215
339
  * @param {string} slug
216
- * @param {import('./_settings.mjs').ThemeData} data
340
+ * @param {{mode?: string, settings: Setting[]}} data - The theme's settings (a whole ThemeData, or the settings with one left out).
217
341
  * @param {{light: Record<string, string>, dark: Record<string, string>}} base
218
342
  * @param {Record<string, unknown>} tokenDefaults
219
343
  * @returns {PaletteMapping | null}
220
344
  */
221
- export function paletteMapping(cwd: string, slug: string, data: import("./_settings.mjs").ThemeData, base: {
345
+ export function paletteMapping(cwd: string, slug: string, data: {
346
+ mode?: string;
347
+ settings: Setting[];
348
+ }, base: {
222
349
  light: Record<string, string>;
223
350
  dark: Record<string, string>;
224
351
  }, tokenDefaults: Record<string, unknown>): PaletteMapping | null;
@@ -262,6 +389,17 @@ export function paletteFailures(pal: PaletteMapping | null, dial: string, modes?
262
389
  * @returns {Set<string>}
263
390
  */
264
391
  export function paletteFailedKeys(pal: PaletteMapping | null): Set<string>;
392
+ /**
393
+ * What the look did to the category colors (Badge, Token, Card tints), the
394
+ * chart colors and the status roles: one line with the accent's notes, and
395
+ * what a set gave up to stay written with every dial's.
396
+ * @param {PaletteMapping} pal
397
+ * @param {string} dial
398
+ * @param {string} [slug]
399
+ * @param {boolean} [vibrancyRuns] whether `set <theme> vibrancy` changes
400
+ * anything (vibrancyTakes): only then is a higher vibrancy advised
401
+ */
402
+ export function categoryNotes(pal: PaletteMapping, dial: string, slug?: string, vibrancyRuns?: boolean): string[];
265
403
  /**
266
404
  * What one color dial did, for the result notes: what its main token uses
267
405
  * in each mode, every token contrast moved, and last the generated files.
@@ -271,9 +409,11 @@ export function paletteFailedKeys(pal: PaletteMapping | null): Set<string>;
271
409
  * @param {string} dial
272
410
  * @param {string} slug
273
411
  * @param {Mode[]} [modes] the modes the theme has
412
+ * @param {boolean} [vibrancyRuns] whether `set <theme> vibrancy` changes
413
+ * anything (vibrancyTakes)
274
414
  * @returns {string[]}
275
415
  */
276
- export function paletteNotes(pal: PaletteMapping | null, dial: string, slug: string, modes?: Mode[]): string[];
416
+ export function paletteNotes(pal: PaletteMapping | null, dial: string, slug: string, modes?: Mode[], vibrancyRuns?: boolean): string[];
277
417
  export function isEditorTemp(name: string): boolean;
278
418
  export function paletteImport(slug: string): string;
279
419
  export function isGraySeed(seed: string | null): boolean;
@@ -299,6 +439,10 @@ export type PalettePlan = {
299
439
  why: string;
300
440
  ratio: number;
301
441
  }>;
442
+ /**
443
+ * the saved palette, kept as it is (a recipe this CLI does not know)
444
+ */
445
+ stored?: boolean | undefined;
302
446
  };
303
447
  export type Mode = "light" | "dark";
304
448
  export type Setting = import("./_settings.mjs").Setting;
@@ -324,6 +468,10 @@ export type StopRef = {
324
468
  * - The stop holds the seed's exact color (an exact anchor).
325
469
  */
326
470
  exact?: boolean | undefined;
471
+ /**
472
+ * - The half is the base theme's own value in that mode (family `literal`): the generated module reads it from the base, so the mode follows the base theme.
473
+ */
474
+ base?: boolean | undefined;
327
475
  };
328
476
  /**
329
477
  * One contrast check behind a stop choice.
@@ -366,6 +514,7 @@ export type ContrastCheck = {
366
514
  /**
367
515
  * A color dial's family: its seed, and the source token that gives it when
368
516
  * the theme's own source sets the family's fill (null when the setting does).
517
+ * An accent set as a token carries the one mode it is for.
369
518
  */
370
519
  export type DialFamily = {
371
520
  id: string;
@@ -373,6 +522,7 @@ export type DialFamily = {
373
522
  seed: string;
374
523
  value: string;
375
524
  source: string | null;
525
+ only?: "light" | "dark";
376
526
  };
377
527
  /**
378
528
  * The palette mapping of a theme.
@@ -386,6 +536,10 @@ export type PaletteMapping = {
386
536
  dark: StopRef;
387
537
  }>;
388
538
  contrast: ContrastCheck[];
539
+ /**
540
+ * - Whether the palette is kept as saved (made with a recipe this CLI does not know): its colors cannot change here.
541
+ */
542
+ stored?: boolean | undefined;
389
543
  /**
390
544
  * - The generator's vibrancy, 0 to 100.
391
545
  */
@@ -402,6 +556,50 @@ export type PaletteMapping = {
402
556
  * - What the config writer kept or replaced of a hand edit.
403
557
  */
404
558
  notes: string[];
559
+ /**
560
+ * - Whether the category colors (Badge, Token, Card tints) and the chart colors follow the look, and what they gave up to stay written.
561
+ */
562
+ categories?: {
563
+ badges: "derived" | "none";
564
+ chart: "derived" | "none";
565
+ limits: string[];
566
+ moved: string[];
567
+ alike: boolean;
568
+ unread: boolean;
569
+ } | undefined;
570
+ /**
571
+ * - Status fills someone red-weak or green-weak may not tell apart.
572
+ */
573
+ cvd?: {
574
+ a: string;
575
+ b: string;
576
+ vision: "red-weak" | "green-weak";
577
+ mode: Mode;
578
+ colors: [string, string];
579
+ page?: string;
580
+ pages?: string[];
581
+ }[] | undefined;
582
+ /**
583
+ * - The code colors that keep the base theme's because none of their family's stops reads on the code background and the page.
584
+ */
585
+ code?: string[] | undefined;
586
+ /**
587
+ * - The look's colors kept at the base theme's in a mode, because a text/fill pair the base theme draws with them would not read.
588
+ */
589
+ kept?: {
590
+ token: string;
591
+ mode: Mode;
592
+ pair: import("../theme/palette/generate/mapping.mjs").BasePair;
593
+ ratio: number;
594
+ }[] | undefined;
595
+ /**
596
+ * - The status roles the theme leaves unset, each derived from the look, and what they gave up to stay written.
597
+ */
598
+ statuses?: {
599
+ roles: Record<string, "derived">;
600
+ why: string[];
601
+ short: string[];
602
+ } | undefined;
405
603
  /**
406
604
  * - Lifted secondary text per background token of LIFT_PARTS (the accent tint, the neutral track), per mode, from the neutral color; null without one.
407
605
  */
@@ -413,4 +611,6 @@ import { PALETTE_DIALS } from '../theme/palette/generate/mapping.mjs';
413
611
  import { VIBRANCY_DEFAULT } from '../theme/palette/generate/mapping.mjs';
414
612
  import { nearestShade } from '../theme/palette/generate/mapping.mjs';
415
613
  import { paletteToken } from '../theme/palette/generate/mapping.mjs';
416
- export { readRegularFile, LIFT_PARTS, PALETTE_DIALS, VIBRANCY_DEFAULT, nearestShade, paletteToken };
614
+ import { isLookToken } from '../theme/palette/generate/mapping.mjs';
615
+ import { STATUS_TOKEN } from '../theme/palette/generate/mapping.mjs';
616
+ export { readRegularFile, LIFT_PARTS, PALETTE_DIALS, VIBRANCY_DEFAULT, nearestShade, paletteToken, isLookToken, STATUS_TOKEN };