@repobit/dex-system-design 3.0.0 → 3.0.2

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 (656) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/src/_bundled/oxc-project_runtime/helpers/esm/decorate.js +1 -0
  3. package/dist/src/components/accordion/accordion-bg.css.js +1 -288
  4. package/dist/src/components/accordion/accordion-bg.css.js.map +1 -1
  5. package/dist/src/components/accordion/accordion-bg.d.ts +5 -5
  6. package/dist/src/components/accordion/accordion-bg.js +15 -210
  7. package/dist/src/components/accordion/accordion-bg.js.map +1 -1
  8. package/dist/src/components/accordion/accordion-keyboard.js +1 -89
  9. package/dist/src/components/accordion/accordion-keyboard.js.map +1 -1
  10. package/dist/src/components/accordion/accordion-panel.js +1 -22
  11. package/dist/src/components/accordion/accordion-panel.js.map +1 -1
  12. package/dist/src/components/accordion/accordion.css.js +1 -380
  13. package/dist/src/components/accordion/accordion.css.js.map +1 -1
  14. package/dist/src/components/accordion/accordion.d.ts +7 -7
  15. package/dist/src/components/accordion/accordion.js +16 -138
  16. package/dist/src/components/accordion/accordion.js.map +1 -1
  17. package/dist/src/components/agent-endpoints/agent-endpoints.css.js +1 -88
  18. package/dist/src/components/agent-endpoints/agent-endpoints.css.js.map +1 -1
  19. package/dist/src/components/agent-endpoints/agent-endpoints.d.ts +4 -4
  20. package/dist/src/components/agent-endpoints/agent-endpoints.js +17 -76
  21. package/dist/src/components/agent-endpoints/agent-endpoints.js.map +1 -1
  22. package/dist/src/components/alert/alert.css.js +1 -217
  23. package/dist/src/components/alert/alert.css.js.map +1 -1
  24. package/dist/src/components/alert/alert.d.ts +4 -4
  25. package/dist/src/components/alert/alert.js +6 -110
  26. package/dist/src/components/alert/alert.js.map +1 -1
  27. package/dist/src/components/anchor/anchor-nav.css.js +1 -546
  28. package/dist/src/components/anchor/anchor-nav.css.js.map +1 -1
  29. package/dist/src/components/anchor/anchor-nav.d.ts +4 -4
  30. package/dist/src/components/anchor/anchor-nav.js +23 -567
  31. package/dist/src/components/anchor/anchor-nav.js.map +1 -1
  32. package/dist/src/components/annotation/annotation.css.js +1 -64
  33. package/dist/src/components/annotation/annotation.css.js.map +1 -1
  34. package/dist/src/components/annotation/annotation.d.ts +2 -2
  35. package/dist/src/components/annotation/annotation.js +7 -72
  36. package/dist/src/components/annotation/annotation.js.map +1 -1
  37. package/dist/src/components/audience-card/audience-card.css.js +1 -122
  38. package/dist/src/components/audience-card/audience-card.css.js.map +1 -1
  39. package/dist/src/components/audience-card/audience-card.d.ts +2 -2
  40. package/dist/src/components/audience-card/audience-card.js +8 -83
  41. package/dist/src/components/audience-card/audience-card.js.map +1 -1
  42. package/dist/src/components/avatar/avatar.css.js +1 -65
  43. package/dist/src/components/avatar/avatar.css.js.map +1 -1
  44. package/dist/src/components/avatar/avatar.d.ts +3 -3
  45. package/dist/src/components/avatar/avatar.js +6 -76
  46. package/dist/src/components/avatar/avatar.js.map +1 -1
  47. package/dist/src/components/awards/awards-flex.css.js +1 -273
  48. package/dist/src/components/awards/awards-flex.css.js.map +1 -1
  49. package/dist/src/components/awards/awards-flex.d.ts +12 -12
  50. package/dist/src/components/awards/awards-flex.js +33 -264
  51. package/dist/src/components/awards/awards-flex.js.map +1 -1
  52. package/dist/src/components/awards/awards-spotlight.css.js +1 -161
  53. package/dist/src/components/awards/awards-spotlight.css.js.map +1 -1
  54. package/dist/src/components/awards/awards-spotlight.d.ts +4 -4
  55. package/dist/src/components/awards/awards-spotlight.js +24 -140
  56. package/dist/src/components/awards/awards-spotlight.js.map +1 -1
  57. package/dist/src/components/awards/awards.css.js +1 -401
  58. package/dist/src/components/awards/awards.css.js.map +1 -1
  59. package/dist/src/components/awards/awards.d.ts +13 -13
  60. package/dist/src/components/awards/awards.js +26 -179
  61. package/dist/src/components/awards/awards.js.map +1 -1
  62. package/dist/src/components/awards/scroll-slides.js +1 -131
  63. package/dist/src/components/awards/scroll-slides.js.map +1 -1
  64. package/dist/src/components/back/back.css.js +1 -91
  65. package/dist/src/components/back/back.css.js.map +1 -1
  66. package/dist/src/components/back/back.d.ts +1 -1
  67. package/dist/src/components/back/back.js +8 -71
  68. package/dist/src/components/back/back.js.map +1 -1
  69. package/dist/src/components/badge/badge.css.js +1 -204
  70. package/dist/src/components/badge/badge.css.js.map +1 -1
  71. package/dist/src/components/badge/badge.d.ts +4 -4
  72. package/dist/src/components/badge/badge.js +2 -117
  73. package/dist/src/components/badge/badge.js.map +1 -1
  74. package/dist/src/components/bento-grid/bento-grid.css.js +16 -150
  75. package/dist/src/components/bento-grid/bento-grid.css.js.map +1 -1
  76. package/dist/src/components/bento-grid/bento-grid.d.ts +3 -3
  77. package/dist/src/components/bento-grid/bento-grid.js +10 -189
  78. package/dist/src/components/bento-grid/bento-grid.js.map +1 -1
  79. package/dist/src/components/bento-grid/bento-item.css.js +1 -338
  80. package/dist/src/components/bento-grid/bento-item.css.js.map +1 -1
  81. package/dist/src/components/bento-grid/bento-item.d.ts +3 -3
  82. package/dist/src/components/bento-grid/bento-item.js +10 -94
  83. package/dist/src/components/bento-grid/bento-item.js.map +1 -1
  84. package/dist/src/components/blockquote/blockquote.css.js +1 -54
  85. package/dist/src/components/blockquote/blockquote.css.js.map +1 -1
  86. package/dist/src/components/blockquote/blockquote.d.ts +2 -2
  87. package/dist/src/components/blockquote/blockquote.js +1 -44
  88. package/dist/src/components/blockquote/blockquote.js.map +1 -1
  89. package/dist/src/components/breadcrumb/breadcrumb.css.js +1 -168
  90. package/dist/src/components/breadcrumb/breadcrumb.css.js.map +1 -1
  91. package/dist/src/components/breadcrumb/breadcrumb.d.ts +5 -5
  92. package/dist/src/components/breadcrumb/breadcrumb.js +9 -166
  93. package/dist/src/components/breadcrumb/breadcrumb.js.map +1 -1
  94. package/dist/src/components/button/button.css.js +1 -843
  95. package/dist/src/components/button/button.css.js.map +1 -1
  96. package/dist/src/components/button/button.d.ts +5 -5
  97. package/dist/src/components/button/button.js +18 -420
  98. package/dist/src/components/button/button.js.map +1 -1
  99. package/dist/src/components/caption/caption.css.js +1 -29
  100. package/dist/src/components/caption/caption.css.js.map +1 -1
  101. package/dist/src/components/caption/caption.d.ts +3 -3
  102. package/dist/src/components/caption/caption.js +2 -36
  103. package/dist/src/components/caption/caption.js.map +1 -1
  104. package/dist/src/components/card-features/card-features.css.js +1 -120
  105. package/dist/src/components/card-features/card-features.css.js.map +1 -1
  106. package/dist/src/components/card-features/card-features.d.ts +3 -3
  107. package/dist/src/components/card-features/card-features.js +12 -145
  108. package/dist/src/components/card-features/card-features.js.map +1 -1
  109. package/dist/src/components/cards/card.css.js +1 -369
  110. package/dist/src/components/cards/card.css.js.map +1 -1
  111. package/dist/src/components/cards/card.d.ts +3 -3
  112. package/dist/src/components/cards/card.js +21 -312
  113. package/dist/src/components/cards/card.js.map +1 -1
  114. package/dist/src/components/carousel/carousel.css.js +1 -261
  115. package/dist/src/components/carousel/carousel.css.js.map +1 -1
  116. package/dist/src/components/carousel/carousel.d.ts +5 -5
  117. package/dist/src/components/carousel/carousel.js +13 -297
  118. package/dist/src/components/carousel/carousel.js.map +1 -1
  119. package/dist/src/components/checkbox/checkbox.css.js +1 -173
  120. package/dist/src/components/checkbox/checkbox.css.js.map +1 -1
  121. package/dist/src/components/checkbox/checkbox.d.ts +2 -2
  122. package/dist/src/components/checkbox/checkbox.js +5 -138
  123. package/dist/src/components/checkbox/checkbox.js.map +1 -1
  124. package/dist/src/components/code/code.css.js +1 -73
  125. package/dist/src/components/code/code.css.js.map +1 -1
  126. package/dist/src/components/code/code.d.ts +2 -2
  127. package/dist/src/components/code/code.js +4 -87
  128. package/dist/src/components/code/code.js.map +1 -1
  129. package/dist/src/components/compare/compare.css.js +1 -478
  130. package/dist/src/components/compare/compare.css.js.map +1 -1
  131. package/dist/src/components/compare/compare.d.ts +5 -5
  132. package/dist/src/components/compare/compare.js +23 -476
  133. package/dist/src/components/compare/compare.js.map +1 -1
  134. package/dist/src/components/comparison-panel/comparison-panel.css.js +1 -141
  135. package/dist/src/components/comparison-panel/comparison-panel.css.js.map +1 -1
  136. package/dist/src/components/comparison-panel/comparison-panel.d.ts +2 -2
  137. package/dist/src/components/comparison-panel/comparison-panel.js +18 -86
  138. package/dist/src/components/comparison-panel/comparison-panel.js.map +1 -1
  139. package/dist/src/components/compatibility-table/compatibility-table.css.js +1 -391
  140. package/dist/src/components/compatibility-table/compatibility-table.css.js.map +1 -1
  141. package/dist/src/components/compatibility-table/compatibility-table.d.ts +2 -2
  142. package/dist/src/components/compatibility-table/compatibility-table.js +26 -136
  143. package/dist/src/components/compatibility-table/compatibility-table.js.map +1 -1
  144. package/dist/src/components/cta-banner/cta-banner.css.js +1 -97
  145. package/dist/src/components/cta-banner/cta-banner.css.js.map +1 -1
  146. package/dist/src/components/cta-banner/cta-banner.d.ts +2 -2
  147. package/dist/src/components/cta-banner/cta-banner.js +8 -51
  148. package/dist/src/components/cta-banner/cta-banner.js.map +1 -1
  149. package/dist/src/components/display/display.css.js +1 -95
  150. package/dist/src/components/display/display.css.js.map +1 -1
  151. package/dist/src/components/display/display.d.ts +2 -2
  152. package/dist/src/components/display/display.js +3 -84
  153. package/dist/src/components/display/display.js.map +1 -1
  154. package/dist/src/components/divider/divider-horizontal.d.ts +2 -2
  155. package/dist/src/components/divider/divider-horizontal.js +4 -63
  156. package/dist/src/components/divider/divider-horizontal.js.map +1 -1
  157. package/dist/src/components/divider/divider-vertical.d.ts +2 -2
  158. package/dist/src/components/divider/divider-vertical.js +6 -61
  159. package/dist/src/components/divider/divider-vertical.js.map +1 -1
  160. package/dist/src/components/divider/divider.css.js +1 -20
  161. package/dist/src/components/divider/divider.css.js.map +1 -1
  162. package/dist/src/components/dropdown/dropdown.css.js +1 -121
  163. package/dist/src/components/dropdown/dropdown.css.js.map +1 -1
  164. package/dist/src/components/dropdown/dropdown.d.ts +5 -5
  165. package/dist/src/components/dropdown/dropdown.js +17 -283
  166. package/dist/src/components/dropdown/dropdown.js.map +1 -1
  167. package/dist/src/components/features/features.css.js +1 -123
  168. package/dist/src/components/features/features.css.js.map +1 -1
  169. package/dist/src/components/features/features.d.ts +5 -5
  170. package/dist/src/components/features/features.js +11 -71
  171. package/dist/src/components/features/features.js.map +1 -1
  172. package/dist/src/components/features-tab/features-tab.css.js +1 -100
  173. package/dist/src/components/features-tab/features-tab.css.js.map +1 -1
  174. package/dist/src/components/features-tab/features-tab.d.ts +5 -5
  175. package/dist/src/components/features-tab/features-tab.js +9 -70
  176. package/dist/src/components/features-tab/features-tab.js.map +1 -1
  177. package/dist/src/components/fieldset/fieldset.css.js +1 -28
  178. package/dist/src/components/fieldset/fieldset.css.js.map +1 -1
  179. package/dist/src/components/fieldset/fieldset.d.ts +2 -2
  180. package/dist/src/components/fieldset/fieldset.js +3 -31
  181. package/dist/src/components/fieldset/fieldset.js.map +1 -1
  182. package/dist/src/components/footer/footer-images.js +5 -27
  183. package/dist/src/components/footer/footer-images.js.map +1 -1
  184. package/dist/src/components/footer/footer-links-group.css.js +1 -33
  185. package/dist/src/components/footer/footer-links-group.css.js.map +1 -1
  186. package/dist/src/components/footer/footer-links-group.d.ts +3 -3
  187. package/dist/src/components/footer/footer-links-group.js +3 -32
  188. package/dist/src/components/footer/footer-links-group.js.map +1 -1
  189. package/dist/src/components/footer/footer-locale.js +1 -45
  190. package/dist/src/components/footer/footer-locale.js.map +1 -1
  191. package/dist/src/components/footer/footer-lp.d.ts +7 -7
  192. package/dist/src/components/footer/footer-lp.js +8 -121
  193. package/dist/src/components/footer/footer-lp.js.map +1 -1
  194. package/dist/src/components/footer/footer-nav-menu.css.js +1 -61
  195. package/dist/src/components/footer/footer-nav-menu.css.js.map +1 -1
  196. package/dist/src/components/footer/footer-nav-menu.d.ts +3 -3
  197. package/dist/src/components/footer/footer-nav-menu.js +3 -47
  198. package/dist/src/components/footer/footer-nav-menu.js.map +1 -1
  199. package/dist/src/components/footer/footer.css.js +1 -664
  200. package/dist/src/components/footer/footer.css.js.map +1 -1
  201. package/dist/src/components/footer/footer.d.ts +13 -13
  202. package/dist/src/components/footer/footer.js +20 -305
  203. package/dist/src/components/footer/footer.js.map +1 -1
  204. package/dist/src/components/footer/localeMap.js +1 -1
  205. package/dist/src/components/footer/localeMap.js.map +1 -1
  206. package/dist/src/components/grid/grid.css.js +1 -78
  207. package/dist/src/components/grid/grid.css.js.map +1 -1
  208. package/dist/src/components/grid/grid.d.ts +2 -2
  209. package/dist/src/components/grid/grid.js +9 -126
  210. package/dist/src/components/grid/grid.js.map +1 -1
  211. package/dist/src/components/header/header-code.css.js +1 -369
  212. package/dist/src/components/header/header-code.css.js.map +1 -1
  213. package/dist/src/components/header/header-code.d.ts +4 -4
  214. package/dist/src/components/header/header-code.js +15 -163
  215. package/dist/src/components/header/header-code.js.map +1 -1
  216. package/dist/src/components/header/header.css.js +1 -757
  217. package/dist/src/components/header/header.css.js.map +1 -1
  218. package/dist/src/components/header/header.d.ts +7 -7
  219. package/dist/src/components/header/header.js +4 -212
  220. package/dist/src/components/header/header.js.map +1 -1
  221. package/dist/src/components/heading/heading.css.js +1 -89
  222. package/dist/src/components/heading/heading.css.js.map +1 -1
  223. package/dist/src/components/heading/heading.d.ts +2 -2
  224. package/dist/src/components/heading/heading.js +1 -108
  225. package/dist/src/components/heading/heading.js.map +1 -1
  226. package/dist/src/components/help-text/help-text.css.js +1 -19
  227. package/dist/src/components/help-text/help-text.css.js.map +1 -1
  228. package/dist/src/components/help-text/help-text.d.ts +2 -2
  229. package/dist/src/components/help-text/help-text.js +3 -31
  230. package/dist/src/components/help-text/help-text.js.map +1 -1
  231. package/dist/src/components/hero/hero.css.js +1 -362
  232. package/dist/src/components/hero/hero.css.js.map +1 -1
  233. package/dist/src/components/hero/hero.d.ts +3 -3
  234. package/dist/src/components/hero/hero.js +12 -164
  235. package/dist/src/components/hero/hero.js.map +1 -1
  236. package/dist/src/components/highlight/highlight.css.js +1 -175
  237. package/dist/src/components/highlight/highlight.css.js.map +1 -1
  238. package/dist/src/components/highlight/highlight.d.ts +3 -3
  239. package/dist/src/components/highlight/highlight.js +4 -115
  240. package/dist/src/components/highlight/highlight.js.map +1 -1
  241. package/dist/src/components/icons/analysis-icon.d.ts +1 -1
  242. package/dist/src/components/icons/analysis-icon.js +2 -20
  243. package/dist/src/components/icons/analysis-icon.js.map +1 -1
  244. package/dist/src/components/icons/arrow-down-icon.d.ts +1 -1
  245. package/dist/src/components/icons/arrow-down-icon.js +2 -20
  246. package/dist/src/components/icons/arrow-down-icon.js.map +1 -1
  247. package/dist/src/components/icons/arrow-icon.d.ts +1 -1
  248. package/dist/src/components/icons/arrow-icon.js +2 -48
  249. package/dist/src/components/icons/arrow-icon.js.map +1 -1
  250. package/dist/src/components/icons/arrow-right-icon.d.ts +1 -1
  251. package/dist/src/components/icons/arrow-right-icon.js +2 -45
  252. package/dist/src/components/icons/arrow-right-icon.js.map +1 -1
  253. package/dist/src/components/icons/arrow-up-icon.d.ts +1 -1
  254. package/dist/src/components/icons/arrow-up-icon.js +2 -33
  255. package/dist/src/components/icons/arrow-up-icon.js.map +1 -1
  256. package/dist/src/components/icons/av-comparatives-icon.js +2 -31
  257. package/dist/src/components/icons/av-comparatives-icon.js.map +1 -1
  258. package/dist/src/components/icons/bd-ai-icon.js +2 -31
  259. package/dist/src/components/icons/bd-ai-icon.js.map +1 -1
  260. package/dist/src/components/icons/best-brands-icon.js +2 -31
  261. package/dist/src/components/icons/best-brands-icon.js.map +1 -1
  262. package/dist/src/components/icons/brand-signature-icon.d.ts +1 -1
  263. package/dist/src/components/icons/brand-signature-icon.js +2 -46
  264. package/dist/src/components/icons/brand-signature-icon.js.map +1 -1
  265. package/dist/src/components/icons/check-icon.d.ts +1 -1
  266. package/dist/src/components/icons/check-icon.js +2 -31
  267. package/dist/src/components/icons/check-icon.js.map +1 -1
  268. package/dist/src/components/icons/circle-info-icon.d.ts +1 -1
  269. package/dist/src/components/icons/circle-info-icon.js +2 -35
  270. package/dist/src/components/icons/circle-info-icon.js.map +1 -1
  271. package/dist/src/components/icons/close-icon.d.ts +1 -1
  272. package/dist/src/components/icons/close-icon.js +2 -20
  273. package/dist/src/components/icons/close-icon.js.map +1 -1
  274. package/dist/src/components/icons/enterprise-icon.d.ts +1 -1
  275. package/dist/src/components/icons/enterprise-icon.js +2 -22
  276. package/dist/src/components/icons/enterprise-icon.js.map +1 -1
  277. package/dist/src/components/icons/family-icon.d.ts +1 -1
  278. package/dist/src/components/icons/family-icon.js +2 -20
  279. package/dist/src/components/icons/family-icon.js.map +1 -1
  280. package/dist/src/components/icons/globe-icon.d.ts +1 -1
  281. package/dist/src/components/icons/globe-icon.js +2 -20
  282. package/dist/src/components/icons/globe-icon.js.map +1 -1
  283. package/dist/src/components/icons/guide-icon.d.ts +1 -1
  284. package/dist/src/components/icons/guide-icon.js +2 -20
  285. package/dist/src/components/icons/guide-icon.js.map +1 -1
  286. package/dist/src/components/icons/home-icon.d.ts +1 -1
  287. package/dist/src/components/icons/home-icon.js +2 -22
  288. package/dist/src/components/icons/home-icon.js.map +1 -1
  289. package/dist/src/components/icons/icon-element.js +1 -162
  290. package/dist/src/components/icons/icon-element.js.map +1 -1
  291. package/dist/src/components/icons/icons.d.ts +23 -23
  292. package/dist/src/components/icons/icons.js +1 -42
  293. package/dist/src/components/icons/individual-icon.d.ts +1 -1
  294. package/dist/src/components/icons/individual-icon.js +2 -20
  295. package/dist/src/components/icons/individual-icon.js.map +1 -1
  296. package/dist/src/components/icons/laurel-icon.d.ts +1 -1
  297. package/dist/src/components/icons/laurel-icon.js +2 -24
  298. package/dist/src/components/icons/laurel-icon.js.map +1 -1
  299. package/dist/src/components/icons/machine-learning-icon.d.ts +1 -1
  300. package/dist/src/components/icons/machine-learning-icon.js +2 -20
  301. package/dist/src/components/icons/machine-learning-icon.js.map +1 -1
  302. package/dist/src/components/icons/marks.d.ts +9 -9
  303. package/dist/src/components/icons/marks.js +1 -41
  304. package/dist/src/components/icons/minus-icon.d.ts +1 -1
  305. package/dist/src/components/icons/minus-icon.js +2 -19
  306. package/dist/src/components/icons/minus-icon.js.map +1 -1
  307. package/dist/src/components/icons/missing-icon.d.ts +1 -1
  308. package/dist/src/components/icons/missing-icon.js +3 -53
  309. package/dist/src/components/icons/missing-icon.js.map +1 -1
  310. package/dist/src/components/icons/pause-icon.d.ts +1 -1
  311. package/dist/src/components/icons/pause-icon.js +2 -22
  312. package/dist/src/components/icons/pause-icon.js.map +1 -1
  313. package/dist/src/components/icons/pc-mag-2024-icon.js +2 -31
  314. package/dist/src/components/icons/pc-mag-2024-icon.js.map +1 -1
  315. package/dist/src/components/icons/pc-mag-business-icon.js +2 -31
  316. package/dist/src/components/icons/pc-mag-business-icon.js.map +1 -1
  317. package/dist/src/components/icons/pc-mag-icon.js +2 -31
  318. package/dist/src/components/icons/pc-mag-icon.js.map +1 -1
  319. package/dist/src/components/icons/pc-mag-readers-icon.js +2 -30
  320. package/dist/src/components/icons/pc-mag-readers-icon.js.map +1 -1
  321. package/dist/src/components/icons/play-icon.d.ts +1 -1
  322. package/dist/src/components/icons/play-icon.js +2 -22
  323. package/dist/src/components/icons/play-icon.js.map +1 -1
  324. package/dist/src/components/icons/plus-icon.d.ts +1 -1
  325. package/dist/src/components/icons/plus-icon.js +2 -19
  326. package/dist/src/components/icons/plus-icon.js.map +1 -1
  327. package/dist/src/components/icons/quote-icon.d.ts +1 -1
  328. package/dist/src/components/icons/quote-icon.js +2 -30
  329. package/dist/src/components/icons/quote-icon.js.map +1 -1
  330. package/dist/src/components/icons/small-business-icon.d.ts +1 -1
  331. package/dist/src/components/icons/small-business-icon.js +2 -22
  332. package/dist/src/components/icons/small-business-icon.js.map +1 -1
  333. package/dist/src/components/icons/top-product-icon.js +2 -31
  334. package/dist/src/components/icons/top-product-icon.js.map +1 -1
  335. package/dist/src/components/image/image.css.js +1 -106
  336. package/dist/src/components/image/image.css.js.map +1 -1
  337. package/dist/src/components/image/image.d.ts +2 -2
  338. package/dist/src/components/image/image.js +10 -115
  339. package/dist/src/components/image/image.js.map +1 -1
  340. package/dist/src/components/input/input-clipboard.css.js +1 -93
  341. package/dist/src/components/input/input-clipboard.css.js.map +1 -1
  342. package/dist/src/components/input/input-clipboard.d.ts +5 -5
  343. package/dist/src/components/input/input-clipboard.js +20 -257
  344. package/dist/src/components/input/input-clipboard.js.map +1 -1
  345. package/dist/src/components/input/input.css.js +1 -9
  346. package/dist/src/components/input/input.css.js.map +1 -1
  347. package/dist/src/components/input/input.d.ts +4 -4
  348. package/dist/src/components/input/input.js +19 -202
  349. package/dist/src/components/input/input.js.map +1 -1
  350. package/dist/src/components/install-options/install-options.css.js +1 -308
  351. package/dist/src/components/install-options/install-options.css.js.map +1 -1
  352. package/dist/src/components/install-options/install-options.d.ts +4 -4
  353. package/dist/src/components/install-options/install-options.js +28 -159
  354. package/dist/src/components/install-options/install-options.js.map +1 -1
  355. package/dist/src/components/label/label.css.js +1 -33
  356. package/dist/src/components/label/label.css.js.map +1 -1
  357. package/dist/src/components/label/label.d.ts +3 -3
  358. package/dist/src/components/label/label.js +3 -135
  359. package/dist/src/components/label/label.js.map +1 -1
  360. package/dist/src/components/light-carousel/light-carousel.css.js +1 -270
  361. package/dist/src/components/light-carousel/light-carousel.css.js.map +1 -1
  362. package/dist/src/components/light-carousel/light-carousel.d.ts +3 -3
  363. package/dist/src/components/light-carousel/light-carousel.js +16 -181
  364. package/dist/src/components/light-carousel/light-carousel.js.map +1 -1
  365. package/dist/src/components/link/link.css.js +1 -288
  366. package/dist/src/components/link/link.css.js.map +1 -1
  367. package/dist/src/components/link/link.d.ts +3 -3
  368. package/dist/src/components/link/link.js +6 -233
  369. package/dist/src/components/link/link.js.map +1 -1
  370. package/dist/src/components/list/list-item/list-item.css.js +1 -167
  371. package/dist/src/components/list/list-item/list-item.css.js.map +1 -1
  372. package/dist/src/components/list/list-item/list-item.d.ts +3 -3
  373. package/dist/src/components/list/list-item/list-item.js +3 -122
  374. package/dist/src/components/list/list-item/list-item.js.map +1 -1
  375. package/dist/src/components/list/list.css.js +1 -180
  376. package/dist/src/components/list/list.css.js.map +1 -1
  377. package/dist/src/components/list/list.d.ts +1 -1
  378. package/dist/src/components/list/list.js +5 -82
  379. package/dist/src/components/list/list.js.map +1 -1
  380. package/dist/src/components/logo-marquee/logo-marquee.css.js +1 -93
  381. package/dist/src/components/logo-marquee/logo-marquee.css.js.map +1 -1
  382. package/dist/src/components/logo-marquee/logo-marquee.d.ts +4 -3
  383. package/dist/src/components/logo-marquee/logo-marquee.js +6 -136
  384. package/dist/src/components/logo-marquee/logo-marquee.js.map +1 -1
  385. package/dist/src/components/modal/modal.css.js +1 -203
  386. package/dist/src/components/modal/modal.css.js.map +1 -1
  387. package/dist/src/components/modal/modal.d.ts +3 -3
  388. package/dist/src/components/modal/modal.js +3 -131
  389. package/dist/src/components/modal/modal.js.map +1 -1
  390. package/dist/src/components/motion-art/motion-art.d.ts +1 -1
  391. package/dist/src/components/motion-art/motion-art.js +1 -114
  392. package/dist/src/components/motion-art/motion-art.js.map +1 -1
  393. package/dist/src/components/overview/overview.css.js +1 -125
  394. package/dist/src/components/overview/overview.css.js.map +1 -1
  395. package/dist/src/components/overview/overview.d.ts +2 -2
  396. package/dist/src/components/overview/overview.js +9 -50
  397. package/dist/src/components/overview/overview.js.map +1 -1
  398. package/dist/src/components/page-switcher/page-switcher.css.js +1 -174
  399. package/dist/src/components/page-switcher/page-switcher.css.js.map +1 -1
  400. package/dist/src/components/page-switcher/page-switcher.d.ts +2 -2
  401. package/dist/src/components/page-switcher/page-switcher.js +6 -62
  402. package/dist/src/components/page-switcher/page-switcher.js.map +1 -1
  403. package/dist/src/components/pagination-dots/pagination-dots.css.js +1 -160
  404. package/dist/src/components/pagination-dots/pagination-dots.css.js.map +1 -1
  405. package/dist/src/components/pagination-dots/pagination-dots.d.ts +2 -2
  406. package/dist/src/components/pagination-dots/pagination-dots.js +10 -210
  407. package/dist/src/components/pagination-dots/pagination-dots.js.map +1 -1
  408. package/dist/src/components/paragraph/paragraph.css.js +1 -101
  409. package/dist/src/components/paragraph/paragraph.css.js.map +1 -1
  410. package/dist/src/components/paragraph/paragraph.d.ts +2 -2
  411. package/dist/src/components/paragraph/paragraph.js +3 -119
  412. package/dist/src/components/paragraph/paragraph.js.map +1 -1
  413. package/dist/src/components/partner-banner/partner-banner.css.js +1 -245
  414. package/dist/src/components/partner-banner/partner-banner.css.js.map +1 -1
  415. package/dist/src/components/partner-banner/partner-banner.d.ts +1 -1
  416. package/dist/src/components/partner-banner/partner-banner.js +6 -81
  417. package/dist/src/components/partner-banner/partner-banner.js.map +1 -1
  418. package/dist/src/components/picture/picture.css.js +1 -208
  419. package/dist/src/components/picture/picture.css.js.map +1 -1
  420. package/dist/src/components/picture/picture.d.ts +2 -2
  421. package/dist/src/components/picture/picture.js +14 -186
  422. package/dist/src/components/picture/picture.js.map +1 -1
  423. package/dist/src/components/post-card/post-card.css.js +1 -149
  424. package/dist/src/components/post-card/post-card.css.js.map +1 -1
  425. package/dist/src/components/post-card/post-card.d.ts +2 -2
  426. package/dist/src/components/post-card/post-card.js +5 -97
  427. package/dist/src/components/post-card/post-card.js.map +1 -1
  428. package/dist/src/components/pricing-cards/adopt-styles.js +1 -18
  429. package/dist/src/components/pricing-cards/adopt-styles.js.map +1 -1
  430. package/dist/src/components/pricing-cards/new-pricing-card.d.ts +2 -2
  431. package/dist/src/components/pricing-cards/new-pricing-card.js +4 -49
  432. package/dist/src/components/pricing-cards/new-pricing-card.js.map +1 -1
  433. package/dist/src/components/pricing-cards/new-pricing.css.js +1 -74
  434. package/dist/src/components/pricing-cards/new-pricing.css.js.map +1 -1
  435. package/dist/src/components/pricing-cards/pricing-card-actions.css.js +1 -11
  436. package/dist/src/components/pricing-cards/pricing-card-actions.css.js.map +1 -1
  437. package/dist/src/components/pricing-cards/pricing-card-actions.d.ts +2 -2
  438. package/dist/src/components/pricing-cards/pricing-card-actions.js +2 -59
  439. package/dist/src/components/pricing-cards/pricing-card-actions.js.map +1 -1
  440. package/dist/src/components/pricing-cards/pricing-card-container.css.js +1 -41
  441. package/dist/src/components/pricing-cards/pricing-card-container.css.js.map +1 -1
  442. package/dist/src/components/pricing-cards/pricing-card-container.d.ts +1 -1
  443. package/dist/src/components/pricing-cards/pricing-card-container.js +2 -40
  444. package/dist/src/components/pricing-cards/pricing-card-container.js.map +1 -1
  445. package/dist/src/components/pricing-cards/pricing-card-header.css.js +1 -82
  446. package/dist/src/components/pricing-cards/pricing-card-header.css.js.map +1 -1
  447. package/dist/src/components/pricing-cards/pricing-card-header.d.ts +5 -5
  448. package/dist/src/components/pricing-cards/pricing-card-header.js +7 -70
  449. package/dist/src/components/pricing-cards/pricing-card-header.js.map +1 -1
  450. package/dist/src/components/pricing-cards/pricing-card-pricing.css.js +1 -92
  451. package/dist/src/components/pricing-cards/pricing-card-pricing.css.js.map +1 -1
  452. package/dist/src/components/pricing-cards/pricing-card-pricing.d.ts +6 -6
  453. package/dist/src/components/pricing-cards/pricing-card-pricing.js +7 -87
  454. package/dist/src/components/pricing-cards/pricing-card-pricing.js.map +1 -1
  455. package/dist/src/components/pricing-cards/pricing-card-show-more.css.js +1 -29
  456. package/dist/src/components/pricing-cards/pricing-card-show-more.css.js.map +1 -1
  457. package/dist/src/components/pricing-cards/pricing-card-show-more.d.ts +4 -4
  458. package/dist/src/components/pricing-cards/pricing-card-show-more.js +5 -41
  459. package/dist/src/components/pricing-cards/pricing-card-show-more.js.map +1 -1
  460. package/dist/src/components/pricing-cards/pricing-card.css.js +1 -660
  461. package/dist/src/components/pricing-cards/pricing-card.css.js.map +1 -1
  462. package/dist/src/components/pricing-cards/pricing-card.d.ts +7 -7
  463. package/dist/src/components/pricing-cards/pricing-card.js +53 -639
  464. package/dist/src/components/pricing-cards/pricing-card.js.map +1 -1
  465. package/dist/src/components/pricing-cards/pricing-feature-item.css.js +1 -34
  466. package/dist/src/components/pricing-cards/pricing-feature-item.css.js.map +1 -1
  467. package/dist/src/components/pricing-cards/pricing-feature-item.d.ts +2 -2
  468. package/dist/src/components/pricing-cards/pricing-feature-item.js +2 -22
  469. package/dist/src/components/pricing-cards/pricing-feature-item.js.map +1 -1
  470. package/dist/src/components/process-steps/process-steps.css.js +1 -106
  471. package/dist/src/components/process-steps/process-steps.css.js.map +1 -1
  472. package/dist/src/components/process-steps/process-steps.d.ts +5 -5
  473. package/dist/src/components/process-steps/process-steps.js +10 -78
  474. package/dist/src/components/process-steps/process-steps.js.map +1 -1
  475. package/dist/src/components/progress/progress.css.js +1 -123
  476. package/dist/src/components/progress/progress.css.js.map +1 -1
  477. package/dist/src/components/progress/progress.d.ts +2 -2
  478. package/dist/src/components/progress/progress.js +6 -72
  479. package/dist/src/components/progress/progress.js.map +1 -1
  480. package/dist/src/components/quick-answer/quick-answer.css.js +1 -130
  481. package/dist/src/components/quick-answer/quick-answer.css.js.map +1 -1
  482. package/dist/src/components/quick-answer/quick-answer.d.ts +2 -2
  483. package/dist/src/components/quick-answer/quick-answer.js +9 -49
  484. package/dist/src/components/quick-answer/quick-answer.js.map +1 -1
  485. package/dist/src/components/radio/radio-group.css.js +1 -41
  486. package/dist/src/components/radio/radio-group.css.js.map +1 -1
  487. package/dist/src/components/radio/radio-group.d.ts +1 -1
  488. package/dist/src/components/radio/radio-group.js +5 -92
  489. package/dist/src/components/radio/radio-group.js.map +1 -1
  490. package/dist/src/components/radio/radio.css.js +1 -193
  491. package/dist/src/components/radio/radio.css.js.map +1 -1
  492. package/dist/src/components/radio/radio.d.ts +4 -4
  493. package/dist/src/components/radio/radio.js +6 -263
  494. package/dist/src/components/radio/radio.js.map +1 -1
  495. package/dist/src/components/radio/toggle-radio.d.ts +2 -2
  496. package/dist/src/components/radio/toggle-radio.js +3 -39
  497. package/dist/src/components/radio/toggle-radio.js.map +1 -1
  498. package/dist/src/components/review/review-grid.css.js +1 -46
  499. package/dist/src/components/review/review-grid.css.js.map +1 -1
  500. package/dist/src/components/review/review-grid.d.ts +2 -2
  501. package/dist/src/components/review/review-grid.js +4 -49
  502. package/dist/src/components/review/review-grid.js.map +1 -1
  503. package/dist/src/components/review/review.css.js +1 -54
  504. package/dist/src/components/review/review.css.js.map +1 -1
  505. package/dist/src/components/review/review.d.ts +2 -2
  506. package/dist/src/components/review/review.js +2 -59
  507. package/dist/src/components/review/review.js.map +1 -1
  508. package/dist/src/components/section/section.css.js +1 -37
  509. package/dist/src/components/section/section.css.js.map +1 -1
  510. package/dist/src/components/section/section.d.ts +1 -1
  511. package/dist/src/components/section/section.js +1 -50
  512. package/dist/src/components/section/section.js.map +1 -1
  513. package/dist/src/components/section-header/section-header.css.js +1 -99
  514. package/dist/src/components/section-header/section-header.css.js.map +1 -1
  515. package/dist/src/components/section-header/section-header.d.ts +2 -2
  516. package/dist/src/components/section-header/section-header.js +4 -85
  517. package/dist/src/components/section-header/section-header.js.map +1 -1
  518. package/dist/src/components/shared/announcer.d.ts +1 -1
  519. package/dist/src/components/shared/announcer.js +1 -34
  520. package/dist/src/components/shared/announcer.js.map +1 -1
  521. package/dist/src/components/shared/controller.media-query.d.ts +1 -1
  522. package/dist/src/components/shared/controller.media-query.js +1 -57
  523. package/dist/src/components/shared/controller.media-query.js.map +1 -1
  524. package/dist/src/components/shared/define-element.js +1 -16
  525. package/dist/src/components/shared/define-element.js.map +1 -1
  526. package/dist/src/components/shared/ensemble.css.js +1 -101
  527. package/dist/src/components/shared/ensemble.css.js.map +1 -1
  528. package/dist/src/components/shared/events.js +0 -13
  529. package/dist/src/components/shared/fill-width.css.js +2 -27
  530. package/dist/src/components/shared/fill-width.css.js.map +1 -1
  531. package/dist/src/components/shared/form-control.d.ts +1 -1
  532. package/dist/src/components/shared/form-control.js +1 -198
  533. package/dist/src/components/shared/form-control.js.map +1 -1
  534. package/dist/src/components/shared/form-field.css.js +1 -258
  535. package/dist/src/components/shared/form-field.css.js.map +1 -1
  536. package/dist/src/components/shared/prop-vocabulary.js +1 -49
  537. package/dist/src/components/shared/prop-vocabulary.js.map +1 -1
  538. package/dist/src/components/shared/token-scales.js +1 -351
  539. package/dist/src/components/shared/token-scales.js.map +1 -1
  540. package/dist/src/components/skeleton/skeleton.css.js +1 -32
  541. package/dist/src/components/skeleton/skeleton.css.js.map +1 -1
  542. package/dist/src/components/skeleton/skeleton.d.ts +2 -2
  543. package/dist/src/components/skeleton/skeleton.js +4 -36
  544. package/dist/src/components/skeleton/skeleton.js.map +1 -1
  545. package/dist/src/components/spinner/spinner.css.js +1 -87
  546. package/dist/src/components/spinner/spinner.css.js.map +1 -1
  547. package/dist/src/components/spinner/spinner.d.ts +3 -3
  548. package/dist/src/components/spinner/spinner.js +3 -69
  549. package/dist/src/components/spinner/spinner.js.map +1 -1
  550. package/dist/src/components/spotlight-section/spotlight-section.css.js +1 -105
  551. package/dist/src/components/spotlight-section/spotlight-section.css.js.map +1 -1
  552. package/dist/src/components/spotlight-section/spotlight-section.d.ts +2 -2
  553. package/dist/src/components/spotlight-section/spotlight-section.js +11 -72
  554. package/dist/src/components/spotlight-section/spotlight-section.js.map +1 -1
  555. package/dist/src/components/stat/stat-highlight.js +6 -82
  556. package/dist/src/components/stat/stat-highlight.js.map +1 -1
  557. package/dist/src/components/stat/stat-tile.js +5 -52
  558. package/dist/src/components/stat/stat-tile.js.map +1 -1
  559. package/dist/src/components/stat/stat.css.js +1 -145
  560. package/dist/src/components/stat/stat.css.js.map +1 -1
  561. package/dist/src/components/stat/stat.d.ts +2 -2
  562. package/dist/src/components/stat/stat.js +1 -3
  563. package/dist/src/components/switch/switch.css.js +1 -175
  564. package/dist/src/components/switch/switch.css.js.map +1 -1
  565. package/dist/src/components/switch/switch.d.ts +4 -4
  566. package/dist/src/components/switch/switch.js +4 -99
  567. package/dist/src/components/switch/switch.js.map +1 -1
  568. package/dist/src/components/tab-list/tab-list.css.js +1 -289
  569. package/dist/src/components/tab-list/tab-list.css.js.map +1 -1
  570. package/dist/src/components/tab-list/tab-list.d.ts +1 -1
  571. package/dist/src/components/tab-list/tab-list.js +13 -191
  572. package/dist/src/components/tab-list/tab-list.js.map +1 -1
  573. package/dist/src/components/tabs/tabs.css.js +1 -77
  574. package/dist/src/components/tabs/tabs.css.js.map +1 -1
  575. package/dist/src/components/tabs/tabs.d.ts +6 -6
  576. package/dist/src/components/tabs/tabs.js +8 -220
  577. package/dist/src/components/tabs/tabs.js.map +1 -1
  578. package/dist/src/components/tag/tag.css.js +1 -52
  579. package/dist/src/components/tag/tag.css.js.map +1 -1
  580. package/dist/src/components/tag/tag.d.ts +2 -2
  581. package/dist/src/components/tag/tag.js +2 -37
  582. package/dist/src/components/tag/tag.js.map +1 -1
  583. package/dist/src/components/terminal/terminal-cursor.js +1 -65
  584. package/dist/src/components/terminal/terminal-cursor.js.map +1 -1
  585. package/dist/src/components/terminal/terminal-message.css.js +1 -409
  586. package/dist/src/components/terminal/terminal-message.css.js.map +1 -1
  587. package/dist/src/components/terminal/terminal-message.d.ts +5 -5
  588. package/dist/src/components/terminal/terminal-message.js +28 -183
  589. package/dist/src/components/terminal/terminal-message.js.map +1 -1
  590. package/dist/src/components/termsOfUse/terms.css.js +1 -55
  591. package/dist/src/components/termsOfUse/terms.css.js.map +1 -1
  592. package/dist/src/components/termsOfUse/terms.d.ts +5 -5
  593. package/dist/src/components/termsOfUse/terms.js +9 -82
  594. package/dist/src/components/termsOfUse/terms.js.map +1 -1
  595. package/dist/src/components/textarea/textarea.css.js +1 -49
  596. package/dist/src/components/textarea/textarea.css.js.map +1 -1
  597. package/dist/src/components/textarea/textarea.d.ts +5 -5
  598. package/dist/src/components/textarea/textarea.js +15 -160
  599. package/dist/src/components/textarea/textarea.js.map +1 -1
  600. package/dist/src/components/tooltip/tooltip.css.js +1 -96
  601. package/dist/src/components/tooltip/tooltip.css.js.map +1 -1
  602. package/dist/src/components/tooltip/tooltip.d.ts +2 -2
  603. package/dist/src/components/tooltip/tooltip.js +5 -285
  604. package/dist/src/components/tooltip/tooltip.js.map +1 -1
  605. package/dist/src/components/trust-panel/trust-panel.css.js +1 -228
  606. package/dist/src/components/trust-panel/trust-panel.css.js.map +1 -1
  607. package/dist/src/components/trust-panel/trust-panel.d.ts +4 -4
  608. package/dist/src/components/trust-panel/trust-panel.js +25 -104
  609. package/dist/src/components/trust-panel/trust-panel.js.map +1 -1
  610. package/dist/src/components/video/video.css.js +1 -20
  611. package/dist/src/components/video/video.css.js.map +1 -1
  612. package/dist/src/components/video/video.d.ts +2 -2
  613. package/dist/src/components/video/video.js +5 -88
  614. package/dist/src/components/video/video.js.map +1 -1
  615. package/dist/src/components/video-player/video-player.css.js +1 -167
  616. package/dist/src/components/video-player/video-player.css.js.map +1 -1
  617. package/dist/src/components/video-player/video-player.d.ts +2 -2
  618. package/dist/src/components/video-player/video-player.js +15 -150
  619. package/dist/src/components/video-player/video-player.js.map +1 -1
  620. package/dist/src/components/visually-hidden/visually-hidden.css.js +1 -22
  621. package/dist/src/components/visually-hidden/visually-hidden.css.js.map +1 -1
  622. package/dist/src/components/visually-hidden/visually-hidden.d.ts +2 -2
  623. package/dist/src/components/visually-hidden/visually-hidden.js +2 -22
  624. package/dist/src/components/visually-hidden/visually-hidden.js.map +1 -1
  625. package/dist/src/tokens/brand-layer.js +8 -162
  626. package/dist/src/tokens/brand-layer.js.map +1 -1
  627. package/dist/src/tokens/dark-derivation.js +1 -325
  628. package/dist/src/tokens/dark-derivation.js.map +1 -1
  629. package/dist/src/tokens/dark-findings.d.ts +1 -1
  630. package/dist/src/tokens/dark-findings.js +1 -204
  631. package/dist/src/tokens/dark-findings.js.map +1 -1
  632. package/dist/src/tokens/fonts.css +1 -166
  633. package/dist/src/tokens/layout.css +1 -61
  634. package/dist/src/tokens/story-chrome.js +27 -221
  635. package/dist/src/tokens/story-chrome.js.map +1 -1
  636. package/dist/src/tokens/themes/bitdefender.js +1 -30
  637. package/dist/src/tokens/themes/bitdefender.js.map +1 -1
  638. package/dist/src/tokens/themes/contract.js +1 -7
  639. package/dist/src/tokens/themes/contract.js.map +1 -1
  640. package/dist/src/tokens/themes/index.js +1 -39
  641. package/dist/src/tokens/themes/index.js.map +1 -1
  642. package/dist/src/tokens/token-map.js +1 -236
  643. package/dist/src/tokens/token-map.js.map +1 -1
  644. package/dist/src/tokens/token-purposes.js +1 -259
  645. package/dist/src/tokens/token-purposes.js.map +1 -1
  646. package/dist/src/tokens/tokens.css +1 -1809
  647. package/dist/src/tokens/tokens.js +1 -1865
  648. package/dist/src/tokens/tokens.js.map +1 -1
  649. package/dist/src/tokens/type-ceiling-words.js +1 -293
  650. package/dist/src/tokens/type-ceiling-words.js.map +1 -1
  651. package/package.json +14 -3
  652. package/schemas/component-manifest.json +1 -1
  653. package/dist/src/components/icons/icons.js.map +0 -1
  654. package/dist/src/components/icons/marks.js.map +0 -1
  655. package/dist/src/components/shared/events.js.map +0 -1
  656. package/dist/src/components/stat/stat.js.map +0 -1
