@astryxdesign/cli 0.6.6 → 0.6.7-canary.13feb39
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.
- package/CHANGELOG.md +129 -0
- package/README.md +84 -82
- package/api/build/_adapter.d.mts +20 -0
- package/api/build/_adapter.mjs +24 -0
- package/api/build/build.doc.mjs +1 -1
- package/api/build/build.test.mjs +1 -1
- package/api/build/build.type.d.mts +12 -0
- package/api/build/build.type.mjs +3 -0
- package/api/build/help/help.mjs +1 -1
- package/api/build/kit/kit.mjs +13 -1
- package/api/component/_adapter.d.mts +19 -0
- package/api/component/_adapter.mjs +33 -0
- package/api/component/component-replacement.test.mjs +615 -0
- package/api/component/component.doc.mjs +5 -2
- package/api/component/component.mjs +49 -15
- package/api/component/component.test.mjs +32 -0
- package/api/component/component.type.d.mts +33 -3
- package/api/component/component.type.mjs +10 -3
- package/api/component/detail/blocks/blocks.d.mts +2 -1
- package/api/component/detail/blocks/blocks.mjs +5 -2
- package/api/component/detail/detail.mjs +5 -1
- package/api/component/detail/props/props.d.mts +2 -1
- package/api/component/detail/props/props.mjs +3 -2
- package/api/component/detail/showcase/showcase.d.mts +3 -1
- package/api/component/detail/showcase/showcase.mjs +3 -1
- package/api/component/detail/source/source.d.mts +3 -2
- package/api/component/detail/source/source.mjs +7 -3
- package/api/component/list/list.mjs +128 -10
- package/api/docs/_adapter.d.mts +11 -0
- package/api/docs/_adapter.mjs +73 -1
- package/api/docs/compiled-topics.test.mjs +1 -1
- package/api/docs/detail/detail.mjs +19 -3
- package/api/docs/detail/section/section.d.mts +44 -0
- package/api/docs/detail/section/section.mjs +171 -14
- package/api/docs/detail/section/section.test.mjs +4 -4
- package/api/docs/docOverlays.test.mjs +52 -23
- package/api/docs/docs.depth.test.mjs +2 -0
- package/api/docs/docs.doc.mjs +3 -3
- package/api/docs/docs.mjs +13 -16
- package/api/docs/docs.test.mjs +9 -10
- package/api/docs/docs.type.d.mts +43 -3
- package/api/docs/docs.type.mjs +23 -3
- package/api/docs/index/index.mjs +11 -2
- package/api/docs/index/index.test.mjs +7 -2
- package/api/docs/integration-tree.test.mjs +26 -26
- package/api/docs/integrationDocs.test.mjs +8 -7
- package/api/docs/namespace-section.test.mjs +260 -0
- package/api/docs/node/node.mjs +3 -0
- package/api/docs/token-tables.test.mjs +93 -0
- package/api/doctor/_adapter.d.mts +50 -0
- package/api/doctor/_adapter.mjs +190 -0
- package/api/doctor/doctor.d.mts +6 -10
- package/api/doctor/doctor.doc.mjs +1 -3
- package/api/doctor/doctor.mjs +144 -150
- package/api/doctor/doctor.test.mjs +104 -0
- package/api/doctor/theme-checks.d.mts +24 -0
- package/api/doctor/theme-checks.mjs +1231 -0
- package/api/doctor/theme-checks.test.mjs +667 -0
- package/api/gap-report/gap-report.doc.mjs +2 -1
- package/api/gap-report/gap-report.mjs +15 -1
- package/api/hook/_adapter.d.mts +1 -0
- package/api/hook/_adapter.mjs +3 -0
- package/api/hook/detail/detail.mjs +2 -2
- package/api/hook/detail/params/params.mjs +2 -2
- package/api/hook/hook.type.d.mts +12 -0
- package/api/hook/hook.type.mjs +3 -0
- package/api/hook/list/list.mjs +8 -8
- package/api/index.d.mts +1 -1
- package/api/index.mjs +4 -0
- package/api/init/run/run.d.mts +3 -5
- package/api/init/run/run.mjs +11 -11
- package/api/integration/__fixtures__/released-0.6.5-ocean.d.mts +14 -0
- package/api/integration/__fixtures__/released-0.6.5-ocean.mjs +15 -0
- package/api/integration/add-helpers.d.mts +26 -5
- package/api/integration/add-helpers.mjs +50 -5
- package/api/integration/add-theme.mjs +16 -2
- package/api/integration/add-theme.test.mjs +66 -15
- package/api/integration/authoring-checks.mjs +21 -1
- package/api/integration/integrationComponentConflicts.doc.mjs +6 -3
- package/api/integration/pack-check.component-replaces.test.mjs +126 -0
- package/api/integration/pack-check.d.mts +10 -0
- package/api/integration/pack-check.lifecycle-output.test.mjs +21 -2
- package/api/integration/pack-check.mjs +485 -3
- package/api/integration/pack-check.test.mjs +578 -10
- package/api/integration/validate-integration.mjs +20 -4
- package/api/integration/validate-integration.test.mjs +73 -0
- package/api/layout/check/check.d.mts +1 -0
- package/api/layout/check/check.mjs +1 -0
- package/api/layout/expand/expand.d.mts +1 -0
- package/api/layout/expand/expand.mjs +1 -0
- package/api/layout/grammar/grammar.d.mts +1 -0
- package/api/layout/grammar/grammar.mjs +1 -0
- package/api/layout/layoutCheck.doc.mjs +1 -1
- package/api/layout/layoutExpand.doc.mjs +1 -1
- package/api/layout/layoutGrammar.doc.mjs +1 -1
- package/api/search/search.d.mts +47 -3
- package/api/search/search.doc.mjs +1 -1
- package/api/search/search.domain-priority.test.mjs +261 -0
- package/api/search/search.mjs +247 -43
- package/api/search/search.test.mjs +5 -1
- package/api/search/search.type.d.mts +3 -3
- package/api/search/search.type.mjs +2 -2
- package/api/swizzle/_adapter.d.mts +10 -0
- package/api/swizzle/_adapter.mjs +23 -0
- package/api/swizzle/copy/copy.d.mts +5 -6
- package/api/swizzle/copy/copy.mjs +29 -10
- package/api/swizzle/list/list.mjs +2 -2
- package/api/swizzle/swizzle.doc.mjs +5 -2
- package/api/swizzle/swizzle.test.mjs +55 -5
- package/api/swizzle/swizzle.type.d.mts +8 -0
- package/api/swizzle/swizzle.type.mjs +2 -0
- package/api/template/copy/copy.mjs +14 -1
- package/api/template/show/show.mjs +2 -0
- package/api/template/skeleton/skeleton.mjs +2 -1
- package/api/template/template.d.mts +1 -1
- package/api/template/template.doc.mjs +1 -1
- package/api/template/template.mjs +1 -0
- package/api/template/template.type.d.mts +15 -0
- package/api/template/template.type.mjs +6 -0
- package/api/theme/_adapter.d.mts +106 -6
- package/api/theme/_adapter.mjs +687 -18
- package/api/theme/add/add.binary.test.mjs +76 -3
- package/api/theme/add/add.d.mts +5 -9
- package/api/theme/add/add.mjs +87 -64
- package/api/theme/add/add.rollback.test.mjs +9 -9
- package/api/theme/add/add.staging.test.mjs +9 -9
- package/api/theme/add/add.test.mjs +461 -55
- package/api/theme/add/add.types.test.mjs +151 -0
- package/api/theme/build/build.d.mts +96 -2
- package/api/theme/build/build.family.test.mjs +13 -4
- package/api/theme/build/build.mjs +286 -118
- package/api/theme/build/build.test.mjs +30 -0
- package/api/theme/build/font-warning.d.mts +11 -0
- package/api/theme/build/font-warning.mjs +28 -3
- package/api/theme/eject/eject.binary.test.mjs +90 -0
- package/api/theme/eject/eject.d.mts +17 -0
- package/api/theme/eject/eject.mjs +65 -0
- package/api/theme/eject/eject.rollback.test.mjs +158 -0
- package/api/theme/eject/eject.staging.test.mjs +83 -0
- package/api/theme/eject/eject.test.mjs +160 -0
- package/api/theme/integration-themes.test.mjs +30 -6
- package/api/theme/list/list.d.mts +10 -0
- package/api/theme/list/list.mjs +75 -7
- package/api/theme/list/list.test.mjs +155 -4
- package/api/theme/remove/remove.d.mts +12 -0
- package/api/theme/remove/remove.mjs +15 -0
- package/api/theme/remove/remove.test.mjs +94 -0
- package/api/theme/template/template.mjs +3 -4
- package/api/theme/theme.d.mts +5 -2
- package/api/theme/theme.mjs +13 -8
- package/api/theme/theme.type.d.mts +106 -2
- package/api/theme/theme.type.mjs +54 -5
- package/api/theme/themeAdd.doc.d.mts +1 -3
- package/api/theme/themeAdd.doc.mjs +35 -22
- package/api/theme/themeBuild.doc.mjs +1 -1
- package/api/theme/themeEject.doc.d.mts +8 -0
- package/api/theme/themeEject.doc.mjs +89 -0
- package/api/theme/themeListAvailable.doc.mjs +4 -4
- package/api/theme/themeListCopySources.doc.d.mts +8 -0
- package/api/theme/themeListCopySources.doc.mjs +60 -0
- package/api/theme/themeRemove.doc.d.mts +6 -0
- package/api/theme/themeRemove.doc.mjs +50 -0
- package/api/theme/themeTemplate.doc.mjs +4 -3
- package/api/theme/themeUse.doc.d.mts +6 -0
- package/api/theme/themeUse.doc.mjs +47 -0
- package/api/theme/use/use.d.mts +12 -0
- package/api/theme/use/use.mjs +15 -0
- package/api/theme/use/use.test.mjs +98 -0
- package/api/upgrade/_adapter.d.mts +1 -0
- package/api/upgrade/_adapter.mjs +3 -0
- package/api/upgrade/list/list.mjs +9 -3
- package/api/upgrade/upgrade.type.d.mts +4 -0
- package/api/upgrade/upgrade.type.mjs +1 -0
- package/assets/codemods/__tests__/registry.test.mjs +1 -0
- package/assets/codemods/integration-discovery.mjs +1 -1
- package/assets/codemods/integration-discovery.test.mjs +64 -0
- package/assets/codemods/registry.mjs +1 -0
- package/assets/codemods/transforms/v0.6.7/__tests__/migrate-copied-themes-to-descriptors.test.mjs +129 -0
- package/assets/codemods/transforms/v0.6.7/index.mjs +23 -0
- package/assets/codemods/transforms/v0.6.7/migrate-copied-themes-to-descriptors.mjs +54 -0
- package/assets/docs/author-a-theme.doc.mjs +166 -0
- package/assets/docs/getting-started.doc.mjs +61 -17
- package/assets/docs/principles.doc.dense.mjs +4 -4
- package/assets/docs/principles.doc.mjs +6 -6
- package/assets/docs/principles.doc.zh.mjs +4 -4
- package/assets/docs/styling-overview.doc.mjs +211 -0
- package/assets/docs/theme.doc.dense.mjs +11 -197
- package/assets/docs/theme.doc.mjs +16 -764
- package/assets/docs/theme.doc.zh.mjs +31 -12
- package/assets/docs/tree/add-a-theme.doc.mjs +2 -2
- package/assets/docs/tree/checks.doc.mjs +6 -5
- package/assets/docs/tree/component-migration.doc.mjs +107 -0
- package/assets/docs/tree/css-and-stylex.doc.mjs +150 -0
- package/assets/docs/tree/define-the-theme.doc.mjs +1 -1
- package/assets/docs/tree/document-the-theme.doc.mjs +4 -4
- package/assets/docs/tree/font-setup.doc.mjs +122 -0
- package/assets/docs/tree/fonts-and-assets.doc.mjs +25 -20
- package/assets/docs/tree/headers-and-footers.doc.mjs +67 -0
- package/assets/docs/tree/i18n-library-integration.doc.mjs +167 -0
- package/assets/docs/tree/i18n-quick-start.doc.mjs +101 -0
- package/assets/docs/{internationalization.doc.mjs → tree/i18n-rtl-and-testing.doc.mjs} +17 -223
- package/assets/docs/tree/internationalization.doc.mjs +29 -0
- package/assets/docs/tree/layout-spacing.doc.mjs +168 -0
- package/assets/docs/tree/layout.doc.mjs +55 -0
- package/assets/docs/{migration.doc.mjs → tree/migration-setup.doc.mjs} +24 -129
- package/assets/docs/tree/migration-verification.doc.mjs +67 -0
- package/assets/docs/tree/migration.doc.mjs +28 -0
- package/assets/docs/tree/non-css-processing.doc.mjs +112 -0
- package/assets/docs/tree/other-libraries.doc.mjs +218 -0
- package/assets/docs/tree/replace-a-core-component.doc.mjs +21 -4
- package/assets/docs/tree/replace-a-core-template.doc.mjs +1 -1
- package/assets/docs/tree/responsive.doc.mjs +98 -0
- package/assets/docs/tree/scaffold.doc.mjs +140 -0
- package/assets/docs/tree/side-panels.doc.mjs +81 -0
- package/assets/docs/tree/structure.doc.mjs +140 -0
- package/assets/docs/tree/styling-advanced.doc.mjs +159 -0
- package/assets/docs/tree/styling-basics.doc.mjs +181 -0
- package/assets/docs/tree/styling-libraries.doc.mjs +30 -0
- package/assets/docs/tree/styling.doc.mjs +29 -0
- package/assets/docs/tree/tailwind.doc.mjs +65 -0
- package/assets/docs/tree/template-doc-overview.doc.mjs +1 -1
- package/assets/docs/tree/themes.doc.mjs +2 -2
- package/assets/docs/tree/tokens-and-setup.doc.mjs +128 -0
- package/assets/docs/tree/tokens-border.doc.mjs +46 -0
- package/assets/docs/tree/tokens-color.doc.dense.mjs +10 -0
- package/assets/docs/tree/tokens-color.doc.mjs +438 -0
- package/assets/docs/tree/tokens-color.doc.zh.mjs +10 -0
- package/assets/docs/tree/tokens-data.doc.mjs +323 -0
- package/assets/docs/tree/tokens-duration.doc.mjs +78 -0
- package/assets/docs/tree/tokens-ease.doc.mjs +46 -0
- package/assets/docs/tree/tokens-focus.doc.mjs +57 -0
- package/assets/docs/tree/tokens-font-weight.doc.mjs +58 -0
- package/assets/docs/tree/tokens-radius.doc.dense.mjs +10 -0
- package/assets/docs/tree/tokens-radius.doc.mjs +70 -0
- package/assets/docs/tree/tokens-radius.doc.zh.mjs +10 -0
- package/assets/docs/tree/tokens-shadow.doc.dense.mjs +10 -0
- package/assets/docs/tree/tokens-shadow.doc.mjs +74 -0
- package/assets/docs/tree/tokens-shadow.doc.zh.mjs +10 -0
- package/assets/docs/tree/tokens-size.doc.dense.mjs +10 -0
- package/assets/docs/tree/tokens-size.doc.mjs +54 -0
- package/assets/docs/tree/tokens-size.doc.zh.mjs +10 -0
- package/assets/docs/tree/tokens-spacing.doc.dense.mjs +10 -0
- package/assets/docs/tree/tokens-spacing.doc.mjs +102 -0
- package/assets/docs/tree/tokens-spacing.doc.zh.mjs +10 -0
- package/assets/docs/tree/tokens-syntax.doc.mjs +98 -0
- package/assets/docs/tree/tokens-text-size.doc.mjs +90 -0
- package/assets/docs/tree/tokens-type-scale.doc.mjs +210 -0
- package/assets/docs/tree/tokens-typography.doc.mjs +54 -0
- package/assets/docs/tree/tokens-usage.doc.dense.mjs +10 -0
- package/assets/docs/tree/tokens-usage.doc.mjs +36 -0
- package/assets/docs/tree/tokens-usage.doc.zh.mjs +10 -0
- package/assets/docs/tree/tokens.doc.mjs +28 -0
- package/assets/docs/tree/troubleshooting.doc.mjs +7 -3
- package/assets/docs/tree/type-scale.doc.mjs +147 -0
- package/assets/docs/tree/typography-best-practices.doc.mjs +55 -0
- package/assets/docs/tree/typography.doc.mjs +29 -0
- package/assets/docs/tree/use-a-theme-in-an-app.doc.mjs +22 -5
- package/assets/docs/tree/versioning.doc.mjs +6 -3
- package/assets/docs/use-a-theme.doc.mjs +212 -0
- package/assets/templates/pages/incident-console/page.tsx +1 -1
- package/assets/templates/pages/table-collapsible/page.tsx +1474 -0
- package/assets/templates/pages/table-collapsible/template.doc.mjs +12 -0
- package/assets/templates/pages/table-comparison/page.tsx +1449 -0
- package/assets/templates/pages/table-comparison/template.doc.mjs +12 -0
- package/assets/theme.template.ts +28 -11
- package/authoring/doctypes/command/command.doc.mjs +5 -0
- package/authoring/doctypes/command/type.ts +2 -0
- package/authoring/doctypes/component/component.doc.mjs +1 -1
- package/authoring/doctypes/component/type.ts +8 -4
- package/authoring/doctypes/template/template.doc.mjs +2 -2
- package/authoring/doctypes/template/type.ts +5 -3
- package/authoring/integration/integration.doc.mjs +1 -1
- package/clients/cli/commands/blog.mjs +3 -3
- package/clients/cli/commands/build-theme.adaptations.test.mjs +1 -1
- package/clients/cli/commands/build-theme.ascii-output.test.mjs +11 -1
- package/clients/cli/commands/build-theme.batch-report.test.mjs +335 -0
- package/clients/cli/commands/build-theme.font-warning.test.mjs +36 -7
- package/clients/cli/commands/build-theme.import-path.test.mjs +3 -3
- package/clients/cli/commands/build-theme.mjs +338 -45
- package/clients/cli/commands/build-theme.watch.test.mjs +33 -0
- package/clients/cli/commands/build.mjs +8 -6
- package/clients/cli/commands/build.text-fields.test.mjs +1 -1
- package/clients/cli/commands/component/index.mjs +91 -12
- package/clients/cli/commands/component-replacement.text.test.mjs +316 -0
- package/clients/cli/commands/component.doc.mjs +9 -2
- package/clients/cli/commands/docs.doc.mjs +2 -1
- package/clients/cli/commands/docs.mjs +63 -23
- package/clients/cli/commands/docs.test.mjs +17 -15
- package/clients/cli/commands/doctor-integration-components.doc.mjs +15 -4
- package/clients/cli/commands/doctor.doc.mjs +1 -1
- package/clients/cli/commands/doctor.test.mjs +59 -52
- package/clients/cli/commands/gap-report.doc.mjs +2 -2
- package/clients/cli/commands/hook/index.mjs +7 -2
- package/clients/cli/commands/import-hint-correctness.test.mjs +28 -5
- package/clients/cli/commands/init.next-steps.test.mjs +18 -23
- package/clients/cli/commands/integration-real-world.test.mjs +61 -12
- package/clients/cli/commands/layout-check.doc.mjs +2 -0
- package/clients/cli/commands/layout-expand.doc.mjs +2 -0
- package/clients/cli/commands/layout-grammar.doc.mjs +2 -0
- package/clients/cli/commands/layout.deprecation-lifecycle.test.mjs +140 -0
- package/clients/cli/commands/layout.doc.mjs +2 -0
- package/clients/cli/commands/layout.mjs +40 -4
- package/clients/cli/commands/no-prompt-wording.test.mjs +4 -4
- package/clients/cli/commands/search.test.mjs +10 -4
- package/clients/cli/commands/swizzle.doc.mjs +12 -3
- package/clients/cli/commands/swizzle.mjs +2 -1
- package/clients/cli/commands/swizzle.routing.test.mjs +2 -1
- package/clients/cli/commands/template.mjs +56 -5
- package/clients/cli/commands/text-json-parity.test.mjs +40 -0
- package/clients/cli/commands/theme-add-lifecycle.test.mjs +135 -0
- package/clients/cli/commands/theme-add.doc.mjs +19 -19
- package/clients/cli/commands/theme-build.doc.mjs +3 -1
- package/clients/cli/commands/theme-eject.doc.mjs +47 -0
- package/clients/cli/commands/theme-list.behavior.test.mjs +5 -2
- package/clients/cli/commands/theme-list.doc.mjs +2 -2
- package/clients/cli/commands/theme-palette-generate.doc.mjs +1 -2
- package/clients/cli/commands/theme-remove.doc.mjs +22 -0
- package/clients/cli/commands/theme-template.doc.mjs +4 -3
- package/clients/cli/commands/theme-use.doc.mjs +22 -0
- package/clients/cli/commands/theme.doc.mjs +21 -16
- package/clients/cli/commands/upgrade.config-ordering.test.mjs +2 -1
- package/clients/cli/commands/upgrade.mjs +1 -1
- package/clients/cli/index.mjs +5 -2
- package/clients/cli/lib/component-format.mjs +29 -2
- package/clients/cli/lib/component-format.test.mjs +1 -1
- package/clients/cli/lib/define-command.mjs +4 -0
- package/clients/cli/lib/resolve-theme.mjs +80 -78
- package/clients/cli/lib/resolve-theme.test.mjs +523 -27
- package/foundation/agent-docs/agent-docs.mjs +48 -30
- package/foundation/agent-docs/agent-docs.test.mjs +47 -34
- package/foundation/agent-docs/app-theme-workflow.test.mjs +13 -0
- package/foundation/config/project.d.mts +20 -5
- package/foundation/config/project.mjs +43 -6
- package/foundation/config/project.test.mjs +1 -1
- package/foundation/config/theme-private-vars.d.mts +12 -0
- package/foundation/config/theme-private-vars.mjs +107 -0
- package/foundation/config/theme-private-vars.test.mjs +55 -0
- package/foundation/config/theme-state.d.mts +145 -0
- package/foundation/config/theme-state.mjs +417 -0
- package/foundation/config/theme-state.test.mjs +182 -0
- package/foundation/discovery/component-discovery.d.mts +5 -2
- package/foundation/discovery/component-discovery.mjs +12 -6
- package/foundation/discovery/component-replacement.d.mts +91 -0
- package/foundation/discovery/component-replacement.mjs +417 -0
- package/foundation/discovery/component-replacement.test.mjs +480 -0
- package/foundation/discovery/docs-discovery.test.mjs +1 -1
- package/foundation/discovery/docs-output-budget.d.mts +6 -2
- package/foundation/discovery/docs-output-budget.mjs +2 -1
- package/foundation/discovery/docs-section-key.d.mts +4 -2
- package/foundation/discovery/docs-section-key.mjs +1 -1
- package/foundation/discovery/module-exports.d.mts +10 -0
- package/foundation/discovery/module-exports.mjs +146 -0
- package/foundation/discovery/package-exports.d.mts +29 -0
- package/foundation/discovery/package-exports.mjs +200 -0
- package/foundation/discovery/template-needs.d.mts +31 -0
- package/foundation/discovery/template-needs.mjs +156 -0
- package/foundation/discovery/template-needs.test.mjs +203 -0
- package/foundation/discovery/theme-discovery.d.mts +72 -5
- package/foundation/discovery/theme-discovery.mjs +134 -18
- package/foundation/discovery/theme-discovery.test.mjs +9 -3
- package/foundation/discovery/theme-imports.d.mts +15 -0
- package/foundation/discovery/theme-imports.mjs +217 -0
- package/foundation/discovery/theme-imports.test.mjs +173 -0
- package/foundation/doc-compiler/bundle.mjs +52 -1
- package/foundation/doc-compiler/doc-loads.test.mjs +15 -5
- package/foundation/doc-compiler/inputs.mjs +2 -1
- package/foundation/doc-compiler/lenses.d.mts +4 -2
- package/foundation/doc-compiler/lenses.mjs +1 -1
- package/foundation/doc-compiler/split-topic-keywords.test.mjs +73 -0
- package/foundation/doc-compiler/tree.d.mts +10 -0
- package/foundation/doc-compiler/tree.mjs +22 -0
- package/foundation/doc-compiler/tree.test.mjs +3 -2
- package/foundation/env/package-manager.d.mts +31 -8
- package/foundation/env/package-manager.mjs +120 -13
- package/foundation/env/package-manager.test.mjs +174 -1
- package/foundation/fs/module-loader.d.mts +9 -0
- package/foundation/fs/module-loader.mjs +71 -2
- package/foundation/integrations/cli-requirement.d.mts +43 -10
- package/foundation/integrations/cli-requirement.mjs +56 -13
- package/foundation/integrations/cli-requirement.test.mjs +160 -23
- package/foundation/integrations/contribution-inventory.mjs +3 -3
- package/foundation/integrations/validate-contributions.d.mts +16 -0
- package/foundation/integrations/validate-contributions.mjs +56 -8
- package/foundation/response/base.d.ts +9 -3
- package/foundation/response/json.d.mts +7 -4
- package/foundation/response/json.mjs +10 -6
- package/foundation/response/response-types.doc.mjs +41 -26
- package/foundation/response/response.doc.mjs +18 -4
- package/foundation/text/copyright-header.mjs +1 -1
- package/foundation/text/copyright-header.test.mjs +1 -1
- package/package.json +9 -9
- package/assets/docs/layout.doc.dense.mjs +0 -388
- package/assets/docs/layout.doc.mjs +0 -550
- package/assets/docs/styling-libraries.doc.mjs +0 -469
- package/assets/docs/styling.doc.mjs +0 -412
- package/assets/docs/tokens.doc.dense.mjs +0 -15
- package/assets/docs/tokens.doc.mjs +0 -1491
- package/assets/docs/tokens.doc.zh.mjs +0 -15
- package/assets/docs/typography.doc.mjs +0 -286
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @file `astryx docs layout/spacing`: hold one content line per region, then
|
|
5
|
+
* tune gaps and density.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/** @type {import('@astryxdesign/cli/authoring').ReferenceDoc} */
|
|
9
|
+
|
|
10
|
+
export const docs = {
|
|
11
|
+
type: 'generic',
|
|
12
|
+
name: 'layout-spacing',
|
|
13
|
+
title: 'Layout spacing',
|
|
14
|
+
placement: {parent: 'namespace:layout', slot: 'guides', order: 40},
|
|
15
|
+
category: 'guide',
|
|
16
|
+
description:
|
|
17
|
+
'Hold one content line per region, then tune gaps and density.',
|
|
18
|
+
keywords: [
|
|
19
|
+
'alignment',
|
|
20
|
+
'content line',
|
|
21
|
+
'rhythm',
|
|
22
|
+
'gap',
|
|
23
|
+
'density',
|
|
24
|
+
'padding',
|
|
25
|
+
'inset',
|
|
26
|
+
'compact',
|
|
27
|
+
'spacious',
|
|
28
|
+
'FormLayout',
|
|
29
|
+
],
|
|
30
|
+
|
|
31
|
+
sections: [
|
|
32
|
+
{
|
|
33
|
+
id: 'spacing',
|
|
34
|
+
title: 'Spacing',
|
|
35
|
+
content: [
|
|
36
|
+
{
|
|
37
|
+
type: 'prose',
|
|
38
|
+
text: 'Hold one content line per region, then tune gaps and density. Alignment, Rhythm, and Density and size cover each step; these rules hold for all of them.',
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
type: 'list',
|
|
42
|
+
style: 'do',
|
|
43
|
+
items: [
|
|
44
|
+
'Let the container own padding; children zero their own margins',
|
|
45
|
+
'Hold one content line per region: text on the line, hover backgrounds bleed to the edge',
|
|
46
|
+
'Hold one padding token across a region header, body, and footer',
|
|
47
|
+
'Contrast tight and generous gaps so grouping reads without borders',
|
|
48
|
+
'One control size per row; match density to use frequency',
|
|
49
|
+
],
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
type: 'list',
|
|
53
|
+
style: 'dont',
|
|
54
|
+
items: [
|
|
55
|
+
'Double padding: a component indented past its Section heading (keep one inset owner)',
|
|
56
|
+
'Raw px for interior spacing; tokens only, px is for structural widths',
|
|
57
|
+
'One repeated gap everywhere, which flattens grouping',
|
|
58
|
+
'Mixed control sizes in a single row',
|
|
59
|
+
],
|
|
60
|
+
},
|
|
61
|
+
],
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
id: 'alignment',
|
|
65
|
+
title: 'Alignment',
|
|
66
|
+
content: [
|
|
67
|
+
{
|
|
68
|
+
type: 'prose',
|
|
69
|
+
text: 'The container owns padding and child gaps; children zero their margins, and interior spacing is always a token. Pick one content line per region and hold it constant, not the padding: `container_inset = content_line - component_intrinsic_inset`.',
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
type: 'list',
|
|
73
|
+
style: 'unordered',
|
|
74
|
+
items: [
|
|
75
|
+
'Text and Heading carry no inset, so the container takes the full padding',
|
|
76
|
+
'List, Tab, Menu, and nav items carry a small inset, so the container gives up its padding and the component owns the line',
|
|
77
|
+
'Table cells carry a larger inset, so the container gives up its padding and the cell owns the line',
|
|
78
|
+
],
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
type: 'code',
|
|
82
|
+
lang: 'tsx',
|
|
83
|
+
label: 'One content line, two inset owners',
|
|
84
|
+
code: `// Target content line = 16px.
|
|
85
|
+
// Heading has 0 inset, so the Section takes the full padding.
|
|
86
|
+
<Section padding={4}><Heading level={3}>Members</Heading></Section>
|
|
87
|
+
|
|
88
|
+
// List has ~8px built in, Table cells 12–16px, so the Section
|
|
89
|
+
// gives up its padding and the component owns the inset.
|
|
90
|
+
<Section padding={0}><List>{/* items */}</List></Section>`,
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
type: 'prose',
|
|
94
|
+
text: 'Verify: draw one vertical line down the left of the region. Every label touches it; only hover and selected backgrounds cross it.',
|
|
95
|
+
},
|
|
96
|
+
],
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
id: 'rhythm',
|
|
100
|
+
title: 'Rhythm',
|
|
101
|
+
content: [
|
|
102
|
+
{
|
|
103
|
+
type: 'prose',
|
|
104
|
+
text: 'Grouping comes from contrast between tight and generous gaps, not one repeated value. If every gap is the same step, proximity does no work.',
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
type: 'list',
|
|
108
|
+
style: 'unordered',
|
|
109
|
+
items: [
|
|
110
|
+
'Tight gaps bind: the smallest steps, used inside an item or field',
|
|
111
|
+
'Generous gaps separate: several steps up, used between sections',
|
|
112
|
+
'Reach for the in-between steps to tune cadence, rather than rounding everything to the same two values',
|
|
113
|
+
],
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
type: 'code',
|
|
117
|
+
lang: 'tsx',
|
|
118
|
+
label: 'Tight inside, generous between',
|
|
119
|
+
code: `// Tight binds at gap={1}–{2}, generous separates at gap={4}–{6}.
|
|
120
|
+
// In-between steps tune cadence: gap={3} = 12px, gap={5} = 20px.
|
|
121
|
+
<VStack gap={6}>
|
|
122
|
+
<VStack gap={1}>
|
|
123
|
+
<Text weight="semibold">Retention</Text>
|
|
124
|
+
<Text color="secondary">Logs are kept for 30 days</Text>
|
|
125
|
+
</VStack>
|
|
126
|
+
<VStack gap={1}>{/* next label and value */}</VStack>
|
|
127
|
+
</VStack>`,
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
type: 'prose',
|
|
131
|
+
text: 'Verify: with every border removed, you can still name the groups from spacing alone. If you cannot, the intervals are too uniform. Form fields are the exception: FormLayout owns their spacing.',
|
|
132
|
+
},
|
|
133
|
+
],
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
id: 'density',
|
|
137
|
+
title: 'Density and size',
|
|
138
|
+
content: [
|
|
139
|
+
{
|
|
140
|
+
type: 'prose',
|
|
141
|
+
text: 'Match density to how often a region is used, and give every control in a row the same size so heights share a baseline.',
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
type: 'list',
|
|
145
|
+
style: 'unordered',
|
|
146
|
+
items: [
|
|
147
|
+
'Compact: high-volume regions scanned fast, like logs, monitors, and large datasets',
|
|
148
|
+
'Balanced: most Table and List surfaces',
|
|
149
|
+
'Spacious: low-frequency or high-stakes rows, like settings or a short selection list',
|
|
150
|
+
],
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
type: 'code',
|
|
154
|
+
lang: 'tsx',
|
|
155
|
+
label: 'Density paired with control size',
|
|
156
|
+
code: `// Pair density with one control size: compact with sm,
|
|
157
|
+
// balanced with sm or md, spacious with md or lg.
|
|
158
|
+
<Table data={rows} columns={columns} density="compact" hasHover />
|
|
159
|
+
<Button label="Retry" size="sm" variant="ghost" />`,
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
type: 'prose',
|
|
163
|
+
text: 'Verify: every interactive element in a row shares one size, and that size is paired with the density of the region it sits in.',
|
|
164
|
+
},
|
|
165
|
+
],
|
|
166
|
+
},
|
|
167
|
+
],
|
|
168
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @file `astryx docs layout`: the layout namespace. A root of the docs tree
|
|
5
|
+
* that groups the outside-in layout guides: scaffold, structure,
|
|
6
|
+
* headers-and-panels, spacing, and responsive.
|
|
7
|
+
*
|
|
8
|
+
* The flat layout topic this replaces was a 22 KB monolith. Each child guide
|
|
9
|
+
* now answers one question and is findable by search on its own.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
/** @type {import('@astryxdesign/cli/authoring').NamespaceDoc} */
|
|
13
|
+
export const docs = {
|
|
14
|
+
type: 'namespace',
|
|
15
|
+
name: 'layout',
|
|
16
|
+
title: 'Layout',
|
|
17
|
+
summary:
|
|
18
|
+
'Build an app layout outside-in: scaffold the regions, structure the content, tune the spacing, then adapt across widths.',
|
|
19
|
+
keywords: [
|
|
20
|
+
'layout',
|
|
21
|
+
'scaffold',
|
|
22
|
+
'structure',
|
|
23
|
+
'spacing',
|
|
24
|
+
'responsive',
|
|
25
|
+
'AppShell',
|
|
26
|
+
'SideNav',
|
|
27
|
+
'TopNav',
|
|
28
|
+
'hasDivider',
|
|
29
|
+
'MobileNav',
|
|
30
|
+
'contentWidth',
|
|
31
|
+
],
|
|
32
|
+
blocks: [
|
|
33
|
+
{
|
|
34
|
+
type: 'prose',
|
|
35
|
+
text: "Build a layout outside-in. Settle the shell and its region budgets before any content exists, then work inward. Content-first layouts drift into a padded column of cards, because every section ends up inventing its own container.",
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
type: 'list',
|
|
39
|
+
style: 'ordered',
|
|
40
|
+
items: [
|
|
41
|
+
"Scaffold: pick the shell, budget each region, and choose navigation",
|
|
42
|
+
"Structure: rank the content in each region, then pick the weakest container that groups it",
|
|
43
|
+
"Spacing: hold one content line per region, then tune gaps and density",
|
|
44
|
+
"Breakpoints: decide what each region does as width changes",
|
|
45
|
+
],
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
type: 'prose',
|
|
49
|
+
text: "This guide decides layout, not component APIs. Run `npx astryx build \"<idea>\"` to start from the closest template for your app type, and `npx astryx component <Name>` for a component's props.",
|
|
50
|
+
},
|
|
51
|
+
],
|
|
52
|
+
slots: {
|
|
53
|
+
guides: {title: 'Guides', accepts: {kinds: ['generic']}},
|
|
54
|
+
},
|
|
55
|
+
};
|
|
@@ -1,13 +1,28 @@
|
|
|
1
1
|
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* @file `astryx docs migration/migration-setup`: theme and CSS setup,
|
|
5
|
+
* cascade layer safety, layer audit, and the foundation smoke test.
|
|
6
|
+
*/
|
|
7
|
+
|
|
3
8
|
/** @type {import('@astryxdesign/cli/authoring').ReferenceDoc} */
|
|
4
9
|
|
|
5
10
|
export const docs = {
|
|
6
|
-
|
|
7
|
-
|
|
11
|
+
type: 'generic',
|
|
12
|
+
name: 'migration-setup',
|
|
13
|
+
title: 'Setup',
|
|
14
|
+
placement: {parent: 'namespace:migration', slot: 'guides', order: 10},
|
|
8
15
|
category: 'guide',
|
|
9
16
|
description:
|
|
10
|
-
'
|
|
17
|
+
'Install the theme, wire CSS layers, audit resets, and run the foundation smoke test before migrating any surface.',
|
|
18
|
+
keywords: [
|
|
19
|
+
'setup',
|
|
20
|
+
'theme',
|
|
21
|
+
'reset',
|
|
22
|
+
'smoke test',
|
|
23
|
+
'layer audit',
|
|
24
|
+
'Tailwind coexistence',
|
|
25
|
+
],
|
|
11
26
|
|
|
12
27
|
sections: [
|
|
13
28
|
{
|
|
@@ -30,15 +45,15 @@ export const docs = {
|
|
|
30
45
|
type: 'list',
|
|
31
46
|
style: 'ordered',
|
|
32
47
|
items: [
|
|
33
|
-
'Install the packages and run `astryx init` for agent docs, then add the reset, `astryx.css`, and theme CSS imports (see Theme and CSS Setup).',
|
|
48
|
+
'Install the packages and run `astryx init` for agent docs, then add the reset, `astryx.css`, and theme CSS imports (see Theme and CSS Setup below).',
|
|
34
49
|
'Wrap the app root with Theme and choose the initial light, dark, or system mode behavior.',
|
|
35
50
|
'Make Tailwind and design system CSS layer order explicit before replacing components.',
|
|
36
51
|
'Render the foundation smoke test page and confirm primitives keep their padding before migrating any surface.',
|
|
37
|
-
'Move the persistent frame first: AppShell, TopNav, SideNav, page content, and mobile navigation.',
|
|
38
|
-
'Replace shared primitives: Button, IconButton, TextInput, NumberInput, Switch, CheckboxInput, RadioList, Selector, TabList, Dialog, AlertDialog, Banner, Toast, Badge, Card, Table, and ListItem.',
|
|
52
|
+
'Move the persistent frame first: AppShell, TopNav, SideNav, page content, and mobile navigation. See {@link generic:component-migration}.',
|
|
53
|
+
'Replace shared primitives: Button, IconButton, TextInput, NumberInput, Switch, CheckboxInput, RadioList, Selector, TabList, Dialog, AlertDialog, Banner, Toast, Badge, Card, Table, and ListItem. See {@link generic:component-migration}.',
|
|
39
54
|
'Replace global workflows: command palette, settings popover, theme toggle, search, filters, create flows, and destructive confirmation dialogs.',
|
|
40
55
|
'Remove legacy Tailwind classes from each completed surface, keeping only token-backed layout utilities or local wrappers that still need to be migrated.',
|
|
41
|
-
'Verify both light and dark modes, keyboard navigation, responsive layout, and empty/error/loading states before moving to the next route.',
|
|
56
|
+
'Verify both light and dark modes, keyboard navigation, responsive layout, and empty/error/loading states before moving to the next route. See {@link generic:migration-verification}.',
|
|
42
57
|
],
|
|
43
58
|
},
|
|
44
59
|
],
|
|
@@ -110,7 +125,7 @@ export function AppRoot({children}: {children: React.ReactNode}) {
|
|
|
110
125
|
},
|
|
111
126
|
{
|
|
112
127
|
type: 'prose',
|
|
113
|
-
text: 'When Tailwind remains in the app, declare layer order once in the global CSS file. Load the Astryx reset and theme CSS before Tailwind utilities so migrated components keep design system defaults while legacy utility classes still work. On Tailwind v4, use the imports and layer order in
|
|
128
|
+
text: 'When Tailwind remains in the app, declare layer order once in the global CSS file. Load the Astryx reset and theme CSS before Tailwind utilities so migrated components keep design system defaults while legacy utility classes still work. On Tailwind v4, use the imports and layer order in {@link generic:tailwind}.',
|
|
114
129
|
},
|
|
115
130
|
{
|
|
116
131
|
type: 'prose',
|
|
@@ -155,7 +170,7 @@ export function AppRoot({children}: {children: React.ReactNode}) {
|
|
|
155
170
|
},
|
|
156
171
|
{
|
|
157
172
|
type: 'prose',
|
|
158
|
-
text: 'Before building screens, check every stylesheet against
|
|
173
|
+
text: 'Before building screens, check every stylesheet against the cascade layer audit below.',
|
|
159
174
|
},
|
|
160
175
|
],
|
|
161
176
|
},
|
|
@@ -258,125 +273,5 @@ if (getComputedStyle(button).paddingInline === '0px') {
|
|
|
258
273
|
},
|
|
259
274
|
],
|
|
260
275
|
},
|
|
261
|
-
{
|
|
262
|
-
title: 'Move the App Frame First',
|
|
263
|
-
content: [
|
|
264
|
-
{
|
|
265
|
-
type: 'prose',
|
|
266
|
-
text: 'Start with AppShell so page migration happens inside the final navigation, spacing, surface, and responsive frame. This also exposes theme and color issues early because every route shares the same shell.',
|
|
267
|
-
},
|
|
268
|
-
{
|
|
269
|
-
type: 'table',
|
|
270
|
-
headers: ['Legacy surface', 'Component', 'Notes'],
|
|
271
|
-
rows: [
|
|
272
|
-
['Header', 'TopNav', 'Use for product identity, global actions, account entry, and command/search trigger.'],
|
|
273
|
-
['Sidebar', 'SideNav', 'Use sections and nested nav items for route groups. Keep selection state driven by the router.'],
|
|
274
|
-
['Main page wrapper', 'AppShell + Layout', 'Let the shell own persistent structure; let route components own page content.'],
|
|
275
|
-
['Mobile drawer nav', 'MobileNav or AppShell mobile behavior', 'Verify focus, close behavior, and route changes on narrow viewports.'],
|
|
276
|
-
['Settings menu', 'Popover + Layout + Switch', 'Use as the home for theme mode and app preferences.'],
|
|
277
|
-
],
|
|
278
|
-
},
|
|
279
|
-
],
|
|
280
|
-
},
|
|
281
|
-
{
|
|
282
|
-
title: 'Map shadcn and Radix Primitives',
|
|
283
|
-
content: [
|
|
284
|
-
{
|
|
285
|
-
type: 'prose',
|
|
286
|
-
text: 'Do not wrap old shadcn components in design system styles. Replace the primitive with the component that owns the behavior, accessibility, state classes, and token usage.',
|
|
287
|
-
},
|
|
288
|
-
{
|
|
289
|
-
type: 'table',
|
|
290
|
-
headers: ['Existing primitive', 'Component', 'Migration note'],
|
|
291
|
-
rows: [
|
|
292
|
-
['button / shadcn Button', 'Button or IconButton', 'Use Button for labeled commands and IconButton for icon-only toolbar actions.'],
|
|
293
|
-
['input', 'TextInput', 'Keep validation state in status props rather than ad hoc border classes.'],
|
|
294
|
-
['textarea', 'TextArea', 'Use when multiline editing is the primary action.'],
|
|
295
|
-
['switch', 'Switch', 'Use for persisted boolean settings, including theme mode when represented as a binary choice.'],
|
|
296
|
-
['checkbox', 'CheckboxInput or CheckboxList', 'Use list variants for grouped selection.'],
|
|
297
|
-
['radio group', 'RadioList', 'Use when one option must be selected from a visible set.'],
|
|
298
|
-
['select / combobox', 'Selector or Typeahead', 'Use Selector for bounded options and Typeahead for searchable async options.'],
|
|
299
|
-
['tabs used as page nav', 'TabList', 'Use route state or current page state as the source of truth.'],
|
|
300
|
-
['command dialog', 'CommandPalette', 'Keep app-specific search sources outside the shell and feed searchable items.'],
|
|
301
|
-
['dropdown action menu', 'DropdownMenu or MoreMenu', 'Use MoreMenu for compact overflow actions.'],
|
|
302
|
-
['alert / callout', 'Banner or Toast', 'Use Banner for page or section messages and Toast for transient feedback.'],
|
|
303
|
-
['dialog', 'Dialog or AlertDialog', 'Use AlertDialog for destructive confirmation and Dialog for task flows.'],
|
|
304
|
-
['card-like list row', 'ListItem', 'Prefer ListItem for selectable rows instead of styling Button as a row.'],
|
|
305
|
-
],
|
|
306
|
-
},
|
|
307
|
-
],
|
|
308
|
-
},
|
|
309
|
-
{
|
|
310
|
-
id: 'command-palette',
|
|
311
|
-
title: 'Command Palette, Settings, and Theme',
|
|
312
|
-
content: [
|
|
313
|
-
{
|
|
314
|
-
type: 'prose',
|
|
315
|
-
text: 'Move global search to CommandPalette once the shell exists. Treat the palette as a view over app commands: routes, contextual actions, create actions, filters, recent items, and entity results. Keep data normalization in app code so search sources always return arrays of searchable items.',
|
|
316
|
-
},
|
|
317
|
-
{
|
|
318
|
-
type: 'prose',
|
|
319
|
-
text: 'Put light and dark mode controls in the settings popover or account menu. The switch or selector should update the mode passed to Theme, not toggle isolated body classes.',
|
|
320
|
-
},
|
|
321
|
-
{
|
|
322
|
-
type: 'code',
|
|
323
|
-
lang: 'tsx',
|
|
324
|
-
label: 'Settings popover theme control',
|
|
325
|
-
code: `function ThemeModeSwitch() {
|
|
326
|
-
const {mode, setMode} = useSettings();
|
|
327
|
-
const isDark = mode === 'dark';
|
|
328
|
-
|
|
329
|
-
return (
|
|
330
|
-
<Switch
|
|
331
|
-
label="Dark mode"
|
|
332
|
-
description="Use the dark color theme"
|
|
333
|
-
value={isDark}
|
|
334
|
-
onChange={next => setMode(next ? 'dark' : 'light')}
|
|
335
|
-
/>
|
|
336
|
-
);
|
|
337
|
-
}`,
|
|
338
|
-
},
|
|
339
|
-
],
|
|
340
|
-
},
|
|
341
|
-
{
|
|
342
|
-
title: 'Verification Checklist',
|
|
343
|
-
content: [
|
|
344
|
-
{
|
|
345
|
-
type: 'list',
|
|
346
|
-
style: 'unordered',
|
|
347
|
-
items: [
|
|
348
|
-
'Run the app in light and dark mode and check that surfaces, borders, text, icons, hover states, focus rings, and status colors flow together.',
|
|
349
|
-
'Open the command palette from the shell, type into it, select items by keyboard, and confirm focus returns to the trigger.',
|
|
350
|
-
'Check the SideNav at collapsed, expanded, active, hover, nested, and mobile states.',
|
|
351
|
-
'Verify settings popovers and dialogs in jsdom and in a real browser because the native dialog and [`Popover`](https://developer.mozilla.org/en-US/docs/Web/API/Popover_API) APIs may need test shims.',
|
|
352
|
-
'Search for leftover hardcoded Tailwind colors, arbitrary hex values, and one-off hover colors after each route migration.',
|
|
353
|
-
'Run component tests, build, and at least one browser screenshot pass for each migrated route.',
|
|
354
|
-
],
|
|
355
|
-
},
|
|
356
|
-
],
|
|
357
|
-
},
|
|
358
|
-
{
|
|
359
|
-
title: 'AI Migration Prompt',
|
|
360
|
-
content: [
|
|
361
|
-
{
|
|
362
|
-
type: 'prose',
|
|
363
|
-
text: 'When using an AI coding agent, give it an explicit migration loop instead of asking for a full-app rewrite.',
|
|
364
|
-
},
|
|
365
|
-
{
|
|
366
|
-
type: 'code',
|
|
367
|
-
lang: 'text',
|
|
368
|
-
label: 'Paste this into your AI',
|
|
369
|
-
code: `We are migrating this existing Tailwind/shadcn app to Astryx incrementally.
|
|
370
|
-
|
|
371
|
-
First run:
|
|
372
|
-
- astryx docs migration --dense
|
|
373
|
-
- astryx docs theme --dense
|
|
374
|
-
- astryx docs styling --dense
|
|
375
|
-
- astryx template AppShellTopNavWithSideNav --skeleton
|
|
376
|
-
|
|
377
|
-
Then migrate one route or shell surface at a time. Keep business logic and routing intact. Replace shadcn/Radix/Tailwind primitives with Astryx components, remove hardcoded colors, verify light and dark mode, and take screenshots before moving to the next surface.`,
|
|
378
|
-
},
|
|
379
|
-
],
|
|
380
|
-
},
|
|
381
276
|
],
|
|
382
277
|
};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @file `astryx docs migration/migration-verification`: post-migration
|
|
5
|
+
* verification checklist and AI migration prompt.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/** @type {import('@astryxdesign/cli/authoring').ReferenceDoc} */
|
|
9
|
+
|
|
10
|
+
export const docs = {
|
|
11
|
+
type: 'generic',
|
|
12
|
+
name: 'migration-verification',
|
|
13
|
+
title: 'Verification',
|
|
14
|
+
placement: {parent: 'namespace:migration', slot: 'guides', order: 30},
|
|
15
|
+
category: 'guide',
|
|
16
|
+
description:
|
|
17
|
+
'Post-migration verification checklist and an AI migration prompt to paste into your coding tool.',
|
|
18
|
+
keywords: [
|
|
19
|
+
'verification',
|
|
20
|
+
'checklist',
|
|
21
|
+
'AI prompt',
|
|
22
|
+
'keyboard navigation',
|
|
23
|
+
],
|
|
24
|
+
|
|
25
|
+
sections: [
|
|
26
|
+
{
|
|
27
|
+
title: 'Verification Checklist',
|
|
28
|
+
content: [
|
|
29
|
+
{
|
|
30
|
+
type: 'list',
|
|
31
|
+
style: 'unordered',
|
|
32
|
+
items: [
|
|
33
|
+
'Run the app in light and dark mode and check that surfaces, borders, text, icons, hover states, focus rings, and status colors flow together.',
|
|
34
|
+
'Open the command palette from the shell, type into it, select items by keyboard, and confirm focus returns to the trigger.',
|
|
35
|
+
'Check the SideNav at collapsed, expanded, active, hover, nested, and mobile states.',
|
|
36
|
+
'Verify settings popovers and dialogs in jsdom and in a real browser because the native dialog and [`Popover`](https://developer.mozilla.org/en-US/docs/Web/API/Popover_API) APIs may need test shims.',
|
|
37
|
+
'Search for leftover hardcoded Tailwind colors, arbitrary hex values, and one-off hover colors after each route migration.',
|
|
38
|
+
'Run component tests, build, and at least one browser screenshot pass for each migrated route.',
|
|
39
|
+
],
|
|
40
|
+
},
|
|
41
|
+
],
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
title: 'AI Migration Prompt',
|
|
45
|
+
content: [
|
|
46
|
+
{
|
|
47
|
+
type: 'prose',
|
|
48
|
+
text: 'When using an AI coding agent, give it an explicit migration loop instead of asking for a full-app rewrite.',
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
type: 'code',
|
|
52
|
+
lang: 'text',
|
|
53
|
+
label: 'Paste this into your AI',
|
|
54
|
+
code: `We are migrating this existing Tailwind/shadcn app to Astryx incrementally.
|
|
55
|
+
|
|
56
|
+
First run:
|
|
57
|
+
- astryx docs migration --dense
|
|
58
|
+
- astryx docs theme --dense
|
|
59
|
+
- astryx docs styling --dense
|
|
60
|
+
- astryx template AppShellTopNavWithSideNav --skeleton
|
|
61
|
+
|
|
62
|
+
Then migrate one route or shell surface at a time. Keep business logic and routing intact. Replace shadcn/Radix/Tailwind primitives with Astryx components, remove hardcoded colors, verify light and dark mode, and take screenshots before moving to the next surface.`,
|
|
63
|
+
},
|
|
64
|
+
],
|
|
65
|
+
},
|
|
66
|
+
],
|
|
67
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @file `astryx docs migration`: the migration namespace. Groups the
|
|
5
|
+
* incremental migration guides: setup (theme, CSS, layers), component
|
|
6
|
+
* replacement, and verification.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
/** @type {import('@astryxdesign/cli/authoring').NamespaceDoc} */
|
|
10
|
+
export const docs = {
|
|
11
|
+
type: 'namespace',
|
|
12
|
+
name: 'migration',
|
|
13
|
+
title: 'Migration Guide',
|
|
14
|
+
summary:
|
|
15
|
+
'Migrate an existing Tailwind, shadcn, or Radix app to the design system incrementally — setup, component replacement, and verification.',
|
|
16
|
+
keywords: [
|
|
17
|
+
'migration',
|
|
18
|
+
'migrate',
|
|
19
|
+
'Tailwind',
|
|
20
|
+
'shadcn',
|
|
21
|
+
'Radix',
|
|
22
|
+
'cascade layers',
|
|
23
|
+
'coexistence',
|
|
24
|
+
],
|
|
25
|
+
slots: {
|
|
26
|
+
guides: {title: 'Guides', accepts: {kinds: ['generic']}},
|
|
27
|
+
},
|
|
28
|
+
};
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @file `astryx docs styling-libraries/non-css-processing`: resolve token
|
|
5
|
+
* values outside the DOM for charts, canvas, SVG, and config objects.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/** @type {import('@astryxdesign/cli/authoring').ReferenceDoc} */
|
|
9
|
+
|
|
10
|
+
export const docs = {
|
|
11
|
+
type: 'generic',
|
|
12
|
+
name: 'non-css-processing',
|
|
13
|
+
title: 'Non-CSS Processing',
|
|
14
|
+
placement: {parent: 'namespace:styling-libraries', slot: 'guides', order: 40},
|
|
15
|
+
category: 'guide',
|
|
16
|
+
description:
|
|
17
|
+
'Resolve token values outside the DOM for charts, canvas, SVG, and config objects using resolveThemeTokens() and useTheme().',
|
|
18
|
+
keywords: [
|
|
19
|
+
'resolveThemeTokens',
|
|
20
|
+
'resolveThemeToken',
|
|
21
|
+
'useTheme',
|
|
22
|
+
'chart',
|
|
23
|
+
'canvas',
|
|
24
|
+
'SVG',
|
|
25
|
+
'non-CSS',
|
|
26
|
+
],
|
|
27
|
+
|
|
28
|
+
sections: [
|
|
29
|
+
{
|
|
30
|
+
title: 'Non-CSS Processing',
|
|
31
|
+
content: [
|
|
32
|
+
{
|
|
33
|
+
type: 'prose',
|
|
34
|
+
text: 'Use `resolveThemeTokens()` or `resolveThemeToken()` when code outside React needs token values for a known theme and mode. Use `useTheme()` inside client components when the values should come from the nearest Theme and active mode.',
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
type: 'code',
|
|
38
|
+
lang: 'ts',
|
|
39
|
+
label: 'Resolve tokens without React context',
|
|
40
|
+
code: `import {resolveThemeTokens} from '@astryxdesign/core/theme/tokens';
|
|
41
|
+
import {neutralTheme} from '@astryxdesign/theme-neutral/built';
|
|
42
|
+
|
|
43
|
+
const tokens = resolveThemeTokens(neutralTheme, {mode: 'light'});
|
|
44
|
+
|
|
45
|
+
const chartOptions = {
|
|
46
|
+
textColor: tokens['--color-text-primary'],
|
|
47
|
+
mutedTextColor: tokens['--color-text-secondary'],
|
|
48
|
+
gridColor: tokens['--color-border'],
|
|
49
|
+
seriesColors: [
|
|
50
|
+
tokens['--color-data-categorical-blue'],
|
|
51
|
+
tokens['--color-data-categorical-orange'],
|
|
52
|
+
tokens['--color-data-categorical-purple'],
|
|
53
|
+
],
|
|
54
|
+
};`,
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
type: 'code',
|
|
58
|
+
lang: 'tsx',
|
|
59
|
+
label: 'Resolve tokens from the nearest Theme',
|
|
60
|
+
code: `'use client';
|
|
61
|
+
|
|
62
|
+
import {useMemo} from 'react';
|
|
63
|
+
import {useTheme} from '@astryxdesign/core/theme';
|
|
64
|
+
|
|
65
|
+
function RevenueChart({data}: {data: Array<{x: string; y: number}>}) {
|
|
66
|
+
const {mode, tokens} = useTheme();
|
|
67
|
+
|
|
68
|
+
const chartOptions = useMemo(
|
|
69
|
+
() => ({
|
|
70
|
+
mode,
|
|
71
|
+
textColor: tokens['--color-text-primary'],
|
|
72
|
+
mutedTextColor: tokens['--color-text-secondary'],
|
|
73
|
+
gridColor: tokens['--color-border'],
|
|
74
|
+
seriesColors: [
|
|
75
|
+
tokens['--color-data-categorical-blue'],
|
|
76
|
+
tokens['--color-data-categorical-orange'],
|
|
77
|
+
tokens['--color-data-categorical-purple'],
|
|
78
|
+
],
|
|
79
|
+
}),
|
|
80
|
+
[mode, tokens],
|
|
81
|
+
);
|
|
82
|
+
|
|
83
|
+
return <ThirdPartyChart data={data} options={chartOptions} />;
|
|
84
|
+
}`,
|
|
85
|
+
},
|
|
86
|
+
],
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
id: 'non-css-best-practices',
|
|
90
|
+
title: 'Non-CSS Processing Best Practices',
|
|
91
|
+
content: [
|
|
92
|
+
{
|
|
93
|
+
type: 'list',
|
|
94
|
+
style: 'do',
|
|
95
|
+
items: [
|
|
96
|
+
'Use the returned `tokens` object as a memo dependency; it is stable until the active theme or mode changes.',
|
|
97
|
+
'Use data visualization tokens such as `--color-data-categorical-blue` for chart series instead of reusing arbitrary UI colors.',
|
|
98
|
+
'Prefer CSS variables for SVG elements when possible (`fill="var(--color-accent)"`); use token resolver APIs when an API requires a string value in JavaScript.',
|
|
99
|
+
],
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
type: 'list',
|
|
103
|
+
style: 'dont',
|
|
104
|
+
items: [
|
|
105
|
+
'Use token resolver APIs for ordinary DOM styling. Use CSS variables, StyleX tokens, xstyle, or library aliases instead.',
|
|
106
|
+
'Assume the returned values reflect every CSS cascade override. They resolve tokens for the current theme and mode; local media-surface overrides and arbitrary CSS overrides may not be represented in the returned map.',
|
|
107
|
+
],
|
|
108
|
+
},
|
|
109
|
+
],
|
|
110
|
+
},
|
|
111
|
+
],
|
|
112
|
+
};
|