@astryxdesign/cli 0.7.17-canary.gffd1fc0 → 0.7.17

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 (1160) hide show
  1. package/CHANGELOG.md +1877 -0
  2. package/README.md +90 -84
  3. package/api/build/_adapter.d.mts +51 -0
  4. package/api/build/_adapter.mjs +133 -7
  5. package/api/build/build.doc.mjs +3 -3
  6. package/api/build/build.mjs +23 -14
  7. package/api/build/build.type.d.mts +1 -1
  8. package/api/build/build.type.mjs +2 -2
  9. package/api/build/help/help.d.mts +15 -14
  10. package/api/build/help/help.mjs +65 -6
  11. package/api/build/kit/kit.mjs +1 -1
  12. package/api/build/kit/start.mjs +1 -1
  13. package/api/component/_adapter.d.mts +28 -4
  14. package/api/component/_adapter.mjs +79 -45
  15. package/api/component/component.d.mts +1 -1
  16. package/api/component/component.mjs +18 -7
  17. package/api/component/detail/showcase/showcase.mjs +19 -8
  18. package/api/discover/_adapter.d.mts +71 -8
  19. package/api/discover/_adapter.mjs +320 -69
  20. package/api/discover/_catalog-view.d.mts +22 -0
  21. package/api/discover/_catalog-view.mjs +30 -1
  22. package/api/discover/_icon-set-coverage.d.mts +22 -0
  23. package/api/discover/_icon-set-coverage.mjs +32 -0
  24. package/api/discover/detail/detail.d.mts +6 -3
  25. package/api/discover/detail/detail.mjs +14 -6
  26. package/api/discover/detail/doc/doc.mjs +1 -1
  27. package/api/discover/detail/item/item.d.mts +11 -1
  28. package/api/discover/detail/item/item.mjs +29 -8
  29. package/api/discover/discover.d.mts +36 -0
  30. package/api/discover/discover.doc.mjs +1 -1
  31. package/api/discover/discover.mjs +206 -29
  32. package/api/discover/discover.type.d.mts +33 -7
  33. package/api/discover/discover.type.mjs +21 -7
  34. package/api/discover/search/search.d.mts +22 -0
  35. package/api/discover/search/search.mjs +293 -70
  36. package/api/docs/_adapter.d.mts +92 -1
  37. package/api/docs/_adapter.mjs +264 -14
  38. package/api/docs/_entry-names.mjs +4 -3
  39. package/api/docs/docs.d.mts +4 -2
  40. package/api/docs/docs.doc.mjs +10 -0
  41. package/api/docs/docs.mjs +25 -5
  42. package/api/docs/docs.type.d.mts +48 -0
  43. package/api/docs/docs.type.mjs +26 -0
  44. package/api/docs/skills/skills.d.mts +51 -0
  45. package/api/docs/skills/skills.mjs +216 -0
  46. package/api/doctor/_adapter.d.mts +256 -10
  47. package/api/doctor/_adapter.mjs +1233 -51
  48. package/api/doctor/built-checks.d.mts +39 -3
  49. package/api/doctor/built-checks.mjs +203 -7
  50. package/api/doctor/doctor.d.mts +222 -10
  51. package/api/doctor/doctor.doc.mjs +4 -4
  52. package/api/doctor/doctor.mjs +1005 -43
  53. package/api/doctor/doctor.type.d.mts +6 -1
  54. package/api/doctor/doctor.type.mjs +3 -1
  55. package/api/doctor/theme-checks.d.mts +20 -1
  56. package/api/doctor/theme-checks.mjs +307 -7
  57. package/api/error.d.mts +12 -1
  58. package/api/error.mjs +18 -6
  59. package/api/icon/_adapter.d.mts +13 -2
  60. package/api/icon/_adapter.mjs +32 -16
  61. package/api/icon/_authoring.mjs +21 -7
  62. package/api/icon/_records.d.mts +3 -1
  63. package/api/icon/_records.mjs +30 -3
  64. package/api/icon/add/add.mjs +1 -1
  65. package/api/icon/definitions/definitions.mjs +19 -8
  66. package/api/icon/exportIconIndex.doc.mjs +1 -1
  67. package/api/icon/icon.doc.mjs +4 -4
  68. package/api/icon/icon.type.d.mts +80 -2
  69. package/api/icon/icon.type.mjs +40 -5
  70. package/api/icon/iconMap.doc.mjs +2 -2
  71. package/api/icon/list/list.mjs +7 -5
  72. package/api/icon/map/map.mjs +13 -4
  73. package/api/icon/rankIconIndex.doc.mjs +1 -1
  74. package/api/icon/search/icon-index.mjs +22 -9
  75. package/api/icon/search/search.d.mts +47 -3
  76. package/api/icon/search/search.mjs +306 -9
  77. package/api/init/_adapter.d.mts +97 -0
  78. package/api/init/_adapter.mjs +284 -15
  79. package/api/init/init.d.mts +3 -3
  80. package/api/init/init.doc.mjs +30 -6
  81. package/api/init/init.mjs +150 -11
  82. package/api/init/init.type.d.mts +102 -8
  83. package/api/init/init.type.mjs +44 -3
  84. package/api/init/remove/remove.d.mts +7 -4
  85. package/api/init/remove/remove.mjs +124 -26
  86. package/api/init/run/run.d.mts +48 -3
  87. package/api/init/run/run.mjs +444 -37
  88. package/api/integration/_adapter.d.mts +21 -4
  89. package/api/integration/_adapter.mjs +52 -6
  90. package/api/integration/integrationCheck.doc.mjs +1 -1
  91. package/api/integration/pack-check.d.mts +2 -1
  92. package/api/integration/pack-check.mjs +10 -18
  93. package/api/integration/validate-integration.d.mts +6 -3
  94. package/api/integration/validate-integration.mjs +86 -15
  95. package/api/integration/validate-integration.type.d.mts +12 -5
  96. package/api/integration/validate-integration.type.mjs +12 -5
  97. package/api/integration/validateIntegration.doc.mjs +4 -2
  98. package/api/render/_adapter.d.mts +6 -2
  99. package/api/render/_adapter.mjs +301 -51
  100. package/api/render/render.doc.d.mts +1 -1
  101. package/api/render/render.doc.mjs +20 -10
  102. package/api/render/render.mjs +16 -13
  103. package/api/render/render.type.d.mts +57 -10
  104. package/api/render/render.type.mjs +26 -13
  105. package/api/search/ORDERING.md +3 -3
  106. package/api/search/_adapter.d.mts +31 -0
  107. package/api/search/_adapter.mjs +107 -15
  108. package/api/search/_candidate-score.d.mts +12 -4
  109. package/api/search/_candidate-score.mjs +94 -16
  110. package/api/search/_cards.json +4 -1
  111. package/api/search/_entries.d.mts +8 -3
  112. package/api/search/_entries.mjs +109 -12
  113. package/api/search/_fit-order.d.mts +8 -4
  114. package/api/search/_fit-order.mjs +35 -7
  115. package/api/search/_gather-docs.mjs +85 -15
  116. package/api/search/_gather-templates.mjs +6 -0
  117. package/api/search/_icons.d.mts +50 -0
  118. package/api/search/_icons.mjs +85 -0
  119. package/api/search/_lexical.d.mts +14 -1
  120. package/api/search/_lexical.mjs +240 -12
  121. package/api/search/_main-searcher.mjs +13 -0
  122. package/api/search/_named-keywords.d.mts +6 -3
  123. package/api/search/_named-keywords.mjs +70 -19
  124. package/api/search/_order.d.mts +34 -1
  125. package/api/search/_order.mjs +156 -13
  126. package/api/search/_result.d.mts +30 -0
  127. package/api/search/_result.mjs +38 -0
  128. package/api/search/_score.d.mts +20 -6
  129. package/api/search/_score.mjs +96 -16
  130. package/api/search/_titles.d.mts +14 -0
  131. package/api/search/_titles.mjs +16 -3
  132. package/api/search/_words.d.mts +8 -0
  133. package/api/search/_words.mjs +26 -1
  134. package/api/search/search-index.mjs +23 -12
  135. package/api/search/search.d.mts +3 -1
  136. package/api/search/search.doc.mjs +5 -4
  137. package/api/search/search.mjs +69 -26
  138. package/api/search/search.type.d.mts +55 -1
  139. package/api/search/search.type.mjs +35 -1
  140. package/api/swizzle/_adapter.d.mts +1 -1
  141. package/api/swizzle/_adapter.mjs +1 -5
  142. package/api/swizzle/_moduleGraph.d.mts +0 -6
  143. package/api/swizzle/_moduleGraph.mjs +0 -12
  144. package/api/swizzle/copy/copy.mjs +1 -1
  145. package/api/template/_adapter.d.mts +46 -0
  146. package/api/template/_adapter.mjs +198 -2
  147. package/api/template/cdn/cdn.mjs +5 -3
  148. package/api/template/copy/copy.d.mts +12 -2
  149. package/api/template/copy/copy.mjs +95 -21
  150. package/api/template/show/show.d.mts +10 -3
  151. package/api/template/show/show.mjs +16 -4
  152. package/api/template/template.doc.mjs +3 -3
  153. package/api/template/template.mjs +55 -7
  154. package/api/template/template.type.d.mts +3 -0
  155. package/api/template/template.type.mjs +5 -2
  156. package/api/theme/_adapter.d.mts +28 -2
  157. package/api/theme/_adapter.mjs +675 -17
  158. package/api/theme/_app-provider.d.mts +42 -0
  159. package/api/theme/_app-provider.mjs +61 -27
  160. package/api/theme/_shared-source.d.mts +33 -0
  161. package/api/theme/_shared-source.mjs +348 -0
  162. package/api/theme/add/add.d.mts +3 -0
  163. package/api/theme/add/add.mjs +21 -4
  164. package/api/theme/build/build.d.mts +61 -30
  165. package/api/theme/build/build.mjs +552 -489
  166. package/api/theme/build/core-interception.d.mts +10 -0
  167. package/api/theme/build/core-interception.mjs +24 -0
  168. package/api/theme/build/family.mjs +4 -2
  169. package/api/theme/build/import-specifier.d.mts +14 -0
  170. package/api/theme/build/import-specifier.mjs +36 -0
  171. package/api/theme/build/input-fields.d.mts +9 -0
  172. package/api/theme/build/input-fields.mjs +155 -16
  173. package/api/theme/build/null-values.d.mts +22 -0
  174. package/api/theme/build/null-values.mjs +110 -21
  175. package/api/theme/build/radius-values.d.mts +18 -0
  176. package/api/theme/build/radius-values.mjs +76 -0
  177. package/api/theme/build/self-contained.mjs +32 -11
  178. package/api/theme/build/setting-effects.d.mts +254 -0
  179. package/api/theme/build/setting-effects.mjs +1065 -0
  180. package/api/theme/build/style-keys.d.mts +33 -0
  181. package/api/theme/build/style-keys.mjs +154 -0
  182. package/api/theme/build/theme-object.d.mts +47 -0
  183. package/api/theme/build/theme-object.mjs +144 -0
  184. package/api/theme/build/typography-values.mjs +7 -23
  185. package/api/theme/build/written-values.d.mts +18 -0
  186. package/api/theme/build/written-values.mjs +107 -31
  187. package/api/theme/eject/eject.mjs +6 -1
  188. package/api/theme/palette/generate/color.d.mts +41 -9
  189. package/api/theme/palette/generate/color.mjs +108 -39
  190. package/api/theme/palette/generate/generate.mjs +10 -0
  191. package/api/theme/palette/generate/generator.d.mts +45 -27
  192. package/api/theme/palette/generate/generator.mjs +347 -149
  193. package/api/theme/palette/generate/mapping.d.mts +456 -0
  194. package/api/theme/palette/generate/mapping.mjs +1903 -0
  195. package/api/theme/palette/generate/newer-recipe.d.mts +28 -0
  196. package/api/theme/palette/generate/newer-recipe.mjs +87 -0
  197. package/api/theme/palette/generate/types.d.mts +270 -0
  198. package/api/theme/palette/generate/types.mjs +123 -0
  199. package/api/theme/theme.d.mts +25 -4
  200. package/api/theme/theme.mjs +55 -5
  201. package/api/theme/theme.type.d.mts +71 -2
  202. package/api/theme/theme.type.mjs +37 -5
  203. package/api/theme/themeAdd.doc.mjs +3 -2
  204. package/api/theme/themeBuild.doc.mjs +4 -4
  205. package/api/theme/themeEject.doc.mjs +1 -1
  206. package/api/theme/themeRemove.doc.mjs +1 -1
  207. package/api/theme/themeTargets.doc.mjs +1 -1
  208. package/api/theme-edit/_catalog.d.mts +40 -0
  209. package/api/theme-edit/_catalog.mjs +101 -23
  210. package/api/theme-edit/_check.mjs +333 -79
  211. package/api/theme-edit/_color.d.mts +2 -60
  212. package/api/theme-edit/_color.mjs +33 -847
  213. package/api/theme-edit/_compiler.mjs +52 -0
  214. package/api/theme-edit/_context.d.mts +23 -3
  215. package/api/theme-edit/_context.mjs +173 -32
  216. package/api/theme-edit/_css.d.mts +4 -35
  217. package/api/theme-edit/_css.mjs +10 -91
  218. package/api/theme-edit/_edit.mjs +667 -87
  219. package/api/theme-edit/_how-question.d.mts +15 -0
  220. package/api/theme-edit/_how-question.mjs +2729 -179
  221. package/api/theme-edit/_how.mjs +62 -3
  222. package/api/theme-edit/_missed.d.mts +2 -1
  223. package/api/theme-edit/_missed.mjs +128 -29
  224. package/api/theme-edit/_normal.d.mts +22 -5
  225. package/api/theme-edit/_normal.mjs +95 -4
  226. package/api/theme-edit/_palette.d.mts +34 -74
  227. package/api/theme-edit/_palette.mjs +261 -1278
  228. package/api/theme-edit/_part-words.mjs +29 -6
  229. package/api/theme-edit/_parts.d.mts +16 -2
  230. package/api/theme-edit/_parts.mjs +161 -41
  231. package/api/theme-edit/_png.d.mts +24 -0
  232. package/api/theme-edit/_png.mjs +99 -0
  233. package/api/theme-edit/_preview-app.d.mts +16 -0
  234. package/api/theme-edit/_preview-app.mjs +52 -18
  235. package/api/theme-edit/_preview.d.mts +44 -26
  236. package/api/theme-edit/_preview.mjs +304 -89
  237. package/api/theme-edit/_project.d.mts +18 -2
  238. package/api/theme-edit/_project.mjs +27 -3
  239. package/api/theme-edit/_settings.d.mts +118 -1
  240. package/api/theme-edit/_settings.mjs +1336 -76
  241. package/api/theme-edit/_tables.d.mts +19 -11
  242. package/api/theme-edit/_tables.mjs +55 -37
  243. package/api/theme-edit/theme-edit.type.d.mts +20 -2
  244. package/api/theme-edit/theme-edit.type.mjs +9 -6
  245. package/api/upgrade/_adapter.d.mts +43 -4
  246. package/api/upgrade/_adapter.mjs +281 -8
  247. package/api/upgrade/run/run.mjs +4 -0
  248. package/api/upgrade/upgrade.mjs +1 -1
  249. package/api/upgrade/upgrade.type.d.mts +46 -7
  250. package/api/upgrade/upgrade.type.mjs +24 -9
  251. package/assets/codemods/registry.mjs +1 -0
  252. package/assets/codemods/transforms/next/index.mjs +1 -11
  253. package/assets/codemods/transforms/v0.7.17/index.mjs +28 -0
  254. package/assets/codemods/transforms/v0.7.17/migrate-item-swipe-actions-to-swipe.mjs +2160 -0
  255. package/assets/codemods/transforms/v0.7.17/preserve-chat-radius.mjs +515 -0
  256. package/assets/component-list.generated.json +1 -1
  257. package/assets/discover/official-packages.json +72 -0
  258. package/assets/docs/author-a-theme.doc.mjs +7 -4
  259. package/assets/docs/getting-started.doc.mjs +1 -1
  260. package/assets/docs/principles.doc.dense.mjs +1 -1
  261. package/assets/docs/principles.doc.mjs +1 -1
  262. package/assets/docs/principles.doc.zh.mjs +1 -1
  263. package/assets/docs/styling-overview.doc.mjs +5 -1
  264. package/assets/docs/tree/agent-guidance.doc.mjs +34 -3
  265. package/assets/docs/tree/check-the-props.doc.mjs +1 -1
  266. package/assets/docs/tree/checks.doc.mjs +2 -2
  267. package/assets/docs/tree/computer-integrations.doc.mjs +1 -1
  268. package/assets/docs/tree/doc-syntax.doc.mjs +1 -1
  269. package/assets/docs/tree/export-pages.doc.mjs +164 -0
  270. package/assets/docs/tree/fonts-and-assets.doc.mjs +1 -1
  271. package/assets/docs/tree/host-entry.doc.mjs +4 -0
  272. package/assets/docs/tree/i18n-library-integration.doc.mjs +7 -3
  273. package/assets/docs/tree/icon-definitions.doc.mjs +3 -3
  274. package/assets/docs/tree/icon-sets.doc.mjs +87 -11
  275. package/assets/docs/tree/layout.doc.mjs +16 -5
  276. package/assets/docs/tree/problems.doc.mjs +2 -2
  277. package/assets/docs/tree/responsive.doc.mjs +2 -2
  278. package/assets/docs/tree/scaffold.doc.mjs +1 -0
  279. package/assets/docs/tree/share-a-page.doc.mjs +14 -16
  280. package/assets/docs/tree/short-and-findable.doc.mjs +3 -3
  281. package/assets/docs/tree/skill-places.doc.mjs +91 -0
  282. package/assets/docs/tree/styling.doc.mjs +41 -3
  283. package/assets/docs/tree/template-grading-rubric.doc.mjs +1 -1
  284. package/assets/docs/tree/test-in-an-app.doc.mjs +1 -1
  285. package/assets/docs/tree/tokens-and-setup.doc.mjs +2 -4
  286. package/assets/docs/tree/tokens-color.doc.mjs +2 -2
  287. package/assets/docs/tree/tokens-radius.doc.mjs +1 -1
  288. package/assets/docs/tree/tokens.doc.mjs +32 -0
  289. package/assets/docs/tree/troubleshooting.doc.mjs +8 -0
  290. package/assets/docs/tree/typography.doc.mjs +31 -2
  291. package/assets/docs/tree/updates.doc.mjs +1 -1
  292. package/assets/docs/tree/versioning.doc.mjs +1 -1
  293. package/assets/docs/use-a-theme.doc.mjs +4 -0
  294. package/assets/docs/working-with-ai.doc.mjs +44 -9
  295. package/assets/docs-routes.generated.json +1 -1
  296. package/assets/docs.generated.json +2 -2
  297. package/assets/icons/definitions/alert.doc.mjs +9 -0
  298. package/assets/icons/definitions/alignBottom.doc.mjs +1 -0
  299. package/assets/icons/definitions/alignCenter.doc.mjs +1 -0
  300. package/assets/icons/definitions/alignEnd.doc.mjs +1 -0
  301. package/assets/icons/definitions/alignJustify.doc.mjs +1 -0
  302. package/assets/icons/definitions/alignMiddle.doc.mjs +1 -0
  303. package/assets/icons/definitions/alignStart.doc.mjs +1 -0
  304. package/assets/icons/definitions/alignTop.doc.mjs +1 -0
  305. package/assets/icons/definitions/arrowDown.doc.mjs +1 -0
  306. package/assets/icons/definitions/arrowLeft.doc.mjs +1 -0
  307. package/assets/icons/definitions/arrowRight.doc.mjs +1 -0
  308. package/assets/icons/definitions/arrowUp.doc.mjs +1 -0
  309. package/assets/icons/definitions/arrowsUpDown.doc.mjs +1 -0
  310. package/assets/icons/definitions/bank.doc.mjs +1 -0
  311. package/assets/icons/definitions/block.doc.mjs +9 -0
  312. package/assets/icons/definitions/bold.doc.mjs +1 -0
  313. package/assets/icons/definitions/bookmark.doc.mjs +1 -0
  314. package/assets/icons/definitions/bookmarkAdd.doc.mjs +1 -0
  315. package/assets/icons/definitions/cart.doc.mjs +1 -0
  316. package/assets/icons/definitions/channel.doc.mjs +9 -0
  317. package/assets/icons/definitions/check.doc.mjs +1 -0
  318. package/assets/icons/definitions/checkDouble.doc.mjs +1 -0
  319. package/assets/icons/definitions/checklist.doc.mjs +9 -0
  320. package/assets/icons/definitions/chevronDown.doc.mjs +1 -0
  321. package/assets/icons/definitions/chevronLeft.doc.mjs +1 -0
  322. package/assets/icons/definitions/chevronRight.doc.mjs +1 -0
  323. package/assets/icons/definitions/chevronUp.doc.mjs +1 -0
  324. package/assets/icons/definitions/chevronsLeft.doc.mjs +1 -0
  325. package/assets/icons/definitions/chevronsRight.doc.mjs +1 -0
  326. package/assets/icons/definitions/clipboard.doc.mjs +1 -0
  327. package/assets/icons/definitions/cloud.doc.mjs +1 -1
  328. package/assets/icons/definitions/collapse.doc.mjs +1 -0
  329. package/assets/icons/definitions/columnSettings.doc.mjs +9 -0
  330. package/assets/icons/definitions/compose.doc.mjs +1 -0
  331. package/assets/icons/definitions/conversation.doc.mjs +1 -0
  332. package/assets/icons/definitions/copy.doc.mjs +1 -0
  333. package/assets/icons/definitions/copyText.doc.mjs +9 -0
  334. package/assets/icons/definitions/cornerRadius.doc.mjs +1 -0
  335. package/assets/icons/definitions/create.doc.mjs +9 -0
  336. package/assets/icons/definitions/creditCard.doc.mjs +1 -0
  337. package/assets/icons/definitions/currency.doc.mjs +9 -0
  338. package/assets/icons/definitions/cut.doc.mjs +1 -0
  339. package/assets/icons/definitions/desktop.doc.mjs +1 -0
  340. package/assets/icons/definitions/discount.doc.mjs +1 -0
  341. package/assets/icons/definitions/document.doc.mjs +1 -0
  342. package/assets/icons/definitions/documentSearch.doc.mjs +1 -0
  343. package/assets/icons/definitions/download.doc.mjs +1 -0
  344. package/assets/icons/definitions/error.doc.mjs +1 -0
  345. package/assets/icons/definitions/exitFullScreen.doc.mjs +16 -0
  346. package/assets/icons/definitions/expand.doc.mjs +1 -0
  347. package/assets/icons/definitions/eye.doc.mjs +1 -0
  348. package/assets/icons/definitions/eyeSlash.doc.mjs +1 -0
  349. package/assets/icons/definitions/file.doc.mjs +1 -0
  350. package/assets/icons/definitions/flipHorizontal.doc.mjs +1 -0
  351. package/assets/icons/definitions/flipVertical.doc.mjs +1 -0
  352. package/assets/icons/definitions/folder.doc.mjs +1 -0
  353. package/assets/icons/definitions/folderAdd.doc.mjs +1 -0
  354. package/assets/icons/definitions/fullScreen.doc.mjs +16 -0
  355. package/assets/icons/definitions/globe.doc.mjs +1 -1
  356. package/assets/icons/definitions/groupRows.doc.mjs +9 -0
  357. package/assets/icons/definitions/halftone.doc.mjs +9 -0
  358. package/assets/icons/definitions/help.doc.mjs +9 -0
  359. package/assets/icons/definitions/house.doc.mjs +9 -0
  360. package/assets/icons/definitions/info.doc.mjs +1 -0
  361. package/assets/icons/definitions/italic.doc.mjs +1 -0
  362. package/assets/icons/definitions/listView.doc.mjs +9 -0
  363. package/assets/icons/definitions/lock.doc.mjs +1 -0
  364. package/assets/icons/definitions/lowercase.doc.mjs +1 -0
  365. package/assets/icons/definitions/mail.doc.mjs +1 -1
  366. package/assets/icons/definitions/media.doc.mjs +9 -0
  367. package/assets/icons/definitions/message.doc.mjs +2 -1
  368. package/assets/icons/definitions/mobile.doc.mjs +1 -0
  369. package/assets/icons/definitions/money.doc.mjs +1 -0
  370. package/assets/icons/definitions/moon.doc.mjs +1 -0
  371. package/assets/icons/definitions/moveToFolder.doc.mjs +9 -0
  372. package/assets/icons/definitions/notification.doc.mjs +1 -0
  373. package/assets/icons/definitions/notificationActive.doc.mjs +1 -0
  374. package/assets/icons/definitions/notificationOff.doc.mjs +1 -0
  375. package/assets/icons/definitions/paddingHorizontal.doc.mjs +1 -0
  376. package/assets/icons/definitions/paddingPerSide.doc.mjs +1 -0
  377. package/assets/icons/definitions/paddingVertical.doc.mjs +1 -0
  378. package/assets/icons/definitions/panelBottom.doc.mjs +1 -0
  379. package/assets/icons/definitions/panelLeft.doc.mjs +1 -0
  380. package/assets/icons/definitions/panelRight.doc.mjs +1 -0
  381. package/assets/icons/definitions/paste.doc.mjs +9 -0
  382. package/assets/icons/definitions/pause.doc.mjs +1 -0
  383. package/assets/icons/definitions/play.doc.mjs +1 -0
  384. package/assets/icons/definitions/radiusPerCorner.doc.mjs +1 -0
  385. package/assets/icons/definitions/redo.doc.mjs +1 -0
  386. package/assets/icons/definitions/review.doc.mjs +9 -0
  387. package/assets/icons/definitions/rotate.doc.mjs +1 -0
  388. package/assets/icons/definitions/rotateCounterclockwise.doc.mjs +1 -0
  389. package/assets/icons/definitions/scale.doc.mjs +1 -2
  390. package/assets/icons/definitions/schedule.doc.mjs +9 -0
  391. package/assets/icons/definitions/search.doc.mjs +1 -0
  392. package/assets/icons/definitions/send.doc.mjs +1 -0
  393. package/assets/icons/definitions/shoppingBag.doc.mjs +1 -0
  394. package/assets/icons/definitions/signal.doc.mjs +9 -0
  395. package/assets/icons/definitions/stop.doc.mjs +1 -0
  396. package/assets/icons/definitions/strikethrough.doc.mjs +1 -0
  397. package/assets/icons/definitions/success.doc.mjs +1 -0
  398. package/assets/icons/definitions/sun.doc.mjs +1 -0
  399. package/assets/icons/definitions/tablet.doc.mjs +1 -0
  400. package/assets/icons/definitions/team.doc.mjs +9 -0
  401. package/assets/icons/definitions/textCase.doc.mjs +2 -1
  402. package/assets/icons/definitions/textRegular.doc.mjs +1 -0
  403. package/assets/icons/definitions/thumbsDown.doc.mjs +1 -0
  404. package/assets/icons/definitions/thumbsUp.doc.mjs +1 -0
  405. package/assets/icons/definitions/transfer.doc.mjs +1 -0
  406. package/assets/icons/definitions/trendDown.doc.mjs +1 -0
  407. package/assets/icons/definitions/trendUp.doc.mjs +1 -0
  408. package/assets/icons/definitions/underline.doc.mjs +1 -0
  409. package/assets/icons/definitions/undo.doc.mjs +1 -0
  410. package/assets/icons/definitions/unlock.doc.mjs +1 -0
  411. package/assets/icons/definitions/upload.doc.mjs +1 -0
  412. package/assets/icons/definitions/uppercase.doc.mjs +1 -0
  413. package/assets/icons/definitions/user.doc.mjs +1 -0
  414. package/assets/icons/definitions/userAdd.doc.mjs +1 -0
  415. package/assets/icons/definitions/userCircle.doc.mjs +1 -0
  416. package/assets/icons/definitions/userRemove.doc.mjs +1 -0
  417. package/assets/icons/definitions/users.doc.mjs +1 -0
  418. package/assets/icons/definitions/verified.doc.mjs +9 -0
  419. package/assets/icons/definitions/wallet.doc.mjs +1 -0
  420. package/assets/icons/definitions/warning.doc.mjs +1 -0
  421. package/assets/icons/definitions/wrench.doc.mjs +1 -1
  422. package/assets/icons/installed-icon-set.doc.mjs +30 -0
  423. package/assets/icons/template-icons.json +661 -0
  424. package/assets/search-catalog.generated.json +2 -2
  425. package/assets/self-audit.generated.json +1 -1
  426. package/assets/templates/blocks/components/AppShell/AppShellShowcase.doc.mjs +0 -7
  427. package/assets/templates/blocks/components/AppShell/AppShellShowcase.tsx +8 -10
  428. package/assets/templates/blocks/components/AppShell/AppShellSideNavOnly.doc.mjs +0 -8
  429. package/assets/templates/blocks/components/AppShell/AppShellSideNavOnly.tsx +10 -8
  430. package/assets/templates/blocks/components/AppShell/AppShellTopNavOnly.doc.mjs +0 -1
  431. package/assets/templates/blocks/components/AppShell/AppShellTopNavOnly.tsx +4 -2
  432. package/assets/templates/blocks/components/AppShell/AppShellTopNavWithSideNav.doc.mjs +0 -8
  433. package/assets/templates/blocks/components/AppShell/AppShellTopNavWithSideNav.tsx +10 -8
  434. package/assets/templates/blocks/components/AppShell/AppShellWithBanner.doc.mjs +0 -8
  435. package/assets/templates/blocks/components/AppShell/AppShellWithBanner.tsx +10 -8
  436. package/assets/templates/blocks/components/AspectRatio/AspectRatioImageGallery.tsx +1 -1
  437. package/assets/templates/blocks/components/AspectRatio/AspectRatioWidescreen.tsx +1 -1
  438. package/assets/templates/blocks/components/AspectRatio/AspectRatioWithSkeleton.tsx +1 -1
  439. package/assets/templates/blocks/components/Avatar/AvatarInteractive.tsx +6 -1
  440. package/assets/templates/blocks/components/Avatar/AvatarShowcase.tsx +1 -1
  441. package/assets/templates/blocks/components/Avatar/AvatarTooltip.tsx +1 -1
  442. package/assets/templates/blocks/components/Avatar/AvatarWithStatus.tsx +1 -1
  443. package/assets/templates/blocks/components/AvatarStatusDot/AvatarStatusDotShowcase.tsx +1 -1
  444. package/assets/templates/blocks/components/AvatarStatusDot/AvatarStatusDotVariants.tsx +1 -1
  445. package/assets/templates/blocks/components/Badge/BadgeShowcase.tsx +2 -2
  446. package/assets/templates/blocks/components/Banner/BannerCollapsibleContent.tsx +14 -1
  447. package/assets/templates/blocks/components/Banner/BannerSectionVariant.tsx +10 -1
  448. package/assets/templates/blocks/components/Banner/BannerWithActionButton.tsx +25 -3
  449. package/assets/templates/blocks/components/BaseTypeahead/BaseTypeaheadCustomSearch.doc.mjs +0 -1
  450. package/assets/templates/blocks/components/BaseTypeahead/BaseTypeaheadCustomSearch.tsx +2 -2
  451. package/assets/templates/blocks/components/BaseTypeahead/BaseTypeaheadMenu.doc.mjs +0 -1
  452. package/assets/templates/blocks/components/BaseTypeahead/BaseTypeaheadMenu.tsx +1 -1
  453. package/assets/templates/blocks/components/BottomSheet/BottomSheetSnapPoints.doc.mjs +0 -8
  454. package/assets/templates/blocks/components/BottomSheet/BottomSheetSnapPoints.tsx +5 -5
  455. package/assets/templates/blocks/components/BreadcrumbItem/BreadcrumbItemShowcase.doc.mjs +0 -1
  456. package/assets/templates/blocks/components/BreadcrumbItem/BreadcrumbItemShowcase.tsx +1 -1
  457. package/assets/templates/blocks/components/Breadcrumbs/BreadcrumbsDeepHierarchy.doc.mjs +0 -1
  458. package/assets/templates/blocks/components/Breadcrumbs/BreadcrumbsDeepHierarchy.tsx +1 -1
  459. package/assets/templates/blocks/components/Breadcrumbs/BreadcrumbsWithIcons.doc.mjs +0 -1
  460. package/assets/templates/blocks/components/Breadcrumbs/BreadcrumbsWithIcons.tsx +2 -2
  461. package/assets/templates/blocks/components/Button/ButtonFloating.doc.mjs +0 -1
  462. package/assets/templates/blocks/components/Button/ButtonFloating.tsx +25 -2
  463. package/assets/templates/blocks/components/Button/ButtonShowcase.tsx +42 -4
  464. package/assets/templates/blocks/components/Button/ButtonSizeVariants.tsx +24 -2
  465. package/assets/templates/blocks/components/Button/ButtonVariants.tsx +28 -1
  466. package/assets/templates/blocks/components/Button/ButtonWithEndSlot.tsx +9 -0
  467. package/assets/templates/blocks/components/Button/ButtonWithIcon.doc.mjs +0 -6
  468. package/assets/templates/blocks/components/Button/ButtonWithIcon.tsx +35 -9
  469. package/assets/templates/blocks/components/ButtonGroup/ButtonGroupBasic.tsx +20 -3
  470. package/assets/templates/blocks/components/ButtonGroup/ButtonGroupFloating.tsx +16 -3
  471. package/assets/templates/blocks/components/ButtonGroup/ButtonGroupShowcase.doc.mjs +0 -6
  472. package/assets/templates/blocks/components/ButtonGroup/ButtonGroupShowcase.tsx +37 -8
  473. package/assets/templates/blocks/components/Center/CenterHorizontal.doc.mjs +0 -8
  474. package/assets/templates/blocks/components/Center/CenterHorizontal.tsx +23 -5
  475. package/assets/templates/blocks/components/Center/CenterInsideACard.doc.mjs +0 -1
  476. package/assets/templates/blocks/components/Center/CenterInsideACard.tsx +1 -1
  477. package/assets/templates/blocks/components/ChatComposer/ChatComposerFlat.doc.mjs +0 -5
  478. package/assets/templates/blocks/components/ChatComposer/ChatComposerFlat.tsx +8 -3
  479. package/assets/templates/blocks/components/ChatComposer/ChatComposerFooterActions.doc.mjs +0 -5
  480. package/assets/templates/blocks/components/ChatComposer/ChatComposerFooterActions.tsx +8 -3
  481. package/assets/templates/blocks/components/ChatComposer/ChatComposerFullFeatured.doc.mjs +0 -7
  482. package/assets/templates/blocks/components/ChatComposer/ChatComposerFullFeatured.tsx +10 -7
  483. package/assets/templates/blocks/components/ChatComposerDrawer/ChatComposerDrawerShowcase.doc.mjs +0 -1
  484. package/assets/templates/blocks/components/ChatComposerDrawer/ChatComposerDrawerShowcase.tsx +2 -2
  485. package/assets/templates/blocks/components/ChatComposerDrawer/ChatComposerDrawerWithProgress.doc.mjs +0 -1
  486. package/assets/templates/blocks/components/ChatComposerDrawer/ChatComposerDrawerWithProgress.tsx +3 -3
  487. package/assets/templates/blocks/components/ChatMessageMetadata/ChatMessageMetadataFooter.doc.mjs +0 -6
  488. package/assets/templates/blocks/components/ChatMessageMetadata/ChatMessageMetadataFooter.tsx +9 -9
  489. package/assets/templates/blocks/components/ChatMessageMetadata/ChatMessageMetadataShowcase.doc.mjs +0 -6
  490. package/assets/templates/blocks/components/ChatMessageMetadata/ChatMessageMetadataShowcase.tsx +10 -10
  491. package/assets/templates/blocks/components/ChatSendButton/ChatSendButtonCustomIcon.doc.mjs +0 -6
  492. package/assets/templates/blocks/components/ChatSendButton/ChatSendButtonCustomIcon.tsx +8 -5
  493. package/assets/templates/blocks/components/ChatSendButton/ChatSendButtonShowcase.doc.mjs +0 -1
  494. package/assets/templates/blocks/components/ChatSendButton/ChatSendButtonShowcase.tsx +1 -1
  495. package/assets/templates/blocks/components/ChatSystemMessage/ChatSystemMessageStatusUpdates.doc.mjs +0 -5
  496. package/assets/templates/blocks/components/ChatSystemMessage/ChatSystemMessageStatusUpdates.tsx +7 -7
  497. package/assets/templates/blocks/components/ChatSystemMessage/ChatSystemMessageWithIcon.doc.mjs +0 -6
  498. package/assets/templates/blocks/components/ChatSystemMessage/ChatSystemMessageWithIcon.tsx +7 -7
  499. package/assets/templates/blocks/components/CodeBlock/CodeBlockTerminal.tsx +1 -1
  500. package/assets/templates/blocks/components/ContextMenu/ContextMenuBottomSheet.doc.mjs +0 -6
  501. package/assets/templates/blocks/components/ContextMenu/ContextMenuBottomSheet.tsx +7 -7
  502. package/assets/templates/blocks/components/DropdownMenu/DropdownMenuBottomSheet.doc.mjs +0 -6
  503. package/assets/templates/blocks/components/DropdownMenu/DropdownMenuBottomSheet.tsx +7 -7
  504. package/assets/templates/blocks/components/DropdownMenu/DropdownMenuNoChevron.doc.mjs +0 -1
  505. package/assets/templates/blocks/components/DropdownMenu/DropdownMenuNoChevron.tsx +2 -2
  506. package/assets/templates/blocks/components/EmptyState/EmptyStateActions.doc.mjs +0 -1
  507. package/assets/templates/blocks/components/EmptyState/EmptyStateActions.tsx +2 -2
  508. package/assets/templates/blocks/components/EmptyState/EmptyStateCompact.doc.mjs +0 -1
  509. package/assets/templates/blocks/components/EmptyState/EmptyStateCompact.tsx +1 -1
  510. package/assets/templates/blocks/components/EmptyState/EmptyStateContainer.doc.mjs +0 -1
  511. package/assets/templates/blocks/components/EmptyState/EmptyStateContainer.tsx +2 -2
  512. package/assets/templates/blocks/components/EmptyState/EmptyStateShowcase.doc.mjs +0 -1
  513. package/assets/templates/blocks/components/EmptyState/EmptyStateShowcase.tsx +2 -2
  514. package/assets/templates/blocks/components/Grid/GridShowcase.tsx +1 -1
  515. package/assets/templates/blocks/components/GridSpan/GridSpanColumns.tsx +1 -1
  516. package/assets/templates/blocks/components/GridSpan/GridSpanShowcase.tsx +1 -1
  517. package/assets/templates/blocks/components/Heading/HeadingTruncation.tsx +3 -2
  518. package/assets/templates/blocks/components/Hooks/useClipboardHookUsage.tsx +1 -1
  519. package/assets/templates/blocks/components/Hooks/useContainerRevealHookUsage.doc.mjs +0 -1
  520. package/assets/templates/blocks/components/Hooks/useContainerRevealHookUsage.tsx +38 -19
  521. package/assets/templates/blocks/components/Hooks/useGridFocusHookUsage.tsx +6 -6
  522. package/assets/templates/blocks/components/Hooks/useHotkeysHookUsage.tsx +1 -1
  523. package/assets/templates/blocks/components/Hooks/useInputContainerHookUsage.doc.mjs +0 -1
  524. package/assets/templates/blocks/components/Hooks/useInputContainerHookUsage.tsx +2 -2
  525. package/assets/templates/blocks/components/Hooks/useKeyboardHintHookUsage.doc.mjs +0 -1
  526. package/assets/templates/blocks/components/Hooks/useKeyboardHintHookUsage.tsx +2 -2
  527. package/assets/templates/blocks/components/Hooks/useListFocusHookUsage.tsx +8 -1
  528. package/assets/templates/blocks/components/Hooks/useOverflowHookUsage.tsx +17 -6
  529. package/assets/templates/blocks/components/Hooks/useStreamingTextHookUsage.tsx +1 -1
  530. package/assets/templates/blocks/components/Hooks/useTreeFocusHookUsage.doc.mjs +0 -1
  531. package/assets/templates/blocks/components/Hooks/useTreeFocusHookUsage.tsx +1 -1
  532. package/assets/templates/blocks/components/HoverCard/HoverCardInteractiveContent.doc.mjs +0 -1
  533. package/assets/templates/blocks/components/HoverCard/HoverCardInteractiveContent.tsx +1 -1
  534. package/assets/templates/blocks/components/HoverCard/HoverCardProfileHoverCard.doc.mjs +0 -1
  535. package/assets/templates/blocks/components/HoverCard/HoverCardProfileHoverCard.tsx +1 -1
  536. package/assets/templates/blocks/components/Icon/useIconHookUsage.doc.mjs +0 -5
  537. package/assets/templates/blocks/components/Icon/useIconHookUsage.tsx +7 -7
  538. package/assets/templates/blocks/components/IconButton/IconButtonActionBar.tsx +11 -0
  539. package/assets/templates/blocks/components/IconButton/IconButtonFloating.doc.mjs +0 -1
  540. package/assets/templates/blocks/components/IconButton/IconButtonFloating.tsx +25 -2
  541. package/assets/templates/blocks/components/IconButton/IconButtonShowcase.tsx +3 -0
  542. package/assets/templates/blocks/components/IconButton/IconButtonTooltipIconButton.tsx +5 -0
  543. package/assets/templates/blocks/components/InternationalizationProvider/InternationalizationProvider02Overrides.doc.mjs +3 -3
  544. package/assets/templates/blocks/components/InternationalizationProvider/InternationalizationProvider02Overrides.tsx +36 -13
  545. package/assets/templates/blocks/components/Item/ItemDocumentTabs.doc.mjs +0 -1
  546. package/assets/templates/blocks/components/Item/ItemDocumentTabs.tsx +4 -4
  547. package/assets/templates/blocks/components/Item/ItemShowcase.doc.mjs +0 -1
  548. package/assets/templates/blocks/components/Item/ItemShowcase.tsx +7 -3
  549. package/assets/templates/blocks/components/Layout/LayoutBasicCardLayout.tsx +14 -2
  550. package/assets/templates/blocks/components/Layout/LayoutContentWidth.tsx +14 -2
  551. package/assets/templates/blocks/components/Layout/LayoutFullBleedContent.tsx +8 -1
  552. package/assets/templates/blocks/components/Layout/LayoutShowcase.tsx +8 -1
  553. package/assets/templates/blocks/components/Layout/LayoutSidebarLayout.tsx +14 -2
  554. package/assets/templates/blocks/components/LinkProvider/LinkProviderCustomLink.tsx +3 -1
  555. package/assets/templates/blocks/components/Markdown/MarkdownShowcase.tsx +1 -1
  556. package/assets/templates/blocks/components/MediaTheme/MediaThemeImageOverlay.tsx +18 -4
  557. package/assets/templates/blocks/components/MediaTheme/MediaThemeLightScrim.tsx +11 -3
  558. package/assets/templates/blocks/components/MediaTheme/MediaThemeShowcase.tsx +27 -5
  559. package/assets/templates/blocks/components/MobileNav/MobileNavBasicMobileNav.doc.mjs +0 -7
  560. package/assets/templates/blocks/components/MobileNav/MobileNavBasicMobileNav.tsx +5 -9
  561. package/assets/templates/blocks/components/MobileNav/MobileNavEndSideMobileNav.doc.mjs +0 -1
  562. package/assets/templates/blocks/components/MobileNav/MobileNavEndSideMobileNav.tsx +2 -2
  563. package/assets/templates/blocks/components/MobileNav/MobileNavWithoutTitleMobileNav.doc.mjs +0 -1
  564. package/assets/templates/blocks/components/MobileNav/MobileNavWithoutTitleMobileNav.tsx +1 -1
  565. package/assets/templates/blocks/components/MoreMenu/MoreMenuBottomSheet.doc.mjs +0 -6
  566. package/assets/templates/blocks/components/MoreMenu/MoreMenuBottomSheet.tsx +15 -15
  567. package/assets/templates/blocks/components/MoreMenu/MoreMenuWithDividers.doc.mjs +0 -5
  568. package/assets/templates/blocks/components/MoreMenu/MoreMenuWithDividers.tsx +4 -8
  569. package/assets/templates/blocks/components/MoreMenu/MoreMenuWithSections.doc.mjs +0 -5
  570. package/assets/templates/blocks/components/MoreMenu/MoreMenuWithSections.tsx +4 -8
  571. package/assets/templates/blocks/components/MultiSelector/useMultiComboboxHookUsage.doc.mjs +0 -1
  572. package/assets/templates/blocks/components/MultiSelector/useMultiComboboxHookUsage.tsx +1 -1
  573. package/assets/templates/blocks/components/OverflowList/OverflowListCappedToolbar.tsx +38 -2
  574. package/assets/templates/blocks/components/OverflowList/OverflowListCollapseFromStartList.tsx +17 -5
  575. package/assets/templates/blocks/components/OverflowList/OverflowListOverflowDropdownActions.tsx +46 -7
  576. package/assets/templates/blocks/components/OverflowList/OverflowListShowcase.tsx +45 -5
  577. package/assets/templates/blocks/components/Overlay/OverlayHoverReveal.tsx +14 -1
  578. package/assets/templates/blocks/components/Overlay/OverlayShowcase.tsx +10 -1
  579. package/assets/templates/blocks/components/Overlay/useOverlayHookUsage.tsx +12 -1
  580. package/assets/templates/blocks/components/Pagination/PaginationDotsCarousel.doc.mjs +0 -1
  581. package/assets/templates/blocks/components/Pagination/PaginationDotsCarousel.tsx +1 -1
  582. package/assets/templates/blocks/components/Popover/PopoverBottomSheetAlternative.doc.mjs +0 -1
  583. package/assets/templates/blocks/components/Popover/PopoverBottomSheetAlternative.tsx +1 -1
  584. package/assets/templates/blocks/components/Resizable/ResizableShowcase.tsx +12 -2
  585. package/assets/templates/blocks/components/Resizable/ResizableSidebar.tsx +1 -1
  586. package/assets/templates/blocks/components/ScrollableArea/ScrollableAreaInlineRail.tsx +1 -1
  587. package/assets/templates/blocks/components/ScrollableArea/ScrollableAreaOverscrollChaining.tsx +1 -1
  588. package/assets/templates/blocks/components/ScrollableArea/ScrollableAreaShowcase.tsx +1 -1
  589. package/assets/templates/blocks/components/ScrollableArea/ScrollableAreaStickyGroupHeaders.tsx +1 -1
  590. package/assets/templates/blocks/components/ScrollableArea/ScrollableAreaStickyPassthrough.tsx +1 -1
  591. package/assets/templates/blocks/components/ScrollableArea/ScrollableAreaTwoAxisBoard.tsx +1 -1
  592. package/assets/templates/blocks/components/Section/SectionWashHighlight.doc.mjs +0 -1
  593. package/assets/templates/blocks/components/Section/SectionWashHighlight.tsx +10 -2
  594. package/assets/templates/blocks/components/Selector/SelectorOptionDescriptions.doc.mjs +0 -1
  595. package/assets/templates/blocks/components/Selector/SelectorOptionDescriptions.tsx +3 -3
  596. package/assets/templates/blocks/components/SelectorOption/SelectorOptionShowcase.doc.mjs +0 -1
  597. package/assets/templates/blocks/components/SelectorOption/SelectorOptionShowcase.tsx +1 -1
  598. package/assets/templates/blocks/components/Stack/StackAlignment.tsx +50 -6
  599. package/assets/templates/blocks/components/Stack/StackDirections.tsx +1 -1
  600. package/assets/templates/blocks/components/Stack/StackFillItem.tsx +10 -1
  601. package/assets/templates/blocks/components/Step/StepContent.tsx +13 -4
  602. package/assets/templates/blocks/components/Step/StepIndicator.tsx +3 -2
  603. package/assets/templates/blocks/components/Step/StepShowcase.tsx +1 -1
  604. package/assets/templates/blocks/components/Step/StepStates.tsx +3 -2
  605. package/assets/templates/blocks/components/Stepper/StepperCustomContent.tsx +18 -14
  606. package/assets/templates/blocks/components/Stepper/StepperOnTrackHorizontal.tsx +1 -1
  607. package/assets/templates/blocks/components/Table/TableInCard.tsx +1 -1
  608. package/assets/templates/blocks/components/Table/TableShowcase.tsx +1 -1
  609. package/assets/templates/blocks/components/TextArea/TextAreaWithIcon.doc.mjs +0 -1
  610. package/assets/templates/blocks/components/TextArea/TextAreaWithIcon.tsx +2 -2
  611. package/assets/templates/blocks/components/TextInput/TextInputIcon.doc.mjs +0 -1
  612. package/assets/templates/blocks/components/TextInput/TextInputIcon.tsx +3 -7
  613. package/assets/templates/blocks/components/TextInput/TextInputSearch.doc.mjs +0 -1
  614. package/assets/templates/blocks/components/TextInput/TextInputSearch.tsx +3 -3
  615. package/assets/templates/blocks/components/Theme/ThemeApply.tsx +8 -1
  616. package/assets/templates/blocks/components/Theme/ThemeNested.tsx +11 -1
  617. package/assets/templates/blocks/components/Theme/ThemeShowcase.tsx +26 -3
  618. package/assets/templates/blocks/components/Theme/ThemeSwitcher.tsx +8 -1
  619. package/assets/templates/blocks/components/ToggleButton/ToggleButtonColor.doc.mjs +0 -11
  620. package/assets/templates/blocks/components/ToggleButton/ToggleButtonColor.tsx +5 -5
  621. package/assets/templates/blocks/components/ToggleButton/ToggleButtonGroup.doc.mjs +0 -9
  622. package/assets/templates/blocks/components/ToggleButton/ToggleButtonGroup.tsx +5 -9
  623. package/assets/templates/blocks/components/ToggleButton/ToggleButtonIconSwap.doc.mjs +0 -6
  624. package/assets/templates/blocks/components/ToggleButton/ToggleButtonIconSwap.tsx +6 -6
  625. package/assets/templates/blocks/components/ToggleButton/ToggleButtonLabel.doc.mjs +0 -6
  626. package/assets/templates/blocks/components/ToggleButton/ToggleButtonLabel.tsx +3 -3
  627. package/assets/templates/blocks/components/ToggleButton/ToggleButtonShowcase.doc.mjs +0 -6
  628. package/assets/templates/blocks/components/ToggleButton/ToggleButtonShowcase.tsx +6 -6
  629. package/assets/templates/blocks/components/ToggleButton/ToggleButtonStates.doc.mjs +0 -1
  630. package/assets/templates/blocks/components/ToggleButton/ToggleButtonStates.tsx +2 -2
  631. package/assets/templates/blocks/components/Token/TokenIcon.doc.mjs +0 -6
  632. package/assets/templates/blocks/components/Token/TokenIcon.tsx +3 -3
  633. package/assets/templates/blocks/components/Token/TokenShowcase.doc.mjs +0 -1
  634. package/assets/templates/blocks/components/Token/TokenShowcase.tsx +1 -1
  635. package/assets/templates/blocks/components/Tokenizer/TokenizerEndContent.tsx +14 -1
  636. package/assets/templates/blocks/components/Tokenizer/TokenizerIcon.doc.mjs +0 -1
  637. package/assets/templates/blocks/components/Tokenizer/TokenizerIcon.tsx +2 -2
  638. package/assets/templates/blocks/components/Toolbar/ToolbarBulkActions.doc.mjs +0 -1
  639. package/assets/templates/blocks/components/Toolbar/ToolbarBulkActions.tsx +36 -3
  640. package/assets/templates/blocks/components/Toolbar/ToolbarCardHeader.doc.mjs +0 -1
  641. package/assets/templates/blocks/components/Toolbar/ToolbarCardHeader.tsx +4 -3
  642. package/assets/templates/blocks/components/Toolbar/ToolbarSizes.doc.mjs +0 -1
  643. package/assets/templates/blocks/components/Toolbar/ToolbarSizes.tsx +3 -3
  644. package/assets/templates/blocks/components/Toolbar/ToolbarTableFilter.doc.mjs +0 -1
  645. package/assets/templates/blocks/components/Toolbar/ToolbarTableFilter.tsx +8 -3
  646. package/assets/templates/blocks/components/Toolbar/ToolbarThreeSlot.doc.mjs +0 -1
  647. package/assets/templates/blocks/components/Toolbar/ToolbarThreeSlot.tsx +6 -2
  648. package/assets/templates/blocks/components/Toolbar/ToolbarWithTabs.doc.mjs +0 -1
  649. package/assets/templates/blocks/components/Toolbar/ToolbarWithTabs.tsx +11 -2
  650. package/assets/templates/blocks/components/Tooltip/TooltipActionBarTooltips.tsx +33 -3
  651. package/assets/templates/blocks/components/TopNav/TopNavCenteredNavigation.doc.mjs +0 -1
  652. package/assets/templates/blocks/components/TopNav/TopNavCenteredNavigation.tsx +2 -2
  653. package/assets/templates/blocks/components/TopNav/TopNavEnterpriseDashboard.doc.mjs +0 -6
  654. package/assets/templates/blocks/components/TopNav/TopNavEnterpriseDashboard.tsx +7 -7
  655. package/assets/templates/blocks/components/TopNav/TopNavHoverMenu.doc.mjs +0 -8
  656. package/assets/templates/blocks/components/TopNav/TopNavHoverMenu.tsx +14 -9
  657. package/assets/templates/blocks/components/TopNav/TopNavMegaMenu.doc.mjs +0 -8
  658. package/assets/templates/blocks/components/TopNav/TopNavMegaMenu.tsx +11 -11
  659. package/assets/templates/blocks/components/TopNav/TopNavMultipleDropdowns.doc.mjs +0 -5
  660. package/assets/templates/blocks/components/TopNav/TopNavMultipleDropdowns.tsx +4 -8
  661. package/assets/templates/blocks/components/TopNav/TopNavShowcase.doc.mjs +0 -5
  662. package/assets/templates/blocks/components/TopNav/TopNavShowcase.tsx +8 -4
  663. package/assets/templates/blocks/components/TopNav/TopNavWithLogo.doc.mjs +0 -1
  664. package/assets/templates/blocks/components/TopNav/TopNavWithLogo.tsx +7 -2
  665. package/assets/templates/blocks/components/TopNavItem/TopNavItemShowcase.tsx +1 -1
  666. package/assets/templates/blocks/components/TopNavMegaMenu/TopNavMegaMenuBasic.doc.mjs +0 -1
  667. package/assets/templates/blocks/components/TopNavMegaMenu/TopNavMegaMenuBasic.tsx +4 -4
  668. package/assets/templates/blocks/components/TopNavMegaMenu/TopNavMegaMenuShowcase.doc.mjs +0 -7
  669. package/assets/templates/blocks/components/TopNavMegaMenu/TopNavMegaMenuShowcase.tsx +12 -12
  670. package/assets/templates/blocks/components/TopNavMegaMenuItem/TopNavMegaMenuItemBasic.doc.mjs +0 -1
  671. package/assets/templates/blocks/components/TopNavMegaMenuItem/TopNavMegaMenuItemBasic.tsx +2 -2
  672. package/assets/templates/blocks/components/TopNavMenu/TopNavMenuBasic.doc.mjs +0 -1
  673. package/assets/templates/blocks/components/TopNavMenu/TopNavMenuBasic.tsx +4 -4
  674. package/assets/templates/blocks/components/TopNavMenu/TopNavMenuShowcase.doc.mjs +0 -6
  675. package/assets/templates/blocks/components/TopNavMenu/TopNavMenuShowcase.tsx +11 -8
  676. package/assets/templates/blocks/components/TreeList/TreeListFileTreeWithIcons.doc.mjs +0 -1
  677. package/assets/templates/blocks/components/TreeList/TreeListFileTreeWithIcons.tsx +4 -4
  678. package/assets/templates/blocks/components/TreeList/TreeListInteractiveSettings.doc.mjs +0 -1
  679. package/assets/templates/blocks/components/TreeList/TreeListInteractiveSettings.tsx +6 -3
  680. package/assets/templates/blocks/components/Typeahead/TypeaheadSearchField.doc.mjs +0 -1
  681. package/assets/templates/blocks/components/Typeahead/TypeaheadSearchField.tsx +2 -2
  682. package/assets/templates/blocks/components/VisuallyHidden/VisuallyHiddenShowcase.doc.mjs +0 -6
  683. package/assets/templates/blocks/components/VisuallyHidden/VisuallyHiddenShowcase.tsx +30 -7
  684. package/assets/templates/blocks/components/VisuallyHidden/VisuallyHiddenSupplementaryContext.doc.mjs +0 -1
  685. package/assets/templates/blocks/components/VisuallyHidden/VisuallyHiddenSupplementaryContext.tsx +4 -1
  686. package/assets/templates/components.generated.json +1 -1
  687. package/assets/templates/pages/ai-chat/page.tsx +19 -15
  688. package/assets/templates/pages/ai-chat/template.doc.mjs +0 -9
  689. package/assets/templates/pages/ai-chat-landing/page.tsx +16 -16
  690. package/assets/templates/pages/ai-chat-landing/template.doc.mjs +0 -11
  691. package/assets/templates/pages/blank/page.tsx +4 -2
  692. package/assets/templates/pages/canvas-editor/page.tsx +200 -110
  693. package/assets/templates/pages/canvas-editor/template.doc.mjs +0 -46
  694. package/assets/templates/pages/centered-hero/page.tsx +2 -2
  695. package/assets/templates/pages/centered-hero/template.doc.mjs +0 -1
  696. package/assets/templates/pages/checkout-wizard/page.tsx +31 -18
  697. package/assets/templates/pages/checkout-wizard/template.doc.mjs +0 -7
  698. package/assets/templates/pages/classic-gallery/page.tsx +1 -1
  699. package/assets/templates/pages/contact-form/page.tsx +15 -10
  700. package/assets/templates/pages/contact-form/template.doc.mjs +0 -5
  701. package/assets/templates/pages/course-detail/page.tsx +10 -10
  702. package/assets/templates/pages/course-detail/template.doc.mjs +0 -11
  703. package/assets/templates/pages/dashboard/page.tsx +37 -19
  704. package/assets/templates/pages/dashboard/template.doc.mjs +0 -6
  705. package/assets/templates/pages/dashboard-alert-rail/page.tsx +16 -14
  706. package/assets/templates/pages/dashboard-alert-rail/template.doc.mjs +0 -8
  707. package/assets/templates/pages/dashboard-cohort-funnel/page.tsx +14 -16
  708. package/assets/templates/pages/dashboard-cohort-funnel/template.doc.mjs +0 -7
  709. package/assets/templates/pages/dashboard-comparison/page.tsx +17 -12
  710. package/assets/templates/pages/dashboard-comparison/template.doc.mjs +0 -8
  711. package/assets/templates/pages/dashboard-composition/page.tsx +40 -23
  712. package/assets/templates/pages/dashboard-composition/template.doc.mjs +0 -1
  713. package/assets/templates/pages/dashboard-progress/page.tsx +105 -109
  714. package/assets/templates/pages/dashboard-progress/template.doc.mjs +0 -7
  715. package/assets/templates/pages/dashboard-scorecard/page.tsx +74 -37
  716. package/assets/templates/pages/dashboard-scorecard/template.doc.mjs +0 -7
  717. package/assets/templates/pages/detail-page/page.tsx +28 -11
  718. package/assets/templates/pages/detail-page/template.doc.mjs +0 -10
  719. package/assets/templates/pages/documentation/page.tsx +11 -4
  720. package/assets/templates/pages/documentation-design/page.tsx +39 -12
  721. package/assets/templates/pages/documentation-design/template.doc.mjs +0 -5
  722. package/assets/templates/pages/documentation-technical/page.tsx +8 -6
  723. package/assets/templates/pages/documentation-technical/template.doc.mjs +0 -5
  724. package/assets/templates/pages/editor/page.tsx +70 -48
  725. package/assets/templates/pages/editor/template.doc.mjs +0 -26
  726. package/assets/templates/pages/file-explorer/page.tsx +19 -19
  727. package/assets/templates/pages/file-explorer/template.doc.mjs +0 -15
  728. package/assets/templates/pages/form-two-column/page.tsx +1 -1
  729. package/assets/templates/pages/form-wizard/page.tsx +12 -5
  730. package/assets/templates/pages/form-wizard-dialog/page.tsx +6 -2
  731. package/assets/templates/pages/form-wizard-inline/page.tsx +16 -12
  732. package/assets/templates/pages/form-wizard-inline/template.doc.mjs +0 -6
  733. package/assets/templates/pages/form-wizard-vertical/page.tsx +21 -24
  734. package/assets/templates/pages/form-wizard-vertical/template.doc.mjs +0 -13
  735. package/assets/templates/pages/gallery-hero/page.tsx +2 -2
  736. package/assets/templates/pages/gallery-hero/template.doc.mjs +0 -1
  737. package/assets/templates/pages/ide/page.tsx +12 -7
  738. package/assets/templates/pages/ide/template.doc.mjs +0 -5
  739. package/assets/templates/pages/incident-console/page.tsx +4 -4
  740. package/assets/templates/pages/incident-console/template.doc.mjs +0 -1
  741. package/assets/templates/pages/kanban-board/page.tsx +128 -47
  742. package/assets/templates/pages/kanban-board/template.doc.mjs +0 -11
  743. package/assets/templates/pages/library/page.tsx +34 -64
  744. package/assets/templates/pages/library/template.doc.mjs +0 -1
  745. package/assets/templates/pages/login/page.tsx +6 -4
  746. package/assets/templates/pages/login/template.doc.mjs +0 -1
  747. package/assets/templates/pages/login-card/page.tsx +6 -4
  748. package/assets/templates/pages/login-card/template.doc.mjs +0 -1
  749. package/assets/templates/pages/login-split/page.tsx +6 -5
  750. package/assets/templates/pages/login-split/template.doc.mjs +0 -1
  751. package/assets/templates/pages/login-sso/page.tsx +6 -6
  752. package/assets/templates/pages/login-sso/template.doc.mjs +0 -1
  753. package/assets/templates/pages/messaging-shell/page.tsx +14 -14
  754. package/assets/templates/pages/messaging-shell/template.doc.mjs +0 -9
  755. package/assets/templates/pages/mixed-gallery/page.tsx +1 -1
  756. package/assets/templates/pages/payment-form/page.tsx +50 -29
  757. package/assets/templates/pages/payment-form/template.doc.mjs +0 -6
  758. package/assets/templates/pages/product-detail/page.tsx +21 -9
  759. package/assets/templates/pages/product-detail/template.doc.mjs +0 -1
  760. package/assets/templates/pages/product-gallery/page.tsx +3 -3
  761. package/assets/templates/pages/product-gallery/template.doc.mjs +0 -1
  762. package/assets/templates/pages/settings/page.tsx +35 -14
  763. package/assets/templates/pages/settings/template.doc.mjs +0 -1
  764. package/assets/templates/pages/settings-dialog/page.tsx +96 -93
  765. package/assets/templates/pages/settings-dialog/template.doc.mjs +0 -53
  766. package/assets/templates/pages/settings-sidebar/page.tsx +74 -36
  767. package/assets/templates/pages/settings-sidebar/template.doc.mjs +0 -16
  768. package/assets/templates/pages/shell-nav/page.tsx +32 -20
  769. package/assets/templates/pages/shell-nav/template.doc.mjs +0 -6
  770. package/assets/templates/pages/shell-side-nav/page.tsx +23 -22
  771. package/assets/templates/pages/shell-side-nav/template.doc.mjs +0 -11
  772. package/assets/templates/pages/shell-top-nav/page.tsx +13 -13
  773. package/assets/templates/pages/shell-top-nav/template.doc.mjs +0 -19
  774. package/assets/templates/pages/side-gallery/page.tsx +5 -2
  775. package/assets/templates/pages/table/page.tsx +21 -21
  776. package/assets/templates/pages/table/template.doc.mjs +0 -10
  777. package/assets/templates/pages/table-collapsible/page.tsx +8 -8
  778. package/assets/templates/pages/table-collapsible/template.doc.mjs +0 -6
  779. package/assets/templates/pages/table-comparison/page.tsx +23 -23
  780. package/assets/templates/pages/table-comparison/template.doc.mjs +0 -14
  781. package/assets/templates/pages/table-filter/page.tsx +75 -47
  782. package/assets/templates/pages/table-filter/template.doc.mjs +0 -19
  783. package/assets/templates/pages/table-grouped/page.tsx +39 -17
  784. package/assets/templates/pages/table-grouped/template.doc.mjs +0 -11
  785. package/assets/templates/pages/table-inbox/page.tsx +147 -65
  786. package/assets/templates/pages/table-inbox/template.doc.mjs +0 -17
  787. package/assets/templates/pages/table-page/page.tsx +3 -6
  788. package/assets/templates/pages/table-page/template.doc.mjs +0 -1
  789. package/assets/templates/pages/table-tree/page.tsx +35 -35
  790. package/assets/templates/pages/table-tree/template.doc.mjs +0 -15
  791. package/assets/templates/pages/theme-showcase/page.tsx +48 -43
  792. package/assets/templates/pages/theme-showcase/template.doc.mjs +0 -19
  793. package/assets/templates/pages/work-item-detail/page.tsx +60 -33
  794. package/assets/templates/pages/work-item-detail/template.doc.mjs +0 -12
  795. package/assets/templates/themes/butter/butterPaletteRefs.generated.ts +12 -12
  796. package/assets/templates/themes/butter/butterTheme.ts +244 -10
  797. package/assets/templates/themes/chocolate/chocolateTheme.ts +81 -10
  798. package/assets/templates/themes/gothic/gothicPaletteRefs.generated.ts +3 -3
  799. package/assets/templates/themes/gothic/gothicTheme.ts +126 -4
  800. package/assets/templates/themes/matcha/matchaPaletteRefs.generated.ts +8 -8
  801. package/assets/templates/themes/matcha/matchaTheme.ts +58 -14
  802. package/assets/templates/themes/neutral/neutralTheme.ts +45 -0
  803. package/assets/templates/themes/stone/stonePaletteRefs.generated.ts +3 -3
  804. package/assets/templates/themes/stone/stoneTheme.ts +101 -10
  805. package/assets/templates/themes/y2k/y2kPaletteRefs.generated.ts +9 -9
  806. package/assets/templates/themes/y2k/y2kTheme.ts +257 -14
  807. package/assets/theme.template.ts +17 -7
  808. package/authoring/config/config.doc.mjs +8 -1
  809. package/authoring/config/parse.mjs +15 -0
  810. package/authoring/config/skill-places.d.mts +23 -0
  811. package/authoring/config/skill-places.mjs +35 -0
  812. package/authoring/config/type.ts +20 -3
  813. package/authoring/debug/parse.d.mts +1 -1
  814. package/authoring/debug/type.ts +4 -0
  815. package/authoring/discover/parse.d.mts +4 -3
  816. package/authoring/discover/parse.mjs +76 -41
  817. package/authoring/discover/type.ts +9 -1
  818. package/authoring/doctypes/_schema.d.mts +36 -16
  819. package/authoring/doctypes/_schema.mjs +29 -0
  820. package/authoring/doctypes/base/type.ts +19 -0
  821. package/authoring/doctypes/command/command.doc.mjs +6 -0
  822. package/authoring/doctypes/command/type.ts +7 -0
  823. package/authoring/doctypes/component/component.doc.mjs +1 -1
  824. package/authoring/doctypes/icon-definition/icon-definition.doc.mjs +17 -1
  825. package/authoring/doctypes/icon-definition/parse.mjs +12 -0
  826. package/authoring/doctypes/icon-definition/type.ts +18 -0
  827. package/authoring/doctypes/reference/reference.doc.mjs +13 -0
  828. package/authoring/doctypes/reference/skill.d.mts +29 -0
  829. package/authoring/doctypes/reference/skill.mjs +56 -0
  830. package/authoring/doctypes/reference/type.ts +19 -0
  831. package/authoring/gap-report/parse.d.mts +1 -1
  832. package/authoring/integration/integration.doc.mjs +8 -0
  833. package/authoring/integration/schema.d.mts +21 -3
  834. package/authoring/integration/schema.mjs +25 -5
  835. package/authoring/integration/type.ts +14 -0
  836. package/clients/cli/build-id.generated.json +1 -1
  837. package/clients/cli/commands/build.doc.mjs +1 -1
  838. package/clients/cli/commands/build.mjs +20 -14
  839. package/clients/cli/commands/component.doc.mjs +3 -1
  840. package/clients/cli/commands/component.mjs +21 -6
  841. package/clients/cli/commands/discover.doc.mjs +2 -2
  842. package/clients/cli/commands/discover.mjs +112 -9
  843. package/clients/cli/commands/docs.doc.mjs +17 -10
  844. package/clients/cli/commands/docs.mjs +112 -191
  845. package/clients/cli/commands/doctor-integration-validate.doc.mjs +4 -2
  846. package/clients/cli/commands/doctor.doc.mjs +3 -1
  847. package/clients/cli/commands/doctor.mjs +16 -3
  848. package/clients/cli/commands/experimental/export.mjs +64 -0
  849. package/clients/cli/commands/experimental/icon.mjs +387 -229
  850. package/clients/cli/commands/experimental/import.mjs +70 -0
  851. package/clients/cli/commands/experimental/index.mjs +152 -13
  852. package/clients/cli/commands/experimental/render-output.mjs +242 -0
  853. package/clients/cli/commands/experimental/theme.mjs +69 -23
  854. package/clients/cli/commands/experimental-export.doc.mjs +73 -0
  855. package/clients/cli/commands/experimental-icon-add.doc.mjs +1 -1
  856. package/clients/cli/commands/experimental-icon-map.doc.mjs +4 -1
  857. package/clients/cli/commands/experimental-icon-new-definition.doc.mjs +4 -1
  858. package/clients/cli/commands/experimental-icon-new-set.doc.mjs +4 -1
  859. package/clients/cli/commands/experimental-icon-use.doc.mjs +1 -1
  860. package/clients/cli/commands/experimental-icon.doc.mjs +1 -1
  861. package/clients/cli/commands/experimental-import.doc.mjs +53 -0
  862. package/clients/cli/commands/experimental-theme-add.doc.mjs +1 -1
  863. package/clients/cli/commands/experimental-theme-compile.doc.mjs +1 -1
  864. package/clients/cli/commands/experimental-theme-editor-new.doc.mjs +1 -1
  865. package/clients/cli/commands/experimental-theme-editor-set.doc.mjs +7 -2
  866. package/clients/cli/commands/experimental-theme-editor-show.doc.mjs +1 -1
  867. package/clients/cli/commands/experimental-theme-editor-undo.doc.mjs +1 -1
  868. package/clients/cli/commands/experimental-theme.doc.mjs +1 -1
  869. package/clients/cli/commands/experimental.doc.mjs +4 -4
  870. package/clients/cli/commands/init.doc.mjs +63 -31
  871. package/clients/cli/commands/integration-check.doc.mjs +1 -1
  872. package/clients/cli/commands/mcp.doc.mjs +57 -0
  873. package/clients/cli/commands/mcp.mjs +51 -0
  874. package/clients/cli/commands/search.mjs +78 -9
  875. package/clients/cli/commands/template.doc.mjs +14 -5
  876. package/clients/cli/commands/template.mjs +21 -2
  877. package/clients/cli/commands/theme-add.doc.mjs +6 -2
  878. package/clients/cli/commands/theme-build.doc.mjs +1 -1
  879. package/clients/cli/commands/theme-remove.doc.mjs +1 -1
  880. package/clients/cli/commands/theme-targets.doc.mjs +1 -1
  881. package/clients/cli/commands/theme.mjs +86 -5
  882. package/clients/cli/commands/upgrade.doc.mjs +2 -1
  883. package/clients/cli/commands.generated.json +1 -1
  884. package/clients/cli/formatters/index.mjs +52 -6
  885. package/clients/cli/index.mjs +44 -37
  886. package/clients/cli/lib/cli-error.mjs +20 -10
  887. package/clients/cli/lib/component-format.mjs +167 -74
  888. package/clients/cli/lib/define-command.mjs +92 -4
  889. package/clients/cli/lib/hook-format.mjs +28 -24
  890. package/clients/cli/lib/json-shim.mjs +61 -4
  891. package/clients/cli/lib/manifest.mjs +9 -1
  892. package/clients/cli/lib/mcp-server.mjs +286 -0
  893. package/clients/cli/lib/mcp-tools.mjs +405 -0
  894. package/clients/cli/lib/other-cli-words.mjs +99 -0
  895. package/clients/cli/lib/renamed-commands.mjs +21 -0
  896. package/clients/cli/lib/root-args.mjs +10 -3
  897. package/clients/cli/lib/stray-option.mjs +79 -1
  898. package/clients/cli/lib/unknown-command.mjs +406 -13
  899. package/clients/cli/manifest.generated.json +1 -1
  900. package/clients/cli/run.mjs +27 -0
  901. package/foundation/agent-docs/agent-doc-state.d.mts +20 -2
  902. package/foundation/agent-docs/agent-doc-state.mjs +71 -4
  903. package/foundation/agent-docs/agent-docs.d.mts +79 -5
  904. package/foundation/agent-docs/agent-docs.mjs +137 -10
  905. package/foundation/agent-docs/computer-agent-text.d.mts +28 -14
  906. package/foundation/agent-docs/computer-agent-text.mjs +85 -172
  907. package/foundation/agent-docs/folder-scope.d.mts +51 -0
  908. package/foundation/agent-docs/folder-scope.mjs +86 -0
  909. package/foundation/agent-docs/managed-skill-file.d.mts +115 -0
  910. package/foundation/agent-docs/managed-skill-file.mjs +224 -0
  911. package/foundation/agent-docs/skill-place-files.d.mts +119 -0
  912. package/foundation/agent-docs/skill-place-files.mjs +374 -0
  913. package/foundation/agent-docs/skill-places.d.mts +139 -0
  914. package/foundation/agent-docs/skill-places.mjs +321 -0
  915. package/foundation/color/css-color.d.mts +150 -0
  916. package/foundation/color/css-color.mjs +960 -0
  917. package/foundation/config/config-path.d.mts +2 -2
  918. package/foundation/config/config-path.mjs +5 -6
  919. package/foundation/config/config-writer.d.mts +5 -1
  920. package/foundation/config/config-writer.mjs +20 -4
  921. package/foundation/config/project.d.mts +8 -5
  922. package/foundation/config/project.mjs +35 -17
  923. package/foundation/config/theme-state.d.mts +13 -0
  924. package/foundation/config/theme-state.mjs +28 -0
  925. package/foundation/debug/event.d.mts +2 -1
  926. package/foundation/debug/event.mjs +2 -1
  927. package/foundation/discovery/button-actions.d.mts +220 -0
  928. package/foundation/discovery/button-actions.mjs +1527 -0
  929. package/foundation/discovery/cli-self-docs.d.mts +7 -0
  930. package/foundation/discovery/cli-self-docs.mjs +67 -6
  931. package/foundation/discovery/color-modes.d.mts +14 -0
  932. package/foundation/discovery/color-modes.mjs +53 -0
  933. package/foundation/discovery/command-pointers.d.mts +21 -4
  934. package/foundation/discovery/command-pointers.mjs +25 -4
  935. package/foundation/discovery/component-discovery.d.mts +10 -0
  936. package/foundation/discovery/component-discovery.mjs +99 -43
  937. package/foundation/discovery/component-replacement.d.mts +8 -0
  938. package/foundation/discovery/component-replacement.mjs +13 -0
  939. package/foundation/discovery/core-augmentation-points.d.mts +90 -0
  940. package/foundation/discovery/core-augmentation-points.mjs +1030 -0
  941. package/foundation/discovery/core-component-views.d.mts +15 -0
  942. package/foundation/discovery/core-component-views.mjs +176 -0
  943. package/foundation/discovery/core-elements.d.mts +29 -0
  944. package/foundation/discovery/core-elements.mjs +57 -0
  945. package/foundation/discovery/core-prop-types.d.mts +65 -0
  946. package/foundation/discovery/core-prop-types.mjs +221 -0
  947. package/foundation/discovery/core-props.d.mts +33 -0
  948. package/foundation/discovery/core-props.mjs +64 -0
  949. package/foundation/discovery/doc-types.d.mts +10 -42
  950. package/foundation/discovery/doc-types.mjs +26 -7
  951. package/foundation/discovery/docs-discovery.d.mts +33 -2
  952. package/foundation/discovery/docs-discovery.mjs +149 -72
  953. package/foundation/discovery/docs-section-key.d.mts +21 -1
  954. package/foundation/discovery/docs-section-key.mjs +57 -19
  955. package/foundation/discovery/hook-discovery.d.mts +2 -0
  956. package/foundation/discovery/hook-discovery.mjs +6 -5
  957. package/foundation/discovery/icon-definition-discovery.d.mts +155 -3
  958. package/foundation/discovery/icon-definition-discovery.mjs +197 -5
  959. package/foundation/discovery/icon-imports.d.mts +66 -0
  960. package/foundation/discovery/icon-imports.mjs +225 -0
  961. package/foundation/discovery/icon-ranking.d.mts +118 -4
  962. package/foundation/discovery/icon-ranking.mjs +453 -59
  963. package/foundation/discovery/icon-set-checks.d.mts +2 -0
  964. package/foundation/discovery/icon-set-checks.mjs +16 -2
  965. package/foundation/discovery/icon-set-discovery.d.mts +68 -2
  966. package/foundation/discovery/icon-set-discovery.mjs +124 -23
  967. package/foundation/discovery/icon-set-writer.d.mts +9 -13
  968. package/foundation/discovery/icon-set-writer.mjs +89 -36
  969. package/foundation/discovery/integration-skills.d.mts +62 -0
  970. package/foundation/discovery/integration-skills.mjs +116 -0
  971. package/foundation/discovery/module-exports.d.mts +8 -0
  972. package/foundation/discovery/module-exports.mjs +20 -21
  973. package/foundation/discovery/name-roots.d.mts +5 -0
  974. package/foundation/discovery/name-roots.mjs +11 -0
  975. package/foundation/discovery/package-exports.d.mts +22 -0
  976. package/foundation/discovery/package-exports.mjs +44 -3
  977. package/foundation/discovery/project-typescript.d.mts +5 -1
  978. package/foundation/discovery/project-typescript.mjs +8 -2
  979. package/foundation/discovery/prop-drift.d.mts +16 -0
  980. package/foundation/discovery/prop-drift.mjs +154 -3
  981. package/foundation/discovery/replacement-aliases.d.mts +51 -0
  982. package/foundation/discovery/replacement-aliases.mjs +95 -0
  983. package/foundation/discovery/runner-allowlist.d.mts +2 -1
  984. package/foundation/discovery/runner-allowlist.mjs +3 -1
  985. package/foundation/discovery/runner-commands.mjs +1 -0
  986. package/foundation/discovery/stored-component-list.mjs +34 -2
  987. package/foundation/discovery/template-adapter.d.mts +27 -1
  988. package/foundation/discovery/template-adapter.mjs +221 -10
  989. package/foundation/discovery/template-destination.d.mts +14 -6
  990. package/foundation/discovery/template-destination.mjs +42 -8
  991. package/foundation/discovery/template-icon-meanings.d.mts +7 -2
  992. package/foundation/discovery/template-icon-meanings.mjs +52 -12
  993. package/foundation/discovery/template-icons.d.mts +46 -3
  994. package/foundation/discovery/template-icons.mjs +72 -109
  995. package/foundation/discovery/template-needs.d.mts +34 -5
  996. package/foundation/discovery/template-needs.mjs +164 -22
  997. package/foundation/discovery/template-placeholders.d.mts +149 -0
  998. package/foundation/discovery/template-placeholders.mjs +463 -0
  999. package/foundation/discovery/template-source-tree.d.mts +6 -3
  1000. package/foundation/discovery/template-source-tree.mjs +8 -5
  1001. package/foundation/discovery/theme-discovery.d.mts +8 -0
  1002. package/foundation/discovery/theme-discovery.mjs +23 -6
  1003. package/foundation/discovery/theme-imports.d.mts +1 -3
  1004. package/foundation/discovery/theme-imports.mjs +5 -30
  1005. package/foundation/doc-compiler/compile.mjs +6 -8
  1006. package/foundation/doc-compiler/doc-syntax.d.mts +25 -1
  1007. package/foundation/doc-compiler/doc-syntax.mjs +85 -10
  1008. package/foundation/doc-compiler/doc-text.d.mts +52 -0
  1009. package/foundation/doc-compiler/doc-text.mjs +176 -0
  1010. package/foundation/doc-compiler/links.d.mts +8 -2
  1011. package/foundation/doc-compiler/links.mjs +27 -6
  1012. package/foundation/doc-compiler/read.d.mts +1 -1
  1013. package/foundation/doc-compiler/stored-docs.d.mts +14 -3
  1014. package/foundation/doc-compiler/stored-docs.mjs +12 -6
  1015. package/foundation/env/cli-command.d.mts +68 -10
  1016. package/foundation/env/cli-command.mjs +116 -22
  1017. package/foundation/env/package-manager.d.mts +33 -2
  1018. package/foundation/env/package-manager.mjs +68 -6
  1019. package/foundation/env/project-scope.d.mts +9 -0
  1020. package/foundation/env/project-scope.mjs +28 -2
  1021. package/foundation/env/user-dirs.d.mts +14 -0
  1022. package/foundation/env/user-dirs.mjs +34 -1
  1023. package/foundation/env/user-settings.d.mts +15 -0
  1024. package/foundation/env/user-settings.mjs +56 -2
  1025. package/foundation/fonts/font-stylesheet.d.mts +11 -0
  1026. package/foundation/fonts/font-stylesheet.mjs +62 -7
  1027. package/foundation/fs/cache-eviction.d.mts +7 -5
  1028. package/foundation/fs/cache-eviction.mjs +20 -13
  1029. package/foundation/fs/empty-folder.d.mts +12 -0
  1030. package/foundation/fs/empty-folder.mjs +30 -0
  1031. package/foundation/fs/file-protection.d.mts +11 -0
  1032. package/foundation/fs/file-protection.mjs +49 -3
  1033. package/foundation/fs/gather-cache.d.mts +14 -7
  1034. package/foundation/fs/gather-cache.mjs +163 -67
  1035. package/foundation/fs/import-url.d.mts +7 -5
  1036. package/foundation/fs/import-url.mjs +7 -5
  1037. package/foundation/fs/jiti-cache.d.mts +47 -26
  1038. package/foundation/fs/jiti-cache.mjs +222 -130
  1039. package/foundation/fs/loaded-files.d.mts +15 -1
  1040. package/foundation/fs/loaded-files.mjs +40 -3
  1041. package/foundation/fs/module-loader.d.mts +3 -1
  1042. package/foundation/fs/module-loader.mjs +85 -5
  1043. package/foundation/fs/path-safety.d.mts +1 -0
  1044. package/foundation/fs/path-safety.mjs +2 -0
  1045. package/foundation/fs/read-record.mjs +9 -5
  1046. package/foundation/fs/relative-specifier.d.mts +10 -0
  1047. package/foundation/fs/relative-specifier.mjs +28 -0
  1048. package/foundation/integrations/computer-integrations.mjs +11 -10
  1049. package/foundation/integrations/icon-features.d.mts +63 -0
  1050. package/foundation/integrations/icon-features.mjs +54 -0
  1051. package/foundation/integrations/integration-warnings.d.mts +10 -0
  1052. package/foundation/integrations/integration-warnings.mjs +12 -3
  1053. package/foundation/integrations/integrations.d.mts +16 -2
  1054. package/foundation/integrations/integrations.mjs +50 -8
  1055. package/foundation/integrations/may-have-integrations.mjs +7 -6
  1056. package/foundation/integrations/provider-resolution.mjs +19 -2
  1057. package/foundation/integrations/validate-contributions.d.mts +13 -3
  1058. package/foundation/integrations/validate-contributions.mjs +64 -13
  1059. package/foundation/release/agent-text-worker.mjs +33 -1
  1060. package/foundation/release/cache.d.mts +48 -3
  1061. package/foundation/release/cache.mjs +196 -20
  1062. package/foundation/release/choose.d.mts +5 -2
  1063. package/foundation/release/choose.mjs +54 -4
  1064. package/foundation/release/global-state.mjs +10 -2
  1065. package/foundation/release/handoff.mjs +7 -1
  1066. package/foundation/release/notices.d.mts +97 -9
  1067. package/foundation/release/notices.mjs +421 -59
  1068. package/foundation/release/project.d.mts +21 -4
  1069. package/foundation/release/project.mjs +74 -42
  1070. package/foundation/release/run-context.d.mts +6 -0
  1071. package/foundation/release/run-context.mjs +9 -0
  1072. package/foundation/render/assets.d.mts +7 -0
  1073. package/foundation/render/assets.mjs +30 -17
  1074. package/foundation/render/charts.d.mts +11 -10
  1075. package/foundation/render/charts.mjs +112 -1
  1076. package/foundation/render/class-alias.d.mts +23 -0
  1077. package/foundation/render/class-alias.mjs +333 -0
  1078. package/foundation/render/client-bundle.d.mts +183 -0
  1079. package/foundation/render/client-bundle.mjs +1026 -0
  1080. package/foundation/render/component-map.mjs +1 -1
  1081. package/foundation/render/css-cut.d.mts +26 -0
  1082. package/foundation/render/css-cut.mjs +344 -2
  1083. package/foundation/render/cut-short.d.mts +7 -1
  1084. package/foundation/render/cut-short.mjs +46 -6
  1085. package/foundation/render/dropped-text.d.mts +43 -0
  1086. package/foundation/render/dropped-text.mjs +90 -0
  1087. package/foundation/render/embedded-files.d.mts +24 -1
  1088. package/foundation/render/embedded-files.mjs +41 -4
  1089. package/foundation/render/embedded-imports.d.mts +72 -12
  1090. package/foundation/render/embedded-imports.mjs +206 -70
  1091. package/foundation/render/esbuild-dependency.d.mts +14 -0
  1092. package/foundation/render/esbuild-dependency.mjs +41 -0
  1093. package/foundation/render/file-header.d.mts +7 -2
  1094. package/foundation/render/file-header.mjs +19 -10
  1095. package/foundation/render/html-reader.d.mts +36 -17
  1096. package/foundation/render/html-reader.mjs +239 -32
  1097. package/foundation/render/image-attributes.d.mts +25 -0
  1098. package/foundation/render/image-attributes.mjs +33 -0
  1099. package/foundation/render/markup-edits.mjs +1 -1
  1100. package/foundation/render/package-resolve-hooks.d.mts +54 -0
  1101. package/foundation/render/package-resolve-hooks.mjs +144 -0
  1102. package/foundation/render/page-host.mjs +1 -1
  1103. package/foundation/render/page-worker.mjs +1307 -107
  1104. package/foundation/render/picture-chrome.mjs +54 -29
  1105. package/foundation/render/picture-playwright.mjs +78 -42
  1106. package/foundation/render/picture-window.d.mts +44 -5
  1107. package/foundation/render/picture-window.mjs +265 -19
  1108. package/foundation/render/rebuild.mjs +2 -2
  1109. package/foundation/render/remote-images.d.mts +83 -0
  1110. package/foundation/render/remote-images.mjs +384 -0
  1111. package/foundation/render/render-page.d.mts +219 -8
  1112. package/foundation/render/render-page.mjs +1702 -165
  1113. package/foundation/render/restore-folder.d.mts +13 -0
  1114. package/foundation/render/restore-folder.mjs +30 -0
  1115. package/foundation/render/served-packages.d.mts +14 -1
  1116. package/foundation/render/served-packages.mjs +50 -6
  1117. package/foundation/render/share-checks.d.mts +35 -0
  1118. package/foundation/render/share-checks.mjs +95 -0
  1119. package/foundation/render/source-block.d.mts +14 -3
  1120. package/foundation/render/source-block.mjs +44 -9
  1121. package/foundation/render/srcset.d.mts +32 -0
  1122. package/foundation/render/srcset.mjs +64 -0
  1123. package/foundation/render/ts-paths.d.mts +52 -1
  1124. package/foundation/render/ts-paths.mjs +114 -4
  1125. package/foundation/render/value-uses.d.mts +43 -0
  1126. package/foundation/render/value-uses.mjs +110 -0
  1127. package/foundation/response/error-codes.d.mts +2 -1
  1128. package/foundation/response/error-codes.doc.mjs +16 -10
  1129. package/foundation/response/error-codes.mjs +19 -8
  1130. package/foundation/response/json.d.mts +0 -15
  1131. package/foundation/response/json.mjs +1 -51
  1132. package/foundation/response/response-types.doc.mjs +28 -17
  1133. package/foundation/runtime/css-tree.d.mts +16 -0
  1134. package/foundation/runtime/css-tree.mjs +46 -3
  1135. package/foundation/runtime/lazy-dependencies.d.mts +7 -0
  1136. package/foundation/runtime/lazy-dependencies.mjs +25 -3
  1137. package/foundation/runtime/locked-versions.d.mts +4 -2
  1138. package/foundation/runtime/locked-versions.mjs +18 -10
  1139. package/foundation/runtime/package-root.d.mts +25 -0
  1140. package/foundation/runtime/package-root.mjs +48 -0
  1141. package/foundation/runtime/word-table.d.mts +18 -0
  1142. package/foundation/runtime/word-table.mjs +33 -0
  1143. package/foundation/suggest/other-command.d.mts +23 -0
  1144. package/foundation/suggest/other-command.mjs +49 -5
  1145. package/foundation/text/default-variant.d.mts +20 -0
  1146. package/foundation/text/default-variant.mjs +24 -0
  1147. package/foundation/text/definition-coverage.d.mts +21 -0
  1148. package/foundation/text/definition-coverage.mjs +20 -0
  1149. package/foundation/text/icon-id.d.mts +20 -0
  1150. package/foundation/text/icon-id.mjs +40 -0
  1151. package/foundation/text/icon-set-next.d.mts +26 -0
  1152. package/foundation/text/icon-set-next.mjs +37 -0
  1153. package/foundation/text/string-utils.mjs +14 -41
  1154. package/foundation/text/suggest-order.d.mts +10 -4
  1155. package/foundation/text/suggest-order.mjs +20 -13
  1156. package/package.json +8 -6
  1157. package/assets/codemods/transforms/next/migrate-item-swipe-actions-to-swipe.mjs +0 -394
  1158. package/assets/docs/tree/render-pages.doc.mjs +0 -135
  1159. package/clients/cli/commands/experimental/render.mjs +0 -154
  1160. package/clients/cli/commands/experimental-render.doc.mjs +0 -73
