@astryxdesign/cli 0.7.17-canary.g4ea41ce → 0.7.17-canary.g5a3fd39

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 (409) hide show
  1. package/README.md +7 -2
  2. package/api/build/_adapter.d.mts +7 -6
  3. package/api/build/_adapter.mjs +18 -11
  4. package/api/build/build.type.mjs +1 -1
  5. package/api/build/kit/kind.d.mts +6 -0
  6. package/api/build/kit/kind.mjs +1 -1
  7. package/api/build/kit/rank.d.mts +7 -1
  8. package/api/build/kit/rank.mjs +15 -5
  9. package/api/build/kit/signals.mjs +58 -57
  10. package/api/build/kit/start.d.mts +2 -1
  11. package/api/build/kit/start.mjs +62 -9
  12. package/api/build/kit/words.d.mts +6 -2
  13. package/api/build/kit/words.mjs +7 -3
  14. package/api/component/__fixtures__/resolutions/modules.txt +2 -2
  15. package/api/component/_adapter.d.mts +30 -24
  16. package/api/component/_adapter.mjs +72 -31
  17. package/api/component/component.mjs +4 -4
  18. package/api/component/detail/detail.d.mts +2 -2
  19. package/api/component/detail/detail.mjs +1 -1
  20. package/api/component/list/list.d.mts +2 -2
  21. package/api/component/list/list.mjs +4 -4
  22. package/api/discover/_adapter.mjs +15 -15
  23. package/api/docs/_adapter.d.mts +13 -5
  24. package/api/docs/_adapter.mjs +37 -10
  25. package/api/doctor/_adapter.d.mts +32 -0
  26. package/api/doctor/_adapter.mjs +56 -1
  27. package/api/doctor/doctor.mjs +28 -5
  28. package/api/doctor/theme-checks.mjs +165 -83
  29. package/api/error.d.mts +4 -3
  30. package/api/error.mjs +3 -2
  31. package/api/hook/_adapter.d.mts +5 -4
  32. package/api/hook/_adapter.mjs +6 -5
  33. package/api/icon/_options.d.mts +17 -0
  34. package/api/icon/_options.mjs +54 -0
  35. package/api/icon/exportIconIndex.doc.d.mts +10 -0
  36. package/api/icon/exportIconIndex.doc.mjs +59 -0
  37. package/api/icon/icon.mjs +11 -34
  38. package/api/icon/icon.type.d.mts +49 -0
  39. package/api/icon/icon.type.mjs +24 -0
  40. package/api/icon/rankIconIndex.doc.d.mts +10 -0
  41. package/api/icon/rankIconIndex.doc.mjs +79 -0
  42. package/api/icon/search/icon-index.d.mts +41 -0
  43. package/api/icon/search/icon-index.mjs +139 -0
  44. package/api/icon/search/search.d.mts +18 -0
  45. package/api/icon/search/search.mjs +13 -0
  46. package/api/index.d.mts +1 -0
  47. package/api/index.mjs +1 -0
  48. package/api/search/_adapter.d.mts +8 -5
  49. package/api/search/_adapter.mjs +14 -10
  50. package/api/search/_gather-components.d.mts +4 -4
  51. package/api/search/_gather-components.mjs +4 -3
  52. package/api/search/_gather-hooks.d.mts +2 -2
  53. package/api/search/_gather-hooks.mjs +1 -1
  54. package/api/search/_lexical.mjs +12 -2
  55. package/api/search/_priority.d.mts +10 -2
  56. package/api/search/_priority.mjs +37 -7
  57. package/api/search/_score.d.mts +12 -3
  58. package/api/search/_score.mjs +6 -3
  59. package/api/search/_words.mjs +12 -3
  60. package/api/search/search.d.mts +7 -1
  61. package/api/search/search.mjs +37 -4
  62. package/api/swizzle/_adapter.d.mts +7 -5
  63. package/api/swizzle/_adapter.mjs +7 -3
  64. package/api/swizzle/copy/copy.mjs +5 -4
  65. package/api/theme/build/build.d.mts +5 -0
  66. package/api/theme/build/build.mjs +400 -21
  67. package/api/theme/build/family.mjs +18 -7
  68. package/api/theme/build/font-warning.mjs +5 -4
  69. package/api/theme/build/input-fields.d.mts +21 -6
  70. package/api/theme/build/input-fields.mjs +104 -13
  71. package/api/theme/build/typography-values.d.mts +22 -0
  72. package/api/theme/build/typography-values.mjs +172 -22
  73. package/api/theme/build/written-values.d.mts +7 -0
  74. package/api/theme/build/written-values.mjs +57 -8
  75. package/api/theme/generateTonalPalette.doc.mjs +1 -1
  76. package/api/theme/palette/generate/generator.d.mts +14 -2
  77. package/api/theme/palette/generate/generator.mjs +94 -8
  78. package/api/theme/theme.type.d.mts +21 -4
  79. package/api/theme/theme.type.mjs +14 -5
  80. package/api/theme/themePaletteGenerate.doc.mjs +1 -1
  81. package/api/theme/themeTemplate.doc.mjs +18 -3
  82. package/api/theme-edit/_adapter.d.mts +1 -1
  83. package/api/theme-edit/_adapter.mjs +1 -1
  84. package/api/theme-edit/_catalog.d.mts +10 -4
  85. package/api/theme-edit/_catalog.mjs +81 -22
  86. package/api/theme-edit/_check.mjs +402 -88
  87. package/api/theme-edit/_color.d.mts +11 -2
  88. package/api/theme-edit/_color.mjs +23 -7
  89. package/api/theme-edit/_compiler.mjs +11 -3
  90. package/api/theme-edit/_context.d.mts +87 -6
  91. package/api/theme-edit/_context.mjs +224 -17
  92. package/api/theme-edit/_css.mjs +4 -0
  93. package/api/theme-edit/_edit.mjs +331 -58
  94. package/api/theme-edit/_how-question.d.mts +11 -0
  95. package/api/theme-edit/_how-question.mjs +2514 -234
  96. package/api/theme-edit/_how.mjs +79 -14
  97. package/api/theme-edit/_missed.mjs +294 -32
  98. package/api/theme-edit/_normal.d.mts +3 -1
  99. package/api/theme-edit/_normal.mjs +4 -1
  100. package/api/theme-edit/_palette.mjs +36 -5
  101. package/api/theme-edit/_part-words.mjs +20 -2
  102. package/api/theme-edit/_parts.d.mts +12 -1
  103. package/api/theme-edit/_parts.mjs +116 -11
  104. package/api/theme-edit/_preview-app.mjs +40 -2
  105. package/api/theme-edit/_preview.d.mts +45 -5
  106. package/api/theme-edit/_preview.mjs +173 -21
  107. package/api/theme-edit/_settings.d.mts +20 -0
  108. package/api/theme-edit/_settings.mjs +1033 -94
  109. package/api/theme-edit/_tables.mjs +2 -2
  110. package/api/theme-edit/theme-edit.type.d.mts +6 -5
  111. package/api/theme-edit/theme-edit.type.mjs +8 -8
  112. package/api/upgrade/_adapter.mjs +13 -2
  113. package/assets/component-list.generated.json +1 -1
  114. package/assets/docs/tree/authoring.doc.mjs +1 -0
  115. package/assets/docs/tree/cli.doc.mjs +1 -0
  116. package/assets/docs/tree/computer-agent-guide.doc.mjs +1 -1
  117. package/assets/docs/tree/generate-a-palette.doc.mjs +2 -2
  118. package/assets/docs/tree/global.doc.mjs +1 -0
  119. package/assets/docs/tree/single-component.doc.mjs +40 -2
  120. package/assets/docs/tree/updates.doc.mjs +1 -1
  121. package/assets/docs/tree/who-answers.doc.mjs +2 -2
  122. package/assets/docs-routes.generated.json +1 -1
  123. package/assets/docs.generated.json +2 -2
  124. package/assets/search-catalog.generated.json +2 -2
  125. package/assets/self-audit.generated.json +1 -1
  126. package/assets/templates/blocks/components/Blockquote/BlockquoteShowcase.tsx +1 -1
  127. package/assets/templates/blocks/components/BreadcrumbItem/BreadcrumbItemShowcase.tsx +4 -4
  128. package/assets/templates/blocks/components/Breadcrumbs/BreadcrumbsCustomSeparator.tsx +1 -0
  129. package/assets/templates/blocks/components/Breadcrumbs/BreadcrumbsSupportingVariant.tsx +2 -2
  130. package/assets/templates/blocks/components/Card/CardElevations.tsx +1 -1
  131. package/assets/templates/blocks/components/Card/CardWithInnerLayout.tsx +19 -3
  132. package/assets/templates/blocks/components/Card/ClickableCardWithNestedButton.tsx +11 -1
  133. package/assets/templates/blocks/components/Card/SelectableCardElevated.tsx +1 -1
  134. package/assets/templates/blocks/components/Card/SelectableCardMulti.tsx +1 -1
  135. package/assets/templates/blocks/components/Center/CenterHorizontal.tsx +1 -1
  136. package/assets/templates/blocks/components/Center/CenterInsideACard.tsx +1 -1
  137. package/assets/templates/blocks/components/ChatComposer/ChatComposerFullFeatured.tsx +8 -0
  138. package/assets/templates/blocks/components/ChatComposerDrawer/ChatComposerDrawerWithProgress.tsx +8 -2
  139. package/assets/templates/blocks/components/ChatLayout/ChatLayoutPanelChat.tsx +1 -0
  140. package/assets/templates/blocks/components/ChatLayout/ChatLayoutShowcase.tsx +1 -1
  141. package/assets/templates/blocks/components/ChatMessageBubble/ChatMessageBubbleCustomContent.tsx +9 -1
  142. package/assets/templates/blocks/components/ChatMessageBubble/ChatMessageBubbleMetadata.tsx +12 -2
  143. package/assets/templates/blocks/components/ChatMessageMetadata/ChatMessageMetadataFooter.tsx +28 -7
  144. package/assets/templates/blocks/components/ChatMessageMetadata/ChatMessageMetadataShowcase.tsx +35 -7
  145. package/assets/templates/blocks/components/Collapsible/CollapsibleShowcase.tsx +1 -1
  146. package/assets/templates/blocks/components/CommandPaletteGroup/CommandPaletteGroupBasic.tsx +20 -4
  147. package/assets/templates/blocks/components/CommandPaletteList/CommandPaletteListBasic.tsx +15 -3
  148. package/assets/templates/blocks/components/CommandPaletteList/CommandPaletteListShowcase.tsx +29 -6
  149. package/assets/templates/blocks/components/ContextMenu/ContextMenuBasic.tsx +2 -2
  150. package/assets/templates/blocks/components/ContextMenu/ContextMenuBottomSheet.tsx +1 -1
  151. package/assets/templates/blocks/components/ContextMenu/ContextMenuShowcase.tsx +2 -2
  152. package/assets/templates/blocks/components/Divider/DividerFullBleed.tsx +1 -1
  153. package/assets/templates/blocks/components/Divider/DividerShowcase.tsx +1 -1
  154. package/assets/templates/blocks/components/Divider/DividerVariants.tsx +1 -1
  155. package/assets/templates/blocks/components/DropdownMenuGroup/DropdownMenuGroupShowcase.tsx +23 -4
  156. package/assets/templates/blocks/components/EmptyState/EmptyStateActions.tsx +18 -2
  157. package/assets/templates/blocks/components/EmptyState/EmptyStateCompact.tsx +20 -2
  158. package/assets/templates/blocks/components/EmptyState/EmptyStateContainer.tsx +16 -2
  159. package/assets/templates/blocks/components/EmptyState/EmptyStateShowcase.tsx +11 -1
  160. package/assets/templates/blocks/components/Heading/HeadingTruncation.tsx +12 -2
  161. package/assets/templates/blocks/components/InternationalizationProvider/useDirectionHookUsage.tsx +1 -1
  162. package/assets/templates/blocks/components/LayoutContent/LayoutContentBasic.tsx +1 -1
  163. package/assets/templates/blocks/components/LayoutContent/LayoutContentShowcase.tsx +1 -1
  164. package/assets/templates/blocks/components/LayoutFooter/LayoutFooterActions.tsx +17 -3
  165. package/assets/templates/blocks/components/LayoutFooter/LayoutFooterShowcase.tsx +17 -3
  166. package/assets/templates/blocks/components/LayoutHeader/LayoutHeaderShowcase.tsx +15 -3
  167. package/assets/templates/blocks/components/LayoutHeader/LayoutHeaderWithActions.tsx +9 -2
  168. package/assets/templates/blocks/components/LayoutPanel/LayoutPanelNavigation.tsx +1 -1
  169. package/assets/templates/blocks/components/LayoutPanel/LayoutPanelShowcase.tsx +1 -1
  170. package/assets/templates/blocks/components/MoreMenu/MoreMenuBottomSheet.tsx +1 -1
  171. package/assets/templates/blocks/components/MultiSelector/MultiSelectorGhostToolbar.tsx +14 -2
  172. package/assets/templates/blocks/components/Outline/OutlineDensity.tsx +2 -0
  173. package/assets/templates/blocks/components/OverflowList/OverflowListShowcase.tsx +6 -1
  174. package/assets/templates/blocks/components/Pagination/PaginationVariants.tsx +4 -0
  175. package/assets/templates/blocks/components/Popover/PopoverHookUsage.tsx +17 -2
  176. package/assets/templates/blocks/components/SegmentedControl/SegmentedControlFillLayout.tsx +1 -1
  177. package/assets/templates/blocks/components/Selector/SelectorGhostToolbar.tsx +14 -2
  178. package/assets/templates/blocks/components/Selector/SelectorOptionDescriptions.tsx +8 -1
  179. package/assets/templates/blocks/components/SideNav/SideNavWithHeaderMenu.tsx +2 -2
  180. package/assets/templates/blocks/components/SideNavHeading/SideNavHeadingShowcase.tsx +2 -0
  181. package/assets/templates/blocks/components/Switch/SwitchWithStatus.tsx +1 -1
  182. package/assets/templates/blocks/components/TabList/TabListTabsFillLayout.tsx +1 -1
  183. package/assets/templates/blocks/components/TabList/TabListTabsWithActions.tsx +12 -1
  184. package/assets/templates/blocks/components/Table/TableBulkActionsTable.tsx +11 -1
  185. package/assets/templates/blocks/components/Table/TableInCard.tsx +2 -2
  186. package/assets/templates/blocks/components/Text/TextTruncation.tsx +1 -1
  187. package/assets/templates/blocks/components/Text/TextWordBreak.tsx +12 -2
  188. package/assets/templates/blocks/components/Text/TextWrap.tsx +19 -4
  189. package/assets/templates/blocks/components/TextArea/TextAreaCharacterCount.tsx +1 -1
  190. package/assets/templates/blocks/components/TextArea/TextAreaShowcase.tsx +1 -1
  191. package/assets/templates/blocks/components/TextArea/TextAreaStates.tsx +1 -1
  192. package/assets/templates/blocks/components/TextArea/TextAreaValidation.tsx +1 -1
  193. package/assets/templates/blocks/components/TextArea/TextAreaWithIcon.tsx +1 -1
  194. package/assets/templates/blocks/components/TextInput/TextInputStatusVariant.tsx +2 -2
  195. package/assets/templates/blocks/components/Timestamp/TimestampAutoFormat.tsx +15 -1
  196. package/assets/templates/blocks/components/Timestamp/TimestampRelativeFormat.tsx +15 -1
  197. package/assets/templates/blocks/components/Toolbar/ToolbarCardHeader.tsx +8 -0
  198. package/assets/templates/blocks/components/Toolbar/ToolbarSizes.tsx +12 -1
  199. package/assets/templates/blocks/components/Toolbar/ToolbarThreeSlot.tsx +18 -3
  200. package/assets/templates/blocks/components/TopNav/TopNavCenteredNavigation.tsx +6 -0
  201. package/assets/templates/blocks/components/TopNav/TopNavEnterpriseDashboard.tsx +7 -1
  202. package/assets/templates/blocks/components/TopNav/TopNavMegaMenu.tsx +2 -2
  203. package/assets/templates/blocks/components/TopNav/TopNavShowcase.tsx +9 -0
  204. package/assets/templates/components.generated.json +1 -1
  205. package/assets/templates/pages/ai-chat/page.tsx +102 -6
  206. package/assets/templates/pages/canvas-editor/page.tsx +73 -2
  207. package/assets/templates/pages/centered-hero/page.tsx +10 -4
  208. package/assets/templates/pages/course-detail/page.tsx +46 -2
  209. package/assets/templates/pages/dashboard/page.tsx +45 -16
  210. package/assets/templates/pages/dashboard-cohort-funnel/page.tsx +31 -20
  211. package/assets/templates/pages/dashboard-comparison/page.tsx +9 -0
  212. package/assets/templates/pages/dashboard-composition/page.tsx +22 -9
  213. package/assets/templates/pages/dashboard-progress/page.tsx +27 -15
  214. package/assets/templates/pages/dashboard-scorecard/page.tsx +9 -0
  215. package/assets/templates/pages/detail-page/page.tsx +105 -77
  216. package/assets/templates/pages/documentation/page.tsx +15 -2
  217. package/assets/templates/pages/documentation-design/page.tsx +7 -34
  218. package/assets/templates/pages/documentation-technical/page.tsx +76 -12
  219. package/assets/templates/pages/editor/page.tsx +26 -21
  220. package/assets/templates/pages/file-explorer/page.tsx +35 -1
  221. package/assets/templates/pages/form-two-column/page.tsx +2 -3
  222. package/assets/templates/pages/form-wizard/page.tsx +31 -3
  223. package/assets/templates/pages/form-wizard-vertical/page.tsx +32 -3
  224. package/assets/templates/pages/gallery-hero/page.tsx +2 -1
  225. package/assets/templates/pages/ide/page.tsx +15 -1
  226. package/assets/templates/pages/incident-console/page.tsx +2 -1
  227. package/assets/templates/pages/incident-console/template.doc.mjs +1 -1
  228. package/assets/templates/pages/kanban-board/page.tsx +39 -2
  229. package/assets/templates/pages/payment-form/page.tsx +77 -39
  230. package/assets/templates/pages/product-gallery/page.tsx +16 -14
  231. package/assets/templates/pages/settings/page.tsx +35 -3
  232. package/assets/templates/pages/settings-dialog/page.tsx +34 -5
  233. package/assets/templates/pages/settings-sidebar/page.tsx +23 -3
  234. package/assets/templates/pages/shell-nav/page.tsx +28 -12
  235. package/assets/templates/pages/shell-side-nav/page.tsx +16 -1
  236. package/assets/templates/pages/shell-top-nav/page.tsx +27 -1
  237. package/assets/templates/pages/side-gallery/page.tsx +1 -1
  238. package/assets/templates/pages/table/page.tsx +2 -1
  239. package/assets/templates/pages/table/template.doc.mjs +1 -1
  240. package/assets/templates/pages/table-collapsible/page.tsx +1 -1
  241. package/assets/templates/pages/table-comparison/page.tsx +1 -1
  242. package/assets/templates/pages/table-filter/page.tsx +9 -2
  243. package/assets/templates/pages/table-grouped/page.tsx +16 -6
  244. package/assets/templates/pages/table-inbox/page.tsx +60 -1
  245. package/assets/templates/pages/table-page/page.tsx +10 -2
  246. package/assets/templates/pages/table-tree/page.tsx +95 -13
  247. package/assets/templates/pages/theme-showcase/page.tsx +107 -11
  248. package/assets/templates/pages/work-item-detail/page.tsx +88 -74
  249. package/assets/templates/pages/work-item-detail/template.doc.mjs +0 -1
  250. package/assets/templates/themes/gothic/gothicPaletteRefs.generated.ts +1 -1
  251. package/assets/templates/themes/gothic/gothicTheme.ts +5 -0
  252. package/assets/templates/themes/neutral/neutralTheme.ts +1 -1
  253. package/assets/templates/themes/y2k/y2kPaletteRefs.generated.ts +1 -1
  254. package/assets/templates/themes/y2k/y2kTheme.ts +1 -1
  255. package/authoring/debug/parse.d.mts +1 -1
  256. package/authoring/doctypes/_schema.d.mts +22 -8
  257. package/authoring/doctypes/_schema.mjs +31 -0
  258. package/authoring/doctypes/command/command.doc.mjs +24 -0
  259. package/authoring/doctypes/command/type.ts +31 -0
  260. package/authoring/doctypes/component/component.doc.mjs +1 -1
  261. package/authoring/doctypes/component/type.ts +8 -5
  262. package/authoring/doctypes/namespace/namespace.doc.mjs +6 -0
  263. package/authoring/doctypes/namespace/type.ts +4 -0
  264. package/authoring/doctypes/template/type.ts +0 -7
  265. package/authoring/index.d.ts +6 -1
  266. package/authoring/integration/integration.doc.mjs +7 -0
  267. package/authoring/integration/schema.d.mts +6 -0
  268. package/authoring/integration/schema.mjs +3 -0
  269. package/authoring/integration/type.ts +34 -0
  270. package/clients/cli/build-id.generated.json +1 -1
  271. package/clients/cli/commands/component.doc.mjs +1 -0
  272. package/clients/cli/commands/component.mjs +5 -1
  273. package/clients/cli/commands/docs.doc.mjs +1 -1
  274. package/clients/cli/commands/experimental/index.mjs +4 -1
  275. package/clients/cli/commands/experimental/theme.mjs +139 -64
  276. package/clients/cli/commands/experimental-render.doc.mjs +2 -0
  277. package/clients/cli/commands/experimental-theme-add.doc.mjs +2 -0
  278. package/clients/cli/commands/experimental-theme-compile.doc.mjs +1 -0
  279. package/clients/cli/commands/experimental-theme-editor-how.doc.mjs +1 -0
  280. package/clients/cli/commands/experimental-theme-editor-new.doc.mjs +3 -1
  281. package/clients/cli/commands/experimental-theme-editor-set.doc.mjs +3 -2
  282. package/clients/cli/commands/experimental-theme-editor-show.doc.mjs +2 -1
  283. package/clients/cli/commands/experimental-theme-editor-undo.doc.mjs +3 -2
  284. package/clients/cli/commands/experimental-theme-eject.doc.mjs +1 -0
  285. package/clients/cli/commands/experimental-theme-preview-add.doc.mjs +1 -0
  286. package/clients/cli/commands/experimental-theme-preview-app.doc.mjs +1 -0
  287. package/clients/cli/commands/experimental-theme-remove.doc.mjs +2 -0
  288. package/clients/cli/commands/experimental-theme-targets.doc.mjs +1 -0
  289. package/clients/cli/commands/experimental-theme-template.doc.mjs +1 -0
  290. package/clients/cli/commands/experimental-theme-use.doc.mjs +2 -0
  291. package/clients/cli/commands/gap-report.doc.mjs +1 -0
  292. package/clients/cli/commands/hook.doc.mjs +1 -1
  293. package/clients/cli/commands/init.doc.mjs +1 -1
  294. package/clients/cli/commands/integration-add.doc.mjs +1 -0
  295. package/clients/cli/commands/manifest.mjs +10 -3
  296. package/clients/cli/commands/swizzle.doc.mjs +8 -1
  297. package/clients/cli/commands/swizzle.mjs +13 -6
  298. package/clients/cli/commands/template.doc.mjs +3 -0
  299. package/clients/cli/commands/theme-add.doc.mjs +2 -1
  300. package/clients/cli/commands/theme-build.doc.mjs +2 -1
  301. package/clients/cli/commands/theme-eject.doc.mjs +1 -1
  302. package/clients/cli/commands/theme-palette-generate.doc.mjs +3 -2
  303. package/clients/cli/commands/theme-remove.doc.mjs +2 -1
  304. package/clients/cli/commands/theme-targets.doc.mjs +1 -0
  305. package/clients/cli/commands/theme-template.doc.mjs +1 -0
  306. package/clients/cli/commands/theme-use.doc.mjs +2 -1
  307. package/clients/cli/commands/theme.doc.mjs +7 -2
  308. package/clients/cli/commands/theme.mjs +21 -5
  309. package/clients/cli/index.mjs +167 -59
  310. package/clients/cli/lib/base-gate.mjs +522 -0
  311. package/clients/cli/lib/command-path.mjs +26 -0
  312. package/clients/cli/lib/define-command.mjs +161 -12
  313. package/clients/cli/lib/json-shim.mjs +34 -31
  314. package/clients/cli/lib/manifest.d.ts +14 -0
  315. package/clients/cli/lib/manifest.mjs +78 -22
  316. package/clients/cli/lib/root-args.mjs +79 -0
  317. package/clients/cli/lib/stray-option.mjs +21 -8
  318. package/clients/cli/lib/unknown-command.mjs +27 -6
  319. package/clients/cli/manifest.generated.json +1 -1
  320. package/clients/cli/run.mjs +13 -1
  321. package/foundation/agent-docs/computer-agent-text.mjs +1 -1
  322. package/foundation/bases/core-docs.d.mts +10 -0
  323. package/foundation/bases/core-docs.mjs +42 -0
  324. package/foundation/bases/core.d.mts +11 -0
  325. package/foundation/bases/core.mjs +32 -0
  326. package/foundation/bases/requirements.d.mts +128 -0
  327. package/foundation/bases/requirements.mjs +193 -0
  328. package/foundation/bases/resolve.d.mts +134 -0
  329. package/foundation/bases/resolve.mjs +295 -0
  330. package/foundation/bases/state.d.mts +24 -0
  331. package/foundation/bases/state.mjs +46 -0
  332. package/foundation/bases/steps.d.mts +49 -0
  333. package/foundation/bases/steps.mjs +88 -0
  334. package/foundation/config/project.d.mts +14 -0
  335. package/foundation/config/project.mjs +68 -1
  336. package/foundation/discovery/cli-self-docs.mjs +9 -1
  337. package/foundation/discovery/command-pointers.d.mts +28 -0
  338. package/foundation/discovery/command-pointers.mjs +31 -0
  339. package/foundation/discovery/component-discovery.d.mts +9 -8
  340. package/foundation/discovery/component-discovery.mjs +9 -4
  341. package/foundation/discovery/docs-discovery.d.mts +13 -5
  342. package/foundation/discovery/docs-discovery.mjs +25 -6
  343. package/foundation/discovery/hook-discovery.d.mts +6 -6
  344. package/foundation/discovery/hook-discovery.mjs +6 -4
  345. package/foundation/discovery/template-adapter.mjs +5 -0
  346. package/foundation/discovery/template-ids.d.mts +1 -1
  347. package/foundation/discovery/template-ids.mjs +5 -1
  348. package/foundation/discovery/theme-discovery.mjs +3 -0
  349. package/foundation/discovery/theme-imports.mjs +19 -1
  350. package/foundation/doc-compiler/tree.d.mts +4 -2
  351. package/foundation/doc-compiler/tree.mjs +46 -1
  352. package/foundation/env/package-manager.d.mts +7 -0
  353. package/foundation/env/package-manager.mjs +21 -0
  354. package/foundation/fonts/font-stylesheet.d.mts +8 -0
  355. package/foundation/fonts/font-stylesheet.mjs +26 -2
  356. package/foundation/fs/gather-cache.mjs +44 -13
  357. package/foundation/fs/own-modules.d.mts +29 -0
  358. package/foundation/fs/own-modules.mjs +57 -0
  359. package/foundation/fs/paths.d.mts +30 -2
  360. package/foundation/fs/paths.mjs +49 -2
  361. package/foundation/integrations/integrations.d.mts +4 -0
  362. package/foundation/integrations/integrations.mjs +6 -1
  363. package/foundation/release/choose.d.mts +7 -0
  364. package/foundation/release/choose.mjs +16 -2
  365. package/foundation/release/notices.d.mts +26 -0
  366. package/foundation/release/notices.mjs +48 -19
  367. package/foundation/release/project.d.mts +3 -2
  368. package/foundation/release/project.mjs +4 -5
  369. package/foundation/release/run-context.d.mts +7 -2
  370. package/foundation/release/run-context.mjs +6 -2
  371. package/foundation/render/css-cut.mjs +86 -6
  372. package/foundation/render/cut-short.d.mts +35 -0
  373. package/foundation/render/cut-short.mjs +124 -0
  374. package/foundation/render/font-probe.d.mts +27 -0
  375. package/foundation/render/font-probe.mjs +77 -0
  376. package/foundation/render/layers.d.mts +1 -9
  377. package/foundation/render/layers.mjs +2 -111
  378. package/foundation/render/page-worker.mjs +83 -6
  379. package/foundation/render/picture-chrome.mjs +24 -2
  380. package/foundation/render/picture-playwright.mjs +22 -2
  381. package/foundation/render/picture-window.d.mts +20 -4
  382. package/foundation/render/picture-window.mjs +137 -4
  383. package/foundation/response/base.d.ts +25 -0
  384. package/foundation/response/error-codes.d.mts +4 -1
  385. package/foundation/response/error-codes.d.ts +4 -1
  386. package/foundation/response/error-codes.doc.mjs +17 -0
  387. package/foundation/response/error-codes.mjs +21 -0
  388. package/foundation/response/json.d.mts +3 -1
  389. package/foundation/response/json.mjs +7 -2
  390. package/foundation/response/response-types.doc.mjs +2 -2
  391. package/foundation/suggest/name-index.d.mts +2 -1
  392. package/foundation/suggest/name-index.mjs +1 -1
  393. package/foundation/suggest/other-command.d.mts +4 -1
  394. package/foundation/suggest/other-command.mjs +23 -6
  395. package/foundation/text/string-utils.d.mts +7 -2
  396. package/foundation/text/string-utils.mjs +24 -10
  397. package/package.json +6 -6
  398. package/assets/templates/pages/access-denied/page.tsx +0 -101
  399. package/assets/templates/pages/access-denied/template.doc.mjs +0 -24
  400. package/assets/templates/pages/error-page/page.tsx +0 -130
  401. package/assets/templates/pages/error-page/template.doc.mjs +0 -22
  402. package/assets/templates/pages/not-found/page.tsx +0 -124
  403. package/assets/templates/pages/not-found/template.doc.mjs +0 -30
  404. package/assets/templates/pages/review-workspace/page.tsx +0 -551
  405. package/assets/templates/pages/review-workspace/template.doc.mjs +0 -31
  406. package/assets/templates/pages/run-console/page.tsx +0 -945
  407. package/assets/templates/pages/run-console/template.doc.mjs +0 -27
  408. package/assets/templates/pages/welcome-portal/page.tsx +0 -538
  409. package/assets/templates/pages/welcome-portal/template.doc.mjs +0 -38