@@ -1,237 +1,2 @@
1
- /**
2
- * The analysis behind Foundations/Token Map, kept free of Lit and the DOM so
3
- * the same functions run in Storybook and under Node: the page renders what
4
- * this returns, and nothing on the page is transcribed by hand.
5
- *
6
- * Inputs are text, not live objects: the generated tokens.css, the tier
7
- * registry in scripts/token-tiers.json, and the raw source of every file that
8
- * might read a token. Component CSS sits inside shadow roots, which is why the
9
- * other Foundations pages can only count token-to-token references; reading the
10
- * source is what lets this page say which component reads a token.
11
- *
12
- * Not a story file: Storybook only globs *.stories.js.
13
- */
14
- /** Blank comments, keeping offsets, so commented-out CSS is never read. */
15
- export const blankComments = (text) => text.replace(/\/\*[\s\S]*?\*\//g, c => c.replace(/[^\n]/g, ' '));
16
- /** name -> raw declared value, in declaration order. */
17
- export function declarationsFrom(cssText) {
18
- const out = new Map();
19
- for (const m of blankComments(cssText).matchAll(/(?:^|[\s;{])(--[A-Za-z0-9-]+)\s*:\s*([^;]*);/g)) {
20
- if (!out.has(m[1]))
21
- out.set(m[1], m[2].replace(/\s+/g, ' ').trim());
22
- }
23
- return out;
24
- }
25
- /** Every custom property a value refers to. */
26
- export const refsOf = (value) => [...value.matchAll(/var\(\s*(--[A-Za-z0-9-]+)/g)].map(m => m[1]);
27
- /** The family a token belongs to: the longest matching registry prefix. */
28
- export function familyOf(token, families) {
29
- let best = null;
30
- for (const f of families) {
31
- if (token.startsWith(f.prefix) && (!best || f.prefix.length > best.prefix.length))
32
- best = f;
33
- }
34
- return best;
35
- }
36
- /**
37
- * The alias chain from a token down to its value. Follows the reference while
38
- * the value is exactly one var(); a value that combines references
39
- * (color-mix, a shorthand, a clamp) ends the chain and is reported as compound.
40
- */
41
- export function chainOf(token, decls) {
42
- const hops = [token];
43
- let value = decls.get(token);
44
- while (value !== undefined) {
45
- const only = value.match(/^var\(\s*(--[A-Za-z0-9-]+)\s*\)$/);
46
- if (!only || !decls.has(only[1]) || hops.includes(only[1]))
47
- break;
48
- hops.push(only[1]);
49
- value = decls.get(only[1]);
50
- }
51
- const compound = value !== undefined && refsOf(value).length > 0;
52
- return { hops, value: value ?? '', compound };
53
- }
54
- /**
55
- * Who reads each token, from raw source text keyed by path.
56
- *
57
- * Three ways a token is read, and all three are real in this package:
58
- * var(--x) the ordinary case
59
- * '--x' a name held as data -- token-scales.ts maps
60
- * color="muted" to '--color-text-muted' this way
61
- * '--spacing-' a prefix the scale helpers complete at runtime, so a
62
- * step may be read without its full name appearing
63
- * The third is reported separately: it says a token can be reached, not that
64
- * anything reaches it.
65
- */
66
- export function consumersFrom(sources, ownerOf) {
67
- const readers = new Map();
68
- const prefixes = new Map();
69
- const add = (map, key, owner) => {
70
- if (!map.has(key))
71
- map.set(key, new Set());
72
- map.get(key).add(owner);
73
- };
74
- for (const [path, raw] of Object.entries(sources)) {
75
- const text = blankComments(raw);
76
- const owner = ownerOf(path);
77
- for (const m of text.matchAll(/var\(\s*(--[A-Za-z0-9-]+)/g))
78
- add(readers, m[1], owner);
79
- for (const m of text.matchAll(/['"`](--[A-Za-z0-9-]*[A-Za-z0-9])['"`]/g))
80
- add(readers, m[1], owner);
81
- /* documentation looks tokens up by prefix to list them, which is not a
82
- product being able to reach one */
83
- if (owner === DOCS)
84
- continue;
85
- for (const m of text.matchAll(/['"`](--[A-Za-z0-9-]+-)['"`$]/g))
86
- add(prefixes, m[1], owner);
87
- for (const m of text.matchAll(/var\(\s*(--[A-Za-z0-9-]+-)\$\{/g))
88
- add(prefixes, m[1], owner);
89
- }
90
- return { readers, prefixes };
91
- }
92
- const TIER_RANK = { primitive: 0, semantic: 1, component: 2 };
93
- /** The owner name ownerOf() should return for documentation sources. */
94
- export const DOCS = 'stories';
95
- /**
96
- * Everything the page shows. `sources` is { path: text }; `ownerOf` turns a
97
- * path into the name shown in "read by".
98
- */
99
- export function analyse({ cssText, registry, sources, ownerOf }) {
100
- const decls = declarationsFrom(cssText);
101
- const families = registry.families;
102
- const { readers, prefixes } = consumersFrom(sources, ownerOf);
103
- const byToken = new Map();
104
- for (const [name, value] of decls) {
105
- const family = familyOf(name, families);
106
- const chain = chainOf(name, decls);
107
- const tokenReaders = new Set();
108
- for (const [other, v] of decls)
109
- if (other !== name && refsOf(v).includes(name))
110
- tokenReaders.add(other);
111
- const reachable = new Set();
112
- for (const [prefix, owners] of prefixes)
113
- if (name.startsWith(prefix))
114
- owners.forEach(o => reachable.add(o));
115
- byToken.set(name, {
116
- name,
117
- value,
118
- family,
119
- tier: family?.tier ?? 'unassigned',
120
- chain,
121
- tokenReaders,
122
- sourceReaders: readers.get(name) ?? new Set(),
123
- reachable
124
- });
125
- }
126
- const rows = [...byToken.values()];
127
- const roleOf = (name) => name.replace(/-[A-Za-z]+$/, '');
128
- /* Tier skips: a component token whose first hop is a primitive. Grouped by
129
- the primitive family reached, because the answer differs by family: a
130
- colour primitive has semantic roles above it that the token could have
131
- asked for, and --spacing-* has none -- its roles were deleted on purpose.
132
- Inversions: a token whose first hop is a HIGHER tier than itself. */
133
- const tierSkips = new Map();
134
- const inversions = [];
135
- for (const r of rows) {
136
- const firstHop = r.chain.hops[1] ?? refsOf(r.value)[0];
137
- const target = firstHop && byToken.get(firstHop);
138
- if (!target)
139
- continue;
140
- if (r.tier === 'component' && target.tier === 'primitive') {
141
- const key = target.family.prefix;
142
- if (!tierSkips.has(key))
143
- tierSkips.set(key, []);
144
- tierSkips.get(key).push({ row: r, target });
145
- }
146
- if (TIER_RANK[target.tier] > TIER_RANK[r.tier])
147
- inversions.push({ row: r, target });
148
- }
149
- /* For each skipped-to family, the semantic tokens that do sit above it --
150
- the roles a skipping token could have asked for instead. A count, not a
151
- verdict: --spacing-* has two (the card roles), and that is not a spacing
152
- vocabulary. */
153
- const rolesAbove = (prefix) => rows.filter(r => r.tier === 'semantic' &&
154
- r.chain.hops.slice(1).some(h => byToken.get(h)?.family?.prefix === prefix));
155
- const skips = [...tierSkips].map(([prefix, list]) => ({ prefix, list, rolesAbove: rolesAbove(prefix) }))
156
- .sort((a, b) => b.list.length - a.list.length);
157
- /* Unread, split by what it means:
158
- unread semantic or component, and nothing reads it -- the
159
- case that retired display-hero and two status tokens
160
- docsOnly read by a story and nothing else
161
- unreadAxes one axis of a typography role whose other axes are
162
- read; a role declares five and a consumer may want two
163
- reachableOnly nothing names it, but a scale helper can build its name
164
- unreadSteps a primitive step nothing reads; a scale is allowed to
165
- be complete */
166
- const unread = [];
167
- const docsOnly = [];
168
- const unreadAxes = [];
169
- const reachableOnly = [];
170
- const unreadSteps = [];
171
- const productRead = (r) => r.tokenReaders.size > 0 || [...r.sourceReaders].some(o => o !== DOCS);
172
- for (const r of rows) {
173
- if (productRead(r))
174
- continue;
175
- if (r.reachable.size) {
176
- reachableOnly.push(r);
177
- continue;
178
- }
179
- if (r.sourceReaders.has(DOCS)) {
180
- docsOnly.push(r);
181
- continue;
182
- }
183
- if (r.tier === 'primitive') {
184
- unreadSteps.push(r);
185
- continue;
186
- }
187
- const isRoleAxis = r.tier === 'semantic' && r.name.startsWith('--typography-');
188
- const siblingRead = isRoleAxis && rows.some(o => o !== r && roleOf(o.name) === roleOf(r.name) && productRead(o));
189
- (siblingRead ? unreadAxes : unread).push(r);
190
- }
191
- /* semantic tokens declared as a literal: no primitive beneath them */
192
- const literalSemantics = rows.filter(r => r.tier === 'semantic' && refsOf(r.value).length === 0);
193
- /* Same colour, two semantic names in one family, differing in exactly one
194
- segment. Split by WHICH segment differs:
195
- sameSlot a middle segment -- --status-brand-surface and
196
- --status-info-surface: one slot, two tones, one colour. This
197
- is the kind that collided twice.
198
- sameRole the last segment -- --color-surface-muted and -disabled: two
199
- jobs that happen to share a value, which CLAUDE.md says is
200
- expected and must not drive a choice. Listed, not flagged. */
201
- const slots = new Map();
202
- const sameRole = [];
203
- const colour = rows.filter(r => r.tier === 'semantic' && !r.chain.compound &&
204
- byToken.get(r.chain.hops.at(-1))?.family?.prefix?.startsWith('--color-') &&
205
- byToken.get(r.chain.hops.at(-1))?.tier === 'primitive');
206
- const segs = (n) => n.slice(2).split('-');
207
- for (let i = 0; i < colour.length; i++) {
208
- for (let j = i + 1; j < colour.length; j++) {
209
- const a = colour[i], b = colour[j];
210
- if (a.family !== b.family || a.chain.hops.at(-1) !== b.chain.hops.at(-1))
211
- continue;
212
- const sa = segs(a.name), sb = segs(b.name);
213
- if (sa.length !== sb.length)
214
- continue;
215
- const diff = sa.map((s, k) => s !== sb[k]);
216
- if (diff.filter(Boolean).length !== 1)
217
- continue;
218
- if (diff.at(-1)) {
219
- sameRole.push({ a, b, primitive: a.chain.hops.at(-1) });
220
- continue;
221
- }
222
- /* one line per slot: --status-*-surface -> blue-50: brand, info */
223
- const k = diff.indexOf(true);
224
- const pattern = `--${sa.map((s, n) => (n === k ? '*' : s)).join('-')}`;
225
- const key = `${pattern}|${a.chain.hops.at(-1)}`;
226
- if (!slots.has(key))
227
- slots.set(key, { pattern, primitive: a.chain.hops.at(-1), members: new Set() });
228
- slots.get(key).members.add(sa[k]).add(sb[k]);
229
- }
230
- }
231
- const sameSlot = [...slots.values()].map(g => ({ ...g, members: [...g.members] }));
232
- return {
233
- rows, decls,
234
- flags: { tierSkips: skips, inversions, unread, docsOnly, unreadAxes, reachableOnly, unreadSteps, literalSemantics, sameSlot, sameRole }
235
- };
236
- }
1
+ var e=e=>e.replace(/\/\*[\s\S]*?\*\//g,e=>e.replace(/[^\n]/g,` `));function t(t){let n=/* @__PURE__ */ new Map;for(let r of e(t).matchAll(/(?:^|[\s;{])(--[A-Za-z0-9-]+)\s*:\s*([^;]*);/g))n.has(r[1])||n.set(r[1],r[2].replace(/\s+/g,` `).trim());return n}var n=e=>[...e.matchAll(/var\(\s*(--[A-Za-z0-9-]+)/g)].map(e=>e[1]);function r(e,t){let n=null;for(let r of t)e.startsWith(r.prefix)&&(!n||r.prefix.length>n.prefix.length)&&(n=r);return n}function i(e,t){let r=[e],i=t.get(e);for(;i!==void 0;){let e=i.match(/^var\(\s*(--[A-Za-z0-9-]+)\s*\)$/);if(!e||!t.has(e[1])||r.includes(e[1]))break;r.push(e[1]),i=t.get(e[1])}let a=i!==void 0&&n(i).length>0;return{hops:r,value:i??``,compound:a}}function a(t,n){let r=/* @__PURE__ */ new Map,i=/* @__PURE__ */ new Map,a=(e,t,n)=>{e.has(t)||e.set(t,/* @__PURE__ */ new Set),e.get(t).add(n)};for(let[o,s]of Object.entries(t)){let t=e(s),c=n(o);for(let e of t.matchAll(/var\(\s*(--[A-Za-z0-9-]+)/g))a(r,e[1],c);for(let e of t.matchAll(/['"`](--[A-Za-z0-9-]*[A-Za-z0-9])['"`]/g))a(r,e[1],c);if(c!==`stories`){for(let e of t.matchAll(/['"`](--[A-Za-z0-9-]+-)['"`$]/g))a(i,e[1],c);for(let e of t.matchAll(/var\(\s*(--[A-Za-z0-9-]+-)\$\{/g))a(i,e[1],c)}}return{readers:r,prefixes:i}}var o={primitive:0,semantic:1,component:2},s=`stories`;function c({cssText:e,registry:s,sources:c,ownerOf:l}){let u=t(e),d=s.families,{readers:f,prefixes:p}=a(c,l),m=/* @__PURE__ */ new Map;for(let[e,t]of u){let a=r(e,d),o=i(e,u),s=/* @__PURE__ */ new Set;for(let[t,r]of u)t!==e&&n(r).includes(e)&&s.add(t);let c=/* @__PURE__ */ new Set;for(let[t,n]of p)e.startsWith(t)&&n.forEach(e=>c.add(e));m.set(e,{name:e,value:t,family:a,tier:a?.tier??`unassigned`,chain:o,tokenReaders:s,sourceReaders:f.get(e)??/* @__PURE__ */ new Set,reachable:c})}let h=[...m.values()],g=e=>e.replace(/-[A-Za-z]+$/,``),_=/* @__PURE__ */ new Map,v=[];for(let e of h){let t=e.chain.hops[1]??n(e.value)[0],r=t&&m.get(t);if(r){if(e.tier===`component`&&r.tier===`primitive`){let t=r.family.prefix;_.has(t)||_.set(t,[]),_.get(t).push({row:e,target:r})}o[r.tier]>o[e.tier]&&v.push({row:e,target:r})}}let y=e=>h.filter(t=>t.tier===`semantic`&&t.chain.hops.slice(1).some(t=>m.get(t)?.family?.prefix===e)),b=[..._].map(([e,t])=>({prefix:e,list:t,rolesAbove:y(e)})).sort((e,t)=>t.list.length-e.list.length),x=[],S=[],C=[],w=[],T=[],E=e=>e.tokenReaders.size>0||[...e.sourceReaders].some(e=>e!==`stories`);for(let e of h)E(e)||(e.reachable.size?w.push(e):e.sourceReaders.has(`stories`)?S.push(e):e.tier===`primitive`?T.push(e):(e.tier===`semantic`&&e.name.startsWith(`--typography-`)&&h.some(t=>t!==e&&g(t.name)===g(e.name)&&E(t))?C:x).push(e));let D=h.filter(e=>e.tier===`semantic`&&n(e.value).length===0),O=/* @__PURE__ */ new Map,k=[],A=h.filter(e=>e.tier===`semantic`&&!e.chain.compound&&m.get(e.chain.hops.at(-1))?.family?.prefix?.startsWith(`--color-`)&&m.get(e.chain.hops.at(-1))?.tier===`primitive`),j=e=>e.slice(2).split(`-`);for(let e=0;e<A.length;e++)for(let t=e+1;t<A.length;t++){let n=A[e],r=A[t];if(n.family!==r.family||n.chain.hops.at(-1)!==r.chain.hops.at(-1))continue;let i=j(n.name),a=j(r.name);if(i.length!==a.length)continue;let o=i.map((e,t)=>e!==a[t]);if(o.filter(Boolean).length!==1)continue;if(o.at(-1)){k.push({a:n,b:r,primitive:n.chain.hops.at(-1)});continue}let s=o.indexOf(!0),c=`--${i.map((e,t)=>t===s?`*`:e).join(`-`)}`,l=`${c}|${n.chain.hops.at(-1)}`;O.has(l)||O.set(l,{pattern:c,primitive:n.chain.hops.at(-1),members:/* @__PURE__ */ new Set}),O.get(l).members.add(i[s]).add(a[s])}return{rows:h,decls:u,flags:{tierSkips:b,inversions:v,unread:x,docsOnly:S,unreadAxes:C,reachableOnly:w,unreadSteps:T,literalSemantics:D,sameSlot:[...O.values()].map(e=>({...e,members:[...e.members]})),sameRole:k}}}export{s as DOCS,c as analyse,e as blankComments,i as chainOf,a as consumersFrom,t as declarationsFrom,r as familyOf,n as refsOf};
237
2
  //# sourceMappingURL=token-map.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"token-map.js","sourceRoot":"","sources":["../../../src/tokens/token-map.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,2EAA2E;AAC3E,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,IAAY,EAAE,EAAE,CAC5C,IAAI,CAAC,OAAO,CAAC,mBAAmB,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC,CAAC;AAEnE,wDAAwD;AACxD,MAAM,UAAU,gBAAgB,CAAC,OAAe;IAC9C,MAAM,GAAG,GAAG,IAAI,GAAG,EAAkB,CAAC;IACtC,KAAK,MAAM,CAAC,IAAI,aAAa,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,+CAA+C,CAAC,EAAE,CAAC;QACjG,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YAAE,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;IACtE,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED,+CAA+C;AAC/C,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC,CAA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AAG,CAAC,EAAE,CAAC;YACvE,MAAM,GAAG,GAAG,GAAG,OAAO,IAAI,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;YAChD,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC;gBAAE,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,GAAG,EAAE,EAAE,CAAC,CAAC;YACrG,KAAK,CAAC,GAAG,CAAC,GAAG,CAAE,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QAChD,CAAC;IACH,CAAC;IACD,MAAM,QAAQ,GAAG,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,OAAO,EAAE,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC;IAEnF,OAAO;QACL,IAAI,EAAE,KAAK;QACX,KAAK,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,aAAa,EAAE,WAAW,EAAE,gBAAgB,EAAE,QAAQ,EAAE,QAAQ,EAAE;KACxI,CAAC;AACJ,CAAC","sourcesContent":["/**\n * The analysis behind Foundations/Token Map, kept free of Lit and the DOM so\n * the same functions run in Storybook and under Node: the page renders what\n * this returns, and nothing on the page is transcribed by hand.\n *\n * Inputs are text, not live objects: the generated tokens.css, the tier\n * registry in scripts/token-tiers.json, and the raw source of every file that\n * might read a token. Component CSS sits inside shadow roots, which is why the\n * other Foundations pages can only count token-to-token references; reading the\n * source is what lets this page say which component reads a token.\n *\n * Not a story file: Storybook only globs *.stories.js.\n */\n\n/** Blank comments, keeping offsets, so commented-out CSS is never read. */\nexport const blankComments = (text: string) =>\n text.replace(/\\/\\*[\\s\\S]*?\\*\\//g, c => c.replace(/[^\\n]/g, ' '));\n\n/** name -> raw declared value, in declaration order. */\nexport function declarationsFrom(cssText: string) {\n const out = new Map<string, string>();\n for (const m of blankComments(cssText).matchAll(/(?:^|[\\s;{])(--[A-Za-z0-9-]+)\\s*:\\s*([^;]*);/g)) {\n if (!out.has(m[1])) out.set(m[1], m[2].replace(/\\s+/g, ' ').trim());\n }\n return out;\n}\n\n/** Every custom property a value refers to. */\nexport const refsOf = (value: string) => [...value.matchAll(/var\\(\\s*(--[A-Za-z0-9-]+)/g)].map(m => m[1]);\n\n/** A family in scripts/token-tiers.json. */\nexport interface TokenFamily {\n prefix: string;\n tier : string;\n}\n\n/** The family a token belongs to: the longest matching registry prefix. */\nexport function familyOf(token: string, families: readonly TokenFamily[]) {\n let best = null;\n for (const f of families) {\n if (token.startsWith(f.prefix) && (!best || f.prefix.length > best.prefix.length)) best = f;\n }\n return best;\n}\n\n/**\n * The alias chain from a token down to its value. Follows the reference while\n * the value is exactly one var(); a value that combines references\n * (color-mix, a shorthand, a clamp) ends the chain and is reported as compound.\n */\nexport function chainOf(token: string, decls: ReadonlyMap<string, string>) {\n const hops = [token];\n let value = decls.get(token);\n while (value !== undefined) {\n const only = value.match(/^var\\(\\s*(--[A-Za-z0-9-]+)\\s*\\)$/);\n if (!only || !decls.has(only[1]) || hops.includes(only[1])) break;\n hops.push(only[1]);\n value = decls.get(only[1]);\n }\n const compound = value !== undefined && refsOf(value).length > 0;\n return { hops, value: value ?? '', compound };\n}\n\n/**\n * Who reads each token, from raw source text keyed by path.\n *\n * Three ways a token is read, and all three are real in this package:\n * var(--x) the ordinary case\n * '--x' a name held as data -- token-scales.ts maps\n * color=\"muted\" to '--color-text-muted' this way\n * '--spacing-' a prefix the scale helpers complete at runtime, so a\n * step may be read without its full name appearing\n * The third is reported separately: it says a token can be reached, not that\n * anything reaches it.\n */\nexport function consumersFrom(sources: Record<string, string>, ownerOf: (path: string) => string) {\n const readers = new Map<string, Set<string>>();\n const prefixes = new Map<string, Set<string>>();\n const add = (map: Map<string, Set<string>>, key: string, owner: string) => {\n if (!map.has(key)) map.set(key, new Set());\n map.get(key)!.add(owner);\n };\n for (const [path, raw] of Object.entries(sources)) {\n const text = blankComments(raw);\n const owner = ownerOf(path);\n for (const m of text.matchAll(/var\\(\\s*(--[A-Za-z0-9-]+)/g)) add(readers, m[1], owner);\n for (const m of text.matchAll(/['\"`](--[A-Za-z0-9-]*[A-Za-z0-9])['\"`]/g)) add(readers, m[1], owner);\n /* documentation looks tokens up by prefix to list them, which is not a\n product being able to reach one */\n if (owner === DOCS) continue;\n for (const m of text.matchAll(/['\"`](--[A-Za-z0-9-]+-)['\"`$]/g)) add(prefixes, m[1], owner);\n for (const m of text.matchAll(/var\\(\\s*(--[A-Za-z0-9-]+-)\\$\\{/g)) add(prefixes, m[1], owner);\n }\n return { readers, prefixes };\n}\n\nconst TIER_RANK: Record<string, number> = { primitive: 0, semantic: 1, component: 2 };\n\n/** The owner name ownerOf() should return for documentation sources. */\nexport const DOCS = 'stories';\n\n/** One token as the page shows it. */\nexport interface TokenRow {\n name : string;\n value : string;\n family : TokenFamily | null;\n tier : string;\n chain : { hops: string[]; value: string; compound: boolean };\n tokenReaders : Set<string>;\n sourceReaders: Set<string>;\n reachable : Set<string>;\n}\n\n/**\n * Everything the page shows. `sources` is { path: text }; `ownerOf` turns a\n * path into the name shown in \"read by\".\n */\nexport function analyse({ cssText, registry, sources, ownerOf }: {\n cssText : string;\n registry: { families: readonly TokenFamily[] };\n sources : Record<string, string>;\n ownerOf : (path: string) => string;\n}) {\n const decls = declarationsFrom(cssText);\n const families = registry.families;\n const { readers, prefixes } = consumersFrom(sources, ownerOf);\n\n const byToken = new Map<string, TokenRow>();\n for (const [name, value] of decls) {\n const family = familyOf(name, families);\n const chain = chainOf(name, decls);\n const tokenReaders = new Set<string>();\n for (const [other, v] of decls) if (other !== name && refsOf(v).includes(name)) tokenReaders.add(other);\n const reachable = new Set<string>();\n for (const [prefix, owners] of prefixes) if (name.startsWith(prefix)) owners.forEach(o => reachable.add(o));\n byToken.set(name, {\n name,\n value,\n family,\n tier : family?.tier ?? 'unassigned',\n chain,\n tokenReaders,\n sourceReaders: readers.get(name) ?? new Set(),\n reachable\n });\n }\n\n const rows = [...byToken.values()];\n const roleOf = (name: string) => name.replace(/-[A-Za-z]+$/, '');\n\n /* Tier skips: a component token whose first hop is a primitive. Grouped by\n the primitive family reached, because the answer differs by family: a\n colour primitive has semantic roles above it that the token could have\n asked for, and --spacing-* has none -- its roles were deleted on purpose.\n Inversions: a token whose first hop is a HIGHER tier than itself. */\n const tierSkips = new Map<string, { row: TokenRow; target: TokenRow }[]>();\n const inversions = [];\n for (const r of rows) {\n const firstHop = r.chain.hops[1] ?? refsOf(r.value)[0];\n const target = firstHop && byToken.get(firstHop);\n if (!target) continue;\n if (r.tier === 'component' && target.tier === 'primitive') {\n const key = target.family!.prefix;\n if (!tierSkips.has(key)) tierSkips.set(key, []);\n tierSkips.get(key)!.push({ row: r, target });\n }\n if (TIER_RANK[target.tier] > TIER_RANK[r.tier]) inversions.push({ row: r, target });\n }\n /* For each skipped-to family, the semantic tokens that do sit above it --\n the roles a skipping token could have asked for instead. A count, not a\n verdict: --spacing-* has two (the card roles), and that is not a spacing\n vocabulary. */\n const rolesAbove = (prefix: string) => rows.filter(r => r.tier === 'semantic' &&\n r.chain.hops.slice(1).some(h => byToken.get(h)?.family?.prefix === prefix));\n const skips = [...tierSkips].map(([prefix, list]) => ({ prefix, list, rolesAbove: rolesAbove(prefix) }))\n .sort((a, b) => b.list.length - a.list.length);\n\n /* Unread, split by what it means:\n unread semantic or component, and nothing reads it -- the\n case that retired display-hero and two status tokens\n docsOnly read by a story and nothing else\n unreadAxes one axis of a typography role whose other axes are\n read; a role declares five and a consumer may want two\n reachableOnly nothing names it, but a scale helper can build its name\n unreadSteps a primitive step nothing reads; a scale is allowed to\n be complete */\n const unread: TokenRow[] = [];\n const docsOnly: TokenRow[] = [];\n const unreadAxes: TokenRow[] = [];\n const reachableOnly: TokenRow[] = [];\n const unreadSteps: TokenRow[] = [];\n const productRead = (r: TokenRow) => r.tokenReaders.size > 0 || [...r.sourceReaders].some(o => o !== DOCS);\n for (const r of rows) {\n if (productRead(r)) continue;\n if (r.reachable.size) { reachableOnly.push(r); continue; }\n if (r.sourceReaders.has(DOCS)) { docsOnly.push(r); continue; }\n if (r.tier === 'primitive') { unreadSteps.push(r); continue; }\n const isRoleAxis = r.tier === 'semantic' && r.name.startsWith('--typography-');\n const siblingRead = isRoleAxis && rows.some(o => o !== r && roleOf(o.name) === roleOf(r.name) && productRead(o));\n (siblingRead ? unreadAxes : unread).push(r);\n }\n\n /* semantic tokens declared as a literal: no primitive beneath them */\n const literalSemantics = rows.filter(r => r.tier === 'semantic' && refsOf(r.value).length === 0);\n\n /* Same colour, two semantic names in one family, differing in exactly one\n segment. Split by WHICH segment differs:\n sameSlot a middle segment -- --status-brand-surface and\n --status-info-surface: one slot, two tones, one colour. This\n is the kind that collided twice.\n sameRole the last segment -- --color-surface-muted and -disabled: two\n jobs that happen to share a value, which CLAUDE.md says is\n expected and must not drive a choice. Listed, not flagged. */\n const slots = new Map<string, { pattern: string; primitive: string | undefined; members: Set<string> }>();\n const sameRole = [];\n const colour = rows.filter(r => r.tier === 'semantic' && !r.chain.compound &&\n byToken.get(r.chain.hops.at(-1)!)?.family?.prefix?.startsWith('--color-') &&\n byToken.get(r.chain.hops.at(-1)!)?.tier === 'primitive');\n const segs = (n: string) => n.slice(2).split('-');\n for (let i = 0; i < colour.length; i++) {\n for (let j = i + 1; j < colour.length; j++) {\n const a = colour[i], b = colour[j];\n if (a.family !== b.family || a.chain.hops.at(-1) !== b.chain.hops.at(-1)) continue;\n const sa = segs(a.name), sb = segs(b.name);\n if (sa.length !== sb.length) continue;\n const diff = sa.map((s, k) => s !== sb[k]);\n if (diff.filter(Boolean).length !== 1) continue;\n if (diff.at(-1)) { sameRole.push({ a, b, primitive: a.chain.hops.at(-1) }); continue; }\n /* one line per slot: --status-*-surface -> blue-50: brand, info */\n const k = diff.indexOf(true);\n const pattern = `--${sa.map((s, n) => (n === k ? '*' : s)).join('-')}`;\n const key = `${pattern}|${a.chain.hops.at(-1)}`;\n if (!slots.has(key)) slots.set(key, { pattern, primitive: a.chain.hops.at(-1), members: new Set() });\n slots.get(key)!.members.add(sa[k]).add(sb[k]);\n }\n }\n const sameSlot = [...slots.values()].map(g => ({ ...g, members: [...g.members] }));\n\n return {\n rows, decls,\n flags: { tierSkips: skips, inversions, unread, docsOnly, unreadAxes, reachableOnly, unreadSteps, literalSemantics, sameSlot, sameRole }\n };\n}\n"]}
1
+ {"version":3,"file":"token-map.js","names":["blankComments","text","c","declarationsFrom","out","m","cssText","refsOf","value","familyOf","best","f","families","token","chainOf","hops","decls","only","compound","consumersFrom","readers","prefixes","add","map","key","owner","path","raw","sources","ownerOf","TIER_RANK","DOCS","analyse","registry","byToken","name","family","chain","tokenReaders","other","v","reachable","prefix","owners","o","rows","roleOf","tierSkips","inversions","r","firstHop","target","rolesAbove","h","skips","list","b","a","unread","docsOnly","unreadAxes","reachableOnly","unreadSteps","productRead","literalSemantics","slots","sameRole","colour","segs","n","i","j","sa","sb","diff","s","k","pattern","g"],"sources":["../../../src/tokens/token-map.ts"],"sourcesContent":["/**\n * The analysis behind Foundations/Token Map, kept free of Lit and the DOM so\n * the same functions run in Storybook and under Node: the page renders what\n * this returns, and nothing on the page is transcribed by hand.\n *\n * Inputs are text, not live objects: the generated tokens.css, the tier\n * registry in scripts/token-tiers.json, and the raw source of every file that\n * might read a token. Component CSS sits inside shadow roots, which is why the\n * other Foundations pages can only count token-to-token references; reading the\n * source is what lets this page say which component reads a token.\n *\n * Not a story file: Storybook only globs *.stories.js.\n */\n\n/** Blank comments, keeping offsets, so commented-out CSS is never read. */\nexport const blankComments = (text: string) =>\n text.replace(/\\/\\*[\\s\\S]*?\\*\\//g, c => c.replace(/[^\\n]/g, ' '));\n\n/** name -> raw declared value, in declaration order. */\nexport function declarationsFrom(cssText: string) {\n const out = new Map<string, string>();\n for (const m of blankComments(cssText).matchAll(/(?:^|[\\s;{])(--[A-Za-z0-9-]+)\\s*:\\s*([^;]*);/g)) {\n if (!out.has(m[1])) out.set(m[1], m[2].replace(/\\s+/g, ' ').trim());\n }\n return out;\n}\n\n/** Every custom property a value refers to. */\nexport const refsOf = (value: string) => [...value.matchAll(/var\\(\\s*(--[A-Za-z0-9-]+)/g)].map(m => m[1]);\n\n/** A family in scripts/token-tiers.json. */\nexport interface TokenFamily {\n prefix: string;\n tier : string;\n}\n\n/** The family a token belongs to: the longest matching registry prefix. */\nexport function familyOf(token: string, families: readonly TokenFamily[]) {\n let best = null;\n for (const f of families) {\n if (token.startsWith(f.prefix) && (!best || f.prefix.length > best.prefix.length)) best = f;\n }\n return best;\n}\n\n/**\n * The alias chain from a token down to its value. Follows the reference while\n * the value is exactly one var(); a value that combines references\n * (color-mix, a shorthand, a clamp) ends the chain and is reported as compound.\n */\nexport function chainOf(token: string, decls: ReadonlyMap<string, string>) {\n const hops = [token];\n let value = decls.get(token);\n while (value !== undefined) {\n const only = value.match(/^var\\(\\s*(--[A-Za-z0-9-]+)\\s*\\)$/);\n if (!only || !decls.has(only[1]) || hops.includes(only[1])) break;\n hops.push(only[1]);\n value = decls.get(only[1]);\n }\n const compound = value !== undefined && refsOf(value).length > 0;\n return { hops, value: value ?? '', compound };\n}\n\n/**\n * Who reads each token, from raw source text keyed by path.\n *\n * Three ways a token is read, and all three are real in this package:\n * var(--x) the ordinary case\n * '--x' a name held as data -- token-scales.ts maps\n * color=\"muted\" to '--color-text-muted' this way\n * '--spacing-' a prefix the scale helpers complete at runtime, so a\n * step may be read without its full name appearing\n * The third is reported separately: it says a token can be reached, not that\n * anything reaches it.\n */\nexport function consumersFrom(sources: Record<string, string>, ownerOf: (path: string) => string) {\n const readers = new Map<string, Set<string>>();\n const prefixes = new Map<string, Set<string>>();\n const add = (map: Map<string, Set<string>>, key: string, owner: string) => {\n if (!map.has(key)) map.set(key, new Set());\n map.get(key)!.add(owner);\n };\n for (const [path, raw] of Object.entries(sources)) {\n const text = blankComments(raw);\n const owner = ownerOf(path);\n for (const m of text.matchAll(/var\\(\\s*(--[A-Za-z0-9-]+)/g)) add(readers, m[1], owner);\n for (const m of text.matchAll(/['\"`](--[A-Za-z0-9-]*[A-Za-z0-9])['\"`]/g)) add(readers, m[1], owner);\n /* documentation looks tokens up by prefix to list them, which is not a\n product being able to reach one */\n if (owner === DOCS) continue;\n for (const m of text.matchAll(/['\"`](--[A-Za-z0-9-]+-)['\"`$]/g)) add(prefixes, m[1], owner);\n for (const m of text.matchAll(/var\\(\\s*(--[A-Za-z0-9-]+-)\\$\\{/g)) add(prefixes, m[1], owner);\n }\n return { readers, prefixes };\n}\n\nconst TIER_RANK: Record<string, number> = { primitive: 0, semantic: 1, component: 2 };\n\n/** The owner name ownerOf() should return for documentation sources. */\nexport const DOCS = 'stories';\n\n/** One token as the page shows it. */\nexport interface TokenRow {\n name : string;\n value : string;\n family : TokenFamily | null;\n tier : string;\n chain : { hops: string[]; value: string; compound: boolean };\n tokenReaders : Set<string>;\n sourceReaders: Set<string>;\n reachable : Set<string>;\n}\n\n/**\n * Everything the page shows. `sources` is { path: text }; `ownerOf` turns a\n * path into the name shown in \"read by\".\n */\nexport function analyse({ cssText, registry, sources, ownerOf }: {\n cssText : string;\n registry: { families: readonly TokenFamily[] };\n sources : Record<string, string>;\n ownerOf : (path: string) => string;\n}) {\n const decls = declarationsFrom(cssText);\n const families = registry.families;\n const { readers, prefixes } = consumersFrom(sources, ownerOf);\n\n const byToken = new Map<string, TokenRow>();\n for (const [name, value] of decls) {\n const family = familyOf(name, families);\n const chain = chainOf(name, decls);\n const tokenReaders = new Set<string>();\n for (const [other, v] of decls) if (other !== name && refsOf(v).includes(name)) tokenReaders.add(other);\n const reachable = new Set<string>();\n for (const [prefix, owners] of prefixes) if (name.startsWith(prefix)) owners.forEach(o => reachable.add(o));\n byToken.set(name, {\n name,\n value,\n family,\n tier : family?.tier ?? 'unassigned',\n chain,\n tokenReaders,\n sourceReaders: readers.get(name) ?? new Set(),\n reachable\n });\n }\n\n const rows = [...byToken.values()];\n const roleOf = (name: string) => name.replace(/-[A-Za-z]+$/, '');\n\n /* Tier skips: a component token whose first hop is a primitive. Grouped by\n the primitive family reached, because the answer differs by family: a\n colour primitive has semantic roles above it that the token could have\n asked for, and --spacing-* has none -- its roles were deleted on purpose.\n Inversions: a token whose first hop is a HIGHER tier than itself. */\n const tierSkips = new Map<string, { row: TokenRow; target: TokenRow }[]>();\n const inversions = [];\n for (const r of rows) {\n const firstHop = r.chain.hops[1] ?? refsOf(r.value)[0];\n const target = firstHop && byToken.get(firstHop);\n if (!target) continue;\n if (r.tier === 'component' && target.tier === 'primitive') {\n const key = target.family!.prefix;\n if (!tierSkips.has(key)) tierSkips.set(key, []);\n tierSkips.get(key)!.push({ row: r, target });\n }\n if (TIER_RANK[target.tier] > TIER_RANK[r.tier]) inversions.push({ row: r, target });\n }\n /* For each skipped-to family, the semantic tokens that do sit above it --\n the roles a skipping token could have asked for instead. A count, not a\n verdict: --spacing-* has two (the card roles), and that is not a spacing\n vocabulary. */\n const rolesAbove = (prefix: string) => rows.filter(r => r.tier === 'semantic' &&\n r.chain.hops.slice(1).some(h => byToken.get(h)?.family?.prefix === prefix));\n const skips = [...tierSkips].map(([prefix, list]) => ({ prefix, list, rolesAbove: rolesAbove(prefix) }))\n .sort((a, b) => b.list.length - a.list.length);\n\n /* Unread, split by what it means:\n unread semantic or component, and nothing reads it -- the\n case that retired display-hero and two status tokens\n docsOnly read by a story and nothing else\n unreadAxes one axis of a typography role whose other axes are\n read; a role declares five and a consumer may want two\n reachableOnly nothing names it, but a scale helper can build its name\n unreadSteps a primitive step nothing reads; a scale is allowed to\n be complete */\n const unread: TokenRow[] = [];\n const docsOnly: TokenRow[] = [];\n const unreadAxes: TokenRow[] = [];\n const reachableOnly: TokenRow[] = [];\n const unreadSteps: TokenRow[] = [];\n const productRead = (r: TokenRow) => r.tokenReaders.size > 0 || [...r.sourceReaders].some(o => o !== DOCS);\n for (const r of rows) {\n if (productRead(r)) continue;\n if (r.reachable.size) { reachableOnly.push(r); continue; }\n if (r.sourceReaders.has(DOCS)) { docsOnly.push(r); continue; }\n if (r.tier === 'primitive') { unreadSteps.push(r); continue; }\n const isRoleAxis = r.tier === 'semantic' && r.name.startsWith('--typography-');\n const siblingRead = isRoleAxis && rows.some(o => o !== r && roleOf(o.name) === roleOf(r.name) && productRead(o));\n (siblingRead ? unreadAxes : unread).push(r);\n }\n\n /* semantic tokens declared as a literal: no primitive beneath them */\n const literalSemantics = rows.filter(r => r.tier === 'semantic' && refsOf(r.value).length === 0);\n\n /* Same colour, two semantic names in one family, differing in exactly one\n segment. Split by WHICH segment differs:\n sameSlot a middle segment -- --status-brand-surface and\n --status-info-surface: one slot, two tones, one colour. This\n is the kind that collided twice.\n sameRole the last segment -- --color-surface-muted and -disabled: two\n jobs that happen to share a value, which CLAUDE.md says is\n expected and must not drive a choice. Listed, not flagged. */\n const slots = new Map<string, { pattern: string; primitive: string | undefined; members: Set<string> }>();\n const sameRole = [];\n const colour = rows.filter(r => r.tier === 'semantic' && !r.chain.compound &&\n byToken.get(r.chain.hops.at(-1)!)?.family?.prefix?.startsWith('--color-') &&\n byToken.get(r.chain.hops.at(-1)!)?.tier === 'primitive');\n const segs = (n: string) => n.slice(2).split('-');\n for (let i = 0; i < colour.length; i++) {\n for (let j = i + 1; j < colour.length; j++) {\n const a = colour[i], b = colour[j];\n if (a.family !== b.family || a.chain.hops.at(-1) !== b.chain.hops.at(-1)) continue;\n const sa = segs(a.name), sb = segs(b.name);\n if (sa.length !== sb.length) continue;\n const diff = sa.map((s, k) => s !== sb[k]);\n if (diff.filter(Boolean).length !== 1) continue;\n if (diff.at(-1)) { sameRole.push({ a, b, primitive: a.chain.hops.at(-1) }); continue; }\n /* one line per slot: --status-*-surface -> blue-50: brand, info */\n const k = diff.indexOf(true);\n const pattern = `--${sa.map((s, n) => (n === k ? '*' : s)).join('-')}`;\n const key = `${pattern}|${a.chain.hops.at(-1)}`;\n if (!slots.has(key)) slots.set(key, { pattern, primitive: a.chain.hops.at(-1), members: new Set() });\n slots.get(key)!.members.add(sa[k]).add(sb[k]);\n }\n }\n const sameSlot = [...slots.values()].map(g => ({ ...g, members: [...g.members] }));\n\n return {\n rows, decls,\n flags: { tierSkips: skips, inversions, unread, docsOnly, unreadAxes, reachableOnly, unreadSteps, literalSemantics, sameSlot, sameRole }\n };\n}\n"],"mappings":"AAeA,IAAaA,EAAiB,GAC5BC,EAAK,QAAQ,oBAAqB,GAAKC,EAAE,QAAQ,SAAU,GAAG,CAAC,EAGjE,SAAgBC,EAAiB,EAAiB,CAChD,IAAMC,kBAAM,IAAI,IAChB,IAAK,IAAMC,KAAKL,EAAcM,CAAO,CAAC,CAAC,SAAS,+CAA+C,EACxFF,EAAI,IAAIC,EAAE,EAAE,GAAGD,EAAI,IAAIC,EAAE,GAAIA,EAAE,EAAE,CAAC,QAAQ,OAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,EAEpE,OAAOD,CACT,CAGA,IAAaG,EAAU,GAAkB,CAAC,GAAGC,EAAM,SAAS,4BAA4B,CAAC,CAAC,CAAC,IAAI,GAAKH,EAAE,EAAE,EASxG,SAAgBI,EAAS,EAAe,EAAkC,CACxE,IAAIC,EAAO,KACX,IAAK,IAAMC,KAAKC,EACVC,EAAM,WAAWF,EAAE,MAAM,IAAM,CAACD,GAAQC,EAAE,OAAO,OAASD,EAAK,OAAO,UAAS,EAAOC,GAE5F,OAAOD,CACT,CAOA,SAAgBI,EAAQ,EAAe,EAAoC,CACzE,IAAMC,EAAO,CAACF,CAAK,EACfL,EAAQQ,EAAM,IAAIH,CAAK,EAC3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7DnD,EAAM,GAAGqD,EAAQ,GAAGpB,EAAE,MAAM,KAAK,GAAG,EAAE,IACvCQ,EAAM,IAAIzC,CAAG,GAAGyC,EAAM,IAAIzC,EAAK,CAAE,UAAS,UAAWiC,EAAE,MAAM,KAAK,GAAG,EAAE,EAAG,wBAAS,IAAI,GAAM,CAAC,EACnGQ,EAAM,IAAIzC,CAAG,CAAC,CAAE,QAAQ,IAAIgD,EAAGI,EAAE,CAAC,CAAC,IAAIH,EAAGG,EAAE,CAC9C,CAIF,MAAO,CACL,OAAM,QACN,MAAO,CAAE,UAAWtB,EAAO,aAAY,SAAQ,WAAU,aAAY,gBAAe,cAAa,mBAAkB,SAJpG,CAAC,GAAGW,EAAM,OAAO,CAAC,CAAC,CAAC,IAAI,IAAM,CAAE,GAAGa,EAAG,QAAS,CAAC,GAAGA,EAAE,OAAO,CAAE,EAIsC,EAAU,UAAS,CACxI,CACF,C"}
@@ -1,260 +1,2 @@
1
- /**
2
- * What each semantic token is FOR, in one place.
3
- *
4
- * Roles are described by the job they do, not by the colour they currently
5
- * resolve to. The swatch on a docs page is there to recognise one on screen;
6
- * it is never the reason to choose one.
7
- *
8
- * Two readers: Foundations/Surfaces renders SURFACES and BORDERS, and
9
- * scripts/figma-variable-descriptions.mjs turns every entry here into the
10
- * description a designer sees in Figma's variable picker. Writing the
11
- * sentence once is the point -- a second hand-kept copy in Figma is how a
12
- * library goes on describing a role code has changed.
13
- *
14
- * Not a story file: Storybook only globs *.stories.js. Pure data, so it
15
- * imports under Node.
16
- */
17
- export const SURFACES = [
18
- {
19
- token: '--color-surface-default',
20
- purpose: 'The page, canvas or component ground. The thing other things sit on.',
21
- use: 'The base of a page, a section, or a component that is not itself a distinct object.',
22
- avoid: 'A card or tile that needs to read as its own object — that is surface-container.',
23
- relation: 'The reference point. Every other surface is described by how far it sits from this one.',
24
- example: 'Page background, modal body, the ground inside a section wrapper.',
25
- theme: 'Whatever the page ground is in the active theme. On dark it is the dark ground, not white.'
26
- },
27
- {
28
- token: '--color-surface-container',
29
- purpose: 'The ground a self-contained content object sits on, one step off the page, so it reads as its own object without needing a border or a shadow. The step is real but faint: Foundations/Surfaces, A card\'s ground and its edge.',
30
- use: 'A card, tile, panel or bounded section that should read as a distinct object on the page.',
31
- avoid: 'The page itself (surface-default); a low-emphasis grouping wash (surface-subtle); a disabled or pressed state (surface-muted); anything on dark (surface-inverse); brand or status meaning.',
32
- relation: 'One step from default, and closer to it than subtle is. Container is the ground of an object; subtle is a wash behind a group.',
33
- example: 'Card and tile surfaces, feature panels, quote cards.',
34
- theme: 'Adjacent to but distinguishable from surface-default. On dark that means one step lighter than the page, not a fixed grey.'
35
- },
36
- {
37
- token: '--color-surface-subtle',
38
- purpose: 'A low-emphasis background that groups content without making it an object.',
39
- use: 'A band or wash behind several things that already belong together.',
40
- avoid: 'The ground of a single self-contained object — that is container.',
41
- relation: 'Further from default than container. Recedes rather than stands out.',
42
- example: 'A grouping band behind a row of items.',
43
- theme: 'A recessive wash relative to the page ground.'
44
- },
45
- {
46
- token: '--color-surface-muted',
47
- purpose: 'A state surface: the thing is present but not currently active.',
48
- use: 'Pressed, inactive or de-emphasised states.',
49
- avoid: 'Resting surfaces. If nothing is in a state, this is the wrong family.',
50
- relation: 'Shares its value with surface-disabled today; the meanings differ, so do not treat them as interchangeable.',
51
- example: 'A pressed toggle track, a de-emphasised row.',
52
- theme: 'A state step away from the surface it applies to.'
53
- },
54
- {
55
- token: '--color-surface-disabled',
56
- purpose: 'The surface of a control that cannot currently be used.',
57
- use: 'Disabled controls only.',
58
- avoid: 'Anything a user can still operate.',
59
- relation: 'Same value as muted today, different meaning. Disabled is exempt from contrast minimums; muted is not.',
60
- example: 'A disabled input or button ground.',
61
- theme: 'Reads as unavailable in the active theme.'
62
- },
63
- {
64
- token: '--color-surface-pressed',
65
- purpose: 'The ground of a control while it is held down, when surface-muted is already its hover.',
66
- use: 'The pressed state of a control whose hover is surface-muted.',
67
- avoid: 'A resting or hovered ground; a pressed action fill, which is the action ramp.',
68
- relation: 'One step further from the page than muted, the way a press follows a hover.',
69
- example: 'bd-back while pressed.',
70
- theme: 'A state step past muted in the active theme. On dark, lighter than muted, not darker.'
71
- },
72
- {
73
- token: '--color-surface-inverse',
74
- purpose: 'A ground that flips the text polarity: content on it uses the inverse text roles.',
75
- use: 'Dark panels inside a light page, tooltips, inverted sections.',
76
- avoid: 'Ordinary surfaces. Choosing this changes which text roles are legible.',
77
- relation: 'Not a step on the default-container-subtle ladder; it is the other side of it.',
78
- example: 'Tooltip body. Not a video or terminal frame: those stay dark in every theme, and read surface-media.',
79
- theme: 'Inverts with the theme: on a dark theme this is the light ground.'
80
- },
81
- {
82
- token: '--color-surface-media',
83
- purpose: 'The frame around media: a video letterbox, a terminal panel. Dark in every theme.',
84
- use: 'A ground that must stay dark because what it frames is dark. Its ink is text-on-media.',
85
- avoid: 'A dark panel that should flip with the theme, such as a tooltip: that is surface-inverse.',
86
- relation: 'Same value as surface-inverse in light; the two part ways in a dark theme, where inverse turns light and media does not.',
87
- example: 'bd-video-player and bd-video letterboxes, the bd-terminal-message panel.',
88
- theme: 'Fixed: the same near-black in every theme.'
89
- },
90
- {
91
- token: '--color-surface-brand',
92
- purpose: 'A surface whose job is to carry brand identity.',
93
- use: 'Large brand areas, such as a footer masthead band.',
94
- avoid: 'Anything blue that is not making a brand statement. An indicator, a badge, a selected row and a switch track are all blue and none of them are brand surfaces.',
95
- relation: 'A meaning, not a colour. Matching the brand primitive by eye is not evidence.',
96
- example: 'The coloured band at the top of the footer.',
97
- theme: 'Follows the brand, not the neutral ramp.'
98
- },
99
- {
100
- token: '--color-surface-info',
101
- purpose: 'The tint an informational message sits on.',
102
- use: 'Informational banners and callouts.',
103
- avoid: 'Decorative blue backgrounds with no message semantics.',
104
- relation: 'One of the four status tints, each paired with a matching text role.',
105
- example: 'An informational banner ground.',
106
- theme: 'A readable informational tint against its paired text role.'
107
- },
108
- {
109
- token: '--color-surface-success',
110
- purpose: 'The tint a success message sits on.',
111
- use: 'Confirmation and success states.',
112
- avoid: 'Decorative green.',
113
- relation: 'Paired with the matching success text role; the pair is measured together.',
114
- example: 'A success banner ground.',
115
- theme: 'A readable success tint against its paired text role.'
116
- },
117
- {
118
- token: '--color-surface-warning',
119
- purpose: 'The tint a warning message sits on.',
120
- use: 'Cautionary states.',
121
- avoid: 'Decorative yellow.',
122
- relation: 'Paired with the matching warning text role.',
123
- example: 'A warning banner ground.',
124
- theme: 'A readable warning tint against its paired text role.'
125
- },
126
- {
127
- token: '--color-surface-error',
128
- purpose: 'The tint an error message sits on.',
129
- use: 'Error and destructive-outcome states.',
130
- avoid: 'Decorative red.',
131
- relation: 'Paired with the matching error text role.',
132
- example: 'An error banner ground.',
133
- theme: 'A readable error tint against its paired text role.'
134
- }
135
- ];
136
- export const BORDERS = [
137
- {
138
- token: '--color-border-subtle',
139
- purpose: 'A decorative hairline between things that already belong together.',
140
- use: 'Separating rows or cells inside one object.',
141
- avoid: 'The edge of anything actionable. It sits below the 3:1 that WCAG 1.4.11 asks of a UI component, on purpose.'
142
- },
143
- {
144
- token: '--color-border-default',
145
- purpose: 'The boundary of an object or control.',
146
- use: 'Inputs, bounded controls, the edge of a component.',
147
- avoid: 'Content separation inside a component — that is a divider job.'
148
- },
149
- {
150
- token: '--color-border-strong',
151
- purpose: 'A boundary that has to assert itself.',
152
- use: 'High-emphasis edges.',
153
- avoid: 'Ordinary component edges, which would flatten the emphasis.'
154
- },
155
- {
156
- token: '--color-border-brand',
157
- purpose: 'A boundary carrying brand emphasis.',
158
- use: 'Brand-emphasised edges.',
159
- avoid: 'Focus. Focus has its own tokens and must not be expressed as a border role.'
160
- },
161
- {
162
- token: '--color-border-disabled',
163
- purpose: 'The edge of a control that cannot be used.',
164
- use: 'Disabled controls.',
165
- avoid: 'Anything operable.'
166
- }
167
- ];
168
- /* The two border roles the Surfaces table does not list, worded from
169
- CLAUDE.md's "A card's ground and its edge". */
170
- export const CARD_EDGES = [
171
- {
172
- token: '--color-border-container',
173
- purpose: 'The edge of a card that sits on a tinted section.',
174
- use: 'A card on a tinted band, paired with surface-default as its ground.',
175
- avoid: 'A card on the page ground: there the surface-container step is the separation and an edge is redundant. On a surface-muted band this edge is the same colour as the band and disappears.'
176
- },
177
- {
178
- token: '--color-border-container-inverse',
179
- purpose: 'The edge of a container that sits on an inverse surface.',
180
- use: 'Bounding an object on a dark ground.',
181
- avoid: 'Light surfaces.'
182
- }
183
- ];
184
- /* Text. Hierarchy and state, from Foundations/Color/Responsibilities. */
185
- export const TEXT = [
186
- { token: '--color-text-primary', purpose: 'Default ink on a light surface: headings and body copy.', avoid: 'Inverse surfaces, where text-inverse takes over.' },
187
- { token: '--color-text-secondary', purpose: 'Supporting copy under a title.', avoid: 'A disabled control: disabled is a state, not a quieter step.' },
188
- { token: '--color-text-muted', purpose: 'Metadata, captions and timestamps.', avoid: 'A disabled control: disabled is a state, not a quieter step.' },
189
- { token: '--color-text-subtle', purpose: 'The quietest readable step of the hierarchy, on the page or a card.', avoid: 'A band (surface-subtle, surface-muted) or a status tint: use text-muted there, because subtle cannot clear 4.5:1 on them. A disabled control: disabled is a state, not a quieter step.' },
190
- { token: '--color-text-disabled', purpose: 'STATE: text on a control the user cannot operate. Exempt from contrast minimums only because it is disabled.', avoid: 'Quiet content that is still usable. Loading is not disabled.' },
191
- { token: '--color-text-inverse', purpose: 'High-emphasis text on an inverse surface.', avoid: 'Light surfaces.' },
192
- { token: '--color-text-muted-inverse', purpose: 'Everything subordinate on an inverse surface. The light-side secondary, muted and subtle roles fail contrast there.', avoid: 'Light surfaces.' },
193
- { token: '--color-text-on-media', purpose: 'Ink on surface-media: a video control glyph, a terminal\'s command lines. White in every theme, fixed with its ground.', avoid: 'Text on an inverse surface (text-inverse), which flips in a dark theme.' },
194
- { token: '--color-text-on-media-muted', purpose: 'The quieter ink on surface-media, such as a terminal\'s subdued lines.', avoid: 'Subordinate text on an inverse surface: that is text-muted-inverse, which flips.' },
195
- { token: '--color-text-brand', purpose: 'Brand-coloured ink, such as a link at rest. One step darker than action-primary, because blue-500 fails on any tint.', avoid: 'The fill of an interactive element at a state: that is the action ramp.' },
196
- { token: '--color-text-brand-hover', purpose: 'Brand text under the pointer: a hovered link or citation reference.', avoid: 'A button fill. It used to be --color-action-primary-active, and a fill and a text colour part ways in a dark theme.' },
197
- { token: '--color-text-success', purpose: 'Success text, paired with surface-success. Offered as color="success" on bd-h and bd-p.', avoid: 'Feedback inside a component (a badge, tag or alert): that is status-success-text.' },
198
- { token: '--color-text-warning', purpose: 'Warning text, paired with surface-warning. Offered as color="warning" on bd-h and bd-p.', avoid: 'Feedback inside a component: that is status-warning-text.' },
199
- { token: '--color-text-error', purpose: 'Error text, paired with surface-error.', avoid: 'Feedback inside a component: that is status-error-text.' }
200
- ];
201
- /* Actions: a state ramp, not a colour. Let the state pick the token. */
202
- export const ACTION = [
203
- { token: '--color-action-primary', purpose: 'The fill of a primary interactive element at rest.', avoid: 'Brand identity. Action and brand share a value at this step and diverge after it.' },
204
- { token: '--color-action-primary-hover', purpose: 'The same element, hovered.', avoid: 'Any blue that is not a hover state. There is no hover-blue role.' },
205
- { token: '--color-action-primary-active', purpose: 'The same element, pressed.', avoid: 'A selected or current item: that is an indicator.' },
206
- { token: '--color-action-accent', purpose: 'The fill of a conversion action at rest.', avoid: 'Errors and destructive outcomes, which are status-error.' },
207
- { token: '--color-action-accent-hover', purpose: 'The conversion action, hovered.', avoid: 'Anything that is not a hover state.' },
208
- { token: '--color-action-accent-active', purpose: 'The conversion action, pressed.', avoid: 'Anything that is not a pressed state.' },
209
- { token: '--color-action-secondary', purpose: 'The neutral action fill: a secondary button at rest, and a ghost button while pressed.', avoid: 'A dark ground for content (surface-inverse), or near-black ink (text-primary). Matching neutral-950 by value is not evidence.' },
210
- { token: '--color-action-secondary-hover', purpose: 'The neutral action, hovered.', avoid: 'Anything that is not a hover state.' },
211
- { token: '--color-action-secondary-active', purpose: 'The neutral action, pressed.', avoid: 'Anything that is not a pressed state.' },
212
- { token: '--color-action-on-fill', purpose: 'Ink on an action fill: a button label, a checkmark, a radio dot, a switch thumb. White in every theme.', avoid: 'Text on an inverse surface (text-inverse) or the page colour (surface-default): both happen to be white here, and both flip in a dark theme.' }
213
- ];
214
- /* Status: feedback state, owned by bd-badge, bd-tag and bd-alert. One slot
215
- per weight of a tone, from the comment above the block in tokens.ts. */
216
- export const STATUS_SLOTS = {
217
- 'text': 'ink on a tinted chip (badge shade, tag)',
218
- 'surface': 'the light tint (tag, alert). A tag sits here so its border reads',
219
- 'surface-strong': 'the heavier tint a borderless badge sits on, so a badge and a tag of one tone read apart',
220
- 'border': 'the hairline around a tag',
221
- 'accent': 'the saturated step (badge dot, alert rule)',
222
- 'fill': 'a saturated chip (badge fill)',
223
- 'on-fill': 'the ink on that saturated chip'
224
- };
225
- export const STATUS_TONES = {
226
- neutral: { label: 'Neutral', note: '' },
227
- brand: { label: 'Brand', note: 'Brand has no surface-strong: it would be info\'s blue-100, and a brand badge would read as info. Brand and info differ only in accent, so never choose between them by colour.' },
228
- info: { label: 'Info', note: 'Info and brand differ only in accent, so never choose between them by colour.' },
229
- success: { label: 'Success', note: '' },
230
- warning: { label: 'Warning', note: '' },
231
- error: { label: 'Error', note: '' }
232
- };
233
- /* The rest of the semantic set Figma carries. */
234
- export const OTHER = [
235
- { prefix: '--icon-', purpose: 'The size of an icon glyph, from the scale every icon is sized from. Size only: an icon takes its colour from the text around it.' },
236
- { prefix: '--grid-container-max-', purpose: 'The page column\'s maximum width at this breakpoint. A section never declares its own width; it composes the ensemble column.' },
237
- { prefix: '--grid-padding-', purpose: 'The page column\'s gutter at the viewport edge, at this breakpoint. The column is the viewport minus twice this.' },
238
- { prefix: '--grid-gutter-', purpose: 'The space between grid columns at this breakpoint.' },
239
- { prefix: '--grid-columns', purpose: 'The number of columns in the page grid.' },
240
- { prefix: '--touch-target-size', purpose: 'The minimum comfortable hit area for a control (WCAG 2.5.8).' },
241
- { prefix: '--touch-target-spacing', purpose: 'The minimum space between two touch targets.' },
242
- { prefix: '--content-width-readable', purpose: 'A comfortable reading measure for running text.' },
243
- { prefix: '--content-width-max', purpose: 'The widest a content region may grow.' },
244
- { prefix: '--transition-duration-', purpose: 'A motion duration step. Anything animated must respect prefers-reduced-motion.' }
245
- ];
246
- /** { purpose, use?, avoid? } for a token, or null when nothing is written. */
247
- export function purposeOf(token) {
248
- const row = [...SURFACES, ...BORDERS, ...CARD_EDGES, ...TEXT, ...ACTION].find(r => r.token === token);
249
- if (row)
250
- return { purpose: row.purpose, use: row.use, avoid: row.avoid };
251
- const status = token.match(/^--status-([a-z]+)-(.+)$/);
252
- if (status && STATUS_TONES[status[1]] && STATUS_SLOTS[status[2]]) {
253
- const tone = STATUS_TONES[status[1]];
254
- const slot = STATUS_SLOTS[status[2]];
255
- return { purpose: `${tone.label} feedback: ${slot}.${tone.note ? ` ${tone.note}` : ''}`, avoid: 'Decoration. A status role means state; a colour that carries no message belongs to the general --color-* family.' };
256
- }
257
- const other = OTHER.find(o => token.startsWith(o.prefix));
258
- return other ? { purpose: other.purpose } : null;
259
- }
1
+ var e=[{token:`--color-surface-default`,purpose:`The page, canvas or component ground. The thing other things sit on.`,use:`The base of a page, a section, or a component that is not itself a distinct object.`,avoid:`A card or tile that needs to read as its own object — that is surface-container.`,relation:`The reference point. Every other surface is described by how far it sits from this one.`,example:`Page background, modal body, the ground inside a section wrapper.`,theme:`Whatever the page ground is in the active theme. On dark it is the dark ground, not white.`},{token:`--color-surface-container`,purpose:`The ground a self-contained content object sits on, one step off the page, so it reads as its own object without needing a border or a shadow. The step is real but faint: Foundations/Surfaces, A card's ground and its edge.`,use:`A card, tile, panel or bounded section that should read as a distinct object on the page.`,avoid:`The page itself (surface-default); a low-emphasis grouping wash (surface-subtle); a disabled or pressed state (surface-muted); anything on dark (surface-inverse); brand or status meaning.`,relation:`One step from default, and closer to it than subtle is. Container is the ground of an object; subtle is a wash behind a group.`,example:`Card and tile surfaces, feature panels, quote cards.`,theme:`Adjacent to but distinguishable from surface-default. On dark that means one step lighter than the page, not a fixed grey.`},{token:`--color-surface-subtle`,purpose:`A low-emphasis background that groups content without making it an object.`,use:`A band or wash behind several things that already belong together.`,avoid:`The ground of a single self-contained object — that is container.`,relation:`Further from default than container. Recedes rather than stands out.`,example:`A grouping band behind a row of items.`,theme:`A recessive wash relative to the page ground.`},{token:`--color-surface-muted`,purpose:`A state surface: the thing is present but not currently active.`,use:`Pressed, inactive or de-emphasised states.`,avoid:`Resting surfaces. If nothing is in a state, this is the wrong family.`,relation:`Shares its value with surface-disabled today; the meanings differ, so do not treat them as interchangeable.`,example:`A pressed toggle track, a de-emphasised row.`,theme:`A state step away from the surface it applies to.`},{token:`--color-surface-disabled`,purpose:`The surface of a control that cannot currently be used.`,use:`Disabled controls only.`,avoid:`Anything a user can still operate.`,relation:`Same value as muted today, different meaning. Disabled is exempt from contrast minimums; muted is not.`,example:`A disabled input or button ground.`,theme:`Reads as unavailable in the active theme.`},{token:`--color-surface-pressed`,purpose:`The ground of a control while it is held down, when surface-muted is already its hover.`,use:`The pressed state of a control whose hover is surface-muted.`,avoid:`A resting or hovered ground; a pressed action fill, which is the action ramp.`,relation:`One step further from the page than muted, the way a press follows a hover.`,example:`bd-back while pressed.`,theme:`A state step past muted in the active theme. On dark, lighter than muted, not darker.`},{token:`--color-surface-inverse`,purpose:`A ground that flips the text polarity: content on it uses the inverse text roles.`,use:`Dark panels inside a light page, tooltips, inverted sections.`,avoid:`Ordinary surfaces. Choosing this changes which text roles are legible.`,relation:`Not a step on the default-container-subtle ladder; it is the other side of it.`,example:`Tooltip body. Not a video or terminal frame: those stay dark in every theme, and read surface-media.`,theme:`Inverts with the theme: on a dark theme this is the light ground.`},{token:`--color-surface-media`,purpose:`The frame around media: a video letterbox, a terminal panel. Dark in every theme.`,use:`A ground that must stay dark because what it frames is dark. Its ink is text-on-media.`,avoid:`A dark panel that should flip with the theme, such as a tooltip: that is surface-inverse.`,relation:`Same value as surface-inverse in light; the two part ways in a dark theme, where inverse turns light and media does not.`,example:`bd-video-player and bd-video letterboxes, the bd-terminal-message panel.`,theme:`Fixed: the same near-black in every theme.`},{token:`--color-surface-brand`,purpose:`A surface whose job is to carry brand identity.`,use:`Large brand areas, such as a footer masthead band.`,avoid:`Anything blue that is not making a brand statement. An indicator, a badge, a selected row and a switch track are all blue and none of them are brand surfaces.`,relation:`A meaning, not a colour. Matching the brand primitive by eye is not evidence.`,example:`The coloured band at the top of the footer.`,theme:`Follows the brand, not the neutral ramp.`},{token:`--color-surface-info`,purpose:`The tint an informational message sits on.`,use:`Informational banners and callouts.`,avoid:`Decorative blue backgrounds with no message semantics.`,relation:`One of the four status tints, each paired with a matching text role.`,example:`An informational banner ground.`,theme:`A readable informational tint against its paired text role.`},{token:`--color-surface-success`,purpose:`The tint a success message sits on.`,use:`Confirmation and success states.`,avoid:`Decorative green.`,relation:`Paired with the matching success text role; the pair is measured together.`,example:`A success banner ground.`,theme:`A readable success tint against its paired text role.`},{token:`--color-surface-warning`,purpose:`The tint a warning message sits on.`,use:`Cautionary states.`,avoid:`Decorative yellow.`,relation:`Paired with the matching warning text role.`,example:`A warning banner ground.`,theme:`A readable warning tint against its paired text role.`},{token:`--color-surface-error`,purpose:`The tint an error message sits on.`,use:`Error and destructive-outcome states.`,avoid:`Decorative red.`,relation:`Paired with the matching error text role.`,example:`An error banner ground.`,theme:`A readable error tint against its paired text role.`}],t=[{token:`--color-border-subtle`,purpose:`A decorative hairline between things that already belong together.`,use:`Separating rows or cells inside one object.`,avoid:`The edge of anything actionable. It sits below the 3:1 that WCAG 1.4.11 asks of a UI component, on purpose.`},{token:`--color-border-default`,purpose:`The boundary of an object or control.`,use:`Inputs, bounded controls, the edge of a component.`,avoid:`Content separation inside a component — that is a divider job.`},{token:`--color-border-strong`,purpose:`A boundary that has to assert itself.`,use:`High-emphasis edges.`,avoid:`Ordinary component edges, which would flatten the emphasis.`},{token:`--color-border-brand`,purpose:`A boundary carrying brand emphasis.`,use:`Brand-emphasised edges.`,avoid:`Focus. Focus has its own tokens and must not be expressed as a border role.`},{token:`--color-border-disabled`,purpose:`The edge of a control that cannot be used.`,use:`Disabled controls.`,avoid:`Anything operable.`}],n=[{token:`--color-border-container`,purpose:`The edge of a card that sits on a tinted section.`,use:`A card on a tinted band, paired with surface-default as its ground.`,avoid:`A card on the page ground: there the surface-container step is the separation and an edge is redundant. On a surface-muted band this edge is the same colour as the band and disappears.`},{token:`--color-border-container-inverse`,purpose:`The edge of a container that sits on an inverse surface.`,use:`Bounding an object on a dark ground.`,avoid:`Light surfaces.`}],r=[{token:`--color-text-primary`,purpose:`Default ink on a light surface: headings and body copy.`,avoid:`Inverse surfaces, where text-inverse takes over.`},{token:`--color-text-secondary`,purpose:`Supporting copy under a title.`,avoid:`A disabled control: disabled is a state, not a quieter step.`},{token:`--color-text-muted`,purpose:`Metadata, captions and timestamps.`,avoid:`A disabled control: disabled is a state, not a quieter step.`},{token:`--color-text-subtle`,purpose:`The quietest readable step of the hierarchy, on the page or a card.`,avoid:`A band (surface-subtle, surface-muted) or a status tint: use text-muted there, because subtle cannot clear 4.5:1 on them. A disabled control: disabled is a state, not a quieter step.`},{token:`--color-text-disabled`,purpose:`STATE: text on a control the user cannot operate. Exempt from contrast minimums only because it is disabled.`,avoid:`Quiet content that is still usable. Loading is not disabled.`},{token:`--color-text-inverse`,purpose:`High-emphasis text on an inverse surface.`,avoid:`Light surfaces.`},{token:`--color-text-muted-inverse`,purpose:`Everything subordinate on an inverse surface. The light-side secondary, muted and subtle roles fail contrast there.`,avoid:`Light surfaces.`},{token:`--color-text-on-media`,purpose:`Ink on surface-media: a video control glyph, a terminal's command lines. White in every theme, fixed with its ground.`,avoid:`Text on an inverse surface (text-inverse), which flips in a dark theme.`},{token:`--color-text-on-media-muted`,purpose:`The quieter ink on surface-media, such as a terminal's subdued lines.`,avoid:`Subordinate text on an inverse surface: that is text-muted-inverse, which flips.`},{token:`--color-text-brand`,purpose:`Brand-coloured ink, such as a link at rest. One step darker than action-primary, because blue-500 fails on any tint.`,avoid:`The fill of an interactive element at a state: that is the action ramp.`},{token:`--color-text-brand-hover`,purpose:`Brand text under the pointer: a hovered link or citation reference.`,avoid:`A button fill. It used to be --color-action-primary-active, and a fill and a text colour part ways in a dark theme.`},{token:`--color-text-success`,purpose:`Success text, paired with surface-success. Offered as color="success" on bd-h and bd-p.`,avoid:`Feedback inside a component (a badge, tag or alert): that is status-success-text.`},{token:`--color-text-warning`,purpose:`Warning text, paired with surface-warning. Offered as color="warning" on bd-h and bd-p.`,avoid:`Feedback inside a component: that is status-warning-text.`},{token:`--color-text-error`,purpose:`Error text, paired with surface-error.`,avoid:`Feedback inside a component: that is status-error-text.`}],i=[{token:`--color-action-primary`,purpose:`The fill of a primary interactive element at rest.`,avoid:`Brand identity. Action and brand share a value at this step and diverge after it.`},{token:`--color-action-primary-hover`,purpose:`The same element, hovered.`,avoid:`Any blue that is not a hover state. There is no hover-blue role.`},{token:`--color-action-primary-active`,purpose:`The same element, pressed.`,avoid:`A selected or current item: that is an indicator.`},{token:`--color-action-accent`,purpose:`The fill of a conversion action at rest.`,avoid:`Errors and destructive outcomes, which are status-error.`},{token:`--color-action-accent-hover`,purpose:`The conversion action, hovered.`,avoid:`Anything that is not a hover state.`},{token:`--color-action-accent-active`,purpose:`The conversion action, pressed.`,avoid:`Anything that is not a pressed state.`},{token:`--color-action-secondary`,purpose:`The neutral action fill: a secondary button at rest, and a ghost button while pressed.`,avoid:`A dark ground for content (surface-inverse), or near-black ink (text-primary). Matching neutral-950 by value is not evidence.`},{token:`--color-action-secondary-hover`,purpose:`The neutral action, hovered.`,avoid:`Anything that is not a hover state.`},{token:`--color-action-secondary-active`,purpose:`The neutral action, pressed.`,avoid:`Anything that is not a pressed state.`},{token:`--color-action-on-fill`,purpose:`Ink on an action fill: a button label, a checkmark, a radio dot, a switch thumb. White in every theme.`,avoid:`Text on an inverse surface (text-inverse) or the page colour (surface-default): both happen to be white here, and both flip in a dark theme.`}],a={text:`ink on a tinted chip (badge shade, tag)`,surface:`the light tint (tag, alert). A tag sits here so its border reads`,"surface-strong":`the heavier tint a borderless badge sits on, so a badge and a tag of one tone read apart`,border:`the hairline around a tag`,accent:`the saturated step (badge dot, alert rule)`,fill:`a saturated chip (badge fill)`,"on-fill":`the ink on that saturated chip`},o={neutral:{label:`Neutral`,note:``},brand:{label:`Brand`,note:`Brand has no surface-strong: it would be info's blue-100, and a brand badge would read as info. Brand and info differ only in accent, so never choose between them by colour.`},info:{label:`Info`,note:`Info and brand differ only in accent, so never choose between them by colour.`},success:{label:`Success`,note:``},warning:{label:`Warning`,note:``},error:{label:`Error`,note:``}},s=[{prefix:`--icon-`,purpose:`The size of an icon glyph, from the scale every icon is sized from. Size only: an icon takes its colour from the text around it.`},{prefix:`--grid-container-max-`,purpose:`The page column's maximum width at this breakpoint. A section never declares its own width; it composes the ensemble column.`},{prefix:`--grid-padding-`,purpose:`The page column's gutter at the viewport edge, at this breakpoint. The column is the viewport minus twice this.`},{prefix:`--grid-gutter-`,purpose:`The space between grid columns at this breakpoint.`},{prefix:`--grid-columns`,purpose:`The number of columns in the page grid.`},{prefix:`--touch-target-size`,purpose:`The minimum comfortable hit area for a control (WCAG 2.5.8).`},{prefix:`--touch-target-spacing`,purpose:`The minimum space between two touch targets.`},{prefix:`--content-width-readable`,purpose:`A comfortable reading measure for running text.`},{prefix:`--content-width-max`,purpose:`The widest a content region may grow.`},{prefix:`--transition-duration-`,purpose:`A motion duration step. Anything animated must respect prefers-reduced-motion.`}];function c(c){let l=[...e,...t,...n,...r,...i].find(e=>e.token===c);if(l)return{purpose:l.purpose,use:l.use,avoid:l.avoid};let u=c.match(/^--status-([a-z]+)-(.+)$/);if(u&&o[u[1]]&&a[u[2]]){let e=o[u[1]],t=a[u[2]];return{purpose:`${e.label} feedback: ${t}.${e.note?` ${e.note}`:``}`,avoid:`Decoration. A status role means state; a colour that carries no message belongs to the general --color-* family.`}}let d=s.find(e=>c.startsWith(e.prefix));return d?{purpose:d.purpose}:null}export{i as ACTION,t as BORDERS,n as CARD_EDGES,s as OTHER,a as STATUS_SLOTS,o as STATUS_TONES,e as SURFACES,r as TEXT,c as purposeOf};
260
2
  //# sourceMappingURL=token-purposes.js.map