@reqvire-org/ads 0.5.0 → 0.5.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 (554) hide show
  1. package/README.md +9 -6
  2. package/dist/ads-errors.mjs +382 -34
  3. package/dist/ads-views.mjs +4 -4
  4. package/dist/analysis/composition-axes.mjs +48 -0
  5. package/dist/analysis/construction-memo.mjs +38 -0
  6. package/dist/analysis/context.mjs +19 -0
  7. package/dist/analysis/design-reads.mjs +177 -0
  8. package/dist/analysis/design-usage.mjs +20 -4
  9. package/dist/analysis/factored-classes.mjs +90 -0
  10. package/dist/analysis/helpers.mjs +5 -7
  11. package/dist/analysis/mock-check.mjs +5 -4
  12. package/dist/analysis/native-project.mjs +12 -0
  13. package/dist/analysis/owner-analysis-cache.mjs +86 -23
  14. package/dist/analysis/owner-analysis-key.mjs +42 -10
  15. package/dist/analysis/owner-choices.mjs +195 -43
  16. package/dist/analysis/owner-composition.mjs +152 -43
  17. package/dist/analysis/owner-controls.mjs +27 -0
  18. package/dist/analysis/owner-reuse.mjs +8 -6
  19. package/dist/analysis/owner-source.mjs +309 -83
  20. package/dist/analysis/prose-owners.mjs +57 -0
  21. package/dist/analysis/scenario-keys.mjs +10 -7
  22. package/dist/analysis/service.mjs +50 -3
  23. package/dist/analysis/standalone.mjs +7 -4
  24. package/dist/analysis/styling-ownership.mjs +22 -0
  25. package/dist/analysis/syntax.mjs +59 -1
  26. package/dist/analysis/worker-protocol.mjs +14 -2
  27. package/dist/analysis/worker.mjs +32 -10
  28. package/dist/architecture-report.mjs +26 -0
  29. package/dist/asset-view-facts.mjs +16 -2
  30. package/dist/boundaries.mjs +26 -10
  31. package/dist/bun-compiler.mjs +2 -2
  32. package/dist/check-service.mjs +29 -17
  33. package/dist/check.mjs +20 -7
  34. package/dist/cli-arguments.mjs +2 -2
  35. package/dist/cli.mjs +4 -4
  36. package/dist/composed-contrast.mjs +28 -8
  37. package/dist/composed-keyline.mjs +107 -0
  38. package/dist/config.mjs +2 -1
  39. package/dist/construction-output.mjs +149 -20
  40. package/dist/construction-spec.d.mts +320 -12
  41. package/dist/construction-spec.mjs +452 -69
  42. package/dist/corner-overpaint.mjs +65 -0
  43. package/dist/derived-states.mjs +182 -0
  44. package/dist/design-foundation.mjs +6 -1
  45. package/dist/design-inputs.mjs +18 -3
  46. package/dist/design-system-closure.mjs +12 -7
  47. package/dist/design-usage.mjs +8 -2
  48. package/dist/emit/contract.mjs +24 -5
  49. package/dist/emit/emission.mjs +14 -5
  50. package/dist/emit/font-emission.mjs +21 -1
  51. package/dist/emit/foundation-sheet.mjs +6 -5
  52. package/dist/emit/integrity.mjs +8 -2
  53. package/dist/emit/output-watch.mjs +120 -0
  54. package/dist/emit/owner-emission-cache.mjs +4 -4
  55. package/dist/emit/preview-emitter.mjs +4 -2
  56. package/dist/emit/preview-tree.mjs +1 -1
  57. package/dist/emit/service.mjs +8 -2
  58. package/dist/finding-rules.mjs +10 -0
  59. package/dist/font-checks.mjs +42 -0
  60. package/dist/font-declaration.d.mts +10 -0
  61. package/dist/font-declaration.mjs +25 -3
  62. package/dist/font-fallback.d.mts +37 -0
  63. package/dist/font-fallback.mjs +25 -0
  64. package/dist/font-macro.d.mts +10 -0
  65. package/dist/font-metrics.d.mts +34 -0
  66. package/dist/font-metrics.mjs +314 -0
  67. package/dist/font-model.mjs +28 -2
  68. package/dist/form-states.mjs +8 -0
  69. package/dist/foundation-macro.d.mts +1 -1
  70. package/dist/frame-regions.mjs +92 -9
  71. package/dist/grid-facts.mjs +72 -16
  72. package/dist/grid-lowering.mjs +11 -5
  73. package/dist/hover-geometry.mjs +15 -0
  74. package/dist/init.mjs +14 -23
  75. package/dist/input-digests.mjs +17 -10
  76. package/dist/linaria/delivery.mjs +2 -0
  77. package/dist/lowering-enter.mjs +31 -0
  78. package/dist/lowering-properties.mjs +27 -1
  79. package/dist/lowering-region-layout.mjs +49 -10
  80. package/dist/lowering-sequence.mjs +89 -0
  81. package/dist/lowering-session.mjs +7 -0
  82. package/dist/lowering-transitions.mjs +22 -8
  83. package/dist/mcp/build-status.mjs +9 -1
  84. package/dist/mcp/compiler-channel.mjs +11 -4
  85. package/dist/mcp/mutations.mjs +1 -0
  86. package/dist/mcp/preview-http.bundle.js +2 -2
  87. package/dist/mcp/preview-watch.mjs +2 -1
  88. package/dist/mcp/preview-widget.bundle.js +5 -5
  89. package/dist/motion-model.mjs +3 -1
  90. package/dist/owner-analysis-check.mjs +86 -12
  91. package/dist/owner-errors.mjs +20 -2
  92. package/dist/owner-lowering.mjs +104 -25
  93. package/dist/owner-scenarios.mjs +29 -4
  94. package/dist/ownership-model.mjs +37 -4
  95. package/dist/paint-contrast.mjs +5 -0
  96. package/dist/placeholder-contrast.mjs +18 -1
  97. package/dist/platform-features.mjs +35 -2
  98. package/dist/preview-bun.mjs +17 -16
  99. package/dist/preview-controls.mjs +35 -0
  100. package/dist/preview-incremental.mjs +1 -1
  101. package/dist/preview-source.mjs +2 -2
  102. package/dist/profile-macro.d.mts +15 -0
  103. package/dist/profile-model.mjs +3 -3
  104. package/dist/profile-view-facts.mjs +55 -4
  105. package/dist/prose-model.d.mts +81 -0
  106. package/dist/prose-model.mjs +101 -0
  107. package/dist/recipe-macro.d.mts +176 -15
  108. package/dist/recipe-model.mjs +35 -7
  109. package/dist/region-lowering.mjs +463 -65
  110. package/dist/render-audit/corner-overpaint.page.mjs +54 -0
  111. package/dist/render-audit/layout-shift.page.mjs +24 -0
  112. package/dist/render-audit/render-states.mjs +122 -1
  113. package/dist/render-audit/render-states.page.mjs +140 -0
  114. package/dist/render-audit/worker.mjs +23 -3
  115. package/dist/render-audit.mjs +139 -1
  116. package/dist/role-vocabulary.d.mts +43 -2
  117. package/dist/role-vocabulary.mjs +50 -4
  118. package/dist/scenario-kit.d.mts +6 -0
  119. package/dist/scenario-registry.mjs +1 -1
  120. package/dist/scenarios-compiler.mjs +20 -6
  121. package/dist/scheme-switch.d.mts +8 -0
  122. package/dist/scheme-switch.mjs +1 -0
  123. package/dist/showcase/ads-views.mjs +116 -53
  124. package/dist/showcase/assets-view.mjs +136 -89
  125. package/dist/showcase/client.bundle.js +65 -65
  126. package/dist/showcase/http-client.bundle.js +17 -17
  127. package/dist/showcase/preview-frame.css +2 -0
  128. package/dist/showcase/profiles-view.mjs +163 -122
  129. package/dist/showcase/scenario-page.d.mts +11 -1
  130. package/dist/showcase/scenario-page.mjs +18 -3
  131. package/dist/showcase/token-sample.mjs +47 -4
  132. package/dist/showcase/tokens-view.mjs +82 -34
  133. package/dist/showcase/ui/ui.css +1 -1
  134. package/dist/showcase/ui/ui.js +5 -5
  135. package/dist/skills/README.md +5 -5
  136. package/dist/skills/ads-designer/README.md +1 -1
  137. package/dist/skills/ads-designer/SKILL.md +13 -12
  138. package/dist/skills/ads-designer/references/accessibility.md +9 -2
  139. package/dist/skills/ads-designer/references/atomic-styles.md +8 -1
  140. package/dist/skills/ads-designer/references/branding.md +20 -5
  141. package/dist/skills/ads-designer/references/cli.md +4 -4
  142. package/dist/skills/ads-designer/references/contracts.md +14 -4
  143. package/dist/skills/ads-designer/references/design-craft.md +1 -1
  144. package/dist/skills/ads-designer/references/design-data.md +3 -3
  145. package/dist/skills/ads-designer/references/forms.md +6 -6
  146. package/dist/skills/ads-designer/references/layout.md +46 -3
  147. package/dist/skills/ads-designer/references/motion.md +45 -1
  148. package/dist/skills/ads-designer/references/performance.md +7 -1
  149. package/dist/skills/ads-designer/references/recipes.md +92 -7
  150. package/dist/skills/ads-designer/references/runtimes.md +1 -1
  151. package/dist/skills/ads-designer/references/scenarios.md +1 -0
  152. package/dist/skills/ads-import/references/atomic-styles.md +8 -1
  153. package/dist/skills/ads-import/references/cli.md +4 -4
  154. package/dist/skills/ads-import/references/contracts.md +14 -4
  155. package/dist/skills/ads-import/references/design-data.md +3 -3
  156. package/dist/skills/ads-import/references/forms.md +6 -6
  157. package/dist/skills/ads-import/references/layout.md +46 -3
  158. package/dist/skills/ads-import/references/recipes.md +92 -7
  159. package/dist/skills/ads-import/references/runtimes.md +1 -1
  160. package/dist/skills/ads-import/references/scenarios.md +1 -0
  161. package/dist/skills/ads-migrate/SKILL.md +3 -1
  162. package/dist/skills/ads-migrate/references/0.5.0-to-0.5.1.md +239 -0
  163. package/dist/skills/ads-migrate/references/0.5.1-to-0.5.2.md +185 -0
  164. package/dist/skills/ads-port/references/atomic-styles.md +8 -1
  165. package/dist/skills/ads-port/references/cli.md +4 -4
  166. package/dist/skills/ads-port/references/contracts.md +14 -4
  167. package/dist/skills/ads-port/references/design-data.md +3 -3
  168. package/dist/skills/ads-port/references/forms.md +6 -6
  169. package/dist/skills/ads-port/references/layout.md +46 -3
  170. package/dist/skills/ads-port/references/recipes.md +92 -7
  171. package/dist/skills/ads-port/references/runtimes.md +1 -1
  172. package/dist/skills/ads-port/references/scenarios.md +1 -0
  173. package/dist/spatial-model.mjs +20 -4
  174. package/dist/state-conditions.d.mts +29 -0
  175. package/dist/state-conditions.mjs +42 -2
  176. package/dist/surface-contrast.mjs +69 -10
  177. package/dist/surface-effects.mjs +100 -0
  178. package/dist/target-size.mjs +1 -1
  179. package/dist/task-cache.mjs +9 -19
  180. package/dist/token-dtcg.mjs +1 -0
  181. package/dist/token-view-facts.mjs +54 -5
  182. package/dist/unreached-sources.mjs +5 -0
  183. package/dist/validation-checks.mjs +1 -1
  184. package/dist/validation.mjs +1 -1
  185. package/docs/ADS.md +36 -13
  186. package/docs/ARCHITECTURE.md +223 -23
  187. package/docs/ASSETS.md +81 -10
  188. package/docs/CACHING.md +152 -24
  189. package/docs/CHANGELOG.md +525 -23
  190. package/docs/DESIGN-REFERENCES.md +5 -5
  191. package/docs/GUIDE.md +286 -73
  192. package/docs/LANGUAGE.md +428 -24
  193. package/docs/LOWERING.md +13 -1
  194. package/docs/MOTION.md +241 -7
  195. package/docs/PROFILE-KINDS.md +176 -14
  196. package/docs/PROFILES.md +2 -2
  197. package/docs/RULES.md +63 -24
  198. package/docs/TOKEN-ROLES.md +15 -7
  199. package/package.json +1 -1
  200. package/dist/starter-files.mjs +0 -155
  201. package/dist/starter-overlay.mjs +0 -189
  202. package/dist/starters/preact/design-system/assets/avatars/avatar.ads.ts +0 -10
  203. package/dist/starters/preact/design-system/assets/avatars/member.svg +0 -1
  204. package/dist/starters/preact/design-system/assets/brand/emblem.ads.ts +0 -18
  205. package/dist/starters/preact/design-system/assets/brand/emblem.svg +0 -4
  206. package/dist/starters/preact/design-system/assets/brand/iris-emblem.ads.ts +0 -14
  207. package/dist/starters/preact/design-system/assets/brand/iris-emblem.svg +0 -4
  208. package/dist/starters/preact/design-system/assets/brand/mark.ads.ts +0 -14
  209. package/dist/starters/preact/design-system/assets/brand/mark.svg +0 -1
  210. package/dist/starters/preact/design-system/assets/glyphs/arrow.ads.ts +0 -14
  211. package/dist/starters/preact/design-system/assets/glyphs/arrow.svg +0 -1
  212. package/dist/starters/preact/design-system/assets/glyphs/chevron-20.svg +0 -1
  213. package/dist/starters/preact/design-system/assets/glyphs/chevron-24.svg +0 -1
  214. package/dist/starters/preact/design-system/assets/glyphs/chevron.ads.ts +0 -20
  215. package/dist/starters/preact/design-system/assets/glyphs/close.ads.ts +0 -13
  216. package/dist/starters/preact/design-system/assets/glyphs/close.svg +0 -1
  217. package/dist/starters/preact/design-system/assets/glyphs/favorite.ads.ts +0 -23
  218. package/dist/starters/preact/design-system/assets/glyphs/favorite.normal.svg +0 -1
  219. package/dist/starters/preact/design-system/assets/glyphs/favorite.selected.svg +0 -1
  220. package/dist/starters/preact/design-system/assets/glyphs/search.ads.ts +0 -10
  221. package/dist/starters/preact/design-system/assets/glyphs/search.svg +0 -1
  222. package/dist/starters/preact/design-system/assets/illustrations/journey.ads.ts +0 -32
  223. package/dist/starters/preact/design-system/assets/illustrations/journey.contrast.svg +0 -6
  224. package/dist/starters/preact/design-system/assets/illustrations/journey.dark.svg +0 -13
  225. package/dist/starters/preact/design-system/assets/illustrations/journey.light.svg +0 -13
  226. package/dist/starters/preact/design-system/assets/logos/harbor-pay.ads.ts +0 -17
  227. package/dist/starters/preact/design-system/assets/logos/harbor-pay.dark.svg +0 -10
  228. package/dist/starters/preact/design-system/assets/logos/harbor-pay.light.svg +0 -10
  229. package/dist/starters/preact/design-system/assets/logos/lumen-cloud.ads.ts +0 -15
  230. package/dist/starters/preact/design-system/assets/logos/lumen-cloud.dark.svg +0 -9
  231. package/dist/starters/preact/design-system/assets/logos/lumen-cloud.light.svg +0 -9
  232. package/dist/starters/preact/design-system/assets/status/error.svg +0 -1
  233. package/dist/starters/preact/design-system/assets/status/outcomes.ads.ts +0 -31
  234. package/dist/starters/preact/design-system/assets/status/status.ads.ts +0 -16
  235. package/dist/starters/preact/design-system/assets/status/success.svg +0 -1
  236. package/dist/starters/preact/design-system/assets/status/sync-status.ads.ts +0 -14
  237. package/dist/starters/preact/design-system/assets/status/sync-status.svg +0 -7
  238. package/dist/starters/preact/design-system/assets/status/warning.svg +0 -1
  239. package/dist/starters/preact/design-system/components/Actions/Button/Button.ads.scenario.tsx +0 -12
  240. package/dist/starters/preact/design-system/components/Actions/Button/Button.tsx +0 -198
  241. package/dist/starters/preact/design-system/components/Actions/IconButton/IconButton.tsx +0 -95
  242. package/dist/starters/preact/design-system/components/Actions/ToggleTile/ToggleTile.ads.scenario.tsx +0 -22
  243. package/dist/starters/preact/design-system/components/Actions/ToggleTile/ToggleTile.tsx +0 -60
  244. package/dist/starters/preact/design-system/components/Containers/Disclosure/Disclosure.ads.scenario.tsx +0 -24
  245. package/dist/starters/preact/design-system/components/Containers/Disclosure/Disclosure.tsx +0 -50
  246. package/dist/starters/preact/design-system/components/Content/Artwork/Artwork.ads.scenario.tsx +0 -8
  247. package/dist/starters/preact/design-system/components/Content/Artwork/Artwork.tsx +0 -110
  248. package/dist/starters/preact/design-system/components/Content/BarChart/BarChart.ads.scenario.tsx +0 -25
  249. package/dist/starters/preact/design-system/components/Content/BarChart/BarChart.tsx +0 -72
  250. package/dist/starters/preact/design-system/components/Content/GuideGrid/GuideGrid.ads.scenario.tsx +0 -8
  251. package/dist/starters/preact/design-system/components/Content/GuideGrid/GuideGrid.tsx +0 -43
  252. package/dist/starters/preact/design-system/components/Content/Icon/Icon.ads.scenario.tsx +0 -21
  253. package/dist/starters/preact/design-system/components/Content/Icon/Icon.tsx +0 -41
  254. package/dist/starters/preact/design-system/components/Content/Icon/glyphs/arrow.tsx +0 -10
  255. package/dist/starters/preact/design-system/components/Content/Icon/glyphs/close.tsx +0 -10
  256. package/dist/starters/preact/design-system/components/Content/Icon/glyphs/search.tsx +0 -10
  257. package/dist/starters/preact/design-system/components/Content/Image/Image.ads.fixture.ts +0 -9
  258. package/dist/starters/preact/design-system/components/Content/Image/Image.ads.scenario.tsx +0 -12
  259. package/dist/starters/preact/design-system/components/Content/Image/Image.tsx +0 -83
  260. package/dist/starters/preact/design-system/components/Content/InspectedGlyph/InspectedGlyph.ads.scenario.tsx +0 -27
  261. package/dist/starters/preact/design-system/components/Content/InspectedGlyph/InspectedGlyph.tsx +0 -46
  262. package/dist/starters/preact/design-system/components/Content/PartnerLogo/PartnerLogo.ads.scenario.tsx +0 -17
  263. package/dist/starters/preact/design-system/components/Content/PartnerLogo/PartnerLogo.tsx +0 -41
  264. package/dist/starters/preact/design-system/components/Content/StatusIcon/StatusIcon.ads.scenario.tsx +0 -20
  265. package/dist/starters/preact/design-system/components/Content/StatusIcon/StatusIcon.tsx +0 -37
  266. package/dist/starters/preact/design-system/components/Forms/TextField/TextField.ads.scenario.tsx +0 -24
  267. package/dist/starters/preact/design-system/components/Forms/TextField/TextField.tsx +0 -173
  268. package/dist/starters/preact/design-system/components/Identity/Identity.ads.scenario.tsx +0 -13
  269. package/dist/starters/preact/design-system/components/Identity/Identity.tsx +0 -146
  270. package/dist/starters/preact/design-system/components/Overlays/Menu/Menu.ads.scenario.tsx +0 -27
  271. package/dist/starters/preact/design-system/components/Overlays/Menu/Menu.tsx +0 -194
  272. package/dist/starters/preact/design-system/components/Overlays/Popover/Popover.ads.scenario.tsx +0 -19
  273. package/dist/starters/preact/design-system/components/Overlays/Popover/Popover.tsx +0 -37
  274. package/dist/starters/preact/design-system/controllers/FormField/FormField.ads.behavior.ts +0 -70
  275. package/dist/starters/preact/design-system/controllers/FormField/FormField.behavior.spec.ts +0 -237
  276. package/dist/starters/preact/design-system/controllers/FormField/FormField.ts +0 -343
  277. package/dist/starters/preact/design-system/controllers/FormField/useFormField.ts +0 -70
  278. package/dist/starters/preact/design-system/controllers/Palette/Palette.ts +0 -165
  279. package/dist/starters/preact/design-system/foundation.ads.ts +0 -22
  280. package/dist/starters/preact/design-system/index.ts +0 -51
  281. package/dist/starters/preact/design-system/mocks/ConstructionProofs/ConstructionProofs.ads.fixture.ts +0 -5
  282. package/dist/starters/preact/design-system/mocks/ConstructionProofs/ConstructionProofs.ads.scenario.tsx +0 -22
  283. package/dist/starters/preact/design-system/mocks/Inspector/Inspector.ads.fixture.ts +0 -12
  284. package/dist/starters/preact/design-system/mocks/Inspector/Inspector.ads.scenario.tsx +0 -21
  285. package/dist/starters/preact/design-system/mocks/Workspace/Layouts.ads.scenario.tsx +0 -24
  286. package/dist/starters/preact/design-system/mocks/Workspace/Media.ads.scenario.tsx +0 -24
  287. package/dist/starters/preact/design-system/mocks/Workspace/Stress.ads.scenario.tsx +0 -36
  288. package/dist/starters/preact/design-system/mocks/Workspace/Workspace.ads.fixture.ts +0 -13
  289. package/dist/starters/preact/design-system/mocks/Workspace/Workspace.ads.scenario.tsx +0 -27
  290. package/dist/starters/preact/design-system/mocks/Workspace/media/ads.svg +0 -1
  291. package/dist/starters/preact/design-system/palette.generated.ts +0 -188
  292. package/dist/starters/preact/design-system/patterns/ArtworkCatalogue/ArtworkCatalogue/ArtworkCatalogue.tsx +0 -73
  293. package/dist/starters/preact/design-system/patterns/ConstructionWorkbench/ConstructionWorkbench/ConstructionWorkbench.ads.scenario.tsx +0 -23
  294. package/dist/starters/preact/design-system/patterns/ConstructionWorkbench/ConstructionWorkbench/ConstructionWorkbench.tsx +0 -94
  295. package/dist/starters/preact/design-system/patterns/Forms/InviteMember/InviteMember.ads.scenario.tsx +0 -21
  296. package/dist/starters/preact/design-system/patterns/Forms/InviteMember/InviteMember.tsx +0 -137
  297. package/dist/starters/preact/design-system/patterns/Inspector/Inspector/Inspector.ads.scenario.tsx +0 -22
  298. package/dist/starters/preact/design-system/patterns/Inspector/Inspector/Inspector.tsx +0 -248
  299. package/dist/starters/preact/design-system/patterns/Shell/Shell.ads.scenario.tsx +0 -26
  300. package/dist/starters/preact/design-system/patterns/Shell/Shell.tsx +0 -268
  301. package/dist/starters/preact/design-system/patterns/Workspace/Workspace/Workspace.ads.scenario.tsx +0 -28
  302. package/dist/starters/preact/design-system/patterns/Workspace/Workspace/Workspace.tsx +0 -105
  303. package/dist/starters/preact/design-system/patterns/Workspace/Workspace/WorkspacePanels.tsx +0 -179
  304. package/dist/starters/preact/design-system/profiles/Containers/containers.ads.ts +0 -67
  305. package/dist/starters/preact/design-system/profiles/Containers/frames.ads.ts +0 -32
  306. package/dist/starters/preact/design-system/profiles/Containers/geometry.ads.ts +0 -30
  307. package/dist/starters/preact/design-system/profiles/Containers/spacing.ads.ts +0 -26
  308. package/dist/starters/preact/design-system/profiles/Controls/controls.ads.ts +0 -157
  309. package/dist/starters/preact/design-system/profiles/Controls/frames.ads.ts +0 -50
  310. package/dist/starters/preact/design-system/profiles/Controls/spacing.ads.ts +0 -29
  311. package/dist/starters/preact/design-system/profiles/Focus/keyboard.ads.ts +0 -13
  312. package/dist/starters/preact/design-system/profiles/Identity/identity.ads.ts +0 -25
  313. package/dist/starters/preact/design-system/profiles/Identity/spacing.ads.ts +0 -22
  314. package/dist/starters/preact/design-system/profiles/Layout/grid.ads.ts +0 -69
  315. package/dist/starters/preact/design-system/profiles/Layout/inspector.ads.ts +0 -146
  316. package/dist/starters/preact/design-system/profiles/Layout/overlays.ads.ts +0 -94
  317. package/dist/starters/preact/design-system/profiles/Layout/regions.ads.ts +0 -296
  318. package/dist/starters/preact/design-system/profiles/Motion/feedback.ads.ts +0 -92
  319. package/dist/starters/preact/design-system/profiles/Surfaces/controls.ads.ts +0 -142
  320. package/dist/starters/preact/design-system/profiles/Surfaces/document.ads.ts +0 -2
  321. package/dist/starters/preact/design-system/profiles/Surfaces/materials.ads.ts +0 -18
  322. package/dist/starters/preact/design-system/profiles/Surfaces/surfaces.ads.ts +0 -48
  323. package/dist/starters/preact/design-system/profiles/Typography/details.ads.ts +0 -19
  324. package/dist/starters/preact/design-system/profiles/Typography/document.ads.ts +0 -2
  325. package/dist/starters/preact/design-system/profiles/Typography/headings.ads.ts +0 -15
  326. package/dist/starters/preact/design-system/profiles/Typography/text.ads.ts +0 -73
  327. package/dist/starters/preact/design-system/profiles/Visuals/artwork.ads.ts +0 -46
  328. package/dist/starters/preact/design-system/profiles/Visuals/charts.ads.ts +0 -31
  329. package/dist/starters/preact/design-system/profiles/Visuals/content.ads.ts +0 -52
  330. package/dist/starters/preact/design-system/profiles/Visuals/glyphs.ads.ts +0 -35
  331. package/dist/starters/preact/design-system/profiles/Visuals/identity.ads.ts +0 -24
  332. package/dist/starters/preact/design-system/tokens/Artwork/paint.ads.css +0 -7
  333. package/dist/starters/preact/design-system/tokens/Artwork/visual-size.ads.css +0 -12
  334. package/dist/starters/preact/design-system/tokens/Brand/paint.ads.css +0 -7
  335. package/dist/starters/preact/design-system/tokens/Charts/paint.ads.css +0 -19
  336. package/dist/starters/preact/design-system/tokens/Containers/border-width.ads.css +0 -1
  337. package/dist/starters/preact/design-system/tokens/Containers/content-gap.ads.css +0 -5
  338. package/dist/starters/preact/design-system/tokens/Containers/frame-inset.ads.css +0 -6
  339. package/dist/starters/preact/design-system/tokens/Containers/frame-size.ads.css +0 -11
  340. package/dist/starters/preact/design-system/tokens/Containers/radius.ads.css +0 -1
  341. package/dist/starters/preact/design-system/tokens/Controls/border-width.ads.css +0 -4
  342. package/dist/starters/preact/design-system/tokens/Controls/content-gap.ads.css +0 -6
  343. package/dist/starters/preact/design-system/tokens/Controls/control-min-size.ads.css +0 -17
  344. package/dist/starters/preact/design-system/tokens/Controls/frame-inset.ads.css +0 -21
  345. package/dist/starters/preact/design-system/tokens/Controls/radius.ads.css +0 -1
  346. package/dist/starters/preact/design-system/tokens/Controls/target-min-size.ads.css +0 -2
  347. package/dist/starters/preact/design-system/tokens/Controls/visual-size.ads.css +0 -2
  348. package/dist/starters/preact/design-system/tokens/Focus/border-width.ads.css +0 -1
  349. package/dist/starters/preact/design-system/tokens/Focus/focus-offset.ads.css +0 -1
  350. package/dist/starters/preact/design-system/tokens/Foundation/spacing.ads.css +0 -20
  351. package/dist/starters/preact/design-system/tokens/Grid/grid-gutter.ads.css +0 -6
  352. package/dist/starters/preact/design-system/tokens/Grid/layer.ads.css +0 -2
  353. package/dist/starters/preact/design-system/tokens/Grid/layout-size.ads.css +0 -15
  354. package/dist/starters/preact/design-system/tokens/Grid/spacing.ads.css +0 -12
  355. package/dist/starters/preact/design-system/tokens/Grid/track-count.ads.css +0 -1
  356. package/dist/starters/preact/design-system/tokens/Identity/content-gap.ads.css +0 -6
  357. package/dist/starters/preact/design-system/tokens/Identity/visual-size.ads.css +0 -1
  358. package/dist/starters/preact/design-system/tokens/Motion/duration.ads.css +0 -6
  359. package/dist/starters/preact/design-system/tokens/Motion/easing.ads.css +0 -5
  360. package/dist/starters/preact/design-system/tokens/Motion/motion-angle.ads.css +0 -1
  361. package/dist/starters/preact/design-system/tokens/Motion/motion-distance.ads.css +0 -2
  362. package/dist/starters/preact/design-system/tokens/Motion/motion-scale.ads.css +0 -9
  363. package/dist/starters/preact/design-system/tokens/Surfaces/blur.ads.css +0 -2
  364. package/dist/starters/preact/design-system/tokens/Surfaces/gradient.ads.css +0 -2
  365. package/dist/starters/preact/design-system/tokens/Surfaces/opacity.ads.css +0 -2
  366. package/dist/starters/preact/design-system/tokens/Surfaces/paint.ads.css +0 -58
  367. package/dist/starters/preact/design-system/tokens/Surfaces/shadow.ads.css +0 -20
  368. package/dist/starters/preact/design-system/tokens/Typography/font-family.ads.css +0 -1
  369. package/dist/starters/preact/design-system/tokens/Typography/font-features.ads.css +0 -1
  370. package/dist/starters/preact/design-system/tokens/Typography/font-size.ads.css +0 -9
  371. package/dist/starters/preact/design-system/tokens/Typography/font-stretch.ads.css +0 -1
  372. package/dist/starters/preact/design-system/tokens/Typography/font-variations.ads.css +0 -1
  373. package/dist/starters/preact/design-system/tokens/Typography/font-weight.ads.css +0 -1
  374. package/dist/starters/preact/design-system/tokens/Typography/letter-spacing.ads.css +0 -1
  375. package/dist/starters/preact/design-system/tokens/Typography/line-height.ads.css +0 -11
  376. package/dist/starters/preact/design-system/tokens/Typography/word-spacing.ads.css +0 -1
  377. package/dist/starters/preact/starter.json +0 -11
  378. package/dist/starters/react/design-system/assets/avatars/avatar.ads.ts +0 -10
  379. package/dist/starters/react/design-system/assets/avatars/member.svg +0 -1
  380. package/dist/starters/react/design-system/assets/brand/emblem.ads.ts +0 -18
  381. package/dist/starters/react/design-system/assets/brand/emblem.svg +0 -4
  382. package/dist/starters/react/design-system/assets/brand/iris-emblem.ads.ts +0 -14
  383. package/dist/starters/react/design-system/assets/brand/iris-emblem.svg +0 -4
  384. package/dist/starters/react/design-system/assets/brand/mark.ads.ts +0 -14
  385. package/dist/starters/react/design-system/assets/brand/mark.svg +0 -1
  386. package/dist/starters/react/design-system/assets/glyphs/arrow.ads.ts +0 -14
  387. package/dist/starters/react/design-system/assets/glyphs/arrow.svg +0 -1
  388. package/dist/starters/react/design-system/assets/glyphs/chevron-20.svg +0 -1
  389. package/dist/starters/react/design-system/assets/glyphs/chevron-24.svg +0 -1
  390. package/dist/starters/react/design-system/assets/glyphs/chevron.ads.ts +0 -20
  391. package/dist/starters/react/design-system/assets/glyphs/close.ads.ts +0 -13
  392. package/dist/starters/react/design-system/assets/glyphs/close.svg +0 -1
  393. package/dist/starters/react/design-system/assets/glyphs/favorite.ads.ts +0 -23
  394. package/dist/starters/react/design-system/assets/glyphs/favorite.normal.svg +0 -1
  395. package/dist/starters/react/design-system/assets/glyphs/favorite.selected.svg +0 -1
  396. package/dist/starters/react/design-system/assets/glyphs/search.ads.ts +0 -10
  397. package/dist/starters/react/design-system/assets/glyphs/search.svg +0 -1
  398. package/dist/starters/react/design-system/assets/illustrations/journey.ads.ts +0 -32
  399. package/dist/starters/react/design-system/assets/illustrations/journey.contrast.svg +0 -6
  400. package/dist/starters/react/design-system/assets/illustrations/journey.dark.svg +0 -13
  401. package/dist/starters/react/design-system/assets/illustrations/journey.light.svg +0 -13
  402. package/dist/starters/react/design-system/assets/logos/harbor-pay.ads.ts +0 -17
  403. package/dist/starters/react/design-system/assets/logos/harbor-pay.dark.svg +0 -10
  404. package/dist/starters/react/design-system/assets/logos/harbor-pay.light.svg +0 -10
  405. package/dist/starters/react/design-system/assets/logos/lumen-cloud.ads.ts +0 -15
  406. package/dist/starters/react/design-system/assets/logos/lumen-cloud.dark.svg +0 -9
  407. package/dist/starters/react/design-system/assets/logos/lumen-cloud.light.svg +0 -9
  408. package/dist/starters/react/design-system/assets/status/error.svg +0 -1
  409. package/dist/starters/react/design-system/assets/status/outcomes.ads.ts +0 -31
  410. package/dist/starters/react/design-system/assets/status/status.ads.ts +0 -16
  411. package/dist/starters/react/design-system/assets/status/success.svg +0 -1
  412. package/dist/starters/react/design-system/assets/status/sync-status.ads.ts +0 -14
  413. package/dist/starters/react/design-system/assets/status/sync-status.svg +0 -7
  414. package/dist/starters/react/design-system/assets/status/warning.svg +0 -1
  415. package/dist/starters/react/design-system/components/Actions/Button/Button.ads.scenario.tsx +0 -12
  416. package/dist/starters/react/design-system/components/Actions/Button/Button.tsx +0 -198
  417. package/dist/starters/react/design-system/components/Actions/IconButton/IconButton.tsx +0 -95
  418. package/dist/starters/react/design-system/components/Actions/ToggleTile/ToggleTile.ads.scenario.tsx +0 -22
  419. package/dist/starters/react/design-system/components/Actions/ToggleTile/ToggleTile.tsx +0 -60
  420. package/dist/starters/react/design-system/components/Containers/Disclosure/Disclosure.ads.scenario.tsx +0 -24
  421. package/dist/starters/react/design-system/components/Containers/Disclosure/Disclosure.tsx +0 -50
  422. package/dist/starters/react/design-system/components/Content/Artwork/Artwork.ads.scenario.tsx +0 -8
  423. package/dist/starters/react/design-system/components/Content/Artwork/Artwork.tsx +0 -110
  424. package/dist/starters/react/design-system/components/Content/BarChart/BarChart.ads.scenario.tsx +0 -25
  425. package/dist/starters/react/design-system/components/Content/BarChart/BarChart.tsx +0 -72
  426. package/dist/starters/react/design-system/components/Content/GuideGrid/GuideGrid.ads.scenario.tsx +0 -8
  427. package/dist/starters/react/design-system/components/Content/GuideGrid/GuideGrid.tsx +0 -43
  428. package/dist/starters/react/design-system/components/Content/Icon/Icon.ads.scenario.tsx +0 -21
  429. package/dist/starters/react/design-system/components/Content/Icon/Icon.tsx +0 -41
  430. package/dist/starters/react/design-system/components/Content/Icon/glyphs/arrow.tsx +0 -10
  431. package/dist/starters/react/design-system/components/Content/Icon/glyphs/close.tsx +0 -10
  432. package/dist/starters/react/design-system/components/Content/Icon/glyphs/search.tsx +0 -10
  433. package/dist/starters/react/design-system/components/Content/Image/Image.ads.fixture.ts +0 -9
  434. package/dist/starters/react/design-system/components/Content/Image/Image.ads.scenario.tsx +0 -12
  435. package/dist/starters/react/design-system/components/Content/Image/Image.tsx +0 -83
  436. package/dist/starters/react/design-system/components/Content/InspectedGlyph/InspectedGlyph.ads.scenario.tsx +0 -27
  437. package/dist/starters/react/design-system/components/Content/InspectedGlyph/InspectedGlyph.tsx +0 -46
  438. package/dist/starters/react/design-system/components/Content/PartnerLogo/PartnerLogo.ads.scenario.tsx +0 -17
  439. package/dist/starters/react/design-system/components/Content/PartnerLogo/PartnerLogo.tsx +0 -41
  440. package/dist/starters/react/design-system/components/Content/StatusIcon/StatusIcon.ads.scenario.tsx +0 -20
  441. package/dist/starters/react/design-system/components/Content/StatusIcon/StatusIcon.tsx +0 -37
  442. package/dist/starters/react/design-system/components/Forms/TextField/TextField.ads.scenario.tsx +0 -24
  443. package/dist/starters/react/design-system/components/Forms/TextField/TextField.tsx +0 -173
  444. package/dist/starters/react/design-system/components/Identity/Identity.ads.scenario.tsx +0 -13
  445. package/dist/starters/react/design-system/components/Identity/Identity.tsx +0 -146
  446. package/dist/starters/react/design-system/components/Overlays/Menu/Menu.ads.scenario.tsx +0 -27
  447. package/dist/starters/react/design-system/components/Overlays/Menu/Menu.tsx +0 -194
  448. package/dist/starters/react/design-system/components/Overlays/Popover/Popover.ads.scenario.tsx +0 -19
  449. package/dist/starters/react/design-system/components/Overlays/Popover/Popover.tsx +0 -37
  450. package/dist/starters/react/design-system/controllers/FormField/FormField.ads.behavior.ts +0 -70
  451. package/dist/starters/react/design-system/controllers/FormField/FormField.behavior.spec.ts +0 -237
  452. package/dist/starters/react/design-system/controllers/FormField/FormField.ts +0 -343
  453. package/dist/starters/react/design-system/controllers/FormField/useFormField.ts +0 -70
  454. package/dist/starters/react/design-system/controllers/Palette/Palette.ts +0 -165
  455. package/dist/starters/react/design-system/foundation.ads.ts +0 -22
  456. package/dist/starters/react/design-system/index.ts +0 -51
  457. package/dist/starters/react/design-system/mocks/ConstructionProofs/ConstructionProofs.ads.fixture.ts +0 -5
  458. package/dist/starters/react/design-system/mocks/ConstructionProofs/ConstructionProofs.ads.scenario.tsx +0 -22
  459. package/dist/starters/react/design-system/mocks/Inspector/Inspector.ads.fixture.ts +0 -12
  460. package/dist/starters/react/design-system/mocks/Inspector/Inspector.ads.scenario.tsx +0 -21
  461. package/dist/starters/react/design-system/mocks/Workspace/Layouts.ads.scenario.tsx +0 -24
  462. package/dist/starters/react/design-system/mocks/Workspace/Media.ads.scenario.tsx +0 -24
  463. package/dist/starters/react/design-system/mocks/Workspace/Stress.ads.scenario.tsx +0 -36
  464. package/dist/starters/react/design-system/mocks/Workspace/Workspace.ads.fixture.ts +0 -13
  465. package/dist/starters/react/design-system/mocks/Workspace/Workspace.ads.scenario.tsx +0 -27
  466. package/dist/starters/react/design-system/mocks/Workspace/media/ads.svg +0 -1
  467. package/dist/starters/react/design-system/palette.generated.ts +0 -188
  468. package/dist/starters/react/design-system/patterns/ArtworkCatalogue/ArtworkCatalogue/ArtworkCatalogue.tsx +0 -73
  469. package/dist/starters/react/design-system/patterns/ConstructionWorkbench/ConstructionWorkbench/ConstructionWorkbench.ads.scenario.tsx +0 -23
  470. package/dist/starters/react/design-system/patterns/ConstructionWorkbench/ConstructionWorkbench/ConstructionWorkbench.tsx +0 -94
  471. package/dist/starters/react/design-system/patterns/Forms/InviteMember/InviteMember.ads.scenario.tsx +0 -21
  472. package/dist/starters/react/design-system/patterns/Forms/InviteMember/InviteMember.tsx +0 -137
  473. package/dist/starters/react/design-system/patterns/Inspector/Inspector/Inspector.ads.scenario.tsx +0 -22
  474. package/dist/starters/react/design-system/patterns/Inspector/Inspector/Inspector.tsx +0 -248
  475. package/dist/starters/react/design-system/patterns/Shell/Shell.ads.scenario.tsx +0 -26
  476. package/dist/starters/react/design-system/patterns/Shell/Shell.tsx +0 -268
  477. package/dist/starters/react/design-system/patterns/Workspace/Workspace/Workspace.ads.scenario.tsx +0 -28
  478. package/dist/starters/react/design-system/patterns/Workspace/Workspace/Workspace.tsx +0 -105
  479. package/dist/starters/react/design-system/patterns/Workspace/Workspace/WorkspacePanels.tsx +0 -179
  480. package/dist/starters/react/design-system/profiles/Containers/containers.ads.ts +0 -67
  481. package/dist/starters/react/design-system/profiles/Containers/frames.ads.ts +0 -32
  482. package/dist/starters/react/design-system/profiles/Containers/geometry.ads.ts +0 -30
  483. package/dist/starters/react/design-system/profiles/Containers/spacing.ads.ts +0 -26
  484. package/dist/starters/react/design-system/profiles/Controls/controls.ads.ts +0 -157
  485. package/dist/starters/react/design-system/profiles/Controls/frames.ads.ts +0 -50
  486. package/dist/starters/react/design-system/profiles/Controls/spacing.ads.ts +0 -29
  487. package/dist/starters/react/design-system/profiles/Focus/keyboard.ads.ts +0 -13
  488. package/dist/starters/react/design-system/profiles/Identity/identity.ads.ts +0 -25
  489. package/dist/starters/react/design-system/profiles/Identity/spacing.ads.ts +0 -22
  490. package/dist/starters/react/design-system/profiles/Layout/grid.ads.ts +0 -69
  491. package/dist/starters/react/design-system/profiles/Layout/inspector.ads.ts +0 -146
  492. package/dist/starters/react/design-system/profiles/Layout/overlays.ads.ts +0 -94
  493. package/dist/starters/react/design-system/profiles/Layout/regions.ads.ts +0 -296
  494. package/dist/starters/react/design-system/profiles/Motion/feedback.ads.ts +0 -92
  495. package/dist/starters/react/design-system/profiles/Surfaces/controls.ads.ts +0 -142
  496. package/dist/starters/react/design-system/profiles/Surfaces/document.ads.ts +0 -2
  497. package/dist/starters/react/design-system/profiles/Surfaces/materials.ads.ts +0 -18
  498. package/dist/starters/react/design-system/profiles/Surfaces/surfaces.ads.ts +0 -48
  499. package/dist/starters/react/design-system/profiles/Typography/details.ads.ts +0 -19
  500. package/dist/starters/react/design-system/profiles/Typography/document.ads.ts +0 -2
  501. package/dist/starters/react/design-system/profiles/Typography/headings.ads.ts +0 -15
  502. package/dist/starters/react/design-system/profiles/Typography/text.ads.ts +0 -73
  503. package/dist/starters/react/design-system/profiles/Visuals/artwork.ads.ts +0 -46
  504. package/dist/starters/react/design-system/profiles/Visuals/charts.ads.ts +0 -31
  505. package/dist/starters/react/design-system/profiles/Visuals/content.ads.ts +0 -52
  506. package/dist/starters/react/design-system/profiles/Visuals/glyphs.ads.ts +0 -35
  507. package/dist/starters/react/design-system/profiles/Visuals/identity.ads.ts +0 -24
  508. package/dist/starters/react/design-system/tokens/Artwork/paint.ads.css +0 -7
  509. package/dist/starters/react/design-system/tokens/Artwork/visual-size.ads.css +0 -12
  510. package/dist/starters/react/design-system/tokens/Brand/paint.ads.css +0 -7
  511. package/dist/starters/react/design-system/tokens/Charts/paint.ads.css +0 -19
  512. package/dist/starters/react/design-system/tokens/Containers/border-width.ads.css +0 -1
  513. package/dist/starters/react/design-system/tokens/Containers/content-gap.ads.css +0 -5
  514. package/dist/starters/react/design-system/tokens/Containers/frame-inset.ads.css +0 -6
  515. package/dist/starters/react/design-system/tokens/Containers/frame-size.ads.css +0 -11
  516. package/dist/starters/react/design-system/tokens/Containers/radius.ads.css +0 -1
  517. package/dist/starters/react/design-system/tokens/Controls/border-width.ads.css +0 -4
  518. package/dist/starters/react/design-system/tokens/Controls/content-gap.ads.css +0 -6
  519. package/dist/starters/react/design-system/tokens/Controls/control-min-size.ads.css +0 -17
  520. package/dist/starters/react/design-system/tokens/Controls/frame-inset.ads.css +0 -21
  521. package/dist/starters/react/design-system/tokens/Controls/radius.ads.css +0 -1
  522. package/dist/starters/react/design-system/tokens/Controls/target-min-size.ads.css +0 -2
  523. package/dist/starters/react/design-system/tokens/Controls/visual-size.ads.css +0 -2
  524. package/dist/starters/react/design-system/tokens/Focus/border-width.ads.css +0 -1
  525. package/dist/starters/react/design-system/tokens/Focus/focus-offset.ads.css +0 -1
  526. package/dist/starters/react/design-system/tokens/Foundation/spacing.ads.css +0 -20
  527. package/dist/starters/react/design-system/tokens/Grid/grid-gutter.ads.css +0 -6
  528. package/dist/starters/react/design-system/tokens/Grid/layer.ads.css +0 -2
  529. package/dist/starters/react/design-system/tokens/Grid/layout-size.ads.css +0 -15
  530. package/dist/starters/react/design-system/tokens/Grid/spacing.ads.css +0 -12
  531. package/dist/starters/react/design-system/tokens/Grid/track-count.ads.css +0 -1
  532. package/dist/starters/react/design-system/tokens/Identity/content-gap.ads.css +0 -6
  533. package/dist/starters/react/design-system/tokens/Identity/visual-size.ads.css +0 -1
  534. package/dist/starters/react/design-system/tokens/Motion/duration.ads.css +0 -6
  535. package/dist/starters/react/design-system/tokens/Motion/easing.ads.css +0 -5
  536. package/dist/starters/react/design-system/tokens/Motion/motion-angle.ads.css +0 -1
  537. package/dist/starters/react/design-system/tokens/Motion/motion-distance.ads.css +0 -2
  538. package/dist/starters/react/design-system/tokens/Motion/motion-scale.ads.css +0 -9
  539. package/dist/starters/react/design-system/tokens/Surfaces/blur.ads.css +0 -2
  540. package/dist/starters/react/design-system/tokens/Surfaces/gradient.ads.css +0 -2
  541. package/dist/starters/react/design-system/tokens/Surfaces/opacity.ads.css +0 -2
  542. package/dist/starters/react/design-system/tokens/Surfaces/paint.ads.css +0 -58
  543. package/dist/starters/react/design-system/tokens/Surfaces/shadow.ads.css +0 -20
  544. package/dist/starters/react/design-system/tokens/Typography/font-family.ads.css +0 -1
  545. package/dist/starters/react/design-system/tokens/Typography/font-features.ads.css +0 -1
  546. package/dist/starters/react/design-system/tokens/Typography/font-size.ads.css +0 -9
  547. package/dist/starters/react/design-system/tokens/Typography/font-stretch.ads.css +0 -1
  548. package/dist/starters/react/design-system/tokens/Typography/font-variations.ads.css +0 -1
  549. package/dist/starters/react/design-system/tokens/Typography/font-weight.ads.css +0 -1
  550. package/dist/starters/react/design-system/tokens/Typography/letter-spacing.ads.css +0 -1
  551. package/dist/starters/react/design-system/tokens/Typography/line-height.ads.css +0 -11
  552. package/dist/starters/react/design-system/tokens/Typography/word-spacing.ads.css +0 -1
  553. package/dist/starters/react/starter.json +0 -11
  554. package/docs/STARTER.md +0 -167