@@ -82,8 +82,10 @@ export function toErrorEnvelope(err: unknown, suggestions?: import("./base").Sug
82
82
  * @param {string} [code] - Stable machine-readable error code (error-codes.mjs).
83
83
  * @param {Record<string, unknown>} [receipt] - What the command had already
84
84
  * done before it failed (see toErrorEnvelope).
85
+ * @param {Record<string, unknown>} [members] - Additive members a code
86
+ * documents, such as `requirement` on `ERR_BASE_CAPABILITY`.
85
87
  */
86
- export function jsonError(message: string, suggestions?: import("./base").Suggestion[], code?: string, receipt?: Record<string, unknown>): void;
88
+ export function jsonError(message: string, suggestions?: import("./base").Suggestion[], code?: string, receipt?: Record<string, unknown>, members?: Record<string, unknown>): void;
87
89
  /**
88
90
  * Whether the output on `fd` is captured in process: the console method or
89
91
  * the stream's write replaced since this module loaded (a test).
@@ -166,10 +166,15 @@ export function toErrorEnvelope(err, suggestions, code, receipt) {
166
166
  * @param {string} [code] - Stable machine-readable error code (error-codes.mjs).
167
167
  * @param {Record<string, unknown>} [receipt] - What the command had already
168
168
  * done before it failed (see toErrorEnvelope).
169
+ * @param {Record<string, unknown>} [members] - Additive members a code
170
+ * documents, such as `requirement` on `ERR_BASE_CAPABILITY`.
169
171
  */
170
- export function jsonError(message, suggestions, code, receipt) {
172
+ export function jsonError(message, suggestions, code, receipt, members) {
171
173
  process.__xdsJsonHandled = true;
172
- const err = toErrorEnvelope(message, suggestions, code, receipt);
174
+ const err = {
175
+ ...toErrorEnvelope(message, suggestions, code, receipt),
176
+ ...(members ?? {}),
177
+ };
173
178
  // No-op when cliError already classified this failure — first outcome wins.
174
179
  setOutcome('error', {exitCode: 1, error: new Error(message), code: err.code});
175
180
  // Written whole before the exit: a process that exits with output still
@@ -381,7 +381,7 @@ export const doc = {
381
381
  {
382
382
  value: 'theme.build',
383
383
  description:
384
- 'A theme build receipt: name, tokenCount and componentCount (override counts), sizeKB, the written outputs {css, cssDts, js, dts, and variantsDts when applicable}, warnings (defects to fix), and notices (advisories about a correct theme, such as a named font it does not load).',
384
+ 'A theme build receipt: name, tokenCount and componentCount (override counts), sizeKB, the written outputs {css, cssDts, js, dts, and variantsDts when applicable}, warnings (defects to fix), and notices (advisories about a correct theme, such as a named font it does not load). A --family build whose root extends a theme the family does not select adds base {theme, package (the installed package it comes from, or null for a local base: a file of the project or a theme defined in the file of the root), export (the name the root imports it by, or null for a theme defined in the file of the root)}: a requirement of the outputs.',
385
385
  },
386
386
  {
387
387
  value: 'theme.build.check',
@@ -421,7 +421,7 @@ export const doc = {
421
421
  {
422
422
  value: 'theme.palette.generate',
423
423
  description:
424
- 'An author-reviewable OKLCH palette response: recipe (`astryx-oklch-v1`), status (`candidate`), familyCount, stopCount, modes, candidate (`TonalPaletteCandidate`), and generationReceipt. The generationReceipt contains schemaVersion (1), recipe, generatorVersion (`palette-generator-v1`), candidateFormatVersion (`palette-typescript-v1` or `palette-json-v1`), candidateSha256, optional preview, resolved request, and diagnostics. File-write fields are output, receipt, preview, written, and reason (`exists` or null).',
424
+ 'An author-reviewable OKLCH palette response: recipe (the one the request or config names; `astryx-oklch-v1` when it names none), status (`candidate`), familyCount, stopCount, modes, candidate (`TonalPaletteCandidate`), and generationReceipt. The generationReceipt contains schemaVersion (1), recipe, generatorVersion (`palette-generator-v1`), candidateFormatVersion (`palette-typescript-v1` or `palette-json-v1`), candidateSha256, optional preview, resolved request, and diagnostics. File-write fields are output, receipt, preview, written, and reason (`exists` or null).',
425
425
  },
426
426
 
427
427
  // upgrade
@@ -6,7 +6,7 @@
6
6
  * name it declares with whether it is placed, as docs discovery loads it
7
7
  * (docs-discovery.mjs integrationDocDeclaration); null when it does not load.
8
8
  * `segment` is the name as a route segment, folded.
9
- * @typedef {{rel: string, declared: {name: string, placed: boolean, segment: string} | null}} DocEntry
9
+ * @typedef {{rel: string, declared: {name: string, placed: boolean, level: string | null, segment: string} | null}} DocEntry
10
10
  */
11
11
  /**
12
12
  * What works out every route `astryx docs` reads in a project with these
@@ -101,6 +101,7 @@ export type DocEntry = {
101
101
  declared: {
102
102
  name: string;
103
103
  placed: boolean;
104
+ level: string | null;
104
105
  segment: string;
105
106
  } | null;
106
107
  };
@@ -64,7 +64,7 @@ const INDEX_CODE = [
64
64
  * name it declares with whether it is placed, as docs discovery loads it
65
65
  * (docs-discovery.mjs integrationDocDeclaration); null when it does not load.
66
66
  * `segment` is the name as a route segment, folded.
67
- * @typedef {{rel: string, declared: {name: string, placed: boolean, segment: string} | null}} DocEntry
67
+ * @typedef {{rel: string, declared: {name: string, placed: boolean, level: string | null, segment: string} | null}} DocEntry
68
68
  */
69
69
 
70
70
  /**
@@ -27,6 +27,7 @@ export function otherCommand(typed: string, entries: LookupNames, from: LookupCo
27
27
  * near hook or hook keyword hint, a suggestion also matches as well when one
28
28
  * of its names is a near name or carries every typed word, and, for a hook
29
29
  * keyword hint, when one of its `keywordsOf` has exactly the typed words.
30
+ * The first `pinned` suggestions always stay ahead of the hint.
30
31
  * @template {Suggestion} T
31
32
  * @param {T[] | undefined} suggestions
32
33
  * @param {Found | null} found
@@ -36,16 +37,18 @@ export function otherCommand(typed: string, entries: LookupNames, from: LookupCo
36
37
  * alone?: boolean,
37
38
  * namesOf?: (suggestion: T) => Array<string | undefined>,
38
39
  * keywordsOf?: (suggestion: T) => string[],
40
+ * pinned?: number,
39
41
  * }} options `namesOf` gives the names the command matched a suggestion by;
40
42
  * by default its name. `keywordsOf` gives the keywords the suggestion's doc
41
43
  * declares and the synonyms its search card lists; by default none
42
44
  * @returns {Array<T | Hint> | undefined}
43
45
  */
44
- export function withOtherCommand<T extends Suggestion>(suggestions: T[] | undefined, found: Found | null, typed: string, { from, alone, namesOf, keywordsOf, }: {
46
+ export function withOtherCommand<T extends Suggestion>(suggestions: T[] | undefined, found: Found | null, typed: string, { from, alone, namesOf, keywordsOf, pinned, }: {
45
47
  from: LookupCommand;
46
48
  alone?: boolean;
47
49
  namesOf?: (suggestion: T) => Array<string | undefined>;
48
50
  keywordsOf?: (suggestion: T) => string[];
51
+ pinned?: number;
49
52
  }): Array<T | Hint> | undefined;
50
53
  /**
51
54
  * {@link otherCommand} over the names the project's catalogs hold. The
@@ -256,6 +256,7 @@ export function otherCommand(typed, entries, from) {
256
256
  * near hook or hook keyword hint, a suggestion also matches as well when one
257
257
  * of its names is a near name or carries every typed word, and, for a hook
258
258
  * keyword hint, when one of its `keywordsOf` has exactly the typed words.
259
+ * The first `pinned` suggestions always stay ahead of the hint.
259
260
  * @template {Suggestion} T
260
261
  * @param {T[] | undefined} suggestions
261
262
  * @param {Found | null} found
@@ -265,6 +266,7 @@ export function otherCommand(typed, entries, from) {
265
266
  * alone?: boolean,
266
267
  * namesOf?: (suggestion: T) => Array<string | undefined>,
267
268
  * keywordsOf?: (suggestion: T) => string[],
269
+ * pinned?: number,
268
270
  * }} options `namesOf` gives the names the command matched a suggestion by;
269
271
  * by default its name. `keywordsOf` gives the keywords the suggestion's doc
270
272
  * declares and the synonyms its search card lists; by default none
@@ -279,6 +281,7 @@ export function withOtherCommand(
279
281
  alone = false,
280
282
  namesOf = suggestion => [suggestion.name],
281
283
  keywordsOf = () => [],
284
+ pinned = 0,
282
285
  },
283
286
  ) {
284
287
  if (!found) return suggestions;
@@ -301,9 +304,9 @@ export function withOtherCommand(
301
304
  (found.tier === MATCH_TIER.keyword &&
302
305
  synonymMatches(typed, {own: {synonyms: keywordsOf(suggestion)}}).size >
303
306
  0);
304
- let at = 0;
307
+ let at = Math.min(pinned, suggestions.length);
305
308
  suggestions.forEach((suggestion, index) => {
306
- if (matchesAsWell(suggestion)) at = index + 1;
309
+ if (matchesAsWell(suggestion)) at = Math.max(at, index + 1);
307
310
  });
308
311
  return [
309
312
  ...suggestions.slice(0, at),
@@ -549,7 +552,8 @@ export function hookByMeaning(typed, hooks, {keywords = true} = {}) {
549
552
  * names and doc text: the CLI's flat topics and root namespaces, the levels
550
553
  * that hold the flat topics, and each integration's topics and root
551
554
  * namespaces. Only a CLI tree file whose name `isWanted` accepts, and only an
552
- * integration doc whose text spells the name, is read.
555
+ * integration doc whose text spells the name, is read. A doc the run's base
556
+ * leaves out is no hint.
553
557
  * @param {Array<string | undefined>} docsDirs the integrations' docs folders
554
558
  * @param {import('./name-index.mjs').NameIndex} index
555
559
  * @param {string} wanted the folded name
@@ -557,8 +561,19 @@ export function hookByMeaning(typed, hooks, {keywords = true} = {}) {
557
561
  * @returns {Promise<string[]>}
558
562
  */
559
563
  async function rootDocNames(docsDirs, index, wanted, isWanted) {
564
+ const {coreOnlyDocNames} = await import('../bases/core-docs.mjs');
565
+ const leftOut = await coreOnlyDocNames();
566
+ /** @param {string} name */
567
+ const served = name => isWanted(name) && !leftOut.has(name);
568
+ // A level exists while a topic sits in it; an integration's topic keeps
569
+ // its level on any base.
570
+ const filled = new Set(
571
+ index.docs.flat().flatMap(({declared}) =>
572
+ declared?.level ? [declared.level] : [],
573
+ ),
574
+ );
560
575
  const builtin = [
561
- ...index.topics.filter(isWanted),
576
+ ...index.topics.filter(served),
562
577
  ...index.treeStems.filter(isWanted).flatMap(stem => {
563
578
  const name = rootNamespaceName(
564
579
  fs.readFileSync(
@@ -566,9 +581,11 @@ async function rootDocNames(docsDirs, index, wanted, isWanted) {
566
581
  'utf8',
567
582
  ),
568
583
  );
569
- return name && isWanted(name) ? [name] : [];
584
+ return name && served(name) ? [name] : [];
570
585
  }),
571
- ...index.levels.filter(isWanted),
586
+ ...index.levels.filter(
587
+ level => served(level) || (isWanted(level) && filled.has(level)),
588
+ ),
572
589
  ];
573
590
  if (builtin.length > 0) return builtin;
574
591
  // A topic or root namespace: a doc without `placement`.
@@ -41,12 +41,13 @@ export function findClosestComponents(name: string, components: Record<string, s
41
41
  * has keeps Core's doc.
42
42
  *
43
43
  * @param {string} needle
44
- * @param {string} coreDir
44
+ * @param {string | null} coreDir null in a run that reads no Core: only the
45
+ * names in `components` are scored
45
46
  * @param {Record<string, string[]>} components
46
47
  * @param {Array<{name: string, view: ComponentMatchView | null}>} [others]
47
48
  * @returns {Promise<{name: string, score: number, reason: string}[]>}
48
49
  */
49
- export function searchComponents(needle: string, coreDir: string, components: Record<string, string[]>, others?: Array<{
50
+ export function searchComponents(needle: string, coreDir: string | null, components: Record<string, string[]>, others?: Array<{
50
51
  name: string;
51
52
  view: ComponentMatchView | null;
52
53
  }>): Promise<{
@@ -76,6 +77,10 @@ export function componentMatchView(docs: any): ComponentMatchView | null;
76
77
  */
77
78
  export function firstSentence(text: string): string;
78
79
  export { levenshteinDistance } from "./levenshtein.mjs";
80
+ /** The score of a component whose name is the typed name, ignoring case. */
81
+ export const EXACT_NAME_SCORE: 100;
82
+ /** The score of a component with a keyword that is the typed name. */
83
+ export const EXACT_KEYWORD_SCORE: 90;
79
84
  /**
80
85
  * The parts of a component doc {@link searchComponents} scores: its keywords,
81
86
  * its description, and its usage description and best practices.
@@ -34,6 +34,11 @@ export function findClosestComponents(name, components, maxDistance = 3) {
34
34
  return matches;
35
35
  }
36
36
 
37
+ /** The score of a component whose name is the typed name, ignoring case. */
38
+ export const EXACT_NAME_SCORE = 100;
39
+ /** The score of a component with a keyword that is the typed name. */
40
+ export const EXACT_KEYWORD_SCORE = 90;
41
+
37
42
  /**
38
43
  * Unified component search that scores matches across multiple signals:
39
44
  * name similarity, keyword matches, and description/feature text search.
@@ -62,7 +67,8 @@ export function findClosestComponents(name, components, maxDistance = 3) {
62
67
  * has keeps Core's doc.
63
68
  *
64
69
  * @param {string} needle
65
- * @param {string} coreDir
70
+ * @param {string | null} coreDir null in a run that reads no Core: only the
71
+ * names in `components` are scored
66
72
  * @param {Record<string, string[]>} components
67
73
  * @param {Array<{name: string, view: ComponentMatchView | null}>} [others]
68
74
  * @returns {Promise<{name: string, score: number, reason: string}[]>}
@@ -74,9 +80,8 @@ export async function searchComponents(
74
80
  others = [],
75
81
  ) {
76
82
  const {readDocView} = await import('../doc-compiler/read.mjs');
77
- const {listDirEntries, oncePerListing, pathExists} = await import(
78
- '../fs/listing-cache.mjs'
79
- );
83
+ const {listDirEntries, oncePerListing, pathExists} =
84
+ await import('../fs/listing-cache.mjs');
80
85
  const path = await import('node:path');
81
86
 
82
87
  const term = needle.toLowerCase();
@@ -116,7 +121,7 @@ export async function searchComponents(
116
121
 
117
122
  // Exact name
118
123
  if (compLower === term) {
119
- addMatch(comp, 100, 'exact name');
124
+ addMatch(comp, EXACT_NAME_SCORE, 'exact name');
120
125
  continue;
121
126
  }
122
127
 
@@ -148,13 +153,14 @@ export async function searchComponents(
148
153
  }
149
154
 
150
155
  // --- Pass 2: Keyword + description matching (async, reads doc files) ---
151
- const srcDir = path.join(coreDir, 'src');
156
+ const srcDir = coreDir == null ? null : path.join(coreDir, 'src');
152
157
  /**
153
158
  * The doc that Pass 2 reads for `comp`, or null.
154
159
  * @param {string} comp
155
160
  * @returns {string | null}
156
161
  */
157
162
  function docPathOf(comp) {
163
+ if (srcDir == null) return null;
158
164
  const direct = path.join(srcDir, comp, comp + '.doc.mjs');
159
165
  if (pathExists(direct)) return direct;
160
166
  const xdsDirect = path.join(srcDir, comp, 'XDS' + comp + '.doc.mjs');
@@ -199,8 +205,10 @@ export async function searchComponents(
199
205
 
200
206
  // Exact keyword
201
207
  if (kwLower === term) {
202
- addMatch(comp, 90, 'keyword "' + kw + '"');
203
- if (!keywordAt.has(comp) || before < 90) keywordAt.set(comp, at);
208
+ addMatch(comp, EXACT_KEYWORD_SCORE, 'keyword "' + kw + '"');
209
+ if (!keywordAt.has(comp) || before < EXACT_KEYWORD_SCORE) {
210
+ keywordAt.set(comp, at);
211
+ }
204
212
  break;
205
213
  }
206
214
 
@@ -276,7 +284,11 @@ export async function searchComponents(
276
284
  if (!comp) continue;
277
285
  const span = j - i;
278
286
  const atEnd = j === words.length ? 1 : 0;
279
- addMatch(comp, 10 + Math.min(span, 4) + atEnd, 'name part "' + run + '"');
287
+ addMatch(
288
+ comp,
289
+ 10 + Math.min(span, 4) + atEnd,
290
+ 'name part "' + run + '"',
291
+ );
280
292
  }
281
293
  }
282
294
  // Keep only the strongest name parts, so a weaker part never sits
@@ -347,7 +359,9 @@ function definedFields(fields) {
347
359
  * @returns {string}
348
360
  */
349
361
  export function firstSentence(text) {
350
- const flat = String(text ?? '').replace(/\s+/g, ' ').trim();
362
+ const flat = String(text ?? '')
363
+ .replace(/\s+/g, ' ')
364
+ .trim();
351
365
  const ends = /[.!?](?=\s|$)/g;
352
366
  for (let m = ends.exec(flat); m; m = ends.exec(flat)) {
353
367
  const before = flat.slice(0, m.index);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astryxdesign/cli",
3
- "version": "0.7.17-canary.g4ea41ce",
3
+ "version": "0.7.17-canary.g5a3fd39",
4
4
  "displayName": "CLI",
5
5
  "description": "The Astryx CLI: scaffold projects, browse templates, generate themes, and get agent-ready docs from the command line.",
6
6
  "author": "Meta Open Source",
@@ -129,7 +129,7 @@
129
129
  "zod": "^4.6.7"
130
130
  },
131
131
  "peerDependencies": {
132
- "@astryxdesign/core": "0.7.17-canary.g4ea41ce"
132
+ "@astryxdesign/core": "0.7.17-canary.g5a3fd39"
133
133
  },
134
134
  "peerDependenciesMeta": {
135
135
  "@astryxdesign/core": {
@@ -137,10 +137,10 @@
137
137
  }
138
138
  },
139
139
  "devDependencies": {
140
- "@astryxdesign/charts": "0.7.17-canary.g4ea41ce",
141
- "@astryxdesign/core": "0.7.17-canary.g4ea41ce",
142
- "@astryxdesign/lab": "0.7.17-canary.g4ea41ce",
143
- "@astryxdesign/theme-neutral": "0.7.17-canary.g4ea41ce",
140
+ "@astryxdesign/charts": "0.7.17-canary.g5a3fd39",
141
+ "@astryxdesign/core": "0.7.17-canary.g5a3fd39",
142
+ "@astryxdesign/lab": "0.7.17-canary.g5a3fd39",
143
+ "@astryxdesign/theme-neutral": "0.7.17-canary.g5a3fd39",
144
144
  "@heroicons/react": "^2.2.0",
145
145
  "@stylexjs/stylex": "^0.19.1",
146
146
  "@types/babel__core": "^7.20.5",
@@ -1,101 +0,0 @@
1
- // Copyright (c) Meta Platforms, Inc. and affiliates.
2
-
3
- 'use client';
4
-
5
- /**
6
- * Access denied: the screen an app shows when the signed-in account may not
7
- * open a page. It names the resource and the account, has a request for
8
- * access with an optional note to the owner (a demo until the app sends it),
9
- * and offers another account or home.
10
- */
11
-
12
- import {useState} from 'react';
13
-
14
- import {Center} from '@astryxdesign/core/Center';
15
- import {VStack, HStack} from '@astryxdesign/core/Layout';
16
- import {EmptyState} from '@astryxdesign/core/EmptyState';
17
- import {Avatar} from '@astryxdesign/core/Avatar';
18
- import {Text} from '@astryxdesign/core/Text';
19
- import {TextArea} from '@astryxdesign/core/TextArea';
20
- import {Banner} from '@astryxdesign/core/Banner';
21
- import {Button} from '@astryxdesign/core/Button';
22
- import {Divider} from '@astryxdesign/core/Divider';
23
- import {Icon} from '@astryxdesign/core/Icon';
24
- import {useToast} from '@astryxdesign/core/Toast';
25
-
26
- import {LockClosedIcon} from '@heroicons/react/24/outline';
27
-
28
- const RESOURCE = 'Quarterly forecast';
29
- const ACCOUNT = {name: 'Riley Quinn', email: 'riley.quinn@example.com'};
30
-
31
- export default function AccessDeniedPage() {
32
- const showToast = useToast();
33
- const [note, setNote] = useState('');
34
- const [isRequested, setIsRequested] = useState(false);
35
-
36
- return (
37
- <Center height="100%" padding={6}>
38
- <VStack gap={5} width="100%" maxWidth={480}>
39
- <EmptyState
40
- icon={<Icon icon={LockClosedIcon} size="lg" />}
41
- headingLevel={1}
42
- title="You don't have access"
43
- description={`You need permission to open ${RESOURCE}. Ask an owner for access, or switch to an account that has it.`}
44
- />
45
- <HStack gap={3} vAlign="center">
46
- <Avatar name={ACCOUNT.name} size="md" />
47
- <VStack gap={0}>
48
- <Text type="body" weight="bold">
49
- {ACCOUNT.name}
50
- </Text>
51
- <Text type="supporting" color="secondary">
52
- Signed in as {ACCOUNT.email}
53
- </Text>
54
- </VStack>
55
- </HStack>
56
- <Divider />
57
- <TextArea
58
- label="Message to the owner"
59
- isOptional
60
- placeholder="Say why you need access"
61
- value={note}
62
- onChange={setNote}
63
- rows={3}
64
- />
65
- {isRequested ? (
66
- // Demo only: replace this banner with the call that sends the
67
- // request and the note to the resource's owners.
68
- <Banner
69
- status="info"
70
- container="card"
71
- title="Demo: no request was sent"
72
- description={
73
- note.trim()
74
- ? `In your app, the request and your note would go to the owners of ${RESOURCE} here.`
75
- : `In your app, the request would go to the owners of ${RESOURCE} here.`
76
- }
77
- />
78
- ) : null}
79
- <VStack gap={2}>
80
- <Button
81
- label="Request access"
82
- variant="primary"
83
- onClick={() => setIsRequested(true)}
84
- />
85
- <Button
86
- label="Switch account"
87
- variant="secondary"
88
- onClick={() =>
89
- // Demo only: replace this toast with the app's account switcher.
90
- showToast({
91
- body: 'Demo: the account switcher would open here',
92
- uniqueID: 'switch-account',
93
- })
94
- }
95
- />
96
- <Button label="Go to home" variant="ghost" href="/" />
97
- </VStack>
98
- </VStack>
99
- </Center>
100
- );
101
- }
@@ -1,24 +0,0 @@
1
- // Copyright (c) Meta Platforms, Inc. and affiliates.
2
-
3
- /** @type {import('@astryxdesign/cli/authoring').TemplateDoc} */
4
- export const doc = {
5
- type: 'page',
6
- name: 'Access Denied',
7
- displayName: 'Access Denied',
8
- description:
9
- "Permission wall shown when the signed-in account isn't allowed to open a resource. It shows a lock message that names the resource, the current account's avatar, name and email, an optional note to the owner, request-access and switch-account buttons that show demo messages until an app wires them, and a go-home link.",
10
- keywords: [
11
- '403 forbidden',
12
- 'no permission',
13
- 'permission required',
14
- 'locked',
15
- 'request access',
16
- 'note to owner',
17
- 'signed-in account',
18
- ],
19
- isReady: false,
20
- category: 'Status - Access Denied',
21
- icons: {
22
- LockClosedIcon: 'lock',
23
- },
24
- };
@@ -1,130 +0,0 @@
1
- // Copyright (c) Meta Platforms, Inc. and affiliates.
2
-
3
- 'use client';
4
-
5
- /**
6
- * Error page: the screen an app shows when a page fails to load. It reloads
7
- * the page to try again, shows whether the browser is online, keeps the
8
- * error's reference for support, and offers a way home.
9
- */
10
-
11
- import {useEffect, useState} from 'react';
12
-
13
- import {Center} from '@astryxdesign/core/Center';
14
- import {HStack, VStack} from '@astryxdesign/core/Layout';
15
- import {EmptyState} from '@astryxdesign/core/EmptyState';
16
- import {Button} from '@astryxdesign/core/Button';
17
- import {Collapsible} from '@astryxdesign/core/Collapsible';
18
- import {MetadataList, MetadataListItem} from '@astryxdesign/core/MetadataList';
19
- import {Code} from '@astryxdesign/core/Code';
20
- import {Timestamp} from '@astryxdesign/core/Timestamp';
21
- import {StatusDot} from '@astryxdesign/core/StatusDot';
22
- import {Heading, Text} from '@astryxdesign/core/Text';
23
- import {Icon} from '@astryxdesign/core/Icon';
24
- import {useToast} from '@astryxdesign/core/Toast';
25
-
26
- import {ExclamationTriangleIcon} from '@heroicons/react/24/outline';
27
-
28
- const ERROR = {
29
- code: 'ERR_UPSTREAM_TIMEOUT',
30
- reference: 'req_7f3a9c2e',
31
- time: '2026-06-30T09:41:12',
32
- };
33
-
34
- /** Whether the browser reports a network connection, kept current. */
35
- function useIsOnline() {
36
- const [isOnline, setIsOnline] = useState(true);
37
- useEffect(() => {
38
- const update = () => setIsOnline(navigator.onLine);
39
- update();
40
- window.addEventListener('online', update);
41
- window.addEventListener('offline', update);
42
- return () => {
43
- window.removeEventListener('online', update);
44
- window.removeEventListener('offline', update);
45
- };
46
- }, []);
47
- return isOnline;
48
- }
49
-
50
- export default function ErrorPage() {
51
- const showToast = useToast();
52
- const isOnline = useIsOnline();
53
- const [isConnectionShown, setIsConnectionShown] = useState(false);
54
-
55
- return (
56
- <Center height="100%" padding={6}>
57
- <VStack gap={6} width="100%" maxWidth={520}>
58
- <EmptyState
59
- icon={<Icon icon={ExclamationTriangleIcon} size="lg" />}
60
- headingLevel={1}
61
- title="Something went wrong"
62
- description="We couldn't load this page. Try again in a moment, or check your connection."
63
- actions={
64
- <>
65
- <Button
66
- label="Try again"
67
- variant="primary"
68
- onClick={() => window.location.reload()}
69
- />
70
- <Button
71
- label="Check connection"
72
- variant="secondary"
73
- onClick={() => setIsConnectionShown(true)}
74
- />
75
- </>
76
- }
77
- />
78
- <Button label="Go to home" variant="ghost" href="/" />
79
-
80
- {isConnectionShown ? (
81
- <VStack gap={2}>
82
- <Heading level={2}>Connection</Heading>
83
- <HStack gap={2} vAlign="center">
84
- <StatusDot
85
- variant={isOnline ? 'success' : 'error'}
86
- label={isOnline ? 'Online' : 'Offline'}
87
- />
88
- <Text type="body">
89
- {isOnline
90
- ? 'Your browser reports a network connection.'
91
- : 'Your browser reports no network connection. Reconnect, then try again.'}
92
- </Text>
93
- </HStack>
94
- <Text type="supporting" color="secondary">
95
- Demo: checks of this app&apos;s own services would run here.
96
- </Text>
97
- </VStack>
98
- ) : null}
99
-
100
- <Collapsible trigger="Error details" defaultIsOpen={false}>
101
- <VStack gap={3}>
102
- <MetadataList>
103
- <MetadataListItem label="Error">
104
- <Code>{ERROR.code}</Code>
105
- </MetadataListItem>
106
- <MetadataListItem label="Reference">
107
- <Code>{ERROR.reference}</Code>
108
- </MetadataListItem>
109
- <MetadataListItem label="Time">
110
- <Timestamp value={ERROR.time} />
111
- </MetadataListItem>
112
- </MetadataList>
113
- <Button
114
- label="Contact support"
115
- variant="secondary"
116
- onClick={() =>
117
- // Demo only: replace this toast with the app's support form,
118
- // prefilled with the reference above.
119
- showToast({
120
- body: `Demo: a support request with ${ERROR.reference} would open here`,
121
- uniqueID: 'contact-support',
122
- })
123
- }
124
- />
125
- </VStack>
126
- </Collapsible>
127
- </VStack>
128
- </Center>
129
- );
130
- }
@@ -1,22 +0,0 @@
1
- // Copyright (c) Meta Platforms, Inc. and affiliates.
2
-
3
- /** @type {import('@astryxdesign/cli/authoring').TemplateDoc} */
4
- export const doc = {
5
- type: 'page',
6
- name: 'Error Page',
7
- displayName: 'Error Page',
8
- description:
9
- 'Recovery page for when a page fails to load. It shows a warning message with a "Try again" button that reloads the page, a "Check connection" button that shows whether the browser is online, and a collapsible details section with the error code, reference ID, time and a contact-support button.',
10
- keywords: [
11
- 'load failure',
12
- 'something went wrong',
13
- 'service unavailable',
14
- 'error details',
15
- 'error reference',
16
- ],
17
- isReady: false,
18
- category: 'Status - Error',
19
- icons: {
20
- ExclamationTriangleIcon: 'warning',
21
- },
22
- };