@@ -25,8 +25,6 @@ import {isAlive} from '../../foundation/release/cache.mjs';
25
25
  import {stillHolds} from '../../foundation/release/folder-lock.mjs';
26
26
  import {AstryxError} from '../error.mjs';
27
27
  import {ERROR_CODES} from '../../foundation/response/error-codes.mjs';
28
- import {parse} from '@babel/parser';
29
- import {THEMES_DIR} from '../../foundation/discovery/theme-discovery.mjs';
30
28
  import {
31
29
  ANCHOR_INPUT_KEYS,
32
30
  DEFAULT_21_STOPS,
@@ -36,12 +34,40 @@ import {
36
34
  PALETTE_GENERATOR_VERSION,
37
35
  PALETTE_RECIPE,
38
36
  PALETTE_RECIPE_V2,
37
+ PALETTE_RECIPES,
39
38
  PALETTE_WHITE,
40
39
  generateTonalPalette,
41
40
  modesForStrategy,
42
- perceptualDelta,
43
41
  } from '../theme/palette/generate/generator.mjs';
44
42
  import {themePaletteGenerate} from '../theme/palette/generate/generate.mjs';
43
+ import {
44
+ ACCENT_MUTED,
45
+ BORDER,
46
+ DARK_FILL,
47
+ LIFT_GROUNDS,
48
+ LIFT_PARTS,
49
+ NEUTRAL_INSIDE,
50
+ NEUTRAL_STOPS,
51
+ NEUTRAL_TINTS,
52
+ NON_TEXT,
53
+ ON_MUTED,
54
+ PALETTE_DIALS,
55
+ STATUS_MUTED,
56
+ STATUS_TOKEN,
57
+ TEXT,
58
+ TEXT_STOP,
59
+ VIBRANCY_DEFAULT,
60
+ anchorDarkFills,
61
+ dialFamily,
62
+ fillAt,
63
+ grownGrays,
64
+ isGray,
65
+ mapPalette,
66
+ nearestShade,
67
+ paletteToken,
68
+ sameColor,
69
+ shade,
70
+ } from '../theme/palette/generate/mapping.mjs';
45
71
  /**
46
72
  * How the page-wide tokens a theme's own source sets are read: given by
47
73
  * _settings (which imports this module) when it loads.
@@ -56,19 +82,16 @@ let ownSourceTokenValues = () => ({});
56
82
  export function setOwnTokenReader(read) {
57
83
  ownSourceTokenValues = read;
58
84
  }
59
- import {hexToOklch, normalizeColor} from '../theme/palette/generate/color.mjs';
60
- import {
61
- alphaOf,
62
- compositeOver,
63
- hex,
64
- isClipped,
65
- parseColor,
66
- ratio,
67
- } from './_color.mjs';
85
+ import {alphaOf, hex, isClipped, parseColor} from './_color.mjs';
68
86
  import {splitTop} from './_css.mjs';
69
- import {P, wordTable} from './_tables.mjs';
87
+ import {P} from './_tables.mjs';
70
88
  import {quoteCommandArgument} from '../../foundation/env/package-manager.mjs';
71
89
  import {sha256} from '../../foundation/render/source-block.mjs';
90
+ import {cliVersion} from '../../foundation/release/run-context.mjs';
91
+ import {
92
+ newerRecipe,
93
+ newerRecipeRefusal,
94
+ } from '../theme/palette/generate/newer-recipe.mjs';
72
95
 
73
96
  export {readRegularFile};
74
97
 
@@ -224,24 +247,6 @@ function sweepTemps(dir) {
224
247
  }
225
248
  }
226
249
 
227
- /**
228
- * Remove `dir` when it is empty; with `deep`, the empty folders under it
229
- * first. A folder with a file in it stays.
230
- * @param {string} dir
231
- * @param {{deep?: boolean}} [opts]
232
- */
233
- export function removeEmptyFolder(dir, opts = {}) {
234
- if (!fs.existsSync(dir)) return;
235
- if (opts.deep)
236
- for (const e of fs.readdirSync(dir, {withFileTypes: true}))
237
- if (e.isDirectory()) removeEmptyFolder(path.join(dir, e.name), opts);
238
- try {
239
- fs.rmdirSync(dir);
240
- } catch {
241
- // Not empty, or gone already.
242
- }
243
- }
244
-
245
250
  /**
246
251
  * Whether a file name is one of the editor's own temp files: a whole-file
247
252
  * write's `.<name>.astryx-<pid>-<random>.tmp`, a build's `.<name>.tmp-<id>`,
@@ -293,13 +298,20 @@ export function tempFor(file) {
293
298
  * @property {boolean} pass
294
299
  * @property {string} [note] - The whole sentence to report, when the check is not a plain stop move.
295
300
  * @property {string[]} [dials] - The color dials whose notes report it, when its token belongs to none of them.
301
+ * @property {{thing: string, value: string, mode?: Mode}} [fix] - The nearest setting that passes it, when one does: a darker exact color for a pale fill.
302
+ */
303
+
304
+ /**
305
+ * A color dial's family: its seed, and the source token that gives it when
306
+ * the theme's own source sets the family's fill (null when the setting does).
307
+ * @typedef {{id: string, dial: string, seed: string, value: string, source: string | null}} DialFamily
296
308
  */
297
309
 
298
310
  /**
299
311
  * The palette mapping of a theme.
300
312
  * @typedef {object} PaletteMapping
301
313
  * @property {Candidate} candidate
302
- * @property {Array<{id: string, dial: string, seed: string, value: string}>} families
314
+ * @property {DialFamily[]} families
303
315
  * @property {Record<string, {family: string, light: StopRef, dark: StopRef}>} tokens
304
316
  * @property {ContrastCheck[]} contrast
305
317
  * @property {number} vibrancy - The generator's vibrancy, 0 to 100.
@@ -309,18 +321,16 @@ export function tempFor(file) {
309
321
  * @property {Record<string, Partial<Record<Mode, StopRef>>> | null} lift - Lifted secondary text per background token of LIFT_PARTS (the accent tint, the neutral track), per mode, from the neutral color; null without one.
310
322
  */
311
323
 
312
- /** The color dials. Each one is a palette family of the same id. */
313
- export const PALETTE_DIALS = [
314
- 'accent',
315
- 'neutral',
316
- 'success',
317
- 'warning',
318
- 'danger',
319
- 'info',
320
- ];
321
-
322
- /** The generator's vibrancy when the theme sets none. */
323
- export const VIBRANCY_DEFAULT = 50;
324
+ // The color dials, the vibrancy default, each dial's main token, the lifted
325
+ // parts and the nearest shade of a ramp: the palette mapping's, which other
326
+ // editor modules read through this one.
327
+ export {
328
+ LIFT_PARTS,
329
+ PALETTE_DIALS,
330
+ VIBRANCY_DEFAULT,
331
+ nearestShade,
332
+ paletteToken,
333
+ };
324
334
 
325
335
  /**
326
336
  * The vibrancy dial a settings list sets, or null.
@@ -338,222 +348,11 @@ function dialVibrancy(settings) {
338
348
  : null;
339
349
  }
340
350
 
341
- /** The Core token word of each status family. */
342
- const STATUS_TOKEN = wordTable(
343
- /** @type {Record<string, string>} */ ({
344
- success: 'success',
345
- warning: 'warning',
346
- danger: 'error',
347
- info: 'info',
348
- }),
349
- );
350
-
351
- /**
352
- * The main token a color dial feeds: the exact-token escape hatch for it.
353
- * @param {string} dial
354
- */
355
- export const paletteToken = dial =>
356
- dial === 'accent'
357
- ? '--color-accent'
358
- : dial === 'neutral'
359
- ? '--color-background-surface'
360
- : `--color-${STATUS_TOKEN[dial]}`;
361
-
362
- /** Text contrast and non-text contrast (fills, focus rings, icons). */
363
- const TEXT = 4.5;
364
- const NON_TEXT = 3;
365
-
366
- /**
367
- * The official neutral theme's color mapping, read from the theme the CLI
368
- * ships rather than copied: each token's stops, `[light, dark]`, written
369
- * there as `<family>.<mode>[N]` or `withAlpha(<family>.<mode>[N], 'aa')`
370
- * (one stop for both modes when it writes one), and the parts whose
371
- * secondary text it lifts (`[part, block]`).
372
- * @returns {{stops: Record<string, Array<{stop: number, alpha?: string}>>, lifted: Array<[string, string]>}}
373
- */
374
- function readOfficialNeutral() {
375
- const ast = parse(
376
- fs.readFileSync(
377
- path.join(THEMES_DIR, 'neutral', 'neutralTheme.ts'),
378
- 'utf8',
379
- ),
380
- {sourceType: 'module', plugins: ['typescript']},
381
- );
382
- /** @param {any} n @returns {{stop: number, alpha?: string} | null} */
383
- const stopOf = n => {
384
- if (n?.type === 'CallExpression' && n.callee?.name === 'withAlpha') {
385
- const inner = stopOf(n.arguments[0]);
386
- const alpha = n.arguments[1]?.value;
387
- return inner && typeof alpha === 'string'
388
- ? {...inner, alpha: alpha.toLowerCase()}
389
- : null;
390
- }
391
- return n?.type === 'MemberExpression' &&
392
- n.computed &&
393
- n.property.type === 'NumericLiteral' &&
394
- ['light', 'dark'].includes(n.object?.property?.name)
395
- ? {stop: n.property.value}
396
- : null;
397
- };
398
- /** @type {Record<string, Array<{stop: number, alpha?: string}>>} */
399
- const stops = {};
400
- /** @type {Array<[string, string]>} */
401
- const lifted = [];
402
- /** @param {any} node @param {string[]} keys */
403
- const visit = (node, keys) => {
404
- if (!node || typeof node !== 'object') return;
405
- if (node.type === 'ObjectProperty') {
406
- const key = node.key.name ?? node.key.value;
407
- const at = [...keys, String(key)];
408
- if (keys.at(-1) === 'tokens' && node.value.type === 'ArrayExpression') {
409
- const pair = node.value.elements.map(stopOf);
410
- if (pair.length === 2 && pair.every(Boolean)) stops[key] = pair;
411
- } else if (keys.at(-1) === 'tokens') {
412
- const one = stopOf(node.value);
413
- if (one) stops[key] = [one, one];
414
- }
415
- if (keys.at(-3) === 'components' && key === '--color-text-secondary')
416
- lifted.push([keys.at(-2) ?? '', keys.at(-1) ?? '']);
417
- visit(node.value, at);
418
- return;
419
- }
420
- for (const [k, v] of Object.entries(node))
421
- if (k !== 'loc' && k !== 'start' && k !== 'end')
422
- for (const x of Array.isArray(v) ? v : [v]) visit(x, keys);
423
- };
424
- visit(ast.program, []);
425
- return {stops, lifted};
426
- }
427
- const OFFICIAL = readOfficialNeutral();
428
- /** A token's official `[light, dark]` stops. @param {string} token */
429
- const officialStops = token =>
430
- /** @type {[number, number]} */ (
431
- (OFFICIAL.stops[token] ?? []).map(x => x.stop)
432
- );
433
-
434
- /**
435
- * The tokens the neutral color sets at the official theme's stops, the
436
- * page background (`--color-background-body`) with the surfaces on it, so
437
- * a warm or cool gray reaches the page as it reaches the cards. The
438
- * inverted surface (tooltips,
439
- * toasts), which the official theme leaves to Core, is the card surface of
440
- * the other mode, as Core makes it from a neutral scale, inside the ramp
441
- * (Core's tones 10 and 99: never the white or black end every ramp shares)
442
- * so it carries the neutral color (NEUTRAL_INSIDE); the text on it is the
443
- * theme's on-dark and on-light. A layout without one of these stops uses
444
- * the nearest one it has.
445
- */
446
- const NEUTRAL_STOPS = wordTable(
447
- /** @type {Record<string, [number, number]>} */ ({
448
- ...Object.fromEntries(
449
- [
450
- '--color-background-body',
451
- '--color-background-surface',
452
- '--color-background-card',
453
- '--color-background-popover',
454
- '--color-background-muted',
455
- '--color-text-primary',
456
- '--color-text-secondary',
457
- '--color-text-disabled',
458
- '--color-icon-primary',
459
- '--color-icon-secondary',
460
- '--color-icon-disabled',
461
- '--color-border-emphasized',
462
- '--color-skeleton',
463
- '--color-on-dark',
464
- '--color-on-light',
465
- ].map(t => [t, officialStops(t)]),
466
- ),
467
- '--color-background-inverted': /** @type {[number, number]} */ (
468
- [...officialStops('--color-background-card')].reverse()
469
- ),
470
- }),
471
- );
472
- /** Neutral tokens whose shade stays inside the ramp, off its white and black ends. */
473
- const NEUTRAL_INSIDE = new Set(['--color-background-inverted']);
474
- /** Neutral tints: a stop with an opacity, `[[stop, alpha], [stop, alpha]]`. */
475
- const NEUTRAL_TINTS = wordTable(
476
- Object.fromEntries(
477
- ['--color-border', '--color-overlay-hover', '--color-overlay-pressed'].map(
478
- t => [
479
- t,
480
- /** @type {[[number, string], [number, string]]} */ (
481
- OFFICIAL.stops[t].map(x => [x.stop, String(x.alpha)])
482
- ),
483
- ],
484
- ),
485
- ),
486
- );
487
- /**
488
- * Accent and status stops, `[light, dark]`, as the official neutral theme
489
- * maps its accent tint and its status families (info stands for them). The
490
- * dark fill starts at 70, where the theme authoring guide puts it, when the
491
- * exact color does not read in dark. A status tint is translucent in dark
492
- * (`[stop, alpha]`).
493
- */
494
- const DARK_FILL = 70;
495
- const TEXT_STOP = officialStops('--color-text-info');
496
- const ACCENT_MUTED = officialStops('--color-accent-muted');
497
- const STATUS_MUTED = /** @type {[number, [number, string]]} */ (
498
- OFFICIAL.stops['--color-info-muted'].map((x, i) =>
499
- i === 0 ? x.stop : [x.stop, String(x.alpha)],
500
- )
501
- );
502
- const ON_MUTED = officialStops('--color-on-info-muted');
503
- /**
504
- * The parts whose secondary text the official neutral theme lifts, with
505
- * the block it lifts it in and what the text sits on: the accent tint,
506
- * except under segmented-control labels, which sit on the translucent
507
- * neutral track (`--color-neutral`).
508
- */
509
- export const LIFT_PARTS = OFFICIAL.lifted.map(
510
- ([part, block]) =>
511
- /** @type {[string, string, string]} */ ([
512
- part,
513
- block,
514
- part === 'segmented-control-item'
515
- ? '--color-neutral'
516
- : '--color-accent-muted',
517
- ]),
518
- );
519
- /** What each lifted background is, and the parts on it, for notes. */
520
- const LIFT_GROUNDS =
521
- /** @type {Record<string, {what: string, parts: string}>} */ ({
522
- '--color-accent-muted': {
523
- what: 'the accent tint',
524
- parts: 'selected items and rows, a dropzone, numbered citations',
525
- },
526
- '--color-neutral': {
527
- what: 'the neutral track',
528
- parts: 'segmented-control labels',
529
- },
530
- });
531
- const BORDER = /** @type {[number, number]} */ ([80, 65]);
532
- /**
533
- * Text on a fill, from the neutral family as the official themes take it:
534
- * white (100) first in light, near-black (5) first in dark, and near-black
535
- * first in both modes on warning. Without a neutral color, black and white.
536
- */
537
- const [ON_LIGHT, ON_DARK] = officialStops('--color-on-accent');
538
- const ON_FILL = wordTable(
539
- /** @type {Record<Mode, [number, number]>} */ ({
540
- light: [ON_LIGHT, ON_DARK],
541
- dark: [ON_DARK, ON_LIGHT],
542
- }),
543
- );
544
351
  /** A layout needs this many stops between black and white to map every token. */
545
352
  const MIN_INNER_STOPS = 5;
546
353
  /** The widest gap between two stops that still maps every token near its stop. */
547
354
  const MAX_STOP_GAP = 25;
548
355
 
549
- /** Text on surfaces darkens in light mode and lightens in dark mode. */
550
- const TOWARD_CONTRAST = wordTable(
551
- /** @type {Record<Mode, 1 | -1>} */ ({
552
- light: -1,
553
- dark: 1,
554
- }),
555
- );
556
-
557
356
  /** @param {string} slug */
558
357
  export function paletteFiles(slug) {
559
358
  return {
@@ -587,15 +386,6 @@ export function seedOf(value) {
587
386
  return rgb && alphaOf(value) >= 1 ? hex(rgb) : null;
588
387
  }
589
388
 
590
- /**
591
- * Below this OKLCH chroma a seed reads as gray: its family is generated as a
592
- * neutral, so no hue is invented for it in either mode.
593
- */
594
- const GRAY_CHROMA = 0.02;
595
-
596
- /** @param {string} seed */
597
- const isGray = seed => hexToOklch(seed).C < GRAY_CHROMA;
598
-
599
389
  /** Whether a seed (or no seed) has no color to saturate. @param {string | null} seed */
600
390
  export const isGraySeed = seed => !seed || isGray(seed);
601
391
 
@@ -626,15 +416,6 @@ export function vibrancyMoves(dial, seed, from, to) {
626
416
  return ramp(from) !== ramp(to);
627
417
  }
628
418
 
629
- /** @param {unknown} a @param {unknown} b */
630
- function sameColor(a, b) {
631
- try {
632
- return normalizeColor(String(a)) === normalizeColor(String(b));
633
- } catch {
634
- return false;
635
- }
636
- }
637
-
638
419
  /**
639
420
  * The modes a theme has: one for a one-mode theme, else light and dark.
640
421
  * @param {{mode?: string}} data
@@ -649,22 +430,60 @@ export function modesOf(data) {
649
430
  }
650
431
 
651
432
  /**
652
- * The color dial settings of a theme, in dial order.
433
+ * The light-mode color of a token value the theme's own source writes: a
434
+ * plain color, or the first half of a light-dark() pair.
435
+ * @param {string | undefined} value
436
+ */
437
+ function lightHalf(value) {
438
+ const v = String(value ?? '').trim();
439
+ const pair = /^light-dark\((.*)\)$/is.exec(v);
440
+ return pair ? (splitTop(pair[1], ',')[0] ?? '').trim() : v;
441
+ }
442
+
443
+ /**
444
+ * The color dial settings of a theme, in dial order. A family whose fill
445
+ * token the theme's own source sets exactly takes that color, the one in
446
+ * effect, as its seed: the shades its text, icons and tints read come from
447
+ * the color the fill shows, never from a dial value the source overrides.
448
+ * The neutral family always takes its setting.
653
449
  * @param {{settings: Setting[]}} data
450
+ * @param {Record<string, string>} [own] the tokens the theme's own source sets
654
451
  */
655
- function dialFamilies(data) {
656
- /** @type {Array<{id: string, dial: string, seed: string, value: string}>} */
452
+ function dialFamilies(data, own = {}) {
453
+ /** @type {DialFamily[]} */
657
454
  const out = [];
658
455
  for (const dial of PALETTE_DIALS) {
659
456
  const s = [...data.settings]
660
457
  .reverse()
661
458
  .find(x => x?.source === 'dial' && x.thing === dial && !x.on && !x.mode);
662
- const seed = s && seedOf(s.value);
663
- if (s && seed) out.push({id: dial, dial, seed, value: s.value});
459
+ // The neutral family keeps its setting: a gray the source sets exactly
460
+ // is one surface, not the color every gray grows from.
461
+ const inEffect =
462
+ dial === 'neutral' ? null : seedOf(lightHalf(own[paletteToken(dial)]));
463
+ const seed = inEffect ?? (s && seedOf(s.value));
464
+ if (s && seed)
465
+ out.push({
466
+ id: dial,
467
+ dial,
468
+ seed,
469
+ value: s.value,
470
+ source: inEffect ? paletteToken(dial) : null,
471
+ });
664
472
  }
665
473
  return out;
666
474
  }
667
475
 
476
+ /**
477
+ * The seed each color family grows from now: the fill the theme's own source
478
+ * sets as a fixed color, else the color setting.
479
+ * @param {string} cwd
480
+ * @param {string} slug
481
+ * @param {{settings: Setting[]}} data
482
+ */
483
+ export function seedsInEffect(cwd, slug, data) {
484
+ return dialFamilies(data, ownSourceTokenValues(cwd, slug));
485
+ }
486
+
668
487
  /** Notes for damaged color configs kept aside during one sync. @type {string[]} */
669
488
  const keptDamaged = [];
670
489
 
@@ -767,61 +586,6 @@ function deadKeys(config) {
767
586
  return out;
768
587
  }
769
588
 
770
- /**
771
- * The light stop nearest a seed color in the ramp the generator grows from
772
- * it. The official themes anchor a brand color there, exactly, so the fill
773
- * keeps the color as given. The end stops are pure black and white and
774
- * never hold an anchor.
775
- * @param {string} seed
776
- * @param {any} config - Its `stops` and `vibrancy` shape the ramp.
777
- * @param {'chromatic' | 'neutral'} [kind]
778
- */
779
- function seedStop(seed, config, kind = 'chromatic') {
780
- const {palette} = generate({
781
- ...(config.stops ? {stops: config.stops} : {}),
782
- ...(config.vibrancy != null ? {vibrancy: config.vibrancy} : {}),
783
- ...(kind === 'neutral' ? {neutralProfile: 'custom'} : {}),
784
- modeStrategy: 'light-only',
785
- families: [{id: 'seed', seed, kind}],
786
- });
787
- const ramp = /** @type {Record<number, string>} */ (
788
- /** @type {any} */ (palette.seed).light
789
- );
790
- return Number(nearestShade(ramp, seed));
791
- }
792
-
793
- /**
794
- * The stop of a ramp whose shade is nearest a color, as the eye compares
795
- * them; never an end stop (pure black or white, which every ramp shares).
796
- * Null for a ramp with no inner stop.
797
- * @param {Record<string | number, string>} ramp
798
- * @param {string} color
799
- * @returns {string | null}
800
- */
801
- export function nearestShade(ramp, color) {
802
- const inner = Object.keys(ramp).filter(s => Number(s) > 0 && Number(s) < 100);
803
- if (!inner.length) return null;
804
- return inner.reduce((best, s) =>
805
- perceptualDelta(ramp[s], color) < perceptualDelta(ramp[best], color)
806
- ? s
807
- : best,
808
- );
809
- }
810
-
811
- /**
812
- * The stop of a layout nearest `n`; on a tie, the one nearer the middle.
813
- * @param {readonly number[]} stops
814
- * @param {number} n
815
- */
816
- function nearestStop(stops, n) {
817
- return stops.reduce((best, s) => {
818
- const d = Math.abs(s - n) - Math.abs(best - n);
819
- return d < 0 || (d === 0 && Math.abs(s - 50) < Math.abs(best - 50))
820
- ? s
821
- : best;
822
- });
823
- }
824
-
825
589
  /**
826
590
  * Refuse a stop layout the token mapping cannot use: numbers only, black
827
591
  * (0) and white (100), enough shades between them, and no gap so wide that
@@ -869,42 +633,21 @@ function usableStops(stops, slug) {
869
633
  }
870
634
 
871
635
  /**
872
- * Look-ups shared by the config writer and the mapping, on one candidate:
873
- * the nearest stop, a stop's color, the surfaces text and fills sit on, the
874
- * text that reads on a fill, and the theme's exact color settings.
875
- * @param {Candidate} candidate
636
+ * What the palette mapping reads of a theme: its base colors, the tokens it
637
+ * has, its exact token settings (a page-wide token its own source sets wins,
638
+ * as the build shows it), the fixed color a value gives in a mode, and the
639
+ * command that sets a value.
640
+ * @param {string} cwd
641
+ * @param {string} slug
876
642
  * @param {{settings: Setting[]}} data
877
643
  * @param {{light: Record<string, string>, dark: Record<string, string>} | undefined} base
644
+ * @param {Record<string, unknown>} [tokenDefaults]
645
+ * @returns {import('../theme/palette/generate/mapping.mjs').PaletteMappingContext}
878
646
  */
879
- function tools(
880
- candidate,
881
- data,
882
- base,
883
- /** @type {Record<string, string>} */ own = {},
884
- ) {
885
- const {stops} = candidate;
886
- /** @param {number} n */
887
- const at = n => nearestStop(stops, n);
888
- /** The stop nearest `n` off the white and black ends. @param {number} n */
889
- const atInside = n =>
890
- nearestStop(
891
- stops.filter(s => s > 0 && s < 100),
892
- n,
893
- );
894
- /** @param {string} id @param {Mode} m @param {number} stop @param {string} [alpha] @returns {StopRef} */
895
- const ref = (id, m, stop, alpha) => {
896
- const color = /** @type {any} */ (candidate.palette[id])[m][stop];
897
- return alpha ? {stop, color: `${color}${alpha}`, alpha} : {stop, color};
898
- };
899
- const neutral = Boolean(/** @type {any} */ (candidate.palette).neutral);
900
- /**
901
- * The whole-theme value a token setting gives in a mode, as written, or
902
- * undefined.
903
- * @param {string} token @param {Mode} m
904
- */
647
+ function paletteContext(cwd, slug, data, base, tokenDefaults = {}) {
648
+ const own = ownSourceTokenValues(cwd, slug);
649
+ /** @param {string} token @param {Mode} m @returns {string | undefined} */
905
650
  const settingOf = (token, m) =>
906
- // A page-wide token the theme's own source sets wins over the settings
907
- // (the build shows it), as an exact setting would.
908
651
  (Object.hasOwn(own, token) ? own[token] : undefined) ??
909
652
  [...data.settings]
910
653
  .reverse()
@@ -949,174 +692,35 @@ function tools(
949
692
  const t = ref.trim();
950
693
  if (!/^--[a-z0-9-]+$/i.test(t) || seen.has(t)) return null;
951
694
  seen.add(t);
952
- const own = settingOf(t, m);
695
+ const set = settingOf(t, m);
953
696
  const read =
954
- own != null ? colorIn(own, m, seen) : colorIn(base?.[m]?.[t], m, seen);
697
+ set != null ? colorIn(set, m, seen) : colorIn(base?.[m]?.[t], m, seen);
955
698
  return read ?? (rest.length ? colorIn(rest.join(','), m, seen) : null);
956
699
  };
957
- /**
958
- * The exact whole-theme color a token setting gives in a mode, or null.
959
- * @param {string} token @param {Mode} m
960
- */
961
- const exactOf = (token, m) => {
962
- const v = colorIn(settingOf(token, m), m);
963
- const rgb = v == null ? null : parseColor(v);
964
- return rgb && v != null && alphaOf(v) >= 1 ? hex(rgb) : null;
965
- };
966
- /**
967
- * The exact whole-theme color a token setting gives in a mode, see-through
968
- * or not, as written (a hex keeps its alpha digits; a `light-dark()` or a
969
- * `var()` gives the color it reads in the mode); null when there is none
970
- * or it is not a fixed color.
971
- * @param {string} token @param {Mode} m
972
- */
973
- const rawOf = (token, m) => colorIn(settingOf(token, m), m);
974
- /**
975
- * Which column of a `[light, dark]` mapping a mode takes: the light one
976
- * on a light page and the dark one on a dark page, by the base theme's
977
- * page, the one its surfaces were made for. A base whose light page is
978
- * dark, such as Gothic, gets dark-page shades in light. A page color the
979
- * theme writes is that one color: it never moves every other surface to
980
- * the other column (a teal page keeps white cards and popovers), and the
981
- * colors that must read on it are held to it where they are picked.
982
- * @param {Mode} m
983
- * @returns {0 | 1}
984
- */
985
- const side = m => {
986
- const page = base?.[m]?.['--color-background-body'];
987
- const rgb = page ? parseColor(page) : null;
988
- if (!rgb || alphaOf(page) < 1) return m === 'light' ? 0 : 1;
989
- return ratio(rgb, [255, 255, 255]) > ratio(rgb, [0, 0, 0]) ? 1 : 0;
990
- };
991
- /**
992
- * What text and fills sit on in a mode: the theme's exact surface
993
- * colors, else the neutral color's surfaces, else the base theme's; the
994
- * family's own surface stop when nothing else is known.
995
- * @param {Mode} m @param {string} id
996
- * @returns {Array<[string, string]>}
997
- */
998
- const surfaces = (m, id) => {
999
- /** @type {Array<[string, string]>} */
1000
- const out = [];
1001
- for (const n of [
1002
- '--color-background-surface',
1003
- '--color-background-body',
1004
- '--color-background-card',
1005
- ]) {
1006
- const own =
1007
- neutral && NEUTRAL_STOPS[n]
1008
- ? ref('neutral', m, at(NEUTRAL_STOPS[n][side(m)])).color
1009
- : null;
1010
- const v = exactOf(n, m) ?? own ?? base?.[m]?.[n];
1011
- if (v && parseColor(v) && alphaOf(v) >= 1)
1012
- out.push([n, hex(/** @type {number[]} */ (parseColor(v)))]);
1013
- }
1014
- if (!out.length) {
1015
- const s = at(NEUTRAL_STOPS['--color-background-surface'][side(m)]);
1016
- out.push([`${id} shade ${s}`, ref(id, m, s).color]);
1017
- }
1018
- return out;
1019
- };
1020
- /**
1021
- * The text shades for a fill, preferred first.
1022
- * @param {string} id @param {Mode} m
1023
- * @returns {StopRef[]}
1024
- */
1025
- const onChoices = (id, m) =>
1026
- (id === 'warning' ? [5, 100] : ON_FILL[m]).map(s =>
1027
- neutral
1028
- ? {...ref('neutral', m, at(s)), family: 'neutral'}
1029
- : s >= 50
1030
- ? {stop: 100, color: PALETTE_WHITE, family: 'white'}
1031
- : {stop: 0, color: PALETTE_BLACK, family: 'black'},
1032
- );
1033
- /**
1034
- * The text on a fill: the preferred shade when it reads at 4.5:1, else
1035
- * the one that reads better.
1036
- * @param {string} id @param {Mode} m @param {string} fill
1037
- */
1038
- const onFor = (id, m, fill) => {
1039
- const [a, b] = onChoices(id, m).map(on => ({
1040
- on,
1041
- r: contrast(on.color, fill),
1042
- }));
1043
- const best = a.r >= TEXT || a.r >= b.r ? a : b;
1044
- const other = best === a ? b : a;
1045
- return {
1046
- on: best.on,
1047
- r: best.r,
1048
- other: other.on,
1049
- otherR: other.r,
1050
- first: a.on,
1051
- };
1052
- };
1053
- /** The lowest contrast of a color on the surfaces. @param {string} color @param {Mode} m @param {string} id */
1054
- const page = (color, m, id) =>
1055
- Math.min(...surfaces(m, id).map(([, bg]) => contrast(color, bg)));
1056
- /**
1057
- * A color as the eye sees it on the surface in a mode: a see-through one
1058
- * drawn over the first surface.
1059
- * @param {string} color @param {Mode} m @param {string} id
1060
- */
1061
- const solid = (color, m, id) => {
1062
- const rgb = /** @type {[number, number, number]} */ (parseColor(color));
1063
- const a = alphaOf(color);
1064
- if (a >= 1) return hex(rgb);
1065
- const under = /** @type {[number, number, number]} */ (
1066
- parseColor(surfaces(m, id)[0][1])
1067
- );
1068
- return hex(compositeOver(rgb, a, under));
1069
- };
1070
700
  return {
1071
- stops,
1072
- at,
1073
- atInside,
1074
- ref,
1075
- exactOf,
701
+ base,
702
+ has: token => token in tokenDefaults,
703
+ reader: {
704
+ rgb: value =>
705
+ /** @type {[number, number, number] | null} */ (parseColor(value)),
706
+ alpha: value => alphaOf(value),
707
+ },
1076
708
  settingOf,
1077
- rawOf,
1078
- side,
1079
- solid,
1080
- surfaces,
1081
- onFor,
1082
- page,
1083
- neutral,
709
+ colorIn: (value, m) => colorIn(value, m),
710
+ setExactly: token =>
711
+ data.settings.some(
712
+ s =>
713
+ s.source === 'token' &&
714
+ s.thing === token &&
715
+ !s.on &&
716
+ !s.when &&
717
+ !s.state,
718
+ ),
719
+ setLine: (thing, value, mode) =>
720
+ `${P} set ${slug} ${thing} ${quoteCommandArgument(value)}${mode ? ` --mode ${mode}` : ''}`,
1084
721
  };
1085
722
  }
1086
723
 
1087
- /** A text shade, named for a sentence. @param {StopRef} r */
1088
- const textName = r =>
1089
- r.family === 'white' || (r.family === 'neutral' && r.stop >= 95)
1090
- ? 'white'
1091
- : r.family === 'black' || (r.family === 'neutral' && r.stop <= 10)
1092
- ? 'near-black'
1093
- : `shade ${r.stop}`;
1094
-
1095
- /**
1096
- * Whether the exact seed color works as the dark fill: text on it reads at
1097
- * 4.5:1 and it stands out from the dark surfaces at 3:1. Why not otherwise.
1098
- * @param {ReturnType<typeof tools>} t
1099
- * @param {string} id
1100
- * @param {string} seed
1101
- */
1102
- function darkExact(t, id, seed) {
1103
- const on = t.onFor(id, 'dark', seed);
1104
- if (on.r < TEXT)
1105
- return {
1106
- ok: false,
1107
- ratio: round(on.r),
1108
- why: `your exact color reads at only ${round(on.r)}:1 with any text shade, and text needs ${TEXT}:1`,
1109
- };
1110
- const p = t.page(seed, 'dark', id);
1111
- if (p < NON_TEXT)
1112
- return {
1113
- ok: false,
1114
- ratio: round(p),
1115
- why: `your exact color stands out from the dark page at only ${round(p)}:1, and a fill needs ${NON_TEXT}:1`,
1116
- };
1117
- return {ok: true, ratio: round(on.r), why: ''};
1118
- }
1119
-
1120
724
  /**
1121
725
  * What the config writer decided: the config, what it kept or replaced of
1122
726
  * a hand edit, and for each accent or status color the stop of its exact
@@ -1137,14 +741,17 @@ function darkExact(t, id, seed) {
1137
741
  * the author's own stay. Null when the config would hold no family.
1138
742
  * @param {string} cwd
1139
743
  * @param {string} slug
1140
- * @param {{mode?: string, settings: Setting[]}} data
744
+ * @param {{mode?: string, settings: Setting[], palette?: string}} data
1141
745
  * @param {{light: Record<string, string>, dark: Record<string, string>}} [base] the base theme's resolved colors, which the dark check reads
1142
746
  * @returns {PalettePlan | null}
1143
747
  */
1144
748
  function planPalette(cwd, slug, data, base) {
1145
749
  const file = paletteFiles(slug).config;
1146
750
  const existing = readConfig(path.join(cwd, file));
1147
- const fams = dialFamilies(data);
751
+ // (Before anything reads it, so the refusal names this project's way to
752
+ // a newer CLI.)
753
+ refuseUnknownRecipe(existing, file, cwd);
754
+ const fams = dialFamilies(data, ownSourceTokenValues(cwd, slug));
1148
755
  if (!existing && !fams.length) return null;
1149
756
  /** @type {string[]} */
1150
757
  const notes = [];
@@ -1200,29 +807,35 @@ function planPalette(cwd, slug, data, base) {
1200
807
  );
1201
808
  /** @type {any[]} */
1202
809
  const before = Array.isArray(config.families) ? config.families : [];
1203
- const savedSeeds = dialFamilies({settings: saved});
810
+ const savedSeeds = dialFamilies(
811
+ {settings: saved},
812
+ ownSourceTokenValues(cwd, slug),
813
+ );
814
+ // A config the editor wrote holds the seeds it gave, from the settings and
815
+ // the source as they were then: its seed is never a hand edit.
816
+ const configMine = configWrittenByEditor(cwd, slug, data);
1204
817
 
1205
818
  /**
1206
819
  * One dial family: the author's family with the dial's seed and the
1207
820
  * exact anchors of that seed in place of the old ones.
1208
821
  * @param {any} prev
1209
- * @param {{id: string, seed: string}} f
822
+ * @param {DialFamily} f
1210
823
  */
1211
824
  const familyOf = (prev, f) => {
1212
825
  const old = prev && typeof prev === 'object' ? prev : {};
1213
826
  const neutral = f.id === 'neutral';
1214
- const wasSaved = savedSeeds.find(x => x.id === f.id)?.seed;
827
+ const wasSaved = configMine
828
+ ? old.seed
829
+ : savedSeeds.find(x => x.id === f.id)?.seed;
1215
830
  if (old.seed != null && wasSaved && !sameColor(old.seed, wasSaved))
1216
831
  notes.push(
1217
- `${file}: the ${f.id} seed ${old.seed} there is replaced by your ${f.id} setting, ${f.seed}`,
832
+ `${file}: the ${f.id} seed ${old.seed} there is replaced by ${f.source ? `the ${f.source} your theme source sets` : `your ${f.id} setting`}, ${f.seed}`,
1218
833
  );
1219
- const gray = isGray(f.seed);
834
+ const {family: made, stop} = dialFamily(f, config, modes);
835
+ // The setting's family as a fresh palette has it; of the author's
836
+ // family, a chromatic kind stays.
1220
837
  const kind =
1221
- neutral || gray
1222
- ? 'neutral'
1223
- : old.kind === 'chromatic'
1224
- ? 'chromatic'
1225
- : undefined;
838
+ made.kind ?? (old.kind === 'chromatic' ? 'chromatic' : undefined);
1226
839
  if (
1227
840
  old.kind === 'neutral' &&
1228
841
  !kind &&
@@ -1232,25 +845,8 @@ function planPalette(cwd, slug, data, base) {
1232
845
  notes.push(
1233
846
  `${file}: the ${f.id} kind "neutral" is dropped: your ${f.id} is not a gray, and a neutral kind turns its shades gray where no exact color holds them`,
1234
847
  );
1235
- const stop = seedStop(
1236
- f.seed,
1237
- config,
1238
- kind === 'neutral' ? 'neutral' : 'chromatic',
1239
- );
1240
- // White and black already end every ramp, so a neutral of either holds
1241
- // no anchor of its own.
1242
- const ends =
1243
- neutral &&
1244
- (sameColor(f.seed, PALETTE_WHITE) || sameColor(f.seed, PALETTE_BLACK));
1245
848
  /** @type {any[]} */
1246
- const mine = ends
1247
- ? []
1248
- : (neutral ? modes : modes.filter(m => m === 'light')).map(m => ({
1249
- mode: m,
1250
- stop,
1251
- color: f.seed,
1252
- policy: 'exact',
1253
- }));
849
+ const mine = made.anchors ?? [];
1254
850
  /** @type {any[]} */
1255
851
  const kept = [];
1256
852
  const anchors = Array.isArray(old.anchors) ? old.anchors : [];
@@ -1291,7 +887,7 @@ function planPalette(cwd, slug, data, base) {
1291
887
  const out = {
1292
888
  ...old,
1293
889
  id: f.id,
1294
- name: old.name ?? f.id[0].toUpperCase() + f.id.slice(1),
890
+ name: old.name ?? made.name,
1295
891
  seed: f.seed,
1296
892
  ...(kind ? {kind} : {}),
1297
893
  anchors: [...mine, ...kept].sort((a, b) =>
@@ -1317,16 +913,14 @@ function planPalette(cwd, slug, data, base) {
1317
913
  const mine = fams.find(x => x.id === f.id);
1318
914
  if (!mine) return null;
1319
915
  const {family, stop} = familyOf(f, mine);
1320
- if (mine.id !== 'neutral')
1321
- fills[mine.id] = {stop, dark: false, why: '', ratio: 0};
916
+ if (mine.id !== 'neutral') fills[mine.id] = fillAt(stop);
1322
917
  return family;
1323
918
  })
1324
919
  .filter(Boolean);
1325
920
  for (const f of fams)
1326
921
  if (!families.some(x => x?.id === f.id)) {
1327
922
  const {family, stop} = familyOf(null, f);
1328
- if (f.id !== 'neutral')
1329
- fills[f.id] = {stop, dark: false, why: '', ratio: 0};
923
+ if (f.id !== 'neutral') fills[f.id] = fillAt(stop);
1330
924
  families.push(family);
1331
925
  }
1332
926
  if (!families.length) return null;
@@ -1380,60 +974,23 @@ function planPalette(cwd, slug, data, base) {
1380
974
  // The exact color anchors dark mode too when it reads there, as the
1381
975
  // official themes anchor a brand color in both modes.
1382
976
  if (modes.includes('dark') && Object.keys(fills).length) {
1383
- const t = tools(
1384
- generate(config, file),
1385
- data,
1386
- base,
1387
- ownSourceTokenValues(cwd, slug),
1388
- );
1389
- /** @type {string[]} */
1390
- const add = [];
1391
- for (const [id, fill] of Object.entries(fills)) {
1392
- const seed = /** @type {string} */ (fams.find(f => f.id === id)?.seed);
1393
- const check = darkExact(t, id, seed);
1394
- Object.assign(fill, {why: check.why, ratio: check.ratio});
1395
- if (check.ok) add.push(id);
1396
- }
1397
- /** @param {string} id @param {any} cfg */
1398
- const withDark = (id, cfg) => ({
1399
- ...cfg,
1400
- families: cfg.families.map((/** @type {any} */ f) => {
1401
- if (f?.id !== id) return f;
1402
- const anchor = {
1403
- mode: 'dark',
1404
- stop: fills[id].stop,
1405
- color: f.seed,
1406
- policy: 'exact',
1407
- };
1408
- const others = (f.anchors ?? []).filter(
1409
- (/** @type {any} */ a) =>
1410
- !(a.mode === 'dark' && a.stop === anchor.stop),
1411
- );
1412
- if (others.length < (f.anchors ?? []).length)
977
+ try {
978
+ config.families = anchorDarkFills(
979
+ config,
980
+ fams,
981
+ fills,
982
+ paletteContext(cwd, slug, data, base),
983
+ (id, stop) =>
1413
984
  notes.push(
1414
- `${file}: your dark anchor at shade ${shade(anchor.stop)} of ${id} is replaced by your exact ${id} color`,
1415
- );
1416
- return {
1417
- ...f,
1418
- anchors: [...others, anchor].sort((a, b) =>
1419
- a.mode === b.mode ? a.stop - b.stop : a.mode === 'light' ? -1 : 1,
985
+ `${file}: your dark anchor at shade ${shade(stop)} of ${id} is replaced by your exact ${id} color`,
1420
986
  ),
1421
- };
1422
- }),
1423
- });
1424
- let next = config;
1425
- for (const id of add) {
1426
- const tried = withDark(id, next);
1427
- try {
1428
- generateTonalPalette(tried);
1429
- next = tried;
1430
- fills[id].dark = true;
1431
- } catch {
1432
- fills[id].why =
1433
- 'the dark shades cannot hold your exact color and stay in order from dark to light';
1434
- }
987
+ );
988
+ } catch (error) {
989
+ // A config the generator refuses is refused as the editor refuses
990
+ // it, naming the file.
991
+ generate(config, file);
992
+ throw error;
1435
993
  }
1436
- config.families = next.families;
1437
994
  }
1438
995
  return {config, notes, fills};
1439
996
  }
@@ -1478,6 +1035,38 @@ export function syncPalette(cwd, slug, data, base) {
1478
1035
  return [...keptDamaged.splice(0), ...notes];
1479
1036
  }
1480
1037
 
1038
+ /**
1039
+ * Whether the editor wrote the theme's palette config as it is now: its hash
1040
+ * is the one the settings hold (`data.palette`, or the saved settings, which
1041
+ * an undo may carry from before the palette existed), or the one the editor
1042
+ * recorded writing (a color change stopped before its settings were saved).
1043
+ * @param {string} cwd
1044
+ * @param {string} slug
1045
+ * @param {{palette?: string}} data
1046
+ */
1047
+ function configWrittenByEditor(cwd, slug, data) {
1048
+ const file = path.join(cwd, paletteFiles(slug).config);
1049
+ if (!fs.existsSync(file)) return false;
1050
+ const hash = sha256(fs.readFileSync(file));
1051
+ /** @type {string | undefined} */
1052
+ let saved;
1053
+ try {
1054
+ saved = JSON.parse(
1055
+ fs.readFileSync(
1056
+ path.join(cwd, 'themes', slug, `${slug}.settings.json`),
1057
+ 'utf8',
1058
+ ),
1059
+ ).palette;
1060
+ } catch {
1061
+ saved = undefined;
1062
+ }
1063
+ return (
1064
+ data.palette === hash ||
1065
+ saved === hash ||
1066
+ readWrittenRecord(cwd, slug)['palette.config.json'] === hash
1067
+ );
1068
+ }
1069
+
1481
1070
  /**
1482
1071
  * @param {string} cwd
1483
1072
  * @param {string} slug
@@ -1492,26 +1081,7 @@ function syncPaletteFiles(cwd, slug, data, base) {
1492
1081
  if (!plan) {
1493
1082
  // Only palette files the editor wrote go: a hand-made palette.config.json
1494
1083
  // (and what it generated) stays.
1495
- // The hash the saved settings recorded too: an undo may carry settings
1496
- // from before the palette existed.
1497
- /** @type {string | undefined} */
1498
- let saved;
1499
- try {
1500
- saved = JSON.parse(
1501
- fs.readFileSync(abs(`themes/${slug}/${slug}.settings.json`), 'utf8'),
1502
- ).palette;
1503
- } catch {
1504
- saved = undefined;
1505
- }
1506
- const hash = fs.existsSync(abs(f.config))
1507
- ? sha256(fs.readFileSync(abs(f.config)))
1508
- : null;
1509
- // Or the config the editor recorded writing (a color change stopped
1510
- // before its settings were saved).
1511
- const recorded = readWrittenRecord(cwd, slug)['palette.config.json'];
1512
- const mine =
1513
- hash != null &&
1514
- (data.palette === hash || saved === hash || recorded === hash);
1084
+ const mine = configWrittenByEditor(cwd, slug, data);
1515
1085
  delete data.palette;
1516
1086
  if (!mine) return [];
1517
1087
  // A palette file edited by hand is never deleted: it stays, and the
@@ -1970,12 +1540,39 @@ export function syncPaletteRefs(cwd, slug, source, pal) {
1970
1540
  writeWhole(file, text);
1971
1541
  }
1972
1542
 
1543
+ /**
1544
+ * A palette made with a recipe this CLI does not know, with the file left as
1545
+ * it is. A newer CLI's recipe is no fault to fix by hand: it gets the
1546
+ * refusal `theme palette generate` gives, with the update step that fits
1547
+ * where the CLI runs. Any other recipe is named as no recipe Astryx makes,
1548
+ * and the file is the fix: its `recipe` set to one this CLI knows.
1549
+ * @param {any} config
1550
+ * @param {string} file the config's path, for the refusal
1551
+ * @param {string} [cwd] the project, for the step that updates the CLI
1552
+ */
1553
+ function refuseUnknownRecipe(config, file, cwd) {
1554
+ const recipe = config?.recipe;
1555
+ if (recipe == null || PALETTE_RECIPES.includes(recipe)) return;
1556
+ if (newerRecipe(recipe))
1557
+ throw newerRecipeRefusal({recipe, file, cwd: cwd ?? process.cwd()});
1558
+ // Every command that reads the theme builds this plan and meets this
1559
+ // refusal again, so the way out is the file itself, and no command is
1560
+ // offered.
1561
+ throw new AstryxError(
1562
+ `${file}: this theme's colors name the palette recipe ${String(recipe)}, which no Astryx CLI makes. Fix that part of the file by hand: set "recipe" to one of the recipes this CLI (${cliVersion()}) knows, ${PALETTE_RECIPES.join(', ')}. Nothing was changed.`,
1563
+ [],
1564
+ ERROR_CODES.ERR_PALETTE_GENERATION,
1565
+ );
1566
+ }
1567
+
1973
1568
  /**
1974
1569
  * @param {any} config
1975
1570
  * @param {string} [file] the config's path, for the refusal
1571
+ * @param {string} [cwd] the project, for the command that updates the CLI
1976
1572
  * @returns {Candidate}
1977
1573
  */
1978
- function generate(config, file = 'palette.config.json') {
1574
+ function generate(config, file = 'palette.config.json', cwd = undefined) {
1575
+ refuseUnknownRecipe(config, file, cwd);
1979
1576
  try {
1980
1577
  return generateTonalPalette(config);
1981
1578
  } catch (e) {
@@ -1987,68 +1584,6 @@ function generate(config, file = 'palette.config.json') {
1987
1584
  }
1988
1585
  }
1989
1586
 
1990
- /**
1991
- * The contrast ratio of two opaque colors. A color that does not parse is
1992
- * a bug in the mapping, never a ratio of 0.
1993
- * @param {string} a @param {string} b
1994
- */
1995
- function contrast(a, b) {
1996
- const x = parseColor(a);
1997
- const y = parseColor(b);
1998
- if (!x || !y) throw new Error(`No contrast between "${a}" and "${b}".`);
1999
- return ratio(x, y);
2000
- }
2001
-
2002
- /**
2003
- * A translucent stop drawn over each surface, as the opaque colors the eye
2004
- * sees; an opaque stop as it is.
2005
- * @param {string} name @param {StopRef} r @param {Array<[string, string]>} under
2006
- * @returns {Array<[string, string]>}
2007
- */
2008
- function over(name, r, under) {
2009
- if (!r.alpha) return [[name, r.color]];
2010
- const top = /** @type {[number, number, number]} */ (
2011
- parseColor(r.color.slice(0, 7))
2012
- );
2013
- const a = parseInt(r.alpha, 16) / 255;
2014
- return under.map(([n, bg]) => [
2015
- `${name} over ${n}`,
2016
- hex(
2017
- compositeOver(
2018
- top,
2019
- a,
2020
- /** @type {[number, number, number]} */ (parseColor(bg)),
2021
- ),
2022
- ),
2023
- ]);
2024
- }
2025
-
2026
- /** @param {number} r */
2027
- const round = r => Math.round(r * 100) / 100;
2028
-
2029
- /** A stop as text: a layout may hold 16.666666666666668. @param {number} s */
2030
- const shade = s => String(round(s));
2031
-
2032
- /**
2033
- * A gray ramp the generator grows from a gray of the theme (its secondary
2034
- * text), for a mode: the grays of a theme whose palette has no neutral
2035
- * family. Null when the seed does not grow.
2036
- * @param {string} seed @param {Mode} m
2037
- * @returns {Record<string, string> | null}
2038
- */
2039
- function grownGrays(seed, m) {
2040
- try {
2041
- const g = generateTonalPalette({
2042
- modeStrategy: m === 'light' ? 'light-only' : 'dark-only',
2043
- neutralProfile: 'custom',
2044
- families: [{id: 'gray', seed, kind: 'neutral'}],
2045
- });
2046
- return /** @type {any} */ (g.palette.gray)[m] ?? null;
2047
- } catch {
2048
- return null;
2049
- }
2050
- }
2051
-
2052
1587
  /**
2053
1588
  * A family's ramp in each mode, as the theme makes it: the palette's own
2054
1589
  * family when its color settings define one; for the neutral family, else
@@ -2067,7 +1602,7 @@ export function familyRamp(cwd, slug, data, base, family) {
2067
1602
  planPalette(cwd, slug, data, base)
2068
1603
  );
2069
1604
  const ramp = /** @type {any} */ (
2070
- generate(plan.config, paletteFiles(slug).config).palette
1605
+ generate(plan.config, paletteFiles(slug).config, cwd).palette
2071
1606
  )[family];
2072
1607
  if (ramp?.light && ramp?.dark) return ramp;
2073
1608
  }
@@ -2106,589 +1641,22 @@ export function familyRamp(cwd, slug, data, base, family) {
2106
1641
  * @returns {PaletteMapping | null}
2107
1642
  */
2108
1643
  export function paletteMapping(cwd, slug, data, base, tokenDefaults) {
2109
- const fams = dialFamilies(data);
1644
+ const fams = dialFamilies(data, ownSourceTokenValues(cwd, slug));
2110
1645
  if (!fams.length) return null;
2111
1646
  const plan = /** @type {PalettePlan} */ (planPalette(cwd, slug, data, base));
2112
1647
  const {config} = plan;
2113
- const candidate = generate(config, paletteFiles(slug).config);
2114
- const t = tools(candidate, data, base, ownSourceTokenValues(cwd, slug));
2115
- const {
2116
- stops,
2117
- at,
2118
- atInside,
2119
- ref,
2120
- exactOf,
2121
- rawOf,
2122
- settingOf,
2123
- side,
2124
- solid,
2125
- surfaces,
2126
- } = t;
2127
- // Both halves, for a one-mode theme too (see planPalette).
2128
- const modes = modesForStrategy('light-and-dark');
2129
- /** @type {PaletteMapping['tokens']} */
2130
- const tokens = {};
2131
- /** @type {ContrastCheck[]} */
2132
- const checks = [];
2133
- /** @type {PaletteMapping['exact']} */
2134
- const exact = {};
2135
- /** @type {Record<string, string>} */
2136
- const unread = {};
2137
- const has = (/** @type {string} */ k) => k in tokenDefaults;
2138
- /** A token the theme sets exactly in any mode: no check speaks for it. @param {string} k */
2139
- const setExactly = k =>
2140
- data.settings.some(
2141
- s =>
2142
- s.source === 'token' && s.thing === k && !s.on && !s.when && !s.state,
2143
- );
2144
- const reports = (/** @type {string} */ k) => has(k) && !setExactly(k);
2145
- /**
2146
- * Point a token at its stops. A theme with one mode has one ramp: the
2147
- * other side repeats it.
2148
- * @param {string} token @param {string} id @param {Partial<Record<Mode, StopRef>>} refs
2149
- */
2150
- const put = (token, id, refs) => {
2151
- if (!has(token)) return;
2152
- const one = /** @type {StopRef} */ (refs[modes[0]]);
2153
- tokens[token] = {
2154
- family: id,
2155
- light: refs.light ?? one,
2156
- dark: refs.dark ?? one,
2157
- };
2158
- };
2159
- /** @template T @param {(m: Mode) => T} fn @returns {Partial<Record<Mode, T>>} */
2160
- const each = fn => Object.fromEntries(modes.map(m => [m, fn(m)]));
2161
- /**
2162
- * The stop nearest `start` that reads at `needs` on every color in `on`,
2163
- * searched both ways (the usual way first on a tie: darker in light,
2164
- * lighter in dark), so a base with dark light-mode surfaces still finds
2165
- * one; the most contrasting stop of all when none does.
2166
- * @param {string} token @param {string} id @param {Mode} m @param {number} start
2167
- * @param {Array<[string, string]>} on - `[name, color]` pairs.
2168
- * @param {number} needs
2169
- */
2170
- const pick = (token, id, m, start, on, needs) => {
2171
- const usual = TOWARD_CONTRAST[m];
2172
- const order = [...stops].sort(
2173
- (a, b) =>
2174
- Math.abs(a - start) - Math.abs(b - start) ||
2175
- (Math.sign(b - a) === usual ? 1 : -1),
2176
- );
2177
- /** @param {number} stop */
2178
- const score = stop => {
2179
- const c = ref(id, m, stop).color;
2180
- return Math.min(...on.map(([, bg]) => contrast(c, bg)));
2181
- };
2182
- const scored = order.map(stop => ({stop, r: score(stop)}));
2183
- const b =
2184
- scored.find(x => x.r >= needs) ??
2185
- scored.reduce((x, y) => (y.r > x.r ? y : x));
2186
- if (reports(token))
2187
- checks.push({
2188
- token,
2189
- mode: m,
2190
- stop: b.stop,
2191
- preferred: start,
2192
- against: on.map(([n]) => n).join(', '),
2193
- ratio: round(b.r),
2194
- needs,
2195
- pass: b.r >= needs,
2196
- });
2197
- return ref(id, m, b.stop);
2198
- };
2199
-
2200
- const neutral = fams.find(f => f.id === 'neutral');
2201
- if (neutral) {
2202
- for (const [token, pair] of Object.entries(NEUTRAL_STOPS)) {
2203
- if (
2204
- token === '--color-text-secondary' ||
2205
- token === '--color-icon-secondary'
2206
- )
2207
- continue;
2208
- const shade = NEUTRAL_INSIDE.has(token) ? atInside : at;
2209
- put(
2210
- token,
2211
- 'neutral',
2212
- each(m => ref('neutral', m, shade(pair[side(m)]))),
2213
- );
2214
- }
2215
- for (const [token, pair] of Object.entries(NEUTRAL_TINTS))
2216
- put(
2217
- token,
2218
- 'neutral',
2219
- each(m => {
2220
- const [s, a] = pair[side(m)];
2221
- return ref('neutral', m, at(s), a);
2222
- }),
2223
- );
2224
- for (const [token, needs] of /** @type {const} */ ([
2225
- ['--color-text-secondary', TEXT],
2226
- ['--color-icon-secondary', NON_TEXT],
2227
- ]))
2228
- put(
2229
- token,
2230
- 'neutral',
2231
- each(m =>
2232
- pick(
2233
- token,
2234
- 'neutral',
2235
- m,
2236
- at(NEUTRAL_STOPS[token][side(m)]),
2237
- surfaces(m, 'neutral'),
2238
- needs,
2239
- ),
2240
- ),
2241
- );
2242
- const surface = paletteToken('neutral');
2243
- const set = each(m => exactOf(surface, m));
2244
- if (Object.values(set).some(Boolean))
2245
- exact[surface] = /** @type {Partial<Record<Mode, string>>} */ (
2246
- Object.fromEntries(Object.entries(set).filter(([, v]) => v))
2247
- );
2248
- }
2249
-
2250
- for (const f of fams) {
2251
- if (f.id === 'neutral') continue;
2252
- const word = f.id === 'accent' ? null : STATUS_TOKEN[f.id];
2253
- const names = word
2254
- ? {
2255
- fill: `--color-${word}`,
2256
- on: `--color-on-${word}`,
2257
- text: `--color-text-${word}`,
2258
- icon: `--color-icon-${word}`,
2259
- muted: `--color-${word}-muted`,
2260
- onMuted: `--color-on-${word}-muted`,
2261
- border: `--color-border-${word}`,
2262
- focus: null,
2263
- }
2264
- : {
2265
- fill: '--color-accent',
2266
- on: '--color-on-accent',
2267
- text: '--color-text-accent',
2268
- icon: '--color-icon-accent',
2269
- muted: '--color-accent-muted',
2270
- onMuted: null,
2271
- border: null,
2272
- focus: '--focus-outline-color',
2273
- };
2274
- const plain = plan.fills[f.id];
2275
- const S = plain.stop;
2276
- const fillWord = f.id;
2277
- /** @type {Partial<Record<Mode, string>>} */
2278
- const exactFill = {};
2279
- for (const m of modes) {
2280
- const v = rawOf(names.fill, m);
2281
- if (v) exactFill[m] = v;
2282
- else if (settingOf(names.fill, m) != null)
2283
- unread[names.fill] = String(settingOf(names.fill, m)).trim();
2284
- }
2285
- if (Object.keys(exactFill).length)
2286
- exact[names.fill] = Object.fromEntries(
2287
- Object.entries(exactFill).map(([m, v]) => {
2288
- // A var() is named with the color it reads, so the note says
2289
- // which color the text was picked for.
2290
- const written = String(
2291
- settingOf(names.fill, /** @type {Mode} */ (m)) ?? '',
2292
- ).trim();
2293
- const rgb = parseColor(v);
2294
- const color = rgb && alphaOf(v) >= 1 ? hex(rgb) : v;
2295
- return [m, /var\(/i.test(written) ? `${written} = ${color}` : v];
2296
- }),
2297
- );
2298
-
2299
- /** @type {Partial<Record<Mode, StopRef>>} */
2300
- const fill = {};
2301
- for (const m of modes) {
2302
- if (m === 'light' || plain.dark) {
2303
- fill[m] = {...ref(f.id, m, S), exact: true};
2304
- continue;
2305
- }
2306
- // The dark fill when the exact color does not read there: shade 70,
2307
- // else the shade nearest 70 that passes, else 70.
2308
- const start = at(DARK_FILL);
2309
- const order = [...stops]
2310
- .filter(s => s > 0 && s < 100)
2311
- .sort((a, b) => Math.abs(a - start) - Math.abs(b - start) || b - a);
2312
- const found =
2313
- order.find(s => {
2314
- const c = ref(f.id, m, s).color;
2315
- return (
2316
- t.page(c, m, f.id) >= NON_TEXT && t.onFor(f.id, m, c).r >= TEXT
2317
- );
2318
- }) ?? start;
2319
- fill[m] = ref(f.id, m, found);
2320
- if (reports(names.fill))
2321
- checks.push({
2322
- token: names.fill,
2323
- mode: m,
2324
- stop: found,
2325
- preferred: S,
2326
- against: 'the dark page and the text on it',
2327
- ratio: plain.ratio,
2328
- needs: TEXT,
2329
- pass: true,
2330
- note: `in dark, ${names.fill} is shade ${shade(found)}, not your exact color: ${plain.why}${found === start ? '' : `; shade ${shade(start)} does not pass either, so it is the nearest shade that does`}`,
2331
- });
2332
- }
2333
- put(names.fill, f.id, fill);
2334
-
2335
- // Text on the fill reads on the fill the theme really uses: the exact
2336
- // token setting when there is one. The exact color never moves; the
2337
- // text changes instead.
2338
- const on = each(m => {
2339
- const used = exactFill[m] ?? /** @type {StopRef} */ (fill[m]).color;
2340
- // A see-through exact fill is measured as it shows on the surface.
2341
- const o = t.onFor(fillWord, m, solid(used, m, f.id));
2342
- const what = exactFill[m]
2343
- ? `your exact ${names.fill} (${used}${alphaOf(used) < 1 ? `, as it shows: ${solid(used, m, f.id)}` : ''})`
2344
- : `${names.fill} (shade ${shade(Number(fill[m]?.stop))})`;
2345
- const moved = o.on !== o.first;
2346
- if (reports(names.on))
2347
- checks.push({
2348
- token: names.on,
2349
- mode: m,
2350
- stop: o.on.stop,
2351
- preferred: o.first.stop,
2352
- against: what,
2353
- ratio: round(o.r),
2354
- needs: TEXT,
2355
- pass: o.r >= TEXT,
2356
- ...(o.r < TEXT
2357
- ? {
2358
- note: `text on ${what} reads at only ${round(o.r)}:1 in ${m} with white or near-black text (needs ${TEXT}:1); the fill keeps your color: pick a lighter or darker ${f.id}, or set ${names.on} exactly`,
2359
- }
2360
- : moved
2361
- ? {
2362
- note: `${names.on} uses ${textName(o.on)} text in ${m}, not ${textName(o.first)}, so it reads at ${round(o.r)}:1 on ${what}, where ${textName(o.other)} text reads at only ${round(o.otherR)}:1 (button and badge labels are normal-size text, which needs ${TEXT}:1); to keep ${textName(o.other)} text anyway, set ${names.on} exactly`,
2363
- }
2364
- : {}),
2365
- });
2366
- return o.on;
2367
- });
2368
- put(names.on, f.id, on);
2369
-
2370
- // A pale fill in light can disappear into the page: say so, and keep
2371
- // the exact color, the dial's or the token's.
2372
- if (modes.includes('light') && has(names.fill)) {
2373
- const used = exactFill.light ?? /** @type {StopRef} */ (fill.light).color;
2374
- const p = t.page(solid(used, 'light', f.id), 'light', f.id);
2375
- if (p < NON_TEXT)
2376
- checks.push({
2377
- token: names.fill,
2378
- mode: 'light',
2379
- stop: S,
2380
- preferred: S,
2381
- against: 'the light page',
2382
- ratio: round(p),
2383
- needs: NON_TEXT,
2384
- pass: false,
2385
- note: exactFill.light
2386
- ? `in light, your exact ${names.fill} (${used}) stands out from the page at only ${round(p)}:1, and a fill needs ${NON_TEXT}:1, so its buttons and badges may not show: give it a darker color`
2387
- : `in light, your exact ${f.id} stands out from the page at only ${round(p)}:1, and a fill needs ${NON_TEXT}:1, so ${names.fill} buttons and badges may not show: pick a darker ${f.id}`,
2388
- });
2389
- }
2390
-
2391
- // The tint: the official stop, never the fill's own shade, see-through
2392
- // or not. Secondary text on the parts that sit on the accent tint is
2393
- // lifted instead, as the official neutral theme lifts it (`lift`).
2394
- const muted = each(m => {
2395
- const i = side(m);
2396
- const spec = word ? STATUS_MUTED[i] : ACCENT_MUTED[i];
2397
- const [s, alpha] = Array.isArray(spec) ? spec : [spec, undefined];
2398
- // Nearest the official stop first, both ways; on a tie (a layout
2399
- // without that stop) lighter first in light, darker in dark.
2400
- const usual = i === 0 ? 1 : -1;
2401
- const order = [...stops].sort(
2402
- (a, b) =>
2403
- Math.abs(a - s) - Math.abs(b - s) ||
2404
- (Math.sign(b - a) === usual ? 1 : -1),
2405
- );
2406
- const away = order.filter(x => x !== fill[m]?.stop);
2407
- return ref(f.id, m, away[0] ?? order[0], alpha);
2408
- });
2409
- put(names.muted, f.id, muted);
2410
- /** The tint the theme really shows: an exact setting wins. @param {Mode} m */
2411
- const mutedSeen = m => {
2412
- const own = rawOf(names.muted, m);
2413
- return own
2414
- ? surfaces(m, f.id).map(
2415
- ([n, bg]) =>
2416
- /** @type {[string, string]} */ ([
2417
- `your exact ${names.muted} over ${n}`,
2418
- hex(
2419
- compositeOver(
2420
- /** @type {[number, number, number]} */ (parseColor(own)),
2421
- alphaOf(own),
2422
- /** @type {[number, number, number]} */ (parseColor(bg)),
2423
- ),
2424
- ),
2425
- ]),
2426
- )
2427
- : over(
2428
- names.muted,
2429
- /** @type {StopRef} */ (muted[m]),
2430
- surfaces(m, f.id),
2431
- );
2432
- };
2433
-
2434
- // Accent text and icons are the color you gave where it reads on what
2435
- // they sit on (the surfaces and the tint), in each mode its fill is
2436
- // your exact color; only where it does not do they move, to the
2437
- // nearest shade that reads, and the result says so.
2438
- const text = each(m => {
2439
- const grounds = [...surfaces(m, f.id), ...mutedSeen(m)];
2440
- const own = fill[m]?.exact ? ref(f.id, m, S) : null;
2441
- if (own) {
2442
- const r = Math.min(...grounds.map(([, bg]) => contrast(own.color, bg)));
2443
- if (r >= TEXT) {
2444
- if (reports(names.text))
2445
- checks.push({
2446
- token: names.text,
2447
- mode: m,
2448
- stop: S,
2449
- preferred: S,
2450
- against: grounds.map(([n]) => n).join(', '),
2451
- ratio: round(r),
2452
- needs: TEXT,
2453
- pass: true,
2454
- });
2455
- return own;
2456
- }
2457
- const before = checks.length;
2458
- const moved = pick(names.text, f.id, m, S, grounds, TEXT);
2459
- const last = checks.length > before ? checks[checks.length - 1] : null;
2460
- if (last && moved.stop !== S)
2461
- last.note = `${names.text} ${m}: your exact color (${own.color}) reads at only ${grounds
2462
- .map(([n, bg]) => [n, contrast(own.color, bg)])
2463
- .filter(([, x]) => Number(x) < TEXT)
2464
- .map(([n, x]) => `${round(Number(x))}:1 on ${n}`)
2465
- .join(
2466
- ', ',
2467
- )} (text needs ${TEXT}:1), so links and accent text use shade ${shade(moved.stop)} (${moved.color}), the nearest that reads; the fill keeps your color, and an exact ${names.text} keeps any color you give it`;
2468
- return moved;
2469
- }
2470
- return pick(names.text, f.id, m, at(TEXT_STOP[side(m)]), grounds, TEXT);
2471
- });
2472
- put(names.text, f.id, text);
2473
- put(names.icon, f.id, text);
2474
- if (names.onMuted) {
2475
- const onMuted = /** @type {string} */ (names.onMuted);
2476
- put(
2477
- onMuted,
2478
- f.id,
2479
- each(m =>
2480
- pick(onMuted, f.id, m, at(ON_MUTED[side(m)]), mutedSeen(m), TEXT),
2481
- ),
2482
- );
2483
- }
2484
- if (names.border)
2485
- put(
2486
- names.border,
2487
- f.id,
2488
- each(m => ref(f.id, m, at(BORDER[side(m)]))),
2489
- );
2490
- // The focus ring follows the fill; with an exact fill it keeps
2491
- // following that (Core's ring reads --color-accent).
2492
- if (names.focus && !Object.keys(exactFill).length) {
2493
- const focus = /** @type {string} */ (names.focus);
2494
- put(
2495
- focus,
2496
- f.id,
2497
- each(m =>
2498
- pick(
2499
- focus,
2500
- f.id,
2501
- m,
2502
- /** @type {StopRef} */ (fill[m]).stop,
2503
- surfaces(m, f.id),
2504
- NON_TEXT,
2505
- ),
2506
- ),
2507
- );
2508
- }
2509
- }
2510
-
2511
- // Secondary text on the parts the official neutral theme lifts it on
2512
- // (LIFT_PARTS), lifted the same way, for every accent: for each
2513
- // background (the accent tint, the neutral track), the gray shade
2514
- // nearest the secondary text's own that reads at 4.5:1 on it and on it
2515
- // under a hover, over every surface. The grays are the neutral color's,
2516
- // else a gray ramp the generator grows from the base theme's own
2517
- // secondary text (written as colors, not shades of the palette). The
2518
- // tint stays at its official stop. A mode where the theme sets
2519
- // secondary text exactly takes that value instead, as written.
2520
- /** @type {Record<string, Partial<Record<Mode, StopRef>>> | null} */
2521
- let lift = null;
2522
- {
2523
- /** @param {Mode} m @param {string} token */
2524
- const valueOf = (m, token) => {
2525
- const v =
2526
- rawOf(token, m) ?? tokens[token]?.[m].color ?? base?.[m]?.[token];
2527
- return v && parseColor(v) ? v : null;
2528
- };
2529
- /** The secondary text a mode starts from. @param {Mode} m */
2530
- const startText = m => {
2531
- const v =
2532
- tokens['--color-text-secondary']?.[m].color ??
2533
- base?.[m]?.['--color-text-secondary'];
2534
- return v && parseColor(v)
2535
- ? hex(/** @type {number[]} */ (parseColor(v)))
2536
- : null;
2537
- };
2538
- /**
2539
- * The gray ramp of a mode, and whether its shades are the palette's
2540
- * neutral ones (else plain colors).
2541
- * @param {Mode} m
2542
- * @returns {{ramp: Record<string, string>, palette: boolean} | null}
2543
- */
2544
- const grays = m => {
2545
- if (neutral)
2546
- return {
2547
- ramp: /** @type {any} */ (candidate.palette.neutral)[m],
2548
- palette: true,
2549
- };
2550
- const seed = startText(m);
2551
- const ramp = seed ? grownGrays(seed, m) : null;
2552
- return ramp ? {ramp, palette: false} : null;
2553
- };
2554
- /**
2555
- * A color drawn over each of `under`, as the eye sees it.
2556
- * @param {string} name @param {string} color @param {Array<[string, string]>} under
2557
- * @returns {Array<[string, string]>}
2558
- */
2559
- const drawn = (name, color, under) => {
2560
- const top = /** @type {[number, number, number]} */ (parseColor(color));
2561
- const a = alphaOf(color);
2562
- return under.map(([n, c]) => [
2563
- `${name} over ${n}`,
2564
- hex(
2565
- compositeOver(
2566
- top,
2567
- a,
2568
- /** @type {[number, number, number]} */ (parseColor(c)),
2569
- ),
2570
- ),
2571
- ]);
2572
- };
2573
- /** @type {Record<string, Partial<Record<Mode, StopRef>>>} */
2574
- const found = {};
2575
- for (const ground of new Set(LIFT_PARTS.map(([, , g]) => g))) {
2576
- const {what, parts} = LIFT_GROUNDS[ground];
2577
- /**
2578
- * The shade the base theme itself lifts this ground's text to in a
2579
- * mode, when it gives one: the search starts there, so a change of
2580
- * color moves it only when that shade no longer reads.
2581
- * @param {Mode} m
2582
- * @returns {string | null}
2583
- */
2584
- const baseLift = m => {
2585
- for (const [part, block, g] of LIFT_PARTS) {
2586
- if (g !== ground) continue;
2587
- const v = /** @type {any} */ (base)?.components?.[part]?.[block]?.[
2588
- '--color-text-secondary'
2589
- ];
2590
- const pair = Array.isArray(v)
2591
- ? v
2592
- : typeof v === 'string'
2593
- ? /^light-dark\((.*)\)$/s.exec(v.trim())?.[1]
2594
- ? splitTop(
2595
- /** @type {string} */ (
2596
- /^light-dark\((.*)\)$/s.exec(v.trim())?.[1]
2597
- ),
2598
- ',',
2599
- )
2600
- : [v, v]
2601
- : null;
2602
- const c = pair?.[m === 'light' ? 0 : 1]?.trim();
2603
- if (c && parseColor(c))
2604
- return hex(/** @type {number[]} */ (parseColor(c)));
2605
- }
2606
- return null;
2607
- };
2608
- /** @type {Partial<Record<Mode, StopRef>>} */
2609
- const byMode = {};
2610
- for (const m of modes) {
2611
- const own = rawOf('--color-text-secondary', m);
2612
- if (own) {
2613
- byMode[m] = {stop: 0, color: own, family: 'literal'};
2614
- continue;
2615
- }
2616
- const fillColor = valueOf(m, ground);
2617
- const g = grays(m);
2618
- const text = startText(m);
2619
- if (!fillColor || !g || !text) break;
2620
- const seen = drawn(what, fillColor, surfaces(m, 'neutral'));
2621
- const hover = valueOf(m, '--color-overlay-hover');
2622
- const on = [
2623
- ...seen,
2624
- ...(hover && alphaOf(hover) > 0
2625
- ? drawn('a hover', hover, seen).map(
2626
- ([n, c]) =>
2627
- /** @type {[string, string]} */ ([
2628
- n.replace(/^a hover over (.*)$/, '$1 under a hover'),
2629
- c,
2630
- ]),
2631
- )
2632
- : []),
2633
- ];
2634
- const keys = Object.keys(g.ramp)
2635
- .map(Number)
2636
- .sort((a, b) => a - b);
2637
- const from = baseLift(m) ?? text;
2638
- const start = keys.reduce((x, y) =>
2639
- perceptualDelta(g.ramp[y], from) < perceptualDelta(g.ramp[x], from)
2640
- ? y
2641
- : x,
2642
- );
2643
- const scored = keys
2644
- .sort(
2645
- (a, b) =>
2646
- Math.abs(a - start) - Math.abs(b - start) ||
2647
- (Math.sign(b - a) === TOWARD_CONTRAST[m] ? 1 : -1),
2648
- )
2649
- .map(stop => ({
2650
- stop,
2651
- r: Math.min(...on.map(([, bg]) => contrast(g.ramp[stop], bg))),
2652
- }));
2653
- const b =
2654
- scored.find(x => x.r >= TEXT) ??
2655
- scored.reduce((x, y) => (y.r > x.r ? y : x));
2656
- byMode[m] = g.palette
2657
- ? ref('neutral', m, b.stop)
2658
- : {stop: b.stop, color: g.ramp[b.stop], family: 'literal'};
2659
- const moved =
2660
- hex(/** @type {number[]} */ (parseColor(g.ramp[b.stop]))) !== from;
2661
- if (b.r < TEXT || moved)
2662
- checks.push({
2663
- token: '--color-text-secondary',
2664
- mode: m,
2665
- stop: b.stop,
2666
- preferred: start,
2667
- against: `${what} over the surfaces`,
2668
- ratio: round(b.r),
2669
- needs: TEXT,
2670
- pass: b.r >= TEXT,
2671
- dials: ['accent', 'neutral'],
2672
- note:
2673
- b.r >= TEXT
2674
- ? `--color-text-secondary on ${parts} uses ${g.ramp[b.stop]} in ${m}, not ${from}, so it stays readable (${round(b.r)}:1) on ${what} and under a hover`
2675
- : `--color-text-secondary on ${parts} reads at only ${round(b.r)}:1 in ${m} on ${what} even at ${g.ramp[b.stop]}, the most contrasting gray (needs ${TEXT}:1): pick another accent or neutral, or set --color-text-secondary on those parts exactly`,
2676
- });
2677
- }
2678
- if (modes.every(m => byMode[m])) found[ground] = byMode;
2679
- }
2680
- if (Object.keys(found).length) lift = found;
2681
- }
2682
-
1648
+ const candidate = generate(config, paletteFiles(slug).config, cwd);
1649
+ const mapping = mapPalette(
1650
+ candidate,
1651
+ fams,
1652
+ plan.fills,
1653
+ paletteContext(cwd, slug, data, base, tokenDefaults),
1654
+ );
2683
1655
  return {
2684
1656
  candidate,
2685
1657
  families: fams,
2686
- tokens,
2687
- contrast: checks.filter(c => c.note !== ''),
2688
- lift,
1658
+ ...mapping,
2689
1659
  vibrancy: config.vibrancy ?? VIBRANCY_DEFAULT,
2690
- exact,
2691
- unread,
2692
1660
  notes: [
2693
1661
  ...plan.notes,
2694
1662
  ...(paletteEdited(cwd, slug)
@@ -2746,16 +1714,25 @@ export function mappingRows(dial) {
2746
1714
  'your exact color sits at its own shade, light and dark, and the shades around it follow it (white and black are already the ends of every ramp)',
2747
1715
  ...Object.entries(NEUTRAL_STOPS).map(
2748
1716
  ([t, [l, d]]) =>
2749
- `${t}: light shade ${l}, dark shade ${d}${t.endsWith('-secondary') ? ` (moves to a shade that reads at ${t.includes('icon') ? NON_TEXT : TEXT}:1 on the surfaces)` : NEUTRAL_INSIDE.has(t) ? ' (the card surface of the other mode, for tooltips and toasts, at the nearest shade inside the ramp so it carries your color)' : ''}`,
1717
+ `${t}: light shade ${l}, dark shade ${d}${t.endsWith('-secondary') ? ` (moves to a shade that reads at ${t.includes('icon') ? NON_TEXT : TEXT}:1 on the surfaces)` : NEUTRAL_INSIDE.includes(t) ? ' (the card surface of the other mode, for tooltips and toasts, at the nearest shade inside the ramp so it carries your color)' : ''}`,
2750
1718
  ),
2751
1719
  ...Object.entries(NEUTRAL_TINTS).map(
2752
1720
  ([t, [[l, la], [d, da]]]) =>
2753
1721
  `${t}: light shade ${l} at opacity ${la}, dark shade ${d} at opacity ${da}`,
2754
1722
  ),
2755
- ...Object.values(LIFT_GROUNDS).map(
2756
- g =>
2757
- `--color-text-secondary on ${g.parts}: the shade nearest the secondary text's that reads at ${TEXT}:1 on ${g.what} and under a hover, as the official theme lifts it`,
2758
- ),
1723
+ ...Object.entries(LIFT_GROUNDS)
1724
+ .filter(([g]) => !g.startsWith('--color-background-'))
1725
+ .map(
1726
+ ([, g]) =>
1727
+ `--color-text-secondary on ${g.parts}: the shade nearest the secondary text's that reads at ${TEXT}:1 on ${g.what} and under a hover, as the official theme lifts it`,
1728
+ ),
1729
+ ...(Object.keys(LIFT_GROUNDS).some(g =>
1730
+ g.startsWith('--color-background-'),
1731
+ )
1732
+ ? [
1733
+ `--color-text-secondary on coloured cards: the shade nearest the secondary text's that reads at ${TEXT}:1 on each card's fill, as the official theme lifts it`,
1734
+ ]
1735
+ : []),
2759
1736
  ];
2760
1737
  const word = dial === 'accent' ? null : STATUS_TOKEN[dial];
2761
1738
  if (dial !== 'accent' && !word) return [];
@@ -2840,7 +1817,11 @@ export function paletteFailures(pal, dial, modes = ['light', 'dark']) {
2840
1817
  if (!pal) return [];
2841
1818
  return dialChecks(pal, dial, modes)
2842
1819
  .filter(c => !c.pass)
2843
- .map(c => ({key: paletteCheckKey(c), text: checkNote(c, dial)}));
1820
+ .map(c => ({
1821
+ key: paletteCheckKey(c),
1822
+ text: checkNote(c, dial),
1823
+ ...(c.fix ? {fix: c.fix} : {}),
1824
+ }));
2844
1825
  }
2845
1826
 
2846
1827
  /**
@@ -2901,7 +1882,9 @@ export function paletteNotes(pal, dial, slug, modes = ['light', 'dark']) {
2901
1882
  const given = pal.families.find(x => x.dial === dial);
2902
1883
  if (given && isClipped(given.value))
2903
1884
  notes.push(
2904
- `your ${dial} ${given.value} is outside the colors every screen shows (sRGB), so the nearest one, ${given.seed}, is used`,
1885
+ given.source
1886
+ ? `your ${dial} ${given.value} is outside the colors every screen shows (sRGB); the nearest one is ${seedOf(given.value)}, but the ${given.source} your theme source sets, ${given.seed}, is used`
1887
+ : `your ${dial} ${given.value} is outside the colors every screen shows (sRGB), so the nearest one, ${seedOf(given.value)}, is used`,
2905
1888
  );
2906
1889
  for (const c of dialChecks(pal, dial, modes)) {
2907
1890
  if (c.note || !c.pass) notes.push(checkNote(c, dial));