@@ -0,0 +1,314 @@
1
+ import { brotliDecompressSync, inflateSync } from "node:zlib";
2
+ import { err, ok } from "./result.mjs";
3
+ export const CHARACTER_FREQUENCY = {
4
+ " ": 1726,
5
+ e: 999,
6
+ t: 741,
7
+ o: 592,
8
+ a: 570,
9
+ n: 552,
10
+ s: 544,
11
+ r: 539,
12
+ i: 539,
13
+ h: 324,
14
+ d: 300,
15
+ c: 294,
16
+ l: 276,
17
+ p: 195,
18
+ u: 194,
19
+ m: 158,
20
+ f: 153,
21
+ ",": 118,
22
+ g: 118,
23
+ w: 114,
24
+ ".": 105,
25
+ y: 104,
26
+ v: 79,
27
+ b: 79,
28
+ k: 60,
29
+ A: 37,
30
+ "-": 37,
31
+ ")": 34,
32
+ "(": 33,
33
+ x: 32,
34
+ T: 31,
35
+ S: 28,
36
+ I: 20,
37
+ ":": 19,
38
+ C: 18,
39
+ "'": 18,
40
+ D: 15,
41
+ E: 14,
42
+ L: 14,
43
+ P: 14,
44
+ R: 12,
45
+ O: 12,
46
+ N: 10,
47
+ ";": 10,
48
+ W: 9,
49
+ '"': 8,
50
+ j: 8,
51
+ G: 7,
52
+ U: 7,
53
+ "1": 7,
54
+ M: 7,
55
+ "0": 6,
56
+ F: 6,
57
+ "2": 5,
58
+ q: 5,
59
+ z: 5
60
+ };
61
+
62
+ class Malformed extends Error {
63
+ }
64
+ const fail = (detail) => {
65
+ throw new Malformed(detail);
66
+ };
67
+ function reader(bytes) {
68
+ const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength), within = (offset, size) => {
69
+ if (offset < 0 || offset + size > bytes.byteLength)
70
+ fail(`read of ${size} bytes at ${offset} is outside ${bytes.byteLength} bytes`);
71
+ };
72
+ return {
73
+ length: bytes.byteLength,
74
+ u8: (offset) => (within(offset, 1), view.getUint8(offset)),
75
+ u16: (offset) => (within(offset, 2), view.getUint16(offset)),
76
+ i16: (offset) => (within(offset, 2), view.getInt16(offset)),
77
+ u32: (offset) => (within(offset, 4), view.getUint32(offset)),
78
+ tag: (offset) => (within(offset, 4), String.fromCharCode(...bytes.subarray(offset, offset + 4))),
79
+ slice: (offset, size) => (within(offset, size), bytes.subarray(offset, offset + size))
80
+ };
81
+ }
82
+ const WANTED = ["head", "hhea", "OS/2", "cmap", "hmtx"];
83
+ function sfntTables(bytes) {
84
+ const read = reader(bytes);
85
+ if (read.tag(0) === "ttcf")
86
+ throw new Collection;
87
+ const count = read.u16(4), found = new Map;
88
+ for (let index = 0;index < count; index++) {
89
+ const at = 12 + index * 16, tag = read.tag(at);
90
+ if (WANTED.includes(tag))
91
+ found.set(tag, read.slice(read.u32(at + 8), read.u32(at + 12)));
92
+ }
93
+ return { get: (tag) => found.get(tag), hmtxTransformed: !1 };
94
+ }
95
+ function woffTables(bytes) {
96
+ const read = reader(bytes);
97
+ if (read.tag(4) === "ttcf")
98
+ throw new Collection;
99
+ const count = read.u16(12), found = new Map;
100
+ for (let index = 0;index < count; index++) {
101
+ const at = 44 + index * 20, tag = read.tag(at);
102
+ if (!WANTED.includes(tag))
103
+ continue;
104
+ const stored = read.slice(read.u32(at + 4), read.u32(at + 8)), length = read.u32(at + 12), table = stored.byteLength < length ? new Uint8Array(inflateSync(stored)) : stored;
105
+ if (table.byteLength !== length)
106
+ fail(`table ${tag} inflates to ${table.byteLength} bytes, not ${length}`);
107
+ found.set(tag, table);
108
+ }
109
+ return { get: (tag) => found.get(tag), hmtxTransformed: !1 };
110
+ }
111
+ const WOFF2_TAGS = [
112
+ "cmap",
113
+ "head",
114
+ "hhea",
115
+ "hmtx",
116
+ "maxp",
117
+ "name",
118
+ "OS/2",
119
+ "post",
120
+ "cvt ",
121
+ "fpgm",
122
+ "glyf",
123
+ "loca",
124
+ "prep",
125
+ "CFF ",
126
+ "VORG",
127
+ "EBDT",
128
+ "EBLC",
129
+ "gasp",
130
+ "hdmx",
131
+ "kern",
132
+ "LTSH",
133
+ "PCLT",
134
+ "VDMX",
135
+ "vhea",
136
+ "vmtx",
137
+ "BASE",
138
+ "GDEF",
139
+ "GPOS",
140
+ "GSUB",
141
+ "EBSC",
142
+ "JSTF",
143
+ "MATH",
144
+ "CBDT",
145
+ "CBLC",
146
+ "COLR",
147
+ "CPAL",
148
+ "SVG ",
149
+ "sbix",
150
+ "acnt",
151
+ "avar",
152
+ "bdat",
153
+ "bloc",
154
+ "bsln",
155
+ "cvar",
156
+ "fdsc",
157
+ "feat",
158
+ "fmtx",
159
+ "fvar",
160
+ "gvar",
161
+ "hsty",
162
+ "just",
163
+ "lcar",
164
+ "mort",
165
+ "morx",
166
+ "opbd",
167
+ "prop",
168
+ "trak",
169
+ "Zapf",
170
+ "Silf",
171
+ "Glat",
172
+ "Gloc",
173
+ "Feat",
174
+ "Sill"
175
+ ];
176
+ function woff2Tables(bytes) {
177
+ const read = reader(bytes);
178
+ if (read.tag(4) === "ttcf")
179
+ throw new Collection;
180
+ const count = read.u16(12), compressed = read.u32(20);
181
+ let at = 48;
182
+ const base128 = () => {
183
+ let value = 0;
184
+ for (let index = 0;index < 5; index++) {
185
+ const byte = read.u8(at++);
186
+ value = value * 128 + (byte & 127);
187
+ if ((byte & 128) === 0)
188
+ return value;
189
+ }
190
+ return fail("a WOFF2 table length runs past five bytes");
191
+ }, entries = [];
192
+ for (let index = 0;index < count; index++) {
193
+ const flags = read.u8(at++), known = flags & 63, tag = known === 63 ? (at += 4, read.tag(at - 4)) : WOFF2_TAGS[known] ?? fail(`unknown WOFF2 table index ${known}`), version = flags >> 6, original = base128(), transformed = tag === "glyf" || tag === "loca" ? version !== 3 : version !== 0;
194
+ entries.push({ tag, length: transformed ? base128() : original, transformed });
195
+ }
196
+ const stream = new Uint8Array(brotliDecompressSync(read.slice(at, compressed))), found = new Map;
197
+ let offset = 0, hmtxTransformed = !1;
198
+ for (const entry of entries) {
199
+ if (WANTED.includes(entry.tag)) {
200
+ if (offset + entry.length > stream.byteLength)
201
+ fail(`table ${entry.tag} ends outside the decompressed data`);
202
+ if (entry.transformed && entry.tag !== "hmtx")
203
+ fail(`table ${entry.tag} is stored transformed`);
204
+ found.set(entry.tag, stream.subarray(offset, offset + entry.length));
205
+ if (entry.tag === "hmtx")
206
+ hmtxTransformed = entry.transformed;
207
+ }
208
+ offset += entry.length;
209
+ }
210
+ return { get: (tag) => found.get(tag), hmtxTransformed };
211
+ }
212
+
213
+ class Collection extends Error {
214
+ }
215
+
216
+ class Missing extends Error {
217
+ table;
218
+ constructor(table) {
219
+ super(table);
220
+ this.table = table;
221
+ }
222
+ }
223
+ function glyphLookup(cmap) {
224
+ const count = cmap.u16(2), subtables = Array.from({ length: count }, (_, index) => ({ platform: cmap.u16(4 + index * 8), encoding: cmap.u16(6 + index * 8), offset: cmap.u32(8 + index * 8) })), rank = (table) => {
225
+ if (table.platform === 3 && table.encoding === 10)
226
+ return 0;
227
+ if (table.platform === 0 && table.encoding >= 4)
228
+ return 1;
229
+ if (table.platform === 3 && table.encoding === 1)
230
+ return 2;
231
+ if (table.platform === 0)
232
+ return 3;
233
+ return 9;
234
+ };
235
+ for (const table of subtables.filter((item) => rank(item) < 9).sort((a, b) => rank(a) - rank(b))) {
236
+ const base = table.offset, format = cmap.u16(base);
237
+ if (format === 12) {
238
+ const groups = cmap.u32(base + 12);
239
+ return (code) => {
240
+ for (let index = 0;index < groups; index++) {
241
+ const at = base + 16 + index * 12, start = cmap.u32(at);
242
+ if (code < start)
243
+ return 0;
244
+ if (code <= cmap.u32(at + 4))
245
+ return cmap.u32(at + 8) + (code - start);
246
+ }
247
+ return 0;
248
+ };
249
+ }
250
+ if (format === 4) {
251
+ const segments = cmap.u16(base + 6) / 2, ends = base + 14, starts = ends + segments * 2 + 2, deltas = starts + segments * 2, ranges = deltas + segments * 2;
252
+ return (code) => {
253
+ for (let index = 0;index < segments; index++) {
254
+ if (code > cmap.u16(ends + index * 2))
255
+ continue;
256
+ const start = cmap.u16(starts + index * 2);
257
+ if (code < start)
258
+ return 0;
259
+ const delta = cmap.u16(deltas + index * 2), range = cmap.u16(ranges + index * 2);
260
+ if (range === 0)
261
+ return code + delta & 65535;
262
+ const glyph = cmap.u16(ranges + index * 2 + range + (code - start) * 2);
263
+ return glyph === 0 ? 0 : glyph + delta & 65535;
264
+ }
265
+ return 0;
266
+ };
267
+ }
268
+ }
269
+ return fail("no Unicode cmap subtable in format 4 or 12");
270
+ }
271
+ function measure(tables) {
272
+ const table = (tag) => reader(tables.get(tag) ?? (() => {
273
+ throw new Missing(tag);
274
+ })()), head = table("head"), hhea = table("hhea"), os2 = table("OS/2"), hmtx = table("hmtx"), unitsPerEm = head.u16(18);
275
+ if (unitsPerEm === 0)
276
+ fail("unitsPerEm is 0");
277
+ const typographic = os2.length >= 78 && (os2.u16(62) & 128) !== 0, [ascent, descent, lineGap] = typographic ? [os2.i16(68), -os2.i16(70), os2.i16(72)] : [hhea.i16(4), -hhea.i16(6), hhea.i16(8)], metrics = hhea.u16(34);
278
+ if (metrics === 0)
279
+ fail("the font has no horizontal metrics");
280
+ const advance = (glyph) => {
281
+ const index = Math.min(glyph, metrics - 1);
282
+ return tables.hmtxTransformed ? hmtx.u16(1 + index * 2) : hmtx.u16(index * 4);
283
+ }, glyphOf = glyphLookup(table("cmap"));
284
+ let total = 0, weight = 0;
285
+ for (const [character, share] of Object.entries(CHARACTER_FREQUENCY)) {
286
+ const glyph = glyphOf(character.charCodeAt(0));
287
+ if (glyph === 0) {
288
+ total = null;
289
+ break;
290
+ }
291
+ total += advance(glyph) * share;
292
+ weight += share;
293
+ }
294
+ return ok({ unitsPerEm, ascent: ascent / unitsPerEm, descent: descent / unitsPerEm, lineGap: lineGap / unitsPerEm, averageWidth: total === null ? null : total / weight / unitsPerEm });
295
+ }
296
+ const READERS = { woff2: woff2Tables, woff: woffTables, truetype: sfntTables, opentype: sfntTables }, known = new WeakMap;
297
+ export function readFontMetrics(bytes, format) {
298
+ const cached = known.get(bytes);
299
+ if (cached !== void 0)
300
+ return cached;
301
+ let result;
302
+ try {
303
+ result = measure(READERS[format](bytes));
304
+ } catch (error) {
305
+ if (error instanceof Collection)
306
+ result = err({ kind: "collection" });
307
+ else if (error instanceof Missing)
308
+ result = err({ kind: "table-missing", table: error.table });
309
+ else
310
+ result = err({ kind: "malformed", detail: error instanceof Error ? error.message : String(error) });
311
+ }
312
+ known.set(bytes, result);
313
+ return result;
314
+ }
@@ -1,6 +1,8 @@
1
1
  import path from "node:path";
