@astryxdesign/cli 0.7.17-canary.g5a3fd39 → 0.7.17-canary.g5cf5d69
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/README.md +64 -63
- package/api/build/_adapter.d.mts +51 -0
- package/api/build/_adapter.mjs +122 -6
- package/api/build/build.doc.mjs +1 -1
- package/api/build/build.mjs +23 -14
- package/api/build/build.type.d.mts +1 -1
- package/api/build/build.type.mjs +3 -3
- package/api/build/help/help.d.mts +15 -14
- package/api/build/help/help.mjs +62 -3
- package/api/build/kit/answer.mjs +2 -3
- package/api/build/kit/signals.d.mts +10 -0
- package/api/build/kit/signals.mjs +15 -2
- package/api/component/detail/blocks/blocks.mjs +2 -1
- package/api/discover/_adapter.d.mts +57 -6
- package/api/discover/_adapter.mjs +278 -49
- package/api/discover/_catalog-view.d.mts +7 -0
- package/api/discover/_catalog-view.mjs +10 -1
- package/api/discover/detail/detail.d.mts +3 -2
- package/api/discover/detail/detail.mjs +3 -2
- package/api/discover/detail/doc/doc.mjs +1 -1
- package/api/discover/discover.d.mts +24 -0
- package/api/discover/discover.doc.mjs +1 -1
- package/api/discover/discover.mjs +146 -25
- package/api/discover/discover.type.d.mts +6 -4
- package/api/discover/discover.type.mjs +6 -4
- package/api/discover/search/search.d.mts +22 -0
- package/api/discover/search/search.mjs +290 -70
- package/api/docs/_entry-names.mjs +4 -3
- package/api/doctor/_adapter.d.mts +43 -3
- package/api/doctor/_adapter.mjs +142 -18
- package/api/doctor/built-checks.d.mts +30 -3
- package/api/doctor/built-checks.mjs +132 -5
- package/api/doctor/doctor.d.mts +93 -6
- package/api/doctor/doctor.doc.mjs +2 -2
- package/api/doctor/doctor.mjs +524 -33
- package/api/doctor/doctor.type.d.mts +2 -1
- package/api/doctor/doctor.type.mjs +2 -1
- package/api/doctor/theme-checks.d.mts +19 -0
- package/api/doctor/theme-checks.mjs +74 -6
- package/api/hook/hook.type.d.mts +1 -1
- package/api/hook/hook.type.mjs +1 -1
- package/api/hook/list/list.mjs +11 -7
- package/api/icon/_adapter.d.mts +2 -1
- package/api/icon/_adapter.mjs +10 -15
- package/api/icon/_records.d.mts +3 -1
- package/api/icon/_records.mjs +30 -3
- package/api/icon/exportIconIndex.doc.mjs +1 -1
- package/api/icon/icon.doc.mjs +3 -3
- package/api/icon/icon.type.d.mts +32 -1
- package/api/icon/icon.type.mjs +19 -3
- package/api/icon/list/list.mjs +4 -1
- package/api/icon/rankIconIndex.doc.mjs +1 -1
- package/api/icon/search/icon-index.mjs +18 -8
- package/api/icon/search/search.d.mts +26 -3
- package/api/icon/search/search.mjs +155 -9
- package/api/init/_adapter.d.mts +14 -0
- package/api/init/_adapter.mjs +26 -4
- package/api/init/init.d.mts +1 -1
- package/api/init/init.doc.mjs +2 -2
- package/api/init/init.mjs +1 -1
- package/api/init/init.type.d.mts +29 -1
- package/api/init/init.type.mjs +14 -1
- package/api/init/run/run.d.mts +11 -1
- package/api/init/run/run.mjs +84 -5
- package/api/integration/_adapter.d.mts +5 -4
- package/api/integration/_adapter.mjs +7 -5
- package/api/integration/integrationCheck.doc.mjs +1 -1
- package/api/integration/pack-check.mjs +8 -9
- package/api/integration/validate-integration.d.mts +1 -1
- package/api/integration/validate-integration.mjs +26 -24
- package/api/integration/validate-integration.type.d.mts +5 -2
- package/api/integration/validate-integration.type.mjs +5 -2
- package/api/integration/validateIntegration.doc.mjs +1 -1
- package/api/render/_adapter.d.mts +4 -2
- package/api/render/_adapter.mjs +62 -21
- package/api/render/render.doc.mjs +8 -5
- package/api/render/render.mjs +1 -1
- package/api/render/render.type.d.mts +2 -0
- package/api/render/render.type.mjs +2 -0
- package/api/search/ORDERING.md +2 -2
- package/api/search/_candidate-score.d.mts +3 -0
- package/api/search/_candidate-score.mjs +36 -3
- package/api/search/_gather-docs.mjs +29 -2
- package/api/search/_gather-templates.mjs +2 -1
- package/api/search/_main-searcher.mjs +13 -0
- package/api/search/_named-keywords.d.mts +2 -1
- package/api/search/_named-keywords.mjs +48 -6
- package/api/search/_order.d.mts +36 -1
- package/api/search/_order.mjs +141 -3
- package/api/swizzle/list/list.mjs +8 -1
- package/api/swizzle/swizzle.type.d.mts +1 -1
- package/api/swizzle/swizzle.type.mjs +1 -1
- package/api/template/copy/copy.mjs +3 -4
- package/api/template/list/list.mjs +2 -1
- package/api/template/show/show.mjs +2 -1
- package/api/template/skeleton/skeleton.mjs +2 -1
- package/api/template/template.doc.mjs +1 -1
- package/api/template/template.mjs +19 -1
- package/api/template/template.type.d.mts +1 -0
- package/api/template/template.type.mjs +2 -1
- package/api/theme/_adapter.d.mts +1 -0
- package/api/theme/_adapter.mjs +3 -5
- package/api/theme/_app-provider.d.mts +42 -0
- package/api/theme/_app-provider.mjs +61 -27
- package/api/theme/build/build.d.mts +4 -10
- package/api/theme/build/build.mjs +165 -116
- package/api/theme/build/input-fields.d.mts +9 -0
- package/api/theme/build/input-fields.mjs +155 -16
- package/api/theme/build/radius-values.d.mts +18 -0
- package/api/theme/build/radius-values.mjs +76 -0
- package/api/theme/build/typography-values.mjs +7 -23
- package/api/theme/build/written-values.d.mts +18 -0
- package/api/theme/build/written-values.mjs +107 -31
- package/api/theme/eject/eject.mjs +6 -1
- package/api/theme/palette/generate/generator.mjs +24 -0
- package/api/theme/theme.type.d.mts +4 -2
- package/api/theme/theme.type.mjs +3 -2
- package/api/theme/themeBuild.doc.mjs +2 -2
- package/api/theme/themeEject.doc.mjs +1 -1
- package/api/theme-edit/_catalog.d.mts +40 -0
- package/api/theme-edit/_catalog.mjs +100 -22
- package/api/theme-edit/_check.mjs +213 -43
- package/api/theme-edit/_color.d.mts +14 -0
- package/api/theme-edit/_color.mjs +22 -0
- package/api/theme-edit/_compiler.mjs +52 -0
- package/api/theme-edit/_context.d.mts +20 -2
- package/api/theme-edit/_context.mjs +157 -29
- package/api/theme-edit/_edit.mjs +426 -58
- package/api/theme-edit/_how-question.d.mts +14 -0
- package/api/theme-edit/_how-question.mjs +1541 -127
- package/api/theme-edit/_how.mjs +43 -0
- package/api/theme-edit/_missed.mjs +107 -27
- package/api/theme-edit/_normal.d.mts +18 -4
- package/api/theme-edit/_normal.mjs +84 -3
- package/api/theme-edit/_palette.d.mts +9 -0
- package/api/theme-edit/_palette.mjs +158 -33
- package/api/theme-edit/_part-words.mjs +16 -3
- package/api/theme-edit/_parts.d.mts +8 -0
- package/api/theme-edit/_parts.mjs +120 -36
- package/api/theme-edit/_png.d.mts +24 -0
- package/api/theme-edit/_png.mjs +99 -0
- package/api/theme-edit/_preview-app.d.mts +16 -0
- package/api/theme-edit/_preview-app.mjs +52 -18
- package/api/theme-edit/_preview.d.mts +44 -26
- package/api/theme-edit/_preview.mjs +255 -67
- package/api/theme-edit/_project.d.mts +12 -1
- package/api/theme-edit/_project.mjs +16 -1
- package/api/theme-edit/_settings.d.mts +116 -0
- package/api/theme-edit/_settings.mjs +1197 -58
- package/api/theme-edit/_tables.d.mts +16 -0
- package/api/theme-edit/_tables.mjs +34 -4
- package/api/theme-edit/theme-edit.type.d.mts +15 -2
- package/api/theme-edit/theme-edit.type.mjs +8 -6
- package/api/upgrade/_adapter.d.mts +46 -7
- package/api/upgrade/_adapter.mjs +110 -15
- package/api/upgrade/registry/registry.d.mts +6 -3
- package/api/upgrade/registry/registry.mjs +21 -6
- package/api/upgrade/run/run.mjs +23 -11
- package/api/upgrade/upgrade.doc.mjs +4 -3
- package/assets/component-list.generated.json +1 -1
- package/assets/docs/tree/agent-guidance.doc.mjs +3 -2
- package/assets/docs/tree/checks.doc.mjs +2 -2
- package/assets/docs/tree/host-entry.doc.mjs +4 -0
- package/assets/docs/tree/icon-definitions.doc.mjs +3 -3
- package/assets/docs/tree/icon-sets.doc.mjs +6 -6
- package/assets/docs/tree/problems.doc.mjs +3 -3
- package/assets/docs/tree/render-pages.doc.mjs +17 -3
- package/assets/docs/tree/share-a-page.doc.mjs +5 -5
- package/assets/docs/tree/short-and-findable.doc.mjs +3 -3
- package/assets/docs/tree/troubleshooting.doc.mjs +8 -0
- package/assets/docs/tree/updates.doc.mjs +1 -1
- package/assets/docs/tree/versioning.doc.mjs +1 -1
- package/assets/docs/working-with-ai.doc.mjs +40 -5
- package/assets/docs-routes.generated.json +1 -1
- package/assets/docs.generated.json +2 -2
- package/assets/icons/installed-icon-set.doc.mjs +30 -0
- package/assets/search-catalog.generated.json +2 -2
- package/assets/self-audit.generated.json +1 -1
- package/assets/templates/blocks/components/Avatar/AvatarInteractive.tsx +6 -1
- package/assets/templates/blocks/components/CodeBlock/CodeBlockTerminal.tsx +1 -1
- package/assets/templates/blocks/components/LinkProvider/LinkProviderCustomLink.tsx +3 -1
- package/assets/templates/components.generated.json +1 -1
- package/assets/templates/pages/ai-chat/page.tsx +6 -2
- package/assets/templates/pages/ai-chat-landing/page.tsx +1 -1
- package/assets/templates/pages/blank/page.tsx +4 -2
- package/assets/templates/pages/canvas-editor/page.tsx +3 -1
- package/assets/templates/pages/centered-hero/page.tsx +1 -1
- package/assets/templates/pages/checkout-wizard/page.tsx +1 -1
- package/assets/templates/pages/classic-gallery/page.tsx +1 -1
- package/assets/templates/pages/contact-form/page.tsx +2 -2
- package/assets/templates/pages/course-detail/page.tsx +1 -1
- package/assets/templates/pages/dashboard/page.tsx +24 -8
- package/assets/templates/pages/dashboard-alert-rail/page.tsx +4 -2
- package/assets/templates/pages/dashboard-cohort-funnel/page.tsx +7 -3
- package/assets/templates/pages/dashboard-comparison/page.tsx +5 -2
- package/assets/templates/pages/dashboard-composition/page.tsx +10 -4
- package/assets/templates/pages/dashboard-progress/page.tsx +6 -3
- package/assets/templates/pages/dashboard-scorecard/page.tsx +17 -8
- package/assets/templates/pages/detail-page/page.tsx +22 -5
- package/assets/templates/pages/documentation/page.tsx +4 -2
- package/assets/templates/pages/documentation-design/page.tsx +5 -2
- package/assets/templates/pages/documentation-technical/page.tsx +4 -2
- package/assets/templates/pages/editor/page.tsx +28 -9
- package/assets/templates/pages/file-explorer/page.tsx +3 -1
- package/assets/templates/pages/form-two-column/page.tsx +1 -1
- package/assets/templates/pages/form-wizard/page.tsx +1 -1
- package/assets/templates/pages/form-wizard-dialog/page.tsx +3 -1
- package/assets/templates/pages/form-wizard-inline/page.tsx +1 -1
- package/assets/templates/pages/form-wizard-vertical/page.tsx +1 -1
- package/assets/templates/pages/gallery-hero/page.tsx +1 -1
- package/assets/templates/pages/ide/page.tsx +7 -2
- package/assets/templates/pages/kanban-board/page.tsx +10 -4
- package/assets/templates/pages/library/page.tsx +31 -61
- package/assets/templates/pages/login/page.tsx +4 -2
- package/assets/templates/pages/login-card/page.tsx +4 -2
- package/assets/templates/pages/login-split/page.tsx +3 -2
- package/assets/templates/pages/login-sso/page.tsx +4 -4
- package/assets/templates/pages/mixed-gallery/page.tsx +1 -1
- package/assets/templates/pages/payment-form/page.tsx +1 -1
- package/assets/templates/pages/product-detail/page.tsx +16 -4
- package/assets/templates/pages/product-gallery/page.tsx +1 -1
- package/assets/templates/pages/settings/page.tsx +10 -4
- package/assets/templates/pages/settings-dialog/page.tsx +5 -6
- package/assets/templates/pages/settings-sidebar/page.tsx +39 -13
- package/assets/templates/pages/side-gallery/page.tsx +1 -1
- package/assets/templates/pages/table/page.tsx +2 -2
- package/assets/templates/pages/table-filter/page.tsx +21 -6
- package/assets/templates/pages/table-grouped/page.tsx +23 -2
- package/assets/templates/pages/table-inbox/page.tsx +82 -32
- package/assets/templates/pages/theme-showcase/page.tsx +3 -2
- package/assets/templates/themes/butter/butterPaletteRefs.generated.ts +12 -12
- package/assets/templates/themes/butter/butterTheme.ts +197 -4
- package/assets/templates/themes/chocolate/chocolateTheme.ts +72 -8
- package/assets/templates/themes/gothic/gothicPaletteRefs.generated.ts +3 -3
- package/assets/templates/themes/gothic/gothicTheme.ts +114 -4
- package/assets/templates/themes/matcha/matchaPaletteRefs.generated.ts +8 -8
- package/assets/templates/themes/matcha/matchaTheme.ts +48 -12
- package/assets/templates/themes/neutral/neutralTheme.ts +29 -0
- package/assets/templates/themes/stone/stonePaletteRefs.generated.ts +2 -2
- package/assets/templates/themes/stone/stoneTheme.ts +69 -0
- package/assets/templates/themes/y2k/y2kPaletteRefs.generated.ts +9 -9
- package/assets/templates/themes/y2k/y2kTheme.ts +249 -14
- package/authoring/codemod/parse.d.mts +0 -36
- package/authoring/codemod/parse.mjs +62 -41
- package/authoring/config/config.doc.mjs +1 -1
- package/authoring/config/parse.d.mts +0 -47
- package/authoring/config/parse.mjs +128 -103
- package/authoring/config/type.ts +4 -3
- package/authoring/debug/parse.d.mts +2 -2
- package/authoring/discover/parse.d.mts +2 -2
- package/authoring/discover/parse.mjs +52 -38
- package/authoring/discover/type.ts +2 -1
- package/authoring/doctypes/_schema.d.mts +834 -950
- package/authoring/doctypes/_schema.mjs +863 -825
- package/authoring/doctypes/command/parse.mjs +2 -2
- package/authoring/doctypes/component/parse.mjs +2 -2
- package/authoring/doctypes/enum/parse.mjs +2 -2
- package/authoring/doctypes/hook/parse.mjs +2 -2
- package/authoring/doctypes/icon-definition/icon-definition.doc.mjs +1 -1
- package/authoring/doctypes/icon-definition/parse.d.mts +0 -24
- package/authoring/doctypes/icon-definition/parse.mjs +59 -43
- package/authoring/doctypes/icon-set/parse.d.mts +0 -75
- package/authoring/doctypes/icon-set/parse.mjs +239 -210
- package/authoring/doctypes/legacy.mjs +3 -3
- package/authoring/doctypes/namespace/parse.mjs +2 -2
- package/authoring/doctypes/reference/parse.mjs +2 -2
- package/authoring/doctypes/schema/parse.mjs +2 -2
- package/authoring/doctypes/template/parse.d.mts +0 -101
- package/authoring/doctypes/template/parse.mjs +131 -106
- package/authoring/doctypes/theme/parse.d.mts +0 -23
- package/authoring/doctypes/theme/parse.mjs +52 -36
- package/authoring/gap-report/parse.d.mts +1 -1
- package/authoring/integration/integration.doc.mjs +8 -0
- package/authoring/integration/schema.d.mts +14 -3
- package/authoring/integration/schema.mjs +20 -2
- package/authoring/integration/type.ts +14 -0
- package/clients/cli/build-id.generated.json +1 -1
- package/clients/cli/commands/build.mjs +27 -13
- package/clients/cli/commands/component.mjs +14 -3
- package/clients/cli/commands/discover.doc.mjs +2 -2
- package/clients/cli/commands/discover.mjs +20 -3
- package/clients/cli/commands/docs.doc.mjs +11 -9
- package/clients/cli/commands/docs.mjs +50 -21
- package/clients/cli/commands/experimental/icon.mjs +330 -227
- package/clients/cli/commands/experimental/render.mjs +16 -1
- package/clients/cli/commands/experimental/theme.mjs +42 -17
- package/clients/cli/commands/experimental-icon-add.doc.mjs +1 -1
- package/clients/cli/commands/experimental-icon-map.doc.mjs +4 -1
- package/clients/cli/commands/experimental-icon-new-definition.doc.mjs +4 -1
- package/clients/cli/commands/experimental-icon-new-set.doc.mjs +4 -1
- package/clients/cli/commands/experimental-icon-use.doc.mjs +1 -1
- package/clients/cli/commands/experimental-icon.doc.mjs +1 -1
- package/clients/cli/commands/experimental-render.doc.mjs +3 -3
- package/clients/cli/commands/experimental-theme-compile.doc.mjs +1 -1
- package/clients/cli/commands/experimental-theme-editor-new.doc.mjs +1 -1
- package/clients/cli/commands/experimental-theme-editor-set.doc.mjs +1 -1
- package/clients/cli/commands/experimental-theme-editor-show.doc.mjs +1 -1
- package/clients/cli/commands/experimental-theme-editor-undo.doc.mjs +1 -1
- package/clients/cli/commands/init.doc.mjs +36 -24
- package/clients/cli/commands/integration-check.doc.mjs +1 -1
- package/clients/cli/commands/mcp.doc.mjs +53 -0
- package/clients/cli/commands/mcp.mjs +51 -0
- package/clients/cli/commands/search.mjs +46 -9
- package/clients/cli/commands/template.mjs +3 -2
- package/clients/cli/commands/theme-build.doc.mjs +1 -1
- package/clients/cli/commands/theme.mjs +12 -2
- package/clients/cli/commands/upgrade.doc.mjs +3 -2
- package/clients/cli/commands.generated.json +1 -1
- package/clients/cli/formatters/index.mjs +52 -6
- package/clients/cli/index.mjs +23 -17
- package/clients/cli/lib/base-gate.mjs +37 -5
- package/clients/cli/lib/define-command.mjs +82 -4
- package/clients/cli/lib/json-shim.mjs +61 -4
- package/clients/cli/lib/manifest.mjs +9 -1
- package/clients/cli/lib/mcp-server.mjs +286 -0
- package/clients/cli/lib/mcp-tools.mjs +405 -0
- package/clients/cli/lib/other-cli-words.mjs +99 -0
- package/clients/cli/lib/stray-option.mjs +27 -1
- package/clients/cli/lib/unknown-command.mjs +326 -11
- package/clients/cli/manifest.generated.json +1 -1
- package/clients/cli/run.mjs +1 -1
- package/foundation/agent-docs/agent-docs.d.mts +49 -1
- package/foundation/agent-docs/agent-docs.mjs +108 -7
- package/foundation/agent-docs/computer-agent-text.mjs +1 -1
- package/foundation/bases/core.d.mts +1 -1
- package/foundation/bases/core.mjs +3 -3
- package/foundation/bases/resolve.d.mts +4 -8
- package/foundation/bases/resolve.mjs +15 -21
- package/foundation/bases/state.d.mts +15 -9
- package/foundation/bases/state.mjs +33 -6
- package/foundation/config/project.d.mts +5 -4
- package/foundation/config/project.mjs +33 -17
- package/foundation/discovery/component-discovery.mjs +15 -28
- package/foundation/discovery/icon-imports.d.mts +66 -0
- package/foundation/discovery/icon-imports.mjs +225 -0
- package/foundation/discovery/icon-ranking.d.mts +12 -2
- package/foundation/discovery/icon-ranking.mjs +197 -10
- package/foundation/discovery/icon-set-checks.mjs +2 -1
- package/foundation/discovery/icon-set-discovery.d.mts +28 -0
- package/foundation/discovery/icon-set-discovery.mjs +42 -0
- package/foundation/discovery/icon-set-writer.d.mts +2 -11
- package/foundation/discovery/icon-set-writer.mjs +3 -29
- package/foundation/discovery/module-exports.d.mts +1 -1
- package/foundation/discovery/module-exports.mjs +136 -33
- package/foundation/discovery/name-roots.d.mts +5 -0
- package/foundation/discovery/name-roots.mjs +11 -0
- package/foundation/discovery/runner-allowlist.d.mts +1 -0
- package/foundation/discovery/runner-allowlist.mjs +2 -0
- package/foundation/discovery/runner-commands.mjs +1 -0
- package/foundation/discovery/template-adapter.d.mts +1 -1
- package/foundation/discovery/template-destination.d.mts +14 -6
- package/foundation/discovery/template-destination.mjs +42 -8
- package/foundation/discovery/template-icons.d.mts +45 -2
- package/foundation/discovery/template-icons.mjs +26 -54
- package/foundation/discovery/template-needs.d.mts +28 -2
- package/foundation/discovery/template-needs.mjs +92 -11
- package/foundation/discovery/theme-discovery.d.mts +8 -0
- package/foundation/discovery/theme-discovery.mjs +23 -6
- package/foundation/discovery/theme-imports.mjs +2 -4
- package/foundation/doc-compiler/parse-readable.mjs +4 -3
- package/foundation/doc-compiler/stored-docs.d.mts +13 -0
- package/foundation/doc-compiler/stored-docs.mjs +74 -3
- package/foundation/env/cli-command.d.mts +68 -10
- package/foundation/env/cli-command.mjs +116 -22
- package/foundation/env/project-scope.d.mts +9 -0
- package/foundation/env/project-scope.mjs +28 -2
- package/foundation/fs/gather-cache.d.mts +23 -0
- package/foundation/fs/gather-cache.mjs +94 -2
- package/foundation/fs/module-loader.d.mts +3 -1
- package/foundation/fs/module-loader.mjs +85 -5
- package/foundation/fs/read-record.mjs +9 -5
- package/foundation/identity/package-names.d.mts +18 -0
- package/foundation/identity/package-names.mjs +19 -0
- package/foundation/identity/providers.mjs +3 -2
- package/foundation/integrations/icon-features.d.mts +63 -0
- package/foundation/integrations/icon-features.mjs +54 -0
- package/foundation/integrations/integrations.d.mts +13 -1
- package/foundation/integrations/integrations.mjs +47 -6
- package/foundation/integrations/pack-state.d.mts +21 -0
- package/foundation/integrations/pack-state.mjs +42 -19
- package/foundation/integrations/validate-contributions.d.mts +11 -3
- package/foundation/integrations/validate-contributions.mjs +51 -13
- package/foundation/release/cache.d.mts +13 -1
- package/foundation/release/cache.mjs +94 -14
- package/foundation/release/notices.d.mts +15 -0
- package/foundation/release/notices.mjs +111 -7
- package/foundation/release/project.d.mts +3 -4
- package/foundation/release/project.mjs +5 -6
- package/foundation/render/client-bundle.d.mts +126 -0
- package/foundation/render/client-bundle.mjs +565 -0
- package/foundation/render/cut-short.d.mts +7 -1
- package/foundation/render/cut-short.mjs +46 -6
- package/foundation/render/embedded-imports.d.mts +4 -3
- package/foundation/render/embedded-imports.mjs +13 -8
- package/foundation/render/esbuild-dependency.d.mts +14 -0
- package/foundation/render/esbuild-dependency.mjs +41 -0
- package/foundation/render/file-header.mjs +5 -4
- package/foundation/render/page-worker.mjs +562 -86
- package/foundation/render/picture-chrome.mjs +54 -29
- package/foundation/render/picture-playwright.mjs +78 -42
- package/foundation/render/picture-window.d.mts +33 -0
- package/foundation/render/picture-window.mjs +78 -0
- package/foundation/render/render-page.d.mts +55 -4
- package/foundation/render/render-page.mjs +199 -28
- package/foundation/render/restore-folder.d.mts +13 -0
- package/foundation/render/restore-folder.mjs +30 -0
- package/foundation/render/served-packages.d.mts +2 -1
- package/foundation/render/served-packages.mjs +5 -3
- package/foundation/render/ts-paths.d.mts +11 -0
- package/foundation/render/ts-paths.mjs +27 -2
- package/foundation/render/value-uses.d.mts +43 -0
- package/foundation/render/value-uses.mjs +110 -0
- package/foundation/response/error-codes.d.mts +2 -1
- package/foundation/response/error-codes.doc.mjs +7 -1
- package/foundation/response/error-codes.mjs +10 -2
- package/foundation/response/response-types.doc.mjs +12 -12
- package/foundation/runtime/package-root.d.mts +8 -0
- package/foundation/runtime/package-root.mjs +20 -0
- package/foundation/suggest/other-command.d.mts +11 -0
- package/foundation/suggest/other-command.mjs +1 -1
- package/foundation/text/icon-id.d.mts +20 -0
- package/foundation/text/icon-id.mjs +40 -0
- package/foundation/text/icon-set-next.d.mts +25 -0
- package/foundation/text/icon-set-next.mjs +29 -0
- package/foundation/xle/browser.d.mts +2 -2
- package/package.json +7 -6
|
@@ -123,6 +123,7 @@ import {
|
|
|
123
123
|
} from '@astryxdesign/core/Table';
|
|
124
124
|
import type {TableColumn, TablePlugin} from '@astryxdesign/core/Table';
|
|
125
125
|
import {useToast} from '@astryxdesign/core/Toast';
|
|
126
|
+
import {useImperativeAlertDialog} from '@astryxdesign/core/AlertDialog';
|
|
126
127
|
import {
|
|
127
128
|
ArchiveBoxIcon,
|
|
128
129
|
ArrowLeftIcon,
|
|
@@ -766,13 +767,24 @@ function useSurfaceWidth() {
|
|
|
766
767
|
* unless something stops it. Guarding centrally rather than hanging
|
|
767
768
|
* `stopPropagation` on each control is what keeps this true for the next
|
|
768
769
|
* control somebody adds — and it has to cover the selection checkbox, which
|
|
769
|
-
* the plugin renders and the template never touches.
|
|
770
|
+
* the plugin renders and the template never touches. A row's delete
|
|
771
|
+
* confirmation renders inside the row too, and its keys bubble through it, so
|
|
772
|
+
* the dialog counts as well.
|
|
770
773
|
*/
|
|
771
774
|
const INTERACTIVE_WITHIN_ROW =
|
|
772
|
-
'button, input, a, label, [role="checkbox"], [role="button"], [role="menuitem"]';
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
775
|
+
'button, input, a, label, dialog, [role="checkbox"], [role="button"], [role="menuitem"]';
|
|
776
|
+
|
|
777
|
+
// Only a control inside this row counts: the page itself may sit inside a
|
|
778
|
+
// dialog or a link, and those ancestors are not the row's own controls.
|
|
779
|
+
function isRowItself(event: {
|
|
780
|
+
target: EventTarget | null;
|
|
781
|
+
currentTarget: EventTarget | null;
|
|
782
|
+
}): boolean {
|
|
783
|
+
const control = (event.target as HTMLElement | null)?.closest(
|
|
784
|
+
INTERACTIVE_WITHIN_ROW,
|
|
785
|
+
);
|
|
786
|
+
const row = event.currentTarget as HTMLElement;
|
|
787
|
+
return !control || control === row || !row.contains(control);
|
|
776
788
|
}
|
|
777
789
|
|
|
778
790
|
// ============= ROW ACTIONS =============
|
|
@@ -991,6 +1003,7 @@ function ReceivedCell({
|
|
|
991
1003
|
isOverlaid: boolean;
|
|
992
1004
|
}) {
|
|
993
1005
|
const showToast = useToast();
|
|
1006
|
+
const confirm = useImperativeAlertDialog();
|
|
994
1007
|
return (
|
|
995
1008
|
/* `height` reserves the buttons' line box. Without it the row is 40px at
|
|
996
1009
|
rest and 44px with the actions in it, so every row nudges its
|
|
@@ -1014,16 +1027,26 @@ function ReceivedCell({
|
|
|
1014
1027
|
label={`${action.label} — ${item.subject}`}
|
|
1015
1028
|
tooltip={action.label}
|
|
1016
1029
|
icon={<Icon icon={action.icon} size="sm" />}
|
|
1017
|
-
onClick={
|
|
1018
|
-
// A delete needs a confirm step, which this demo does not have.
|
|
1030
|
+
onClick={() =>
|
|
1019
1031
|
action.id === 'delete'
|
|
1020
|
-
?
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1032
|
+
? confirm.show({
|
|
1033
|
+
title: `Delete “${item.subject}”?`,
|
|
1034
|
+
description: "This demo won't delete anything.",
|
|
1035
|
+
actionLabel: 'Delete',
|
|
1036
|
+
onAction: () => {
|
|
1037
|
+
confirm.hide();
|
|
1038
|
+
// Demo only: replace this toast with the call that performs the action.
|
|
1039
|
+
showToast({
|
|
1040
|
+
body: `Demo: “${item.subject}” would be deleted here`,
|
|
1041
|
+
uniqueID: `delete-${item.id}`,
|
|
1042
|
+
});
|
|
1043
|
+
},
|
|
1044
|
+
})
|
|
1045
|
+
: // Demo only: replace this toast with the call that performs the action.
|
|
1046
|
+
showToast({
|
|
1047
|
+
body: `Demo: ${action.label} would run on “${item.subject}” here`,
|
|
1048
|
+
uniqueID: `${action.id}-${item.id}`,
|
|
1049
|
+
})
|
|
1027
1050
|
}
|
|
1028
1051
|
/>
|
|
1029
1052
|
))}
|
|
@@ -1080,6 +1103,7 @@ function ReceivedCell({
|
|
|
1080
1103
|
</Text>
|
|
1081
1104
|
</HStack>
|
|
1082
1105
|
</StackItem>
|
|
1106
|
+
{confirm.element}
|
|
1083
1107
|
</HStack>
|
|
1084
1108
|
);
|
|
1085
1109
|
}
|
|
@@ -1364,6 +1388,7 @@ function ConversationPane({
|
|
|
1364
1388
|
isFullWidth: boolean;
|
|
1365
1389
|
}) {
|
|
1366
1390
|
const showToast = useToast();
|
|
1391
|
+
const confirm = useImperativeAlertDialog();
|
|
1367
1392
|
// Named against the subject, because the pane is not the only Archive on
|
|
1368
1393
|
// screen — every row in the list behind it has one.
|
|
1369
1394
|
const threadActions = THREAD_ACTIONS.map(action => (
|
|
@@ -1373,16 +1398,26 @@ function ConversationPane({
|
|
|
1373
1398
|
label={`${action.label} — ${conversation.subject}`}
|
|
1374
1399
|
tooltip={action.label}
|
|
1375
1400
|
icon={<Icon icon={action.icon} size="sm" />}
|
|
1376
|
-
onClick={
|
|
1377
|
-
// A delete needs a confirm step, which this demo does not have.
|
|
1401
|
+
onClick={() =>
|
|
1378
1402
|
action.id === 'delete'
|
|
1379
|
-
?
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1403
|
+
? confirm.show({
|
|
1404
|
+
title: `Delete “${conversation.subject}”?`,
|
|
1405
|
+
description: "This demo won't delete anything.",
|
|
1406
|
+
actionLabel: 'Delete',
|
|
1407
|
+
onAction: () => {
|
|
1408
|
+
confirm.hide();
|
|
1409
|
+
// Demo only: replace this toast with the call that performs the action.
|
|
1410
|
+
showToast({
|
|
1411
|
+
body: `Demo: “${conversation.subject}” would be deleted here`,
|
|
1412
|
+
uniqueID: `delete-${conversation.id}`,
|
|
1413
|
+
});
|
|
1414
|
+
},
|
|
1415
|
+
})
|
|
1416
|
+
: // Demo only: replace this toast with the call that performs the action.
|
|
1417
|
+
showToast({
|
|
1418
|
+
body: `Demo: ${action.label} would run on “${conversation.subject}” here`,
|
|
1419
|
+
uniqueID: `${action.id}-${conversation.id}`,
|
|
1420
|
+
})
|
|
1386
1421
|
}
|
|
1387
1422
|
/>
|
|
1388
1423
|
));
|
|
@@ -1577,6 +1612,7 @@ function ConversationPane({
|
|
|
1577
1612
|
</HStack>
|
|
1578
1613
|
</VStack>
|
|
1579
1614
|
</StackItem>
|
|
1615
|
+
{confirm.element}
|
|
1580
1616
|
</VStack>
|
|
1581
1617
|
);
|
|
1582
1618
|
}
|
|
@@ -2016,6 +2052,7 @@ function ComposeWindow({
|
|
|
2016
2052
|
|
|
2017
2053
|
export default function SupportInboxTemplate() {
|
|
2018
2054
|
const showToast = useToast();
|
|
2055
|
+
const confirm = useImperativeAlertDialog();
|
|
2019
2056
|
const [category, setCategory] = useState<Category>('inbox');
|
|
2020
2057
|
/**
|
|
2021
2058
|
* Which thread the user has picked — `undefined` until they pick one.
|
|
@@ -2536,16 +2573,28 @@ export default function SupportInboxTemplate() {
|
|
|
2536
2573
|
variant="ghost"
|
|
2537
2574
|
size="sm"
|
|
2538
2575
|
icon={<Icon icon={action.icon} size="sm" />}
|
|
2539
|
-
onClick={
|
|
2540
|
-
// A delete needs a confirm step, which this demo does not have.
|
|
2576
|
+
onClick={() =>
|
|
2541
2577
|
action.id === 'delete'
|
|
2542
|
-
?
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2578
|
+
? confirm.show({
|
|
2579
|
+
title:
|
|
2580
|
+
'Delete the selected conversations?',
|
|
2581
|
+
description:
|
|
2582
|
+
"This demo won't delete anything.",
|
|
2583
|
+
actionLabel: 'Delete',
|
|
2584
|
+
onAction: () => {
|
|
2585
|
+
confirm.hide();
|
|
2586
|
+
// Demo only: replace this toast with the call that performs the action.
|
|
2587
|
+
showToast({
|
|
2588
|
+
body: 'Demo: the selected conversations would be deleted here',
|
|
2589
|
+
uniqueID: 'bulk-delete',
|
|
2590
|
+
});
|
|
2591
|
+
},
|
|
2592
|
+
})
|
|
2593
|
+
: // Demo only: replace this toast with the call that performs the action.
|
|
2594
|
+
showToast({
|
|
2595
|
+
body: `Demo: ${action.label} would run on the selected conversations here`,
|
|
2596
|
+
uniqueID: `bulk-${action.id}`,
|
|
2597
|
+
})
|
|
2549
2598
|
}
|
|
2550
2599
|
/>
|
|
2551
2600
|
))}
|
|
@@ -2755,6 +2804,7 @@ export default function SupportInboxTemplate() {
|
|
|
2755
2804
|
onOpenChange={setComposeOpen}
|
|
2756
2805
|
draft={composeDraft}
|
|
2757
2806
|
/>
|
|
2807
|
+
{confirm.element}
|
|
2758
2808
|
</>
|
|
2759
2809
|
);
|
|
2760
2810
|
}
|
|
@@ -74,6 +74,7 @@ import {
|
|
|
74
74
|
} from '@astryxdesign/core/Chat';
|
|
75
75
|
import {useToast} from '@astryxdesign/core/Toast';
|
|
76
76
|
import {useImperativeAlertDialog} from '@astryxdesign/core/AlertDialog';
|
|
77
|
+
import {VisuallyHidden} from '@astryxdesign/core/VisuallyHidden';
|
|
77
78
|
|
|
78
79
|
// StackItem has no wrapping basis; Stack has no body variant.
|
|
79
80
|
// LayoutContent has no height cap; keep the message viewport bounded.
|
|
@@ -1327,7 +1328,7 @@ function InventoryCard({
|
|
|
1327
1328
|
columns={[
|
|
1328
1329
|
{
|
|
1329
1330
|
key: 'select',
|
|
1330
|
-
header:
|
|
1331
|
+
header: <VisuallyHidden>Select</VisuallyHidden>,
|
|
1331
1332
|
width: pixel(64),
|
|
1332
1333
|
renderCell: row => (
|
|
1333
1334
|
<CheckboxInput
|
|
@@ -1365,7 +1366,7 @@ function InventoryCard({
|
|
|
1365
1366
|
},
|
|
1366
1367
|
{
|
|
1367
1368
|
key: 'actions',
|
|
1368
|
-
header:
|
|
1369
|
+
header: <VisuallyHidden>Actions</VisuallyHidden>,
|
|
1369
1370
|
width: pixel(64),
|
|
1370
1371
|
align: 'end',
|
|
1371
1372
|
renderCell: () => <ActionsCell />,
|
|
@@ -6,6 +6,18 @@
|
|
|
6
6
|
// making consumers pay for unused palette stops.
|
|
7
7
|
// prettier-ignore
|
|
8
8
|
export const butterPaletteRefs = {
|
|
9
|
+
neutral: {
|
|
10
|
+
light: {0: '#000000', 15: '#1d1c11', 30: '#4a4732', 40: '#725538', 45: '#605f52', 55: '#79786a', 70: '#adac9e', 75: '#c7c4b2', 80: '#d6d3b8', 85: '#e5e3d4', 90: '#f3f2e2', 95: '#fdfbe4', 100: '#ffffff'},
|
|
11
|
+
dark: {0: '#000000', 5: '#131107', 10: '#261a13', 15: '#2e2117', 20: '#3a2a1f', 30: '#4a4732', 35: '#49473b', 40: '#725538', 45: '#605f52', 60: '#939184', 70: '#adac9e', 80: '#d6d3b8', 85: '#f0edd4', 90: '#f3f2e2', 95: '#fdfbe4', 100: '#ffffff'},
|
|
12
|
+
},
|
|
13
|
+
accent: {
|
|
14
|
+
light: {35: '#194ce8', 40: '#225bff', 55: '#4d82ff'},
|
|
15
|
+
dark: {70: '#81a9ff'},
|
|
16
|
+
},
|
|
17
|
+
yellow: {
|
|
18
|
+
dark: {15: '#2c2600', 25: '#443c00', 70: '#bcae4e', 75: '#cdbe59', 85: '#eedf75', 90: '#fdee8c'},
|
|
19
|
+
light: {25: '#443c00', 30: '#514700', 55: '#958500', 70: '#bfae35', 80: '#dfcf5b', 85: '#f0df72', 90: '#fdee8c', 95: '#fff7c0'},
|
|
20
|
+
},
|
|
9
21
|
purple: {
|
|
10
22
|
light: {25: '#52237b', 80: '#ddb9f6', 90: '#f2daff'},
|
|
11
23
|
dark: {25: '#52237b', 80: '#ddb9f6', 90: '#f2daff'},
|
|
@@ -14,10 +26,6 @@ export const butterPaletteRefs = {
|
|
|
14
26
|
light: {25: '#004a05', 55: '#4a984a', 70: '#7bbf7a', 80: '#a2d7a0', 85: '#b6e3b4', 90: '#caeec8'},
|
|
15
27
|
dark: {15: '#013004', 20: '#063c0a', 70: '#83bc82', 80: '#a8d4a6', 90: '#cdedcc'},
|
|
16
28
|
},
|
|
17
|
-
neutral: {
|
|
18
|
-
light: {0: '#000000', 15: '#1d1c11', 30: '#4a4732', 45: '#605f52', 55: '#79786a', 70: '#adac9e', 75: '#c7c4b2', 80: '#d6d3b8', 85: '#e5e3d4', 90: '#f3f2e2', 95: '#fdfbe4', 100: '#ffffff'},
|
|
19
|
-
dark: {0: '#000000', 5: '#131107', 10: '#261a13', 15: '#2e2117', 20: '#3a2a1f', 30: '#4a4732', 35: '#49473b', 40: '#725538', 45: '#605f52', 60: '#939184', 70: '#adac9e', 80: '#d6d3b8', 85: '#f0edd4', 90: '#f3f2e2', 95: '#fdfbe4', 100: '#ffffff'},
|
|
20
|
-
},
|
|
21
29
|
orange: {
|
|
22
30
|
light: {25: '#622e00', 80: '#f2bd81', 90: '#ffdcb6'},
|
|
23
31
|
dark: {25: '#622e00', 80: '#f2bd81', 90: '#ffdcb6'},
|
|
@@ -30,18 +38,10 @@ export const butterPaletteRefs = {
|
|
|
30
38
|
light: {10: '#3b0200', 25: '#6f1400', 30: '#821b00', 60: '#e56241', 80: '#ffb09b', 90: '#ffd9cf', 95: '#ffece7'},
|
|
31
39
|
dark: {15: '#4c0700', 25: '#6f1400', 80: '#ffb09b', 85: '#ffc5b5', 90: '#ffd9cf'},
|
|
32
40
|
},
|
|
33
|
-
yellow: {
|
|
34
|
-
light: {25: '#443c00', 30: '#514700', 55: '#958500', 70: '#bfae35', 80: '#dfcf5b', 85: '#f0df72', 90: '#fdee8c', 95: '#fff7c0'},
|
|
35
|
-
dark: {15: '#2c2600', 25: '#443c00', 70: '#bcae4e', 75: '#cdbe59', 85: '#eedf75', 90: '#fdee8c'},
|
|
36
|
-
},
|
|
37
41
|
teal: {
|
|
38
42
|
light: {25: '#00482d', 80: '#94d3bb', 90: '#b0f0d7'},
|
|
39
43
|
dark: {25: '#00482d', 80: '#94d3bb', 90: '#b0f0d7'},
|
|
40
44
|
},
|
|
41
|
-
accent: {
|
|
42
|
-
light: {35: '#194ce8', 40: '#225bff', 55: '#4d82ff'},
|
|
43
|
-
dark: {70: '#81a9ff'},
|
|
44
|
-
},
|
|
45
45
|
cyan: {
|
|
46
46
|
light: {25: '#004649', 80: '#8dd2d3', 90: '#a9eff0'},
|
|
47
47
|
dark: {25: '#004649', 80: '#8dd2d3', 90: '#a9eff0'},
|
|
@@ -10,7 +10,9 @@
|
|
|
10
10
|
* The signature blue and butter yellow remain exact anchors.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
+
import {parseStyleKey} from '@astryxdesign/core/utils';
|
|
13
14
|
import {defineTheme, defineSyntaxTheme} from '@astryxdesign/core/theme';
|
|
15
|
+
import type {ComponentStyleMap} from '@astryxdesign/core/theme';
|
|
14
16
|
import {butterIconRegistry} from './icons';
|
|
15
17
|
import {butterPaletteRefs} from './butterPaletteRefs.generated';
|
|
16
18
|
|
|
@@ -32,6 +34,147 @@ const withAlpha = (color: string, alpha: string): string => `${color}${alpha}`;
|
|
|
32
34
|
const lightDark = (light: string, dark: string): string =>
|
|
33
35
|
`light-dark(${light}, ${dark})`;
|
|
34
36
|
|
|
37
|
+
/**
|
|
38
|
+
* Secondary text on the accent tint (a selected row, a dropzone's hint, a
|
|
39
|
+
* numbered citation): the nearest stop that reads on the tint over the page,
|
|
40
|
+
* a card and the muted fill. Inside a coloured card, a selected row and a
|
|
41
|
+
* numbered citation take a dark stop like the rest of the card's ink.
|
|
42
|
+
*/
|
|
43
|
+
const LIFTED_ON_PAGE = lightDark(neutral.light[40], neutral.dark[85]);
|
|
44
|
+
const LIFTED_ON_COLOURED_CARD = lightDark(neutral.light[30], neutral.dark[45]);
|
|
45
|
+
|
|
46
|
+
// The theme's own text and link colours, which a part that paints a fill
|
|
47
|
+
// of its own sets again (OWN_FILL_RULES).
|
|
48
|
+
const SURFACE_TEXT = {
|
|
49
|
+
'--color-text-primary': lightDark(neutral.light[15], neutral.dark[90]),
|
|
50
|
+
'--color-text-secondary': lightDark(neutral.light[45], neutral.dark[70]),
|
|
51
|
+
'--color-text-accent': lightDark(accent.light[40], yellow.dark[90]),
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* The selector Core's TableRow gives a striped table's painted rows (its
|
|
56
|
+
* even rows, not counting expansion panels); the striped-row rule repeats it.
|
|
57
|
+
*/
|
|
58
|
+
const STRIPED_ROW = ':nth-child(even of :not([data-expansion-panel]))';
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* The rules of the parts that paint a fill of their own (a surface, a
|
|
62
|
+
* popover, the muted fill or a card fill) and draw text on it, each as
|
|
63
|
+
* `[part, rule, selector?]`. A coloured card's ink must not reach them, so
|
|
64
|
+
* each sets the theme's own text and link colours again. A transparent card
|
|
65
|
+
* is left out: it paints nothing, so it keeps its parent's ink.
|
|
66
|
+
*/
|
|
67
|
+
const OWN_FILL_RULES: ReadonlyArray<readonly [string, string, string?]> = [
|
|
68
|
+
['card', 'variant:default'],
|
|
69
|
+
['card', 'variant:muted'],
|
|
70
|
+
['clickable-card', 'variant:default'],
|
|
71
|
+
['clickable-card', 'variant:muted'],
|
|
72
|
+
['selectable-card', 'variant:default'],
|
|
73
|
+
['selectable-card', 'variant:muted'],
|
|
74
|
+
['section', 'variant:section'],
|
|
75
|
+
['section', 'variant:muted'],
|
|
76
|
+
['app-shell', 'variant:surface'],
|
|
77
|
+
['app-shell', 'variant:section'],
|
|
78
|
+
['app-shell-header', 'variant:surface'],
|
|
79
|
+
['app-shell-sidenav', 'variant:surface'],
|
|
80
|
+
['layout-panel', 'base'],
|
|
81
|
+
['layout-content', 'base'],
|
|
82
|
+
['code', 'base'],
|
|
83
|
+
['avatar', 'base'],
|
|
84
|
+
['avatar-group-overflow', 'base'],
|
|
85
|
+
['segmented-control-item', 'selected'],
|
|
86
|
+
['step-indicator', 'progress:not-started'],
|
|
87
|
+
['table-row', 'base', STRIPED_ROW],
|
|
88
|
+
['banner-content', 'base'],
|
|
89
|
+
['input-group-text', 'base'],
|
|
90
|
+
['text-input', 'base'],
|
|
91
|
+
['text-area', 'base'],
|
|
92
|
+
['number-input', 'base'],
|
|
93
|
+
['date-input', 'base'],
|
|
94
|
+
['date-range-input', 'base'],
|
|
95
|
+
['date-time-input-date-segment', 'base'],
|
|
96
|
+
['date-time-input-time-segment', 'base'],
|
|
97
|
+
['time-input', 'base'],
|
|
98
|
+
['file-input', 'base'],
|
|
99
|
+
['typeahead', 'base'],
|
|
100
|
+
['tokenizer', 'base'],
|
|
101
|
+
['selector', 'variant:input'],
|
|
102
|
+
['multi-selector', 'variant:input'],
|
|
103
|
+
['selector-popup', 'base'],
|
|
104
|
+
['multi-selector-popup', 'base'],
|
|
105
|
+
['dropdown-menu', 'base'],
|
|
106
|
+
['dropdown-menu-radio', 'base'],
|
|
107
|
+
['context-menu', 'base'],
|
|
108
|
+
['popover', 'base'],
|
|
109
|
+
['hover-card', 'base'],
|
|
110
|
+
['dialog', 'base'],
|
|
111
|
+
['drawer', 'base'],
|
|
112
|
+
['bottom-sheet', 'base'],
|
|
113
|
+
['chat-composer-drawer', 'base'],
|
|
114
|
+
];
|
|
115
|
+
|
|
116
|
+
/** Puts SURFACE_TEXT under each own-fill rule; a rule's own values win. */
|
|
117
|
+
function withOwnFillText(components: ComponentStyleMap): ComponentStyleMap {
|
|
118
|
+
const out: ComponentStyleMap = {...components};
|
|
119
|
+
for (const [part, key, selector] of OWN_FILL_RULES) {
|
|
120
|
+
const rule = out[part]?.[key] ?? {};
|
|
121
|
+
out[part] = {
|
|
122
|
+
...out[part],
|
|
123
|
+
[key]: selector
|
|
124
|
+
? {
|
|
125
|
+
...rule,
|
|
126
|
+
// A table sets its text color on its root, so a painted row
|
|
127
|
+
// sets it again as well as the tokens.
|
|
128
|
+
[selector]: {
|
|
129
|
+
...SURFACE_TEXT,
|
|
130
|
+
color: 'var(--color-text-primary)',
|
|
131
|
+
...((rule as Record<string, object>)[selector] ?? {}),
|
|
132
|
+
},
|
|
133
|
+
}
|
|
134
|
+
: {...SURFACE_TEXT, ...rule},
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
return out;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/** The coloured card variants: a pastel fill with dark ink in both modes. */
|
|
141
|
+
const COLOURED_CARDS = [
|
|
142
|
+
'blue',
|
|
143
|
+
'cyan',
|
|
144
|
+
'gray',
|
|
145
|
+
'green',
|
|
146
|
+
'orange',
|
|
147
|
+
'pink',
|
|
148
|
+
'purple',
|
|
149
|
+
'red',
|
|
150
|
+
'teal',
|
|
151
|
+
'yellow',
|
|
152
|
+
];
|
|
153
|
+
|
|
154
|
+
/** The selector Core gives a part's rule key. */
|
|
155
|
+
function ruleSelector(part: string, key: string): string {
|
|
156
|
+
return `.astryx-${part}${parseStyleKey(key)}`;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* Inside a coloured card and not inside a part with a fill of its own
|
|
161
|
+
* between that card and the element: where a part draws on the card's
|
|
162
|
+
* pastel fill. A part with its own fill above the card does not count.
|
|
163
|
+
*/
|
|
164
|
+
const COLOURED_CARD = `:is(${COLOURED_CARDS.map(
|
|
165
|
+
variant => `.astryx-card[data-variant="${variant}"]`,
|
|
166
|
+
).join(', ')})`;
|
|
167
|
+
const OWN_FILL = `:is(${OWN_FILL_RULES.filter(([, , selector]) => !selector)
|
|
168
|
+
.map(([part, key]) => ruleSelector(part, key))
|
|
169
|
+
.join(', ')})`;
|
|
170
|
+
const IN_COLOURED_CARD = `:where(${COLOURED_CARD} *):not(:where(${COLOURED_CARD} ${OWN_FILL} *))`;
|
|
171
|
+
/**
|
|
172
|
+
* The same one level down: a coloured card inside a part with its own fill
|
|
173
|
+
* that itself sits in a coloured card. The dark stop holds two coloured
|
|
174
|
+
* cards deep.
|
|
175
|
+
*/
|
|
176
|
+
const IN_NESTED_COLOURED_CARD = `:where(${COLOURED_CARD} ${OWN_FILL} ${COLOURED_CARD} *):not(:where(${COLOURED_CARD} ${OWN_FILL} ${COLOURED_CARD} ${OWN_FILL} *))`;
|
|
177
|
+
|
|
35
178
|
/** Butter syntax colors resolved through reviewed palette stops. */
|
|
36
179
|
const butterSyntax = defineSyntaxTheme({
|
|
37
180
|
name: 'astryx-butter',
|
|
@@ -360,7 +503,43 @@ export const butterTheme = defineTheme({
|
|
|
360
503
|
'--shadow-inset-error': `inset 0px 0px 0px 2px ${withAlpha(red.light[30], '30')}`,
|
|
361
504
|
},
|
|
362
505
|
|
|
363
|
-
components: {
|
|
506
|
+
components: withOwnFillText({
|
|
507
|
+
// In dark mode, secondary text falls under 4.5:1 on the selected fill (the
|
|
508
|
+
// accent tint) and under its hover. Selected rows, a dropzone's hint and
|
|
509
|
+
// a numbered citation, all on that fill, use the nearest stop that clears
|
|
510
|
+
// both.
|
|
511
|
+
item: {
|
|
512
|
+
selected: {
|
|
513
|
+
'--color-text-secondary': LIFTED_ON_PAGE,
|
|
514
|
+
[IN_COLOURED_CARD]: {'--color-text-secondary': LIFTED_ON_COLOURED_CARD},
|
|
515
|
+
[IN_NESTED_COLOURED_CARD]: {
|
|
516
|
+
'--color-text-secondary': LIFTED_ON_COLOURED_CARD,
|
|
517
|
+
},
|
|
518
|
+
},
|
|
519
|
+
},
|
|
520
|
+
'tree-list-item': {
|
|
521
|
+
selected: {
|
|
522
|
+
'--color-text-secondary': LIFTED_ON_PAGE,
|
|
523
|
+
[IN_COLOURED_CARD]: {'--color-text-secondary': LIFTED_ON_COLOURED_CARD},
|
|
524
|
+
[IN_NESTED_COLOURED_CARD]: {
|
|
525
|
+
'--color-text-secondary': LIFTED_ON_COLOURED_CARD,
|
|
526
|
+
},
|
|
527
|
+
},
|
|
528
|
+
},
|
|
529
|
+
citation: {
|
|
530
|
+
'variant:number': {
|
|
531
|
+
'--color-text-secondary': LIFTED_ON_PAGE,
|
|
532
|
+
[IN_COLOURED_CARD]: {'--color-text-secondary': LIFTED_ON_COLOURED_CARD},
|
|
533
|
+
[IN_NESTED_COLOURED_CARD]: {
|
|
534
|
+
'--color-text-secondary': LIFTED_ON_COLOURED_CARD,
|
|
535
|
+
},
|
|
536
|
+
},
|
|
537
|
+
},
|
|
538
|
+
'file-input': {
|
|
539
|
+
'mode:dropzone': {
|
|
540
|
+
'--color-text-secondary': LIFTED_ON_PAGE,
|
|
541
|
+
},
|
|
542
|
+
},
|
|
364
543
|
// TopNav uses Butter's blue accent: the heading and the selected item are
|
|
365
544
|
// the full brand blue; unselected items (default + hover) use a lighter
|
|
366
545
|
// blue. Dark mode keeps the theme's butter-yellow accent.
|
|
@@ -484,48 +663,62 @@ export const butterTheme = defineTheme({
|
|
|
484
663
|
'--color-text-secondary': neutral.light[45],
|
|
485
664
|
},
|
|
486
665
|
'variant:blue': {
|
|
666
|
+
'--color-text-accent': accent.light[35],
|
|
487
667
|
'--color-text-primary': neutral.light[15],
|
|
488
668
|
'--color-text-secondary': neutral.light[45],
|
|
489
669
|
},
|
|
490
670
|
'variant:cyan': {
|
|
671
|
+
'--color-text-accent': accent.light[35],
|
|
491
672
|
'--color-text-primary': neutral.light[15],
|
|
492
673
|
'--color-text-secondary': neutral.light[45],
|
|
493
674
|
},
|
|
494
675
|
'variant:gray': {
|
|
676
|
+
'--color-text-accent': accent.light[35],
|
|
495
677
|
'--color-text-primary': neutral.light[15],
|
|
496
678
|
'--color-text-secondary': neutral.light[45],
|
|
497
679
|
},
|
|
498
680
|
'variant:green': {
|
|
681
|
+
'--color-text-accent': accent.light[35],
|
|
499
682
|
'--color-text-primary': neutral.light[15],
|
|
500
683
|
'--color-text-secondary': neutral.light[45],
|
|
501
684
|
},
|
|
502
685
|
'variant:orange': {
|
|
686
|
+
'--color-text-accent': accent.light[35],
|
|
503
687
|
'--color-text-primary': neutral.light[15],
|
|
504
688
|
'--color-text-secondary': neutral.light[45],
|
|
505
689
|
},
|
|
506
690
|
'variant:pink': {
|
|
691
|
+
'--color-text-accent': accent.light[35],
|
|
507
692
|
'--color-text-primary': neutral.light[15],
|
|
508
693
|
'--color-text-secondary': neutral.light[45],
|
|
509
694
|
},
|
|
510
695
|
'variant:purple': {
|
|
696
|
+
'--color-text-accent': accent.light[35],
|
|
511
697
|
'--color-text-primary': neutral.light[15],
|
|
512
698
|
'--color-text-secondary': neutral.light[45],
|
|
513
699
|
},
|
|
514
700
|
'variant:red': {
|
|
701
|
+
'--color-text-accent': accent.light[35],
|
|
515
702
|
'--color-text-primary': neutral.light[15],
|
|
516
703
|
'--color-text-secondary': neutral.light[45],
|
|
517
704
|
},
|
|
518
705
|
'variant:teal': {
|
|
706
|
+
'--color-text-accent': accent.light[35],
|
|
519
707
|
'--color-text-primary': neutral.light[15],
|
|
520
708
|
'--color-text-secondary': neutral.light[45],
|
|
521
709
|
},
|
|
522
710
|
'variant:yellow': {
|
|
711
|
+
'--color-text-accent': accent.light[35],
|
|
523
712
|
'--color-text-primary': neutral.light[15],
|
|
524
713
|
'--color-text-secondary': neutral.light[45],
|
|
525
714
|
},
|
|
715
|
+
// The muted fill turns dark in dark mode: its text follows the mode.
|
|
526
716
|
'variant:muted': {
|
|
527
|
-
'--color-text-primary': neutral.light[15],
|
|
528
|
-
'--color-text-secondary':
|
|
717
|
+
'--color-text-primary': lightDark(neutral.light[15], neutral.dark[90]),
|
|
718
|
+
'--color-text-secondary': lightDark(
|
|
719
|
+
neutral.light[45],
|
|
720
|
+
neutral.dark[70],
|
|
721
|
+
),
|
|
529
722
|
},
|
|
530
723
|
},
|
|
531
724
|
|
|
@@ -668,7 +861,7 @@ export const butterTheme = defineTheme({
|
|
|
668
861
|
fontFamily: 'Sarina, "Brush Script MT", "Snell Roundhand", cursive',
|
|
669
862
|
},
|
|
670
863
|
},
|
|
671
|
-
},
|
|
864
|
+
}),
|
|
672
865
|
|
|
673
866
|
icons: butterIconRegistry,
|
|
674
867
|
});
|