2
2
  import { parseFont } from "./font-declaration.mjs";
3
- import { check, rejecting, required } from "./design-rejection.mjs";
3
+ import { fallbackFace, fallbackFamily } from "./font-fallback.mjs";
4
+ import { readFontMetrics } from "./font-metrics.mjs";
5
+ import { check, fail as reject, rejecting, required } from "./design-rejection.mjs";
4
6
  import { err, ok } from "./result.mjs";
5
7
  const SIGNATURES = {
6
8
  woff2: ["wOF2"],
@@ -21,7 +23,31 @@ function readFont(input, file, site, { bytes, assetRoot }) {
21
23
  check(hasSignature(content, face.format), `ADS font: faces[${index}] source ${face.source} is not a ${FORMAT_NAMES[face.format]} file`);
22
24
  return { ...face, index, file: source, bytes: content, output: `fonts/${slug}/${face.source.slice(2)}` };
23
25
  });
24
- return { family: spec.family, spec, slug, faces, site };
26
+ return { family: spec.family, spec, slug, faces, fallback: fallbackRecord(spec, faces), site };
27
+ }
28
+ const METRICS_FAILURE = {
29
+ collection: () => "is a font collection, which has no one set of measurements",
30
+ "table-missing": (failure) => `has no ${failure.table} table`,
31
+ malformed: (failure) => `cannot be read (${failure.detail})`
32
+ };
33
+ function fallbackRecord(spec, faces) {
34
+ const declared = spec.fallback;
35
+ if (declared === null)
36
+ return null;
37
+ return {
38
+ family: fallbackFamily(spec.family),
39
+ faces: faces.map((face) => {
40
+ const metrics = readFontMetrics(face.bytes, face.format);
41
+ if (metrics.kind === "err") {
42
+ const failure = metrics.error, why = METRICS_FAILURE[failure.kind](failure);
43
+ return reject(`ADS font: faces[${face.index}] source ${face.source} ${why}, so its fallback cannot be matched to it. Remove fallback, or use a font file ADS can measure`);
44
+ }
45
+ const matched = fallbackFace(declared, face, metrics.value);
46
+ if ("kind" in matched)
47
+ return reject(`ADS font: faces[${face.index}] source ${face.source} has no Latin letters to measure, so ADS cannot size ${declared.font} to it. State fallback as { font: ${JSON.stringify(declared.font)}, sizeAdjust: <percentage> }`);
48
+ return matched;
49
+ })
50
+ };
25
51
  }
26
52
  export function fontCatalog(records) {
27
53
  const fonts = new Map, slugs = new Map;
@@ -60,6 +60,14 @@ function nonColour(foundation, treatment) {
60
60
  }
61
61
  export function formStateFailures(foundation, spec) {
62
62
  const found = [], byState = new Map;
63
+ if (spec.kind === "region") {
64
+ const shaped = [...spec.geometryWhen.map((state) => ["&", state]), ...spec.parts.flatMap(function each(part) {
65
+ return [...part.geometryWhen.map((state) => [`& > ${part.selector}`, state]), ...part.parts.flatMap(each)];
66
+ })];
67
+ for (const [element, state] of shaped)
68
+ if (formStateOf(state.condition) === "autofill")
69
+ found.push({ path: state.path, failure: { kind: "autofill-layout-shift", condition: state.condition, element, property: state.frame !== null ? "frame" : state.spacing !== null ? "spacing" : "collapsed" } });
70
+ }
63
71
  for (const treatment of treatments(spec)) {
64
72
  const state = formStateOf(treatment.condition);
65
73
  if (state === null)
@@ -33,7 +33,7 @@ export interface FoundationSpec {
33
33
  * The themes and brands also apply to nested sections: any element carrying `data-theme` or
34
34
  * `data-brand` switches every token in its subtree, the nearest of each attribute selecting the
35
35
  * context. Opt-in, as the emitted section rules add to every sheet's token CSS (about 13% gzip on
36
- * the starter's CSS). Omitted: only the root's attributes select a context.
36
+ * a design system's CSS). Omitted: only the root's attributes select a context.
37
37
  */
38
38
  readonly sections?: true;
39
39
  /**
@@ -1,5 +1,6 @@
1
1
  import { selectedProfile, tokenValueContexts } from "./design-foundation.mjs";
2
2
  import { lengthPx, px } from "./css-length.mjs";
3
+ import { frameInlineInsets, sideWidth } from "./lowering-region-layout.mjs";
3
4
  const FITS = /^(?:(?:100|[1-9]?\d(?:\.\d+)?)%|min\(.*(?:^|[\s(,])(?:100|[1-9]?\d(?:\.\d+)?)%.*\))$/;
4
5
  function length(value, context) {
5
6
  if (value === void 0 || value === "auto" || value === "none")
@@ -26,7 +27,11 @@ function needed(fields, context) {
26
27
  return { kind: "px", px: minimum.px, field: "min-inline-size" };
27
28
  return sized.kind === "px" && sized.px > 0 ? sized : { kind: "none" };
28
29
  }
29
- function frameOf(foundation, spec) {
30
+ export const rootFrames = (spec) => [
31
+ void 0,
32
+ ...spec?.kind === "region" ? [...new Set(spec.geometryWhen.flatMap((state) => state.frame === null ? [] : [state.frame]))] : []
33
+ ];
34
+ function frameOf(foundation, spec, under) {
30
35
  if (spec === null || spec.kind !== "region" && spec.kind !== "control")
31
36
  return null;
32
37
  if (spec.kind === "region" && (spec.frame === null || spec.profile === null))
@@ -36,10 +41,10 @@ function frameOf(foundation, spec) {
36
41
  const selected = selectedProfile(foundation, spec.profile, spec.select);
37
42
  if (selected.kind === "err")
38
43
  return null;
39
- const profile = selected.value, name = profile.kind === "frame" ? spec.profile : profile.kind === "composite" ? profile.fields.get("frame-profile") : void 0;
40
- if (name === void 0)
44
+ const profile = selected.value, own = profile.kind === "frame" ? spec.profile : profile.kind === "composite" ? profile.fields.get("frame-profile") : void 0;
45
+ if (own === void 0)
41
46
  return null;
42
- const frame = name === spec.profile ? selected : selectedProfile(foundation, name);
47
+ const name = under ?? own, frame = name === spec.profile ? selected : selectedProfile(foundation, name);
43
48
  return frame.kind === "ok" && frame.value.kind === "frame" ? { name, fields: Object.fromEntries(frame.value.fields) } : null;
44
49
  }
45
50
  const UA_INSET = new Set(["ul", "ol", "menu", "dd", "figure", "blockquote", "fieldset"]);
@@ -59,19 +64,94 @@ function pathRoom(foundation, path, context) {
59
64
  return { kind: "unresolved", reason: `the size of the <${step.tag}> around it cannot be evaluated: ${need.reason}` };
60
65
  if (need.kind === "px" && need.field === "inline-size")
61
66
  cap = Math.min(cap, need.px - insets);
62
- const padding = length(frame.fields["padding-inline"] ?? frame.fields.padding, context), border = length(frame.fields["border-width"], context);
63
- for (const side of [padding, border]) {
67
+ const inline = frameInlineInsets(frame.fields);
68
+ for (const side of [length(inline.start, context), length(inline.end, context), length(sideWidth(frame.fields, "inline-start"), context), length(sideWidth(frame.fields, "inline-end"), context)]) {
64
69
  if (side.kind === "unresolved" || side.kind === "fits")
65
70
  return { kind: "unresolved", reason: `the insets of the <${step.tag}> around it cannot be evaluated${side.kind === "unresolved" ? `: ${side.reason}` : ""}` };
66
71
  if (side.kind === "px")
67
- insets += 2 * side.px;
72
+ insets += side.px;
68
73
  }
69
74
  }
70
75
  return { kind: "room", cap, insets };
71
76
  }
77
+ const KEYLINE_GUTTER = "wide", tokenName = (value) => value === void 0 ? void 0 : /^var\(\s*(--[\w-]+)\s*\)$/.exec(value)?.[1] ?? value;
78
+ export function gridKeylineOf(foundation, spec) {
79
+ if (spec.mode !== "fluid" && spec.mode !== "hybrid")
80
+ return null;
81
+ const mode = spec.layout.find(([key]) => key === "gutter")?.[1];
82
+ if (typeof mode !== "string" || mode === KEYLINE_GUTTER)
83
+ return null;
84
+ const named = selectedProfile(foundation, spec.profile);
85
+ if (named.kind === "err")
86
+ return null;
87
+ const reference = named.value.kind === "spatial" ? spec.profile : named.value.fields.get("spatial-profile");
88
+ if (reference === void 0)
89
+ return null;
90
+ const spatial = reference === spec.profile ? named : selectedProfile(foundation, reference);
91
+ if (spatial.kind === "err" || spatial.value.kind !== "spatial")
92
+ return null;
93
+ const start = tokenName(spatial.value.clauses.get(`ads-gutter ${mode}`)?.get("start")), line = tokenName(spatial.value.clauses.get(`ads-gutter ${KEYLINE_GUTTER}`)?.get("start")), fine = tokenName(spatial.value.fields.get("fine-unit"));
94
+ return start === void 0 || line === void 0 || fine === void 0 ? null : { gutter: mode, start, line, fine };
95
+ }
96
+ export function frameInlinePadding(foundation, spec, under) {
97
+ if (spec === null || spec.kind !== "region")
98
+ return null;
99
+ const frame = frameOf(foundation, spec, under);
100
+ return frame === null ? null : { frame: frame.name, padding: frameInlineInsets(frame.fields).start ?? null };
101
+ }
102
+ export function paddingPx(value, context) {
103
+ const padding = length(value ?? void 0, context);
104
+ return padding.kind === "px" ? padding.px : padding.kind === "absent" ? 0 : null;
105
+ }
106
+ const inlinePadding = (fields, context) => paddingPx(frameInlineInsets(fields).start, context);
107
+ export function keylineOffset(keyline, padding, context) {
108
+ const own = paddingPx(padding, context);
109
+ if (own === null || own === 0)
110
+ return null;
111
+ const gutter = length(`var(${keyline.start})`, context), line = length(`var(${keyline.line})`, context), fine = length(`var(${keyline.fine})`, context);
112
+ if (gutter.kind !== "px" || line.kind !== "px" || fine.kind !== "px")
113
+ return null;
114
+ const insetPx = gutter.px + own;
115
+ return { insetPx, keylinePx: line.px, tolerancePx: fine.px, missed: Math.abs(insetPx - line.px) > fine.px + 0.01 };
116
+ }
117
+ export function keylineFinding(foundation, place, spec, keyline) {
118
+ for (const under of rootFrames(spec)) {
119
+ const found = keylineOf(foundation, place, spec, keyline, under);
120
+ if (found !== null)
121
+ return found;
122
+ }
123
+ return null;
124
+ }
125
+ function keylineOf(foundation, place, spec, keyline, under) {
126
+ const framed = frameInlinePadding(foundation, spec, under);
127
+ if (framed === null)
128
+ return null;
129
+ const frame = { name: framed.frame }, padding = framed.padding;
130
+ for (const context of tokenValueContexts(foundation)) {
131
+ const offset = keylineOffset(keyline, padding, context);
132
+ if (offset === null || !offset.missed)
133
+ continue;
134
+ if (place.path.map((step) => {
135
+ if (step.kind === "component")
136
+ return null;
137
+ const outer = frameOf(foundation, step.spec);
138
+ if (outer === null)
139
+ return step.spec === null && UA_INSET.has(step.tag) ? null : 0;
140
+ return inlinePadding(outer.fields, context);
141
+ }).some((inset) => inset !== 0))
142
+ continue;
143
+ return { kind: "keyline-missed", cell: place.cell, element: place.element, frame: frame.name, gutter: keyline.gutter, insetPx: offset.insetPx, keylinePx: offset.keylinePx, tolerancePx: offset.tolerancePx, context: context.label };
144
+ }
145
+ return null;
146
+ }
72
147
  const regionsIn = (regions, context) => regions.contexts.find((item) => item.contexts.includes(context)) ?? regions;
73
148
  export function frameRegionFinding(foundation, place, spec, regions, moved) {
74
- const frame = frameOf(foundation, spec);
149
+ const found = rootFrames(spec).map((under) => frameRegionOf(foundation, place, spec, regions, moved, under));
150
+ return firstFinding(found);
151
+ }
152
+ const firstFinding = (found) => found.find((finding) => finding !== null && finding.kind !== "frame-region-unresolved") ?? found.find((finding) => finding !== null) ?? null;
153
+ function frameRegionOf(foundation, place, spec, regions, moved, under) {
154
+ const frame = frameOf(foundation, spec, under);
75
155
  if (frame === null)
76
156
  return null;
77
157
  const { cell, element } = place;
@@ -151,6 +231,9 @@ export function componentCellFinding(foundation, cell, component, regions) {
151
231
  };
152
232
  }
153
233
  export function tileFrameFinding(foundation, place, spec, component, regions) {
234
+ return firstFinding(rootFrames(spec).map((under) => tileFrameOf(foundation, place, spec, component, regions, under)));
235
+ }
236
+ function tileFrameOf(foundation, place, spec, component, regions, under) {
154
237
  const { cell, element } = place;
155
238
  if (component !== null)
156
239
  return {
@@ -161,7 +244,7 @@ export function tileFrameFinding(foundation, place, spec, component, regions) {
161
244
  reason: `that frame is ${component}'s own owner's, which this owner does not see; a tile is at most ${regions.tilePx === null ? "its tile size" : px(regions.tilePx)} and shrinks to a narrower region`,
162
245
  context: tokenValueContexts(foundation)[0]?.label ?? ":root"
163
246
  };
164
- const frame = frameOf(foundation, spec);
247
+ const frame = frameOf(foundation, spec, under);
165
248
  if (frame === null)
166
249
  return null;
167
250
  let unresolved = null;
@@ -34,24 +34,69 @@ const frozen = (value) => {
34
34
  }
35
35
  return value;
36
36
  };
37
- function gridOf(foundation, name) {
37
+ function gridOf(foundation, name, withExamples) {
38
38
  return attempt((reject) => {
39
- const profile = profiles(foundation, reject), tokens = new Set, { definition } = readSpatial(profile.select(name), name, geometryToken(tokens, reject), profile, reject), algebra = model(spatialModel(definition, geometryOf(foundation, tokens, reject)), reject), px = (token) => model(algebra.length(token), reject), lengths = {
39
+ const profile = profiles(foundation, reject), tokens = new Set, spatial = profile.select(name), token = geometryToken(tokens, reject), { definition } = readSpatial(spatial, name, token, profile, reject), stated = Object.fromEntries(spatial.fields), optional = (field) => stated[field] === void 0 ? void 0 : token(stated[field]), tile = optional("tile-size"), fixedStart = optional("fixed-start"), fixedEnd = optional("fixed-end"), tierTracks = [];
40
+ for (const [key, values] of spatial.clauses) {
41
+ const [kind, tier = ""] = key.split(" ");
42
+ if (kind !== "ads-breakpoint")
43
+ continue;
44
+ const fixed = [...values].filter(([item]) => item.startsWith("fixed-")).map(([item, value]) => [item, token(value)]);
45
+ if (fixed.length > 0)
46
+ tierTracks.push([tier, fixed]);
47
+ }
48
+ const algebra = model(spatialModel(definition, geometryOf(foundation, tokens, reject)), reject), px = (token) => model(algebra.length(token), reject), lengths = {
40
49
  miniUnitPx: px(definition.miniUnit),
41
50
  fineUnitPx: px(definition.fineUnit),
42
51
  scalePx: definition.scale.map(px),
43
52
  maxWidthPx: px(definition.maxWidth),
44
53
  gutters: Object.fromEntries(Object.entries(definition.gutters).map(([mode, edges]) => [mode, { startPx: px(edges.start ?? "0"), endPx: px(edges.end ?? "0") }]))
45
- }, [gutter = null] = Object.keys(definition.gutters), layout = postcss.atRule({ name: "ads-layout", params: "fluid", nodes: [] });
46
- layout.append(postcss.decl({ prop: "gutter", value: gutter ?? "none" }));
47
- layout.append(postcss.atRule({ name: "ads-cell", params: `.${EXAMPLE_CELL}`, nodes: [postcss.decl({ prop: "start", value: "auto" }), postcss.decl({ prop: "span", value: "1" })] }));
48
- const tree = postcss.root({ nodes: [postcss.rule({ selector: "&", nodes: [layout] })] });
49
- model(expandSpatialStyles(tree, algebra), reject);
50
- const [region] = tree.nodes;
51
- if (region?.type !== "rule")
52
- return reject({ kind: "spatial-clause-unsupported", clause: "example" });
53
- const example = { gutter, rules: exampleRules(region, reject) };
54
- return frozen({ definition: structuredClone(definition), breakpoints: algebra.breakpoints.map((point) => ({ ...point })), lengths, example });
54
+ }, expand = (mode, values, cells, fail) => {
55
+ const layout = postcss.atRule({ name: "ads-layout", params: mode, nodes: [] });
56
+ for (const [prop, value] of values)
57
+ layout.append(postcss.decl({ prop, value }));
58
+ if (mode === "hybrid")
59
+ for (const [tier, fixed] of tierTracks) {
60
+ const at = postcss.atRule({ name: "ads-at", params: tier, nodes: [] });
61
+ for (const [prop, value] of fixed)
62
+ at.append(postcss.decl({ prop, value }));
63
+ layout.append(at);
64
+ }
65
+ if (cells)
66
+ layout.append(postcss.atRule({ name: "ads-cell", params: `.${EXAMPLE_CELL}`, nodes: [postcss.decl({ prop: "start", value: "auto" }), postcss.decl({ prop: "span", value: "1" })] }));
67
+ const tree = postcss.root({ nodes: [postcss.rule({ selector: "&", nodes: [layout] })] });
68
+ tree.walkDecls(/^fixed-(start|end)$/, (decl) => {
69
+ if (model(algebra.length(decl.value), fail) === 0)
70
+ decl.value = "0";
71
+ });
72
+ model(expandSpatialStyles(tree, algebra), fail);
73
+ const [region] = tree.nodes;
74
+ return region?.type === "rule" ? exampleRules(region, fail) : fail({ kind: "spatial-clause-unsupported", clause: "example" });
75
+ }, modes = Object.keys(definition.gutters), [gutter = null] = modes, fact = { definition: structuredClone(definition), breakpoints: algebra.breakpoints.map((point) => ({ ...point })), lengths };
76
+ if (!withExamples) {
77
+ expand("fluid", [["gutter", gutter ?? "none"]], !0, reject);
78
+ return frozen({ ...fact, examples: [], omitted: [] });
79
+ }
80
+ const examples = (modes.length ? modes : [null]).map((mode) => ({
81
+ id: `fluid-${mode ?? "none"}`,
82
+ mode: "fluid",
83
+ gutter: mode,
84
+ tokens: {},
85
+ rules: expand("fluid", [["gutter", mode ?? "none"]], !0, reject)
86
+ })), omitted = [], optionalExample = (example, values, cells) => {
87
+ const rules = attempt((fail) => expand(example.mode, values, cells, fail));
88
+ if (rules.kind === "ok")
89
+ examples.push({ ...example, rules: rules.value });
90
+ else
91
+ omitted.push({ id: example.id, reason: rules.error.kind === "design" ? rules.error.rejection.message : rules.error.kind });
92
+ };
93
+ if (fixedStart !== void 0 || fixedEnd !== void 0) {
94
+ const ends = { ...fixedStart === void 0 ? {} : { "fixed-start": fixedStart }, ...fixedEnd === void 0 ? {} : { "fixed-end": fixedEnd } }, fits = [...modes, null].find((mode) => attempt((fail) => expand("hybrid", [["gutter", mode ?? "none"], ...Object.entries(ends)], !0, fail)).kind === "ok"), used = fits === void 0 ? gutter : fits;
95
+ optionalExample({ id: "hybrid", mode: "hybrid", gutter: used, tokens: ends }, [["gutter", used ?? "none"], ...Object.entries(ends)], !0);
96
+ }
97
+ if (tile !== void 0)
98
+ optionalExample({ id: "fixed", mode: "fixed", gutter: null, tokens: { tile } }, [["tile", tile]], !1);
99
+ return frozen({ ...fact, examples, omitted });
55
100
  });
56
101
  }
57
102
  export function foundationGrids(foundation) {
@@ -60,15 +105,26 @@ export function foundationGrids(foundation) {
60
105
  for (const name of [...foundation.profiles.keys()].sort()) {
61
106
  if (foundation.profiles.get(name)?.kind !== "spatial")
62
107
  continue;
63
- const grid = gridOf(foundation, name);
108
+ const grid = gridOf(foundation, name, !1);
64
109
  if (grid.kind === "ok")
65
- grids.set(name, grid.value);
110
+ grids.set(name, { definition: grid.value.definition, breakpoints: grid.value.breakpoints, lengths: grid.value.lengths });
66
111
  else
67
112
  rejected.push({ profile: name, failure: grid.error });
68
113
  }
69
114
  return frozen({ grids, rejected });
70
115
  });
71
116
  }
117
+ export function foundationGridExamples(foundation) {
118
+ return memoProgram(foundation, "grid-examples", () => {
119
+ const examples = new Map;
120
+ for (const name of foundationGrids(foundation).grids.keys()) {
121
+ const grid = gridOf(foundation, name, !0);
122
+ if (grid.kind === "ok")
123
+ examples.set(name, { examples: grid.value.examples, omitted: grid.value.omitted });
124
+ }
125
+ return frozen(examples);
126
+ });
127
+ }
72
128
  export function revisionGrids(dsRoot) {
73
129
  const compute = () => {
74
130
  const inputs = revisionDesignInputs(dsRoot);
@@ -79,8 +135,8 @@ export function revisionGrids(dsRoot) {
79
135
  const key = `grid-facts:${dsRoot}`, revision = context.revision;
80
136
  return memoFact(context, key, () => revision === void 0 ? compute() : memoProgram(revision, key, compute));
81
137
  }
82
- export function previewFactsText({ grids }, tokens, owners = new Map, profiles = null, assets = null) {
83
- const entries = Object.fromEntries([...grids].map(([name, grid]) => [name, { ...grid.definition, resolved: { breakpoints: grid.breakpoints, ...grid.lengths }, example: grid.example }])), selected = Object.fromEntries([...owners].filter(([, profiles]) => profiles.length > 0).sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0));
138
+ export function previewFactsText({ grids }, examples, tokens, owners = new Map, profiles = null, assets = null) {
139
+ const inputsOf = new Map((profiles?.profiles ?? []).map((profile) => [profile.name, profile.inputs])), entries = Object.fromEntries([...grids].map(([name, grid]) => [name, { ...grid.definition, buildsOn: inputsOf.get(name) ?? [], resolved: { breakpoints: grid.breakpoints, ...grid.lengths }, examples: examples.get(name)?.examples ?? [], omitted: examples.get(name)?.omitted ?? [] }])), selected = Object.fromEntries([...owners].filter(([, profiles]) => profiles.length > 0).sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0));
84
140
  return `${JSON.stringify({ schemaVersion: 1, grids: entries, owners: selected, tokens, profiles, assets }, null, 2)}
85
141
  `;
86
142
  }