An open source design system that's fully customizable and agent ready
TypeScript
feat(themes): copy-a-theme flow on /themes + `astryx theme add` CLI (#3241)
rubyycheung627808d9229e
diff --git a/.changeset/theme-add-command.md b/.changeset/theme-add-command.mdnew file mode 100644index 0000000000..784db30943--- /dev/null+++ b/.changeset/theme-add-command.md@@ -0,0 +1,6 @@+---+'@astryxdesign/cli': patch+---++[feat] Add `astryx theme add <slug> [path]` (and `astryx theme list`) to scaffold a theme's source into your project as editable files you own, with theme sources bundled into the CLI+@rubyycheungdiff --git a/.changeset/theme-build-output-consistency.md b/.changeset/theme-build-output-consistency.mdnew file mode 100644index 0000000000..7d0aab8afc--- /dev/null+++ b/.changeset/theme-build-output-consistency.md@@ -0,0 +1,6 @@+---+'@astryxdesign/cli': patch+---++[fix] `astryx theme build` now derives every output file (.css/.js/.d.ts) from the theme name so they share one naming scheme, shows import paths as bare `./<name>` specifiers (instead of a cwd-rooted `./src/...` path that was wrong when your file already lives under src/), and no longer warns about the `variant` prop on `card`+@rubyycheungdiff --git a/.github/scripts/api-cli-parity-test.mjs b/.github/scripts/api-cli-parity-test.mjsindex b33b5be6a9..f1fbe5c8f5 100644--- a/.github/scripts/api-cli-parity-test.mjs+++ b/.github/scripts/api-cli-parity-test.mjs@@ -194,6 +194,14 @@ if (firstTemplate) {add('template nonexistent', ['template', 'nonexistent99'],() => apiCall(api.template, 'nonexistent99'));+// Theme add — list + error paths (read-only; never scaffolds files here).+add('theme list', ['theme', 'list'],+ () => apiCall(api.themeAdd, undefined, {list: true, cwd: ROOT}));+add('theme add --list', ['theme', 'add', '--list'],+ () => apiCall(api.themeAdd, undefined, {list: true, cwd: ROOT}));+add('theme add nonexistent', ['theme', 'add', 'nonexistent99'],+ () => apiCall(api.themeAdd, 'nonexistent99', {cwd: ROOT}));+// Hook — list variantsadd('hook --list', ['hook', '--list'],() => apiCall(api.hook, undefined, {list: true, cwd: ROOT}));diff --git a/apps/docsite/src/components/ThemeCommandBlock.module.css b/apps/docsite/src/components/ThemeCommandBlock.module.cssnew file mode 100644index 0000000000..3f90dcb527--- /dev/null+++ b/apps/docsite/src/components/ThemeCommandBlock.module.css@@ -0,0 +1,9 @@+/* Copyright (c) Meta Platforms, Inc. and affiliates. */++/* Neutralize the headerless CodeBlock copy button's negative margin so it+ isn't flush against the container's right edge. */+.commandBlock > button {+ margin-inline-end: 0;+ inset-inline-end: var(--spacing-3);+ inset-block-start: var(--spacing-2);+}diff --git a/apps/docsite/src/components/ThemeInstallBlock.tsx b/apps/docsite/src/components/ThemeInstallBlock.tsxdeleted file mode 100644index 810aa04c9b..0000000000--- a/apps/docsite/src/components/ThemeInstallBlock.tsx+++ /dev/null@@ -1,77 +0,0 @@-// Copyright (c) Meta Platforms, Inc. and affiliates.--'use client';--import {VStack} from '@astryxdesign/core/Layout';-import {Heading, Text} from '@astryxdesign/core/Text';-import {Link} from '@astryxdesign/core/Link';-import {Section} from '@astryxdesign/core/Section';-import {CodeExampleBlock} from './CodeExampleBlock';-import {packages} from '../generated/packageRegistry';--// Strip "Theme: " prefix and " Theme" suffix from the registered displayName-// so headings read as the brand wordmark ("Y2K") rather than "Theme: Y2K Theme".-function brandLabel(displayName: string): string {- return displayName.replace(/^Theme:\s*/, '').replace(/\s*Theme$/, '');-}--interface ThemeInstallBlockProps {- /** Full npm package name, e.g. `@astryxdesign/theme-y2k`. */- packageName: string;-}--/**- * "Use this theme" snippet shown below the themed preview on /themes —- * `npm install` + the matching import so visitors can copy both without- * leaving the page.- */-export function ThemeInstallBlock({packageName}: ThemeInstallBlockProps) {- const pkg = packages.find(p => p.name === packageName);- const themeLabel = pkg- ? brandLabel(pkg.displayName) || pkg.displayName- : '';- const slug = packageName.replace(/^@astryxdesign\/theme-/, '');- const importName = `${slug}Theme`;- const installCode = `npm install ${packageName}`;- const importCode = `import {Theme} from '@astryxdesign/core';-import {${importName}} from '${packageName}';--<Theme theme={${importName}}>{/* your app */}</Theme>`;-- return (- <Section>- <VStack gap={4}>- <VStack gap={1}>- <Heading level={2} type="display-3">- Use the {themeLabel} theme- </Heading>- <Text type="body" color="secondary">- Install the package, then wrap your app in {'<Theme>'}. See the{' '}- <Link- type="body"- color="secondary"- href="/docs/theme"- hasUnderline>- Theme System guide- </Link>{' '}- for SSR, light/dark mode, and customization.- </Text>- </VStack>- <CodeExampleBlock- code={installCode}- language="bash"- hasCopyButton- isWrapped- width="100%"- />- <CodeExampleBlock- code={importCode}- language="tsx"- hasCopyButton- isWrapped- width="100%"- />- </VStack>- </Section>- );-}diff --git a/apps/docsite/src/components/ThemePackagePage.tsx b/apps/docsite/src/components/ThemePackagePage.tsxindex dcd7825937..c12014df97 100644--- a/apps/docsite/src/components/ThemePackagePage.tsx+++ b/apps/docsite/src/components/ThemePackagePage.tsx@@ -15,6 +15,8 @@ import {Carousel} from '@astryxdesign/core/Carousel';import {Theme} from '@astryxdesign/core/theme';import type {DefinedTheme} from '@astryxdesign/core/theme';import {Button} from '@astryxdesign/core/Button';+import {CodeBlock} from '@astryxdesign/core/CodeBlock';+import {Popover} from '@astryxdesign/core/Popover';import {Link} from '@astryxdesign/core/Link';import {LinkProvider} from '@astryxdesign/core/Link';import {SelectableCard} from '@astryxdesign/core/SelectableCard';@@ -24,13 +26,13 @@ import {useMediaQuery} from '@astryxdesign/core/hooks';import {ThemeShowcaseStore} from '../../../../packages/cli/templates/pages/theme-showcase/page';import {getThemeShowcaseContent} from './themeShowcaseContent';import {buildPlaygroundHref} from './playgroundLink';-import {ThemeInstallBlock} from './ThemeInstallBlock';import {packages} from '../generated/packageRegistry';import {layout} from '../layout.stylex';import {themeObjects} from '../generated/themeRegistry';import {templates} from '../generated/templateRegistry';-import {trackOpenPlayground, trackToggle} from '../lib/analytics';+import {trackCopy, trackOpenPlayground, trackToggle} from '../lib/analytics';import {useThemeMode} from '../app/providers';+import commandBlockStyles from './ThemeCommandBlock.module.css';// Raw source of the theme-showcase page template (embedded as a string in// the generated template registry). Used to prepopulate the playground's@@ -65,6 +67,13 @@ const THEME_ORDER: ReadonlyArray<string> = [// server then strips on reload, etc.).const DEFAULT_THEME_PACKAGE = '@astryxdesign/theme-neutral';+// The CLI command that copies a theme into the consumer's project as+// editable source (see `astryx theme add`). The destination defaults to+// `src/themes/<slug>/`, so the bare command is copy-paste runnable.+function themeScaffoldCommand(slug: string): string {+ return `npx astryx theme add ${slug}`;+}+// Strip "Theme: " prefix and " Theme" suffix from the registered// displayName so the switcher labels read as the brand wordmark// ("Neutral", "Butter") rather than the redundant decorations.@@ -197,14 +206,29 @@ const styles = stylex.create({width: '100%',justifyContent: 'flex-start',},- // Hero primary CTA — sits on a flex row beside the icon-only- // mode toggle. flex:1 + minWidth:0 lets it absorb the leading- // horizontal space so the icon button stays pinned to the- // trailing edge regardless of label length.- heroPrimaryButton: {+ // The two stacked action buttons, full-width.+ actionButton: {+ width: '100%',+ },+ // Title row — heading takes the leading flex space (minWidth:0 lets it+ // shrink) so the icon-only mode toggle stays pinned to the trailing edge.+ titleRow: {+ width: '100%',+ },+ titleText: {flex: 1,minWidth: 0,},+ // The command snippet in the popover — CodeBlock with container="section"+ // (no border/radius of its own), so paint the muted inset here. The extra+ // inline-end padding keeps wrapping text clear of the absolutely-positioned+ // copy button (see ThemeCommandBlock.module.css).+ commandBlock: {+ width: '100%',+ borderRadius: 'var(--radius-element)',+ backgroundColor: 'var(--color-background-muted)',+ paddingInlineEnd: 'var(--spacing-5)',+ },// Themed theme-row card. The SelectableCard wrapper itself// stays variant="transparent" + padding=0 so it doesn't paint a// surface from the OUTER docsite theme; the inner themedSurface@@ -443,17 +467,14 @@ const styles = stylex.create({showcaseCard: {overflow: 'hidden',},- // Width cap + centering applied to the right column's main content- // blocks (showcase, install snippet, etc.) so they don't run- // edge-to-edge on very wide screens.- contentBlock: {+ // Caps the showcase at the site's wide-content width and centers it so+ // it doesn't run edge-to-edge on very wide screens. overflow:hidden+ // clips template content that exceeds the width on mobile (e.g.+ // inventory filter rows, tables) to the card's rounded corners.+ showcaseBlock: {width: '100%',maxWidth: layout.contentMaxWidth,marginInline: 'auto',- },- // Showcase-only: clips template content that overflows on mobile- // (inventory rows, tables) to the card's rounded corners.- showcaseClip: {overflow: 'hidden',borderRadius: 'var(--radius-container)',},@@ -465,7 +486,7 @@ const styles = stylex.create({[SIDEBAR_BREAKPOINT]: {display: 'flex',flexDirection: 'column' as const,- gap: 'var(--spacing-3)',+ gap: 'var(--spacing-5)',},},});@@ -512,35 +533,137 @@ const PICKER_OVERRIDES: Record<function ThemeHeading({align = 'start',isMobile = false,+ mode,+ onToggleMode,}: {align?: 'start' | 'center';isMobile?: boolean;+ /** Effective preview color mode — drives the toggle beside the title. */+ mode: 'light' | 'dark';+ /** Toggle the preview color mode. */+ onToggleMode: () => void;}) {const isCentered = align === 'center';+ const modeToggleLabel =+ mode === 'light'+ ? 'Switch preview to dark mode'+ : 'Switch preview to light mode';+ const modeToggleIcon =+ mode === 'light' ? <Moon size={16} /> : <Sun size={16} />;return (<VStack gap={2} hAlign={isCentered ? 'center' : undefined}>- {/* display-3 in the desktop sidebar (display-2 wraps in the 260px- column); display-2 in the narrow layout to match /templates and- /components. Driven by the same SIDEBAR_QUERY mobile check the rest- of the component uses, not a separate CSS breakpoint. */}- <Heading- level={1}- type={isMobile ? 'display-2' : 'display-3'}- justify={align}>- Themes- </Heading>- <Text- type="body"- color="secondary"- display={isCentered ? 'block' : 'inline'}- justify={align}>- Preview each theme, then start from one and make it your own.{' '}+ {/* Title row — heading takes the leading flex space so the icon-only+ mode toggle stays pinned to the trailing edge. display-3 in the+ 260px sidebar; display-2 in the narrow layout. */}+ <HStack gap={2} vAlign="center" xstyle={styles.titleRow}>+ <Heading+ level={1}+ type={isMobile ? 'display-2' : 'display-3'}+ justify={align}+ xstyle={styles.titleText}>+ Themes+ </Heading>+ <Button+ variant="ghost"+ size="lg"+ isIconOnly+ label={modeToggleLabel}+ tooltip={modeToggleLabel}+ icon={modeToggleIcon}+ onClick={onToggleMode}+ />+ </HStack>+ {/* Body + docs link on its own line below it. */}+ <VStack gap={1} hAlign={isCentered ? 'center' : undefined}>+ <Text type="body" color="secondary" justify={align}>+ Astryx comes with a default theme built in. To make it your own, copy+ any theme you see here into a theme file you own.+ </Text><Link type="body" color="secondary" href="/docs/theme" hasUnderline>Learn how theming works</Link>- .- </Text>+ </VStack>+ </VStack>+ );+}++interface ThemeActionsProps {+ selectedPkgName: string;+ /** Playground deep link for the selected theme + showcase source. */+ customizeHref: string;+}++// Shared action cluster for the desktop sidebar and the mobile context+// block. The primary action ("Use this theme") opens a popover with the+// CLI command that copies the theme into the consumer's project; "Try in+// Playground" is secondary. The preview mode toggle lives beside the page+// title (ThemeHeading), not here.+function ThemeActions({selectedPkgName, customizeHref}: ThemeActionsProps) {+ const slug = packageNameToSlug(selectedPkgName);+ const command = themeScaffoldCommand(slug);+ // Capitalize the slug for the popover copy — some theme packages have no+ // registered displayName, so the slug is lowercase (e.g. "matcha").+ const displayName = slug.charAt(0).toUpperCase() + slug.slice(1);++ return (+ <VStack gap={2} align="stretch">+ <Popover+ width={300}+ label="Use this theme"+ content={+ <VStack gap={2}>+ <Text type="body">+ Run this in a terminal in your project to add {displayName} as a+ theme file you can edit.+ </Text>+ <CodeBlock+ code={command}+ language="bash"+ size="sm"+ container="section"+ width="100%"+ isWrapped+ hasLanguageLabel={false}+ xstyle={styles.commandBlock}+ className={commandBlockStyles.commandBlock}+ onCopy={() => {+ trackCopy({+ page: 'themes',+ target: 'cli_command',+ item: selectedPkgName,+ });+ }}+ />+ </VStack>+ }>+ {/* Render-prop trigger: no inline-flex anchor wrapper, so the+ Button fills the column width as a direct flex child. */}+ {triggerProps => (+ <Button+ {...triggerProps}+ variant="primary"+ size="lg"+ label="Use this theme"+ xstyle={styles.actionButton}+ />+ )}+ </Popover>++ <Button+ variant="secondary"+ size="lg"+ label="Try in Playground"+ href={customizeHref}+ xstyle={styles.actionButton}+ onClick={() => {+ trackOpenPlayground({+ page: 'themes',+ item: selectedPkgName,+ source: 'theme-showcase',+ });+ }}+ /></VStack>);}@@ -675,6 +798,20 @@ export function ThemePackagePage({packageName, theme}: ThemePackagePageProps) {[themePackages],);+ // Mode toggle + analytics — used by the toggle beside the title+ // (ThemeHeading). The bare floating toolbar uses the untracked+ // handleToggleMode above.+ const handleToggleModeTracked = useCallback(() => {+ const next = mode === 'light' ? 'dark' : 'light';+ trackToggle({+ page: 'themes',+ target: 'mode',+ item: selectedPkgName,+ value: next,+ });+ setLocalMode(next);+ }, [mode, selectedPkgName]);+// Shared action cluster reused by both the sidebar (vertical// stack) and the mobile bar (inline row). Hoisted so the two// placements stay byte-identical — adding a button updates both.@@ -683,7 +820,7 @@ export function ThemePackagePage({packageName, theme}: ThemePackagePageProps) {? 'Switch preview to dark mode': 'Switch preview to light mode';const modeToggleIcon =- mode === 'light' ? <Moon size={20} /> : <Sun size={20} />;+ mode === 'light' ? <Moon size={16} /> : <Sun size={16} />;// Open in Playground destination: the main /playground seeded with// the theme-showcase template in the code editor (#code) and the@@ -714,47 +851,16 @@ export function ThemePackagePage({packageName, theme}: ThemePackagePageProps) {Heading is display-3 in this sidebar (display-2 wraps in the260px column); the narrow layout uses display-2 (see isMobile).CTAs stack full-width. */}- <VStack gap={3}>- <ThemeHeading isMobile={isMobile} />- {/* Action row — primary CTA takes the leading flex- space, mode toggle (icon-only) sits on the trailing- edge. Both belong here because they're page-level- preview controls; the theme list below stays a- pure picker. */}- <HStack gap={2} vAlign="center">- <Button- variant="primary"- size="lg"- label="Open in Playground"- href={customizeHref}- xstyle={styles.heroPrimaryButton}- onClick={() => {- trackOpenPlayground({- page: 'themes',- item: selectedPkgName,- source: 'theme-showcase',- });- }}- />- <Button- variant="ghost"- size="lg"- isIconOnly- label={modeToggleLabel}- tooltip={modeToggleLabel}- icon={modeToggleIcon}- onClick={() => {- const next = mode === 'light' ? 'dark' : 'light';- trackToggle({- page: 'themes',- target: 'mode',- item: selectedPkgName,- value: next,- });- setLocalMode(next);- }}- />- </HStack>+ <VStack gap={5}>+ <ThemeHeading+ isMobile={isMobile}+ mode={mode}+ onToggleMode={handleToggleModeTracked}+ />+ <ThemeActions+ selectedPkgName={selectedPkgName}+ customizeHref={customizeHref}+ /></VStack><Divider />@@ -870,41 +976,16 @@ export function ThemePackagePage({packageName, theme}: ThemePackagePageProps) {Mirrors the sidebar's hero: heading, description, andaction buttons (Open in Playground + mode toggle). */}<div {...stylex.props(styles.mobileContext)}>- <ThemeHeading align="center" isMobile={isMobile} />- <HStack gap={2} vAlign="center">- <Button- variant="primary"- size="lg"- label="Open in Playground"- href={customizeHref}- xstyle={styles.heroPrimaryButton}- onClick={() => {- trackOpenPlayground({- page: 'themes',- item: selectedPkgName,- source: 'theme-showcase',- });- }}- />- <Button- variant="ghost"- size="lg"- isIconOnly- label={modeToggleLabel}- tooltip={modeToggleLabel}- icon={modeToggleIcon}- onClick={() => {- const next = mode === 'light' ? 'dark' : 'light';- trackToggle({- page: 'themes',- target: 'mode',- item: selectedPkgName,- value: next,- });- setLocalMode(next);- }}- />- </HStack>+ <ThemeHeading+ align="center"+ isMobile={isMobile}+ mode={mode}+ onToggleMode={handleToggleModeTracked}+ />+ <ThemeActions+ selectedPkgName={selectedPkgName}+ customizeHref={customizeHref}+ /></div>{/* Mobile theme carousel — horizontal row of theme cards.@@ -975,7 +1056,7 @@ export function ThemePackagePage({packageName, theme}: ThemePackagePageProps) {own backgrounds (top nav, sections) to the card's radius.LinkProvider keeps demo href="#" clicks from scrolling thepage to the top (see PreviewAnchor). */}- <div {...stylex.props(styles.contentBlock, styles.showcaseClip)}>+ <div {...stylex.props(styles.showcaseBlock)}><Card padding={0} xstyle={styles.showcaseCard}><Theme theme={selectedTheme} mode={mode}><LinkProvider component={PreviewAnchor}>@@ -990,15 +1071,6 @@ export function ThemePackagePage({packageName, theme}: ThemePackagePageProps) {</Theme></Card></div>-- {/* Install block — inline "Use this theme" affordance with the- two-step install + import snippet. Sits BELOW the showcase- so the themed preview leads (it's the reason the visitor came- here); the install snippet acts as the natural next step- after they've decided they like what they see. */}- <div {...stylex.props(styles.contentBlock)}>- <ThemeInstallBlock packageName={selectedPkgName} />- </div></div></div>);diff --git a/package.json b/package.jsonindex d8db8a76bf..0551cc7f36 100644--- a/package.json+++ b/package.json@@ -4,7 +4,8 @@"private": true,"license": "MIT","scripts": {- "build": "pnpm -F @astryxdesign/build build && pnpm -F @astryxdesign/core build && pnpm -F @astryxdesign/vega build && pnpm -F @astryxdesign/theme-neutral build && pnpm -F @astryxdesign/theme-matcha build && pnpm -F @astryxdesign/theme-stone build && pnpm -F @astryxdesign/theme-gothic build && pnpm -F @astryxdesign/theme-chocolate build && pnpm -F @astryxdesign/theme-y2k build && pnpm -F @astryxdesign/theme-butter build",+ "build": "pnpm -F @astryxdesign/build build && pnpm -F @astryxdesign/core build && pnpm -F @astryxdesign/vega build && pnpm -F @astryxdesign/theme-neutral build && pnpm -F @astryxdesign/theme-matcha build && pnpm -F @astryxdesign/theme-stone build && pnpm -F @astryxdesign/theme-gothic build && pnpm -F @astryxdesign/theme-chocolate build && pnpm -F @astryxdesign/theme-y2k build && pnpm -F @astryxdesign/theme-butter build && pnpm bundle:cli-themes",+ "bundle:cli-themes": "node scripts/generate-cli-themes.mjs","dev": "pnpm -F @astryxdesign/storybook dev","test": "vitest run","test:watch": "vitest",diff --git a/packages/cli/src/api/index.mjs b/packages/cli/src/api/index.mjsindex fcf7da5120..170e71901d 100644--- a/packages/cli/src/api/index.mjs+++ b/packages/cli/src/api/index.mjs@@ -23,6 +23,7 @@ export {component} from './component.mjs';export {docs} from './docs.mjs';export {discover} from './discover.mjs';export {template} from './template.mjs';+export {themeAdd, listThemes} from './theme-add.mjs';export {hook} from './hook.mjs';export {search} from './search.mjs';export {doctor} from './doctor.mjs';diff --git a/packages/cli/src/api/theme-add.mjs b/packages/cli/src/api/theme-add.mjsnew file mode 100644index 0000000000..8d995e2d68--- /dev/null+++ b/packages/cli/src/api/theme-add.mjs@@ -0,0 +1,182 @@+// Copyright (c) Meta Platforms, Inc. and affiliates.++/**+ * @file Programmatic API for `astryx theme add` — copies a bundled theme's+ * source (`templates/themes/`, see scripts/generate-cli-themes.mjs) into the+ * consumer's project so they own it, without needing the theme package.+ */++import * as fs from 'node:fs';+import * as path from 'node:path';+import {CLI_ROOT} from '../utils/paths.mjs';+import {assertWithin, PathSafetyError} from '../utils/path-safety.mjs';+import {AstryxError} from './error.mjs';+import {ERROR_CODES} from '../lib/error-codes.mjs';++const THEMES_DIR = path.join(CLI_ROOT, 'templates', 'themes');+const MANIFEST_PATH = path.join(THEMES_DIR, 'manifest.json');++// Stripped from scaffolded files so the consumer's copy doesn't carry our+// repo boilerplate (mirrors the docsite). Preserves a leading BOM/shebang.+const META_COPYRIGHT_HEADER_RE =+ /^(\uFEFF?(?:#![^\r\n]*(?:\r?\n))?)\/\/ Copyright \(c\) Meta Platforms, Inc\. and affiliates\.\r?\n(?:\r?\n)*/;++function stripCopyrightHeader(source) {+ return source.replace(META_COPYRIGHT_HEADER_RE, '$1');+}++/** Parsed `themes` array from the bundle manifest (empty if not generated). */+export function listThemes() {+ if (!fs.existsSync(MANIFEST_PATH)) return [];+ let manifest;+ try {+ manifest = JSON.parse(fs.readFileSync(MANIFEST_PATH, 'utf-8'));+ } catch (err) {+ throw new AstryxError(+ `Theme bundle manifest is unreadable (${MANIFEST_PATH}): ${err.message}`,+ undefined,+ ERROR_CODES.ERR_NO_SOURCE,+ );+ }+ return Array.isArray(manifest.themes) ? manifest.themes : [];+}++function findTheme(slug) {+ if (!slug) return undefined;+ const lc = String(slug).toLowerCase();+ return listThemes().find(t => t.slug.toLowerCase() === lc);+}++function defaultTargetDir(slug) {+ return path.join('src', 'themes', slug);+}++/**+ * Resolve the scaffold plan for `theme add`. Returns the theme list when no+ * slug (or `list`); otherwise copies the theme's files into the destination+ * (defaults to `src/themes/<slug>/`).+ *+ * @param {string} [slug]+ * @param {{list?: boolean, targetPath?: string, overwrite?: boolean, cwd?: string}} [options]+ * @returns {Promise<{type: string, data: unknown}>}+ */+export async function themeAdd(slug, options = {}) {+ const {list = false, targetPath, overwrite = false, cwd = process.cwd()} =+ options;+ const themes = listThemes();++ if (list || !slug) {+ return {+ type: 'theme.list',+ data: themes.map(t => ({+ slug: t.slug,+ displayName: t.displayName,+ description: t.description,+ maintained: t.maintained,+ })),+ };+ }++ const match = findTheme(slug);+ if (!match) {+ throw new AstryxError(+ `Unknown theme "${slug}"`,+ themes.map(t => ({+ name: t.slug,+ reason: t.maintained ? 'maintained theme' : 'example theme',+ })),+ ERROR_CODES.ERR_UNKNOWN_THEME,+ );+ }++ const themeSrcDir = path.join(THEMES_DIR, match.slug);++ // Path-safe destination; reject traversal outside cwd.+ const rawTarget = targetPath || defaultTargetDir(match.slug);+ let resolvedDir;+ try {+ resolvedDir = assertWithin(rawTarget, cwd, {label: 'theme target path'});+ } catch (err) {+ if (err instanceof PathSafetyError) {+ throw new AstryxError(+ err.message,+ undefined,+ ERROR_CODES.ERR_PATH_TRAVERSAL,+ );+ }+ throw err;+ }++ const writes = match.files.map(name => ({+ name,+ src: path.join(themeSrcDir, name),+ dest: path.join(resolvedDir, name),+ }));+ for (const w of writes) {+ if (!fs.existsSync(w.src)) {+ throw new AstryxError(+ `Theme "${match.slug}" is missing bundled file "${w.name}". ` ++ `Re-run \`node scripts/generate-cli-themes.mjs\` to rebuild the bundle.`,+ undefined,+ ERROR_CODES.ERR_NO_SOURCE,+ );+ }+ }++ // Refuse to clobber unless --overwrite.+ if (!overwrite) {+ const existing = writes.find(w => fs.existsSync(w.dest));+ if (existing) {+ const rel = path.relative(cwd, existing.dest) || existing.dest;+ throw new AstryxError(+ `Refusing to overwrite existing file ${rel}. ` ++ `Re-run with --overwrite (or -f) to replace it.`,+ undefined,+ ERROR_CODES.ERR_FILE_EXISTS,+ );+ }+ }++ // Stage to temp files then rename, rolling back partials on failure so a+ // failed write never leaves a half-written theme.+ fs.mkdirSync(resolvedDir, {recursive: true});+ const staged = [];+ try {+ for (const w of writes) {+ const tmp = `${w.dest}.${process.pid}.tmp`;+ const contents = stripCopyrightHeader(fs.readFileSync(w.src, 'utf-8'));+ fs.writeFileSync(tmp, contents);+ staged.push({tmp, dest: w.dest});+ }+ for (const s of staged) {+ fs.renameSync(s.tmp, s.dest);+ }+ } catch (err) {+ for (const s of staged) {+ try {+ fs.rmSync(s.tmp, {force: true});+ } catch {+ /* best-effort */+ }+ }+ throw new AstryxError(+ `Failed to write theme files: ${err.message}`,+ undefined,+ ERROR_CODES.ERR_WRITE_FAILED,+ );+ }++ const relDir = path.relative(cwd, resolvedDir) || '.';+ return {+ type: 'theme.add',+ data: {+ slug: match.slug,+ displayName: match.displayName,+ maintained: match.maintained,+ outputDir: relDir,+ entry: match.entry,+ exportName: match.exportName,+ files: match.files,+ },+ };+}diff --git a/packages/cli/src/commands/build-theme.import-path.test.mjs b/packages/cli/src/commands/build-theme.import-path.test.mjsindex 20e327851a..4c7b364da8 100644--- a/packages/cli/src/commands/build-theme.import-path.test.mjs+++ b/packages/cli/src/commands/build-theme.import-path.test.mjs@@ -77,7 +77,7 @@ afterEach(() => {});describe('theme build install-instructions import path', () => {- it('emits ./<name> (no double slash) when out dir equals cwd', () => {+ it('emits bare ./<name> specifiers (no double slash) when out dir equals cwd', () => {// Source theme lives directly in the project root, so the output dir// is the cwd and the relative dir is an empty string.const project = path.join(tmpDir, 'project');@@ -97,7 +97,7 @@ describe('theme build install-instructions import path', () => {expect(result.stdout).toContain('href="./cwd-theme.css"');});- it('emits ./<sub>/<name> when out dir is a subdirectory of cwd', () => {+ it('keeps the subdir in the import path for a non-src subdirectory build', () => {const project = path.join(tmpDir, 'project');const themeFile = writeTheme(path.join(project, 'themes'), 'sub-theme');@@ -112,4 +112,24 @@ describe('theme build install-instructions import path', () => {expect(result.stdout).toContain("import './themes/sub-theme.css'");expect(result.stdout).toContain('href="./themes/sub-theme.css"');});++ it('strips a leading src/ from the import path (relative to a file in src/)', () => {+ const project = path.join(tmpDir, 'project');+ const themeFile = writeTheme(+ path.join(project, 'src', 'themes', 'ocean'),+ 'ocean',+ );++ const result = runCli(+ ['theme', 'build', path.relative(project, themeFile)],+ project,+ );++ expect(result.code).toBe(0);+ expect(result.stdout).not.toContain('.//');+ // The leading src/ is dropped, but themes/ocean/ is kept (people need it).+ expect(result.stdout).toContain("from './themes/ocean/ocean'");+ expect(result.stdout).toContain("import './themes/ocean/ocean.css'");+ expect(result.stdout).not.toContain('./src/');+ });});diff --git a/packages/cli/src/commands/build-theme.mjs b/packages/cli/src/commands/build-theme.mjsindex a19546dab8..d5c105d3d0 100644--- a/packages/cli/src/commands/build-theme.mjs+++ b/packages/cli/src/commands/build-theme.mjs@@ -17,10 +17,15 @@ import * as path from 'node:path';import {pathToFileURL, fileURLToPath} from 'node:url';import {createJiti} from 'jiti';import {getRunPrefix} from '../utils/package-manager.mjs';-import {sanitizeName, PathSafetyError} from '../utils/path-safety.mjs';+import {+ sanitizeName,+ PathSafetyError,+ isNonInteractive,+} from '../utils/path-safety.mjs';import {jsonOut, humanLog} from '../lib/json.mjs';import {cliError} from '../lib/cli-error.mjs';import {ERROR_CODES} from '../lib/error-codes.mjs';+import {themeAdd, listThemes} from '../api/theme-add.mjs';// Import shared theme processing from core. `astryx theme build` MUST produce the// exact same CSS as the `<Theme>` runtime, so it has exactly one generation@@ -75,6 +80,18 @@ function toIdentifier(name) {return name.replace(/-([a-z])/g, (_, c) => c.toUpperCase());}+/**+ * Import specifier for install/scaffold instructions. Drops a leading `src/`+ * from the cwd-relative dir (most consumers import from a file under src/) but+ * keeps the rest of the path (e.g. `themes/gothic`). Callers note the path is+ * relative to the consumer's file.+ */+function importSpecifier(relDir, base) {+ const normalized = relDir === '.' ? '' : relDir;+ const withinSrc = normalized.replace(/^src\/?/, '').replace(/\/+$/, '');+ return withinSrc ? `./${withinSrc}/${base}` : `./${base}`;+}+/*** Convert a kebab-case component name to PascalCase.* e.g. 'button' → 'Button', 'progress-bar' → 'ProgressBar', 'avatar-status-dot' → 'AvatarStatusDot'@@ -443,7 +460,7 @@ const KNOWN_COMPONENTS = {breadcrumbs: ['variant'],button: ['variant', 'size'],calendar: [],- card: [],+ card: ['variant'],center: [],checkboxinput: [],collapsible: [],@@ -737,10 +754,12 @@ export function registerTheme(program) {const sourceRelative = path.relative(process.cwd(), filePath);const buildCommand = `astryx theme build ${sourceRelative}${options.out ? ' --out ' + path.relative(process.cwd(), path.resolve(process.cwd(), options.out)) : ''}`;- // Determine output path+ // Derive the default CSS name from the theme name so .css/.js/.d.ts+ // share one scheme; an explicit --out still wins.+ const baseName = themeDef.name;const outPath = options.out? path.resolve(process.cwd(), options.out)- : filePath.replace(/\.(ts|tsx|js|jsx|mjs)$/, '.css');+ : path.join(path.dirname(filePath), `${baseName}.css`);const displayTheme = resolvedTheme || themeDef;const tokenCount = displayTheme.tokens ? Object.keys(displayTheme.tokens).length : 0;@@ -753,7 +772,6 @@ export function registerTheme(program) {// was left as orphaned half-built output. Stage-then-commit avoids// that.const outDir = path.dirname(outPath);- const baseName = themeDef.name;const jsPath = path.join(outDir, `${baseName}.js`);const dtsPath = path.join(outDir, `${baseName}.d.ts`);@@ -834,18 +852,16 @@ export function registerTheme(program) {});}- // Print install instructions- const relDir = path.relative(process.cwd(), outDir);- // When the output dir is the cwd, relDir is empty — avoid emitting a- // double-slash import path like './/<name>'. Build a './<relDir>/'- // prefix that collapses to './' when relDir is empty.- const importPrefix = relDir ? `./${relDir}/` : './';+ const relOutDir = path.relative(process.cwd(), outDir) || '.';+ const cssBase = path.basename(outPath, '.css');+ const jsImport = importSpecifier(relOutDir, baseName);+ const cssImport = importSpecifier(relOutDir, cssBase) + '.css';const exportName = `${toIdentifier(baseName)}Theme`;humanLog(`-Install in your app:+Install in your app (paths are relative to a file in src/ — adjust if yours lives elsewhere):- import { ${exportName} } from '${importPrefix}${baseName}';- import '${importPrefix}${baseName}.css';+ import { ${exportName} } from '${jsImport}';+ import '${cssImport}';<Theme theme={${exportName}}><App />@@ -853,9 +869,9 @@ Install in your app:Or with a <link> tag:- import { ${exportName} } from '${importPrefix}${baseName}';+ import { ${exportName} } from '${jsImport}';- <link rel="stylesheet" href="${importPrefix}${baseName}.css" />+ <link rel="stylesheet" href="${cssImport}" /><Theme theme={${exportName}}><App /></Theme>@@ -871,4 +887,157 @@ Or with a <link> tag:humanLog('');}});++ theme+ .command('list')+ .description('List themes available to add')+ .action(async () => {+ const json = program.opts().json || false;+ let result;+ try {+ result = await themeAdd(undefined, {list: true, cwd: process.cwd()});+ } catch (e) {+ cliError(e.message, {suggestions: e.suggestions || [], code: e.code});+ return;+ }++ if (json) return jsonOut(result.type, result.data);++ const themes = result.data;+ if (themes.length === 0) {+ humanLog('\nNo themes are bundled with this CLI build.\n');+ return;+ }+ humanLog('\nThemes:\n');+ for (const t of themes) {+ const tag = t.maintained ? ' (maintained)' : '';+ humanLog(` ${t.slug}${tag}`);+ if (t.description) humanLog(` ${t.description}`);+ }+ humanLog('\nUsage:');+ humanLog(' astryx theme add <slug> [target-path] Scaffold a theme file you own\n');+ });++ theme+ .command('add [slug] [path]')+ .description('Scaffold a theme into your project as editable source')+ .option('-f, --overwrite', 'Overwrite existing files without prompting')+ .option('--list', 'List available themes')+ .action(async (slug, targetPath, options) => {+ const json = program.opts().json || false;++ // Only prompt with a real TTY on stdin — a piped/redirected stdin would+ // make clack hang. Non-interactive callers fall through to the API's+ // ERR_FILE_EXISTS guard.+ const interactive =+ !json && !isNonInteractive({json}) && Boolean(process.stdin.isTTY);+ if (slug && !options.list && !options.overwrite && interactive) {+ const collision = await detectThemeCollision(slug, targetPath);+ if (collision) {+ const rel = path.relative(process.cwd(), collision) || collision;+ const p = await import('@clack/prompts');+ const confirmed = await p.confirm({+ message: `Overwrite existing file ${rel}?`,+ initialValue: false,+ });+ if (p.isCancel(confirmed)) {+ p.cancel('Cancelled.');+ return;+ }+ if (!confirmed) {+ humanLog('Aborted. Re-run with --overwrite to replace the file.');+ return;+ }+ options.overwrite = true;+ }+ }++ let result;+ try {+ result = await themeAdd(slug, {+ list: options.list,+ targetPath,+ overwrite: options.overwrite,+ cwd: process.cwd(),+ });+ } catch (e) {+ cliError(e.message, {suggestions: e.suggestions || [], code: e.code});+ return;+ }++ if (json) return jsonOut(result.type, result.data);++ if (result.type === 'theme.list') {+ const themes = result.data;+ humanLog('\nThemes:\n');+ for (const t of themes) {+ const tag = t.maintained ? ' (maintained)' : '';+ humanLog(` ${t.slug}${tag}`);+ if (t.description) humanLog(` ${t.description}`);+ }+ humanLog('\nUsage:');+ humanLog(' astryx theme add <slug> [target-path] Scaffold a theme file you own\n');+ return;+ }++ // theme.add — print where files landed + how to use the theme.+ const {displayName, outputDir, entry, exportName, files} = result.data;+ humanLog(`\n✓ Added ${displayName} theme to ${outputDir}/`);+ for (const f of files) {+ humanLog(` ${outputDir}/${f}`);+ }+ const entryModule = importSpecifier(+ outputDir,+ entry.replace(/\.tsx?$/, ''),+ );+ humanLog(`+Use it in your app (import path is relative to a file in src/ — adjust if yours lives elsewhere):++ import { ${exportName} } from '${entryModule}';++ <Theme theme={${exportName}}>+ <App />+ </Theme>++This is your copy of the ${displayName} theme — edit ${entry} to make it your own.+`);+ });+}++/**+ * First existing file that scaffolding <slug> into <targetPath> would clobber,+ * or null. Used to prompt before invoking the API; the API re-validates and+ * owns any authoritative error.+ *+ * @param {string} slug+ * @param {string} [targetPath]+ * @returns {Promise<string|null>}+ */+async function detectThemeCollision(slug, targetPath) {+ let themes;+ try {+ themes = listThemes();+ } catch {+ return null;+ }+ const match = themes.find(t => t.slug.toLowerCase() === slug.toLowerCase());+ if (!match) return null;++ const rawTarget = targetPath || path.join('src', 'themes', match.slug);+ let resolvedDir;+ try {+ // Fail soft (null) on traversal; the API surfaces the real error.+ const {assertWithin} = await import('../utils/path-safety.mjs');+ resolvedDir = assertWithin(rawTarget, process.cwd(), {+ label: 'theme target path',+ });+ } catch {+ return null;+ }++ for (const name of match.files) {+ const dest = path.join(resolvedDir, name);+ if (fs.existsSync(dest)) return dest;+ }+ return null;}diff --git a/packages/cli/src/index.mjs b/packages/cli/src/index.mjsindex 748ce45c08..7334504b35 100644--- a/packages/cli/src/index.mjs+++ b/packages/cli/src/index.mjs@@ -59,6 +59,8 @@ export const JSON_SUPPORTED = new Set(['template','hook','theme build',+ 'theme list',+ 'theme add','gap-report','upgrade','manifest',diff --git a/packages/cli/src/lib/error-codes.mjs b/packages/cli/src/lib/error-codes.mjsindex d765661e2f..e884a1d84b 100644--- a/packages/cli/src/lib/error-codes.mjs+++ b/packages/cli/src/lib/error-codes.mjs@@ -52,6 +52,7 @@* | 'ERR_UNKNOWN_SECTION'* | 'ERR_UNKNOWN_CATEGORY'* | 'ERR_UNKNOWN_TEMPLATE'+ * | 'ERR_UNKNOWN_THEME'* | 'ERR_UNKNOWN_PACKAGE'* | 'ERR_UNKNOWN_AGENT'* | 'ERR_UNKNOWN_FEATURE'@@ -124,6 +125,8 @@ export const ERROR_CODES = Object.freeze({ERR_UNKNOWN_CATEGORY: 'ERR_UNKNOWN_CATEGORY',/** No template matched the requested name. */ERR_UNKNOWN_TEMPLATE: 'ERR_UNKNOWN_TEMPLATE',+ /** No theme matched the requested slug (theme add). */+ ERR_UNKNOWN_THEME: 'ERR_UNKNOWN_THEME',/** No package matched the requested name (discover). */ERR_UNKNOWN_PACKAGE: 'ERR_UNKNOWN_PACKAGE',/** An unrecognized `--agent` value was passed to agent-docs/init. */diff --git a/packages/cli/src/lib/manifest.mjs b/packages/cli/src/lib/manifest.mjsindex 728cb49426..3f20411a53 100644--- a/packages/cli/src/lib/manifest.mjs+++ b/packages/cli/src/lib/manifest.mjs@@ -60,6 +60,8 @@ export const RESPONSE_TYPES = {],hook: ['hook.list', 'hook.brief', 'hook.full', 'hook.detail', 'hook.detail.params'],'theme build': ['theme.build'],+ 'theme list': ['theme.list'],+ 'theme add': ['theme.list', 'theme.add'],upgrade: ['upgrade.list', 'upgrade.status', 'upgrade.run'],'gap-report': ['gap-report.categories', 'gap-report.dryRun', 'gap-report.file'],manifest: ['manifest'],@@ -82,6 +84,8 @@ const EXAMPLES = {template: ['astryx template --json', 'astryx template dashboard ./src/app'],hook: ['astryx hook', 'astryx hook useToggle --json'],'theme build': ['astryx theme build ./src/themes/ocean.ts --out ./dist/ocean.css'],+ 'theme list': ['astryx theme list --json'],+ 'theme add': ['astryx theme add matcha', 'astryx theme add matcha ./src/themes/matcha'],upgrade: ['astryx upgrade --json'],manifest: ['astryx manifest --json', 'astryx --json'],doctor: ['astryx doctor', 'astryx doctor --json'],diff --git a/packages/cli/templates/themes/butter/butterTheme.ts b/packages/cli/templates/themes/butter/butterTheme.tsnew file mode 100644index 0000000000..81fb94e4de--- /dev/null+++ b/packages/cli/templates/themes/butter/butterTheme.ts@@ -0,0 +1,916 @@+// Copyright (c) Meta Platforms, Inc. and affiliates.++/**+ * Butter Theme+ *+ * Warm, golden buttery theme with blue accents.+ * Sarina for display, Outfit for headings and body.+ *+ * Source palette (per design):+ * Accent #225BFF Gray #868B99 Red #FF7553+ * Orange #FFA347 Yellow #fdee8c Green #5DCE5F+ * Cyan #60CFD3 Teal #6CD9A8 Blue #5681FF+ * Purple #B780F6 Pink #F680E8 Error #FF5947+ * Warning #F8C726 Success #91D143+ *+ * All tonal ramps derived in CIELab (matches the algorithm used by+ * ThemePalettePreview so card / badge / banner / strip render the+ * same values). Regen via scripts/butter-palette-gen.mjs if sources+ * change.+ */++import {defineTheme, defineSyntaxTheme} from '@astryxdesign/core/theme';+import {butterIconRegistry} from './icons';++/** Butter syntax palette — T25 / T80 of each color's ramp. */+const butterSyntax = defineSyntaxTheme({+ name: 'xds-butter',+ tokens: {+ keyword: ['#52237b', '#ddb9f6'], // Purple+ string: ['#004800', '#a5d29d'], // Green+ comment: ['#605f52', '#adac9e'],+ number: ['#622e00', '#f2bd81'], // Orange+ function: ['#203a6c', '#bdc5eb'], // Blue+ type: ['#52237b', '#ddb9f6'], // Purple+ variable: ['#605f52', '#adac9e'],+ operator: ['#605f52', '#adac9e'],+ constant: ['#622e00', '#f2bd81'],+ tag: ['#6d211c', '#f4b8ae'], // Red+ attribute: ['#413e00', '#d6c957'], // Yellow+ property: ['#00482d', '#94d3bb'], // Teal+ punctuation: ['#605f52', '#adac9e'],+ background: ['#FDFBE4', '#131107'],+ },+});++export const butterTheme = defineTheme({+ name: 'butter',++ typography: {+ scale: {base: 14, ratio: 1.25},+ body: {+ family: 'Outfit',+ fallbacks:+ '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif',+ },+ heading: {+ family: 'Outfit',+ fallbacks:+ '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif',+ weights: {3: 'bold', 4: 'bold'},+ },+ code: {+ family: 'JetBrains Mono',+ fallbacks: '"SF Mono", Monaco, Consolas, monospace',+ },+ },++ motion: {fast: 125, medium: 300, slow: 700, ratio: 0.75},++ syntax: butterSyntax,++ tokens: {+ // =========================================================================+ // Core semantic — accent is the exact brand #225BFF+ // =========================================================================+ '--color-accent': ['#225BFF', '#FDEE8C'],+ '--color-accent-muted': ['#225BFF33', '#FDEE8C40'],+ '--color-neutral': ['#1d1c110F', '#f3f2e21A'],+ '--color-background-surface': ['#FFFFFF', '#2E2117'],+ '--color-background-body': ['#FDFBE4', '#261A13'],+ '--color-overlay': ['#1d1c1180', '#261A13cc'],+ '--color-overlay-hover': ['#1d1c110D', '#f3f2e20D'],+ '--color-overlay-pressed': ['#1d1c111A', '#f3f2e21A'],+ '--color-background-muted': ['#f3f2e2', '#3A2A1F'],++ // Text — warm neutral+ '--color-text-primary': ['#1d1c11', '#f3f2e2'],+ '--color-text-secondary': ['#605f52', '#adac9e'],+ '--color-text-disabled': ['#adac9e', '#605f52'],+ '--color-text-accent': ['#225BFF', '#FDEE8C'],+ '--color-on-dark': '#ffffff',+ '--color-on-light': '#1d1c11',+ '--color-on-accent': ['#ffffff', '#1d1c11'],+ // T95 of each ramp for use on the vivid semantic surfaces.+ '--color-on-success': ['#ccff88', '#0b2e00'],+ '--color-on-error': ['#ffe3de', '#600000'],+ '--color-on-warning': ['#ffeec3', '#3b2200'],++ // Icon+ '--color-icon-accent': ['#225BFF', '#FDEE8C'],+ '--color-icon-primary': ['#1d1c11', '#f3f2e2'],+ '--color-icon-secondary': ['#605f52', '#adac9e'],+ '--color-icon-disabled': ['#adac9e', '#605f52'],++ // Surface variants+ '--color-background-card': ['#FFFFFF', '#3A2A1F'],+ '--color-background-popover': ['#FFFFFF', '#3A2A1F'],+ '--color-background-inverted': ['#1d1c11', '#FDFBE4'],++ // Status semantics — T25 light / T80 dark from each status palette.+ '--color-error': ['#771210', '#ffb4a6'],+ '--color-error-muted': ['#77121033', '#ffb4a640'],+ '--color-warning': ['#543700', '#f7be00'],+ '--color-warning-muted': ['#54370033', '#f7be0040'],+ '--color-success': ['#004700', '#99d94b'],+ '--color-success-muted': ['#00470033', '#99d94b40'],++ // Border — softer taupe card outline (emphasized) in light mode.+ '--color-border': ['#e5e3d4', '#f3f2e21A'],+ '--color-border-emphasized': ['#C7C4B2', '#939184'],++ // Effects+ '--color-skeleton': ['#e5e3d4', '#49473b'],+ '--color-shadow': ['#1d1c111A', '#0000004D'],+ '--color-tint-hover': ['black', 'white'],++ // Typography override+ '--text-supporting-size': '12px',++ // Element sizes — slightly taller defaults so the new input padding+ // (--spacing-2 block) has room to breathe.+ '--size-element-sm': '32px',+ '--size-element-md': '40px',+ '--size-element-lg': '48px',++ // =========================================================================+ // Categorical — same values in light and dark mode (curated dark mode+ // keeps the same pastel backgrounds + dark text as light mode).+ // =========================================================================++ // Blue+ '--color-background-blue': ['#dbe1ff', '#dbe1ff'],+ '--color-border-blue': ['#bdc5eb', '#bdc5eb'],+ '--color-icon-blue': ['#203a6c', '#203a6c'],+ '--color-text-blue': ['#203a6c', '#203a6c'],++ // Cyan+ '--color-background-cyan': ['#a9eff0', '#a9eff0'],+ '--color-border-cyan': ['#8dd2d3', '#8dd2d3'],+ '--color-icon-cyan': ['#004649', '#004649'],+ '--color-text-cyan': ['#004649', '#004649'],++ // Gray (uses the neutral palette)+ '--color-background-gray': ['#f0edd4', '#f0edd4'],+ '--color-border-gray': ['#d6d3b8', '#d6d3b8'],+ '--color-icon-gray': ['#4a4732', '#4a4732'],+ '--color-text-gray': ['#4a4732', '#4a4732'],++ // Green+ '--color-background-green': ['#c1efb8', '#c1efb8'],+ '--color-border-green': ['#a5d29d', '#a5d29d'],+ '--color-icon-green': ['#004800', '#004800'],+ '--color-text-green': ['#004800', '#004800'],++ // Orange+ '--color-background-orange': ['#ffdcb6', '#ffdcb6'],+ '--color-border-orange': ['#f2bd81', '#f2bd81'],+ '--color-icon-orange': ['#622e00', '#622e00'],+ '--color-text-orange': ['#622e00', '#622e00'],++ // Pink+ '--color-background-pink': ['#ffd5fb', '#ffd5fb'],+ '--color-border-pink': ['#f0b3e8', '#f0b3e8'],+ '--color-icon-pink': ['#6c0a68', '#6c0a68'],+ '--color-text-pink': ['#6c0a68', '#6c0a68'],++ // Purple+ '--color-background-purple': ['#f2daff', '#f2daff'],+ '--color-border-purple': ['#ddb9f6', '#ddb9f6'],+ '--color-icon-purple': ['#52237b', '#52237b'],+ '--color-text-purple': ['#52237b', '#52237b'],++ // Red+ '--color-background-red': ['#ffdad3', '#ffdad3'],+ '--color-border-red': ['#f4b8ae', '#f4b8ae'],+ '--color-icon-red': ['#6d211c', '#6d211c'],+ '--color-text-red': ['#6d211c', '#6d211c'],++ // Teal+ '--color-background-teal': ['#b0f0d7', '#b0f0d7'],+ '--color-border-teal': ['#94d3bb', '#94d3bb'],+ '--color-icon-teal': ['#00482d', '#00482d'],+ '--color-text-teal': ['#00482d', '#00482d'],++ // Yellow+ '--color-background-yellow': ['#feee7b', '#feee7b'],+ '--color-border-yellow': ['#d6c957', '#d6c957'],+ '--color-icon-yellow': ['#413e00', '#413e00'],+ '--color-text-yellow': ['#413e00', '#413e00'],++ // =========================================================================+ // Radius+ // --radius-element drives buttons, badges, inputs — 8px per design+ // --radius-container drives cards, banners, popovers — 12px per design+ // =========================================================================+ '--radius-none': '0.125rem',+ '--radius-inner': '0.375rem',+ '--radius-element': '0.5rem', // 8px+ '--radius-container': '0.75rem', // 12px+ '--radius-page': '1.5rem',+ '--radius-full': '9999px',++ // =========================================================================+ // Shadows — warm neutral tint+ // =========================================================================+ '--shadow-low': '0 2px 4px #1d1c110D, 0 4px 8px #1d1c111A',+ '--shadow-med': '0 2px 4px #1d1c110D, 0 4px 12px #1d1c111A',+ '--shadow-high': '0 4px 6px #1d1c111A, 0 12px 24px #1d1c1126',+ '--shadow-inset-hover': 'inset 0px 0px 0px 2px #79786a30',+ '--shadow-inset-selected': 'inset 0px 0px 0px 2px #79786a50',+ '--shadow-inset-success': 'inset 0px 0px 0px 2px #00470030',+ '--shadow-inset-warning': 'inset 0px 0px 0px 2px #54370030',+ '--shadow-inset-error': 'inset 0px 0px 0px 2px #77121030',+ },++ components: {+ // TopNav uses Butter's blue accent: the heading and the selected item are+ // the full brand blue; unselected items (default + hover) use a lighter+ // blue. Dark mode keeps the theme's butter-yellow accent.+ 'top-nav-heading': {+ // The heading text is an inner span that reads --color-text-primary, so+ // redirect that token (not just `color`) to the brand blue so the text+ // itself turns blue, not only the container.+ base: {+ color: 'light-dark(#225BFF, #FDEE8C)',+ '--color-text-primary': 'light-dark(#225BFF, #FDEE8C)',+ },+ },+ 'top-nav-item': {+ base: {+ color: 'light-dark(#6E92FF, #FDEE8CCC)',+ },+ // Selected item: full brand blue, no pill background — rely on weight ++ // color for emphasis. Hover/active keep the neutral overlay.+ selected: {+ color: 'light-dark(#225BFF, #FDEE8C)',+ backgroundColor: 'transparent',+ ':hover': {+ backgroundColor: 'var(--color-overlay-hover)',+ },+ ':active': {+ backgroundColor: 'var(--color-overlay-pressed)',+ },+ },+ },+ button: {+ // Radius intentionally not pinned, so buttons keep core's+ // `var(--_button-radius, --radius-element)`: standalone buttons stay 8px,+ // while the chat composer (which sets --_button-radius) rounds them fully.+ base: {+ paddingBlock: 'var(--spacing-3)',+ paddingInline: 'var(--spacing-4)',+ },+ // Secondary: blue outline + label in light, butter yellow in dark.+ 'variant:secondary': {+ backgroundColor: 'transparent',+ borderWidth: '1.5px',+ borderStyle: 'solid',+ borderColor: 'light-dark(#225BFF, #FDEE8C)',+ color: 'light-dark(#225BFF, #FDEE8C)',+ ':hover': {+ backgroundColor: 'light-dark(#225BFF14, #FDEE8C14)',+ },+ },+ // Ghost: same accent color as secondary, no background.+ 'variant:ghost': {+ color: 'light-dark(#225BFF, #FDEE8C)',+ },+ 'variant:destructive': {+ backgroundColor: 'light-dark(#ffdad3, #f4b8ae)',+ color: 'light-dark(#550000, #6d211c)',+ },+ },++ badge: {+ // Match astryx/daily badge sizing: 30px tall with 12px horizontal pad.+ // Use explicit values because butter inherits the standard spacing+ // scale (where --spacing-3 = 12px), unlike astryx which redefines it.+ base: {+ height: '30px',+ paddingBlock: '0',+ paddingInline: 'var(--spacing-3)',+ },+ // Vivid semantic badges — pinned to the brand colors from the spec.+ // Info uses the Blue palette source (NOT the brand accent #225BFF).+ 'variant:info': {+ backgroundColor: '#4883fd',+ color: '#ffffff',+ },+ 'variant:neutral': {+ backgroundColor: '#ffee7b',+ color: '#225BFF',+ },+ 'variant:success': {+ backgroundColor: '#91D143',+ color: '#1d1c11',+ },+ 'variant:warning': {+ backgroundColor: '#ffc502',+ color: '#1d1c11',+ },+ 'variant:error': {+ backgroundColor: '#fc473b',+ color: '#ffffff',+ },+ },++ // Banner backgrounds match the semantic badge fills.+ // Banner status colors — override the muted tokens locally so the+ // header (which reads --color-*-muted via StyleX) renders vivid fills+ // matching the badge palette. Scoped to the banner root, doesn't leak.+ banner: {+ 'status:info': {+ '--color-accent-muted': '#4883fd',+ '--color-text-primary': '#ffffff',+ '--color-text-secondary': '#ffffff',+ '--color-accent': '#ffffff',+ },+ 'status:success': {+ '--color-success-muted': '#91D143',+ '--color-text-primary': '#1d1c11',+ '--color-text-secondary': '#1d1c11',+ '--color-success': '#1d1c11',+ },+ 'status:warning': {+ '--color-warning-muted': '#ffc502',+ '--color-text-primary': '#1d1c11',+ '--color-text-secondary': '#1d1c11',+ '--color-warning': '#1d1c11',+ },+ 'status:error': {+ '--color-error-muted': '#fc473b',+ '--color-text-primary': '#ffffff',+ '--color-text-secondary': '#ffffff',+ '--color-error': '#ffffff',+ },+ },++ card: {+ base: {+ borderRadius: 'var(--radius-container)',+ padding: 'var(--spacing-4)',+ },+ 'variant:info': {+ '--color-text-primary': '#1d1c11',+ '--color-text-secondary': '#605f52',+ },+ 'variant:success': {+ '--color-text-primary': '#1d1c11',+ '--color-text-secondary': '#605f52',+ },+ 'variant:warning': {+ '--color-text-primary': '#1d1c11',+ '--color-text-secondary': '#605f52',+ },+ 'variant:error': {+ '--color-text-primary': '#1d1c11',+ '--color-text-secondary': '#605f52',+ },+ 'variant:blue': {+ '--color-text-primary': '#1d1c11',+ '--color-text-secondary': '#605f52',+ },+ 'variant:cyan': {+ '--color-text-primary': '#1d1c11',+ '--color-text-secondary': '#605f52',+ },+ 'variant:gray': {+ '--color-text-primary': '#1d1c11',+ '--color-text-secondary': '#605f52',+ },+ 'variant:green': {+ '--color-text-primary': '#1d1c11',+ '--color-text-secondary': '#605f52',+ },+ 'variant:orange': {+ '--color-text-primary': '#1d1c11',+ '--color-text-secondary': '#605f52',+ },+ 'variant:pink': {+ '--color-text-primary': '#1d1c11',+ '--color-text-secondary': '#605f52',+ },+ 'variant:purple': {+ '--color-text-primary': '#1d1c11',+ '--color-text-secondary': '#605f52',+ },+ 'variant:red': {+ '--color-text-primary': '#1d1c11',+ '--color-text-secondary': '#605f52',+ },+ 'variant:teal': {+ '--color-text-primary': '#1d1c11',+ '--color-text-secondary': '#605f52',+ },+ 'variant:yellow': {+ '--color-text-primary': '#1d1c11',+ '--color-text-secondary': '#605f52',+ },+ 'variant:muted': {+ '--color-text-primary': '#1d1c11',+ '--color-text-secondary': '#605f52',+ },+ },++ section: {+ base: {+ padding: 'var(--spacing-4)',+ },+ },++ // Progress bar — white track in light, warm brown in dark. Vivid+ // semantic fills match the banner colors (Success / Warning / Error).+ 'progressbar-track': {+ base: {+ backgroundColor: 'light-dark(#e5e3d4, #725538)',+ },+ },+ 'progressbar-fill': {+ 'variant:success': {+ backgroundColor: '#91D143',+ },+ 'variant:warning': {+ backgroundColor: '#ffc502',+ },+ 'variant:error': {+ backgroundColor: '#fc473b',+ },+ },++ // Field status bubble — match the corresponding banner colors so the+ // helper text below an input reads as the same "this is a warning /+ // error / success" surface as the standalone banner.+ 'field-status': {+ 'type:success': {+ backgroundColor: '#91D143',+ color: '#1d1c11',+ },+ 'type:warning': {+ backgroundColor: '#ffc502',+ color: '#1d1c11',+ },+ 'type:error': {+ backgroundColor: '#fc473b',+ color: '#ffffff',+ },+ },++ // Inputs — softer border than default, more vertical breathing room.+ // Status modifiers also remap the semantic tokens locally so the+ // status icon + border read as the same vivid hue as the banner+ // (icons inherit from --color-{success,warning,error}).+ 'text-input': {+ base: {+ paddingBlock: 'var(--spacing-2)',+ paddingInline: 'var(--spacing-3)',+ borderColor: 'var(--color-border)',+ },+ 'status:success': {'--color-success': '#91D143'},+ 'status:warning': {'--color-warning': '#ffc502'},+ 'status:error': {'--color-error': '#fc473b'},+ },+ textarea: {+ base: {+ paddingBlock: 'var(--spacing-2)',+ paddingInline: 'var(--spacing-3)',+ borderColor: 'var(--color-border)',+ },+ 'status:success': {'--color-success': '#91D143'},+ 'status:warning': {'--color-warning': '#ffc502'},+ 'status:error': {'--color-error': '#fc473b'},+ },+ 'number-input': {+ base: {+ paddingBlock: 'var(--spacing-2)',+ paddingInline: 'var(--spacing-3)',+ borderColor: 'var(--color-border)',+ },+ 'status:success': {'--color-success': '#91D143'},+ 'status:warning': {'--color-warning': '#ffc502'},+ 'status:error': {'--color-error': '#fc473b'},+ },+ 'date-input': {+ base: {+ paddingBlock: 'var(--spacing-2)',+ paddingInline: 'var(--spacing-3)',+ borderColor: 'var(--color-border)',+ },+ 'status:success': {'--color-success': '#91D143'},+ 'status:warning': {'--color-warning': '#ffc502'},+ 'status:error': {'--color-error': '#fc473b'},+ },+ 'time-input': {+ base: {+ paddingBlock: 'var(--spacing-2)',+ paddingInline: 'var(--spacing-3)',+ borderColor: 'var(--color-border)',+ },+ 'status:success': {'--color-success': '#91D143'},+ 'status:warning': {'--color-warning': '#ffc502'},+ 'status:error': {'--color-error': '#fc473b'},+ },+ selector: {+ base: {+ paddingBlock: 'var(--spacing-2)',+ paddingInline: 'var(--spacing-3)',+ borderColor: 'var(--color-border)',+ },+ 'status:success': {'--color-success': '#91D143'},+ 'status:warning': {'--color-warning': '#ffc502'},+ 'status:error': {'--color-error': '#fc473b'},+ },+ 'multi-selector': {+ base: {+ paddingBlock: 'var(--spacing-2)',+ paddingInline: 'var(--spacing-3)',+ borderColor: 'var(--color-border)',+ },+ 'status:success': {'--color-success': '#91D143'},+ 'status:warning': {'--color-warning': '#ffc502'},+ 'status:error': {'--color-error': '#fc473b'},+ },+ typeahead: {+ base: {+ paddingBlock: 'var(--spacing-2)',+ paddingInline: 'var(--spacing-3)',+ borderColor: 'var(--color-border)',+ },+ 'status:success': {'--color-success': '#91D143'},+ 'status:warning': {'--color-warning': '#ffc502'},+ 'status:error': {'--color-error': '#fc473b'},+ },+ tokenizer: {+ base: {+ paddingBlock: 'var(--spacing-2)',+ paddingInline: 'var(--spacing-3)',+ borderColor: 'var(--color-border)',+ },+ 'status:success': {'--color-success': '#91D143'},+ 'status:warning': {'--color-warning': '#ffc502'},+ 'status:error': {'--color-error': '#fc473b'},+ },++ // Display sizes use Sarina — the signature buttery display+ // cursive, reserved for hero/marketing-scale text only.+ // Headings (h1–h6) and body still use Outfit (configured above+ // under typography.heading / typography.body). Same pattern+ // Gothic uses for its Manufacturing Consent display family.+ text: {+ 'type:display-1': {+ fontFamily: 'Sarina, "Brush Script MT", "Snell Roundhand", cursive',+ },+ 'type:display-2': {+ fontFamily: 'Sarina, "Brush Script MT", "Snell Roundhand", cursive',+ },+ 'type:display-3': {+ fontFamily: 'Sarina, "Brush Script MT", "Snell Roundhand", cursive',+ },+ },+ },++ icons: butterIconRegistry,+});++/**+ * Raw tonal palettes — generated from design-spec source hexes via the+ * same CIELab algorithm `ThemePalettePreview` uses for the displayed+ * strip, so the rendered ramp and the consumed token values are 1:1.+ *+ * Source colors:+ * accent #225BFF neutral #868B99+ * red #ffc3b8 orange #ffc98d yellow #feee7b+ * green #bdebb4 cyan #abf1f1 teal #aeefd6+ * blue #cdd5fc purple #e6c2ff pink #fec0f5+ * error #fc473b warning #ffc502 success #91D143+ *+ * Categorical sources are the pastel pill hexes from the design spec so+ * each ramp's T85 lands directly on the card / badge background color.+ * Semantic sources are vivid so the ramp anchors near the badge fill.+ *+ * Regenerate with: node packages/themes/butter/scripts/generate-palettes.mjs+ */+export const butterPalettes = {+ blue: {+ 0: '#000000',+ 5: '#001041',+ 10: '#001b4c',+ 15: '#002558',+ 20: '#062f63',+ 25: '#203a6c',+ 30: '#324575',+ 35: '#41517d',+ 40: '#505d86',+ 45: '#5f698f',+ 50: '#6d7698',+ 55: '#7a82a6',+ 60: '#878fb3',+ 65: '#949cc1',+ 70: '#a2aacf',+ 75: '#afb7dd',+ 80: '#bdc5eb',+ 85: '#cbd3f9',+ 90: '#dbe1ff',+ 95: '#edf0ff',+ 100: '#ffffff',+ },+ cyan: {+ 0: '#000000',+ 5: '#001d1e',+ 10: '#00262a',+ 15: '#003034',+ 20: '#003a3e',+ 25: '#004649',+ 30: '#005255',+ 35: '#005e61',+ 40: '#006a6d',+ 45: '#1f7678',+ 50: '#3c8183',+ 55: '#4a8e90',+ 60: '#579c9d',+ 65: '#65a9aa',+ 70: '#72b7b8',+ 75: '#80c4c5',+ 80: '#8dd2d3',+ 85: '#9be0e1',+ 90: '#a9eff0',+ 95: '#b7fdfe',+ 100: '#ffffff',+ },+ green: {+ 0: '#000000',+ 5: '#001f00',+ 10: '#002800',+ 15: '#003100',+ 20: '#003c00',+ 25: '#004800',+ 30: '#01530d',+ 35: '#1f5f1f',+ 40: '#346a30',+ 45: '#467640',+ 50: '#578151',+ 55: '#648e5d',+ 60: '#709c6a',+ 65: '#7da976',+ 70: '#8ab783',+ 75: '#98c490',+ 80: '#a5d29d',+ 85: '#b3e0ab',+ 90: '#c1efb8',+ 95: '#cffdc6',+ 100: '#ffffff',+ },+ orange: {+ 0: '#000000',+ 5: '#2d0600',+ 10: '#381200',+ 15: '#461b00',+ 20: '#542400',+ 25: '#622e00',+ 30: '#6d3a00',+ 35: '#794700',+ 40: '#845406',+ 45: '#906121',+ 50: '#9b6e36',+ 55: '#a97b42',+ 60: '#b7874e',+ 65: '#c6945b',+ 70: '#d4a267',+ 75: '#e3af74',+ 80: '#f2bd81',+ 85: '#ffcb8e',+ 90: '#ffdcb6',+ 95: '#ffedda',+ 100: '#ffffff',+ },+ pink: {+ 0: '#000000',+ 5: '#3c003d',+ 10: '#490048',+ 15: '#560054',+ 20: '#62005f',+ 25: '#6c0a68',+ 30: '#762371',+ 35: '#80357a',+ 40: '#894583',+ 45: '#93558c',+ 50: '#9c6496',+ 55: '#aa71a3',+ 60: '#b77eb0',+ 65: '#c58bbe',+ 70: '#d398cc',+ 75: '#e2a6da',+ 80: '#f0b3e8',+ 85: '#ffc1f6',+ 90: '#ffd5fb',+ 95: '#ffeafd',+ 100: '#ffffff',+ },+ purple: {+ 0: '#000000',+ 5: '#1e004f',+ 10: '#2b005c',+ 15: '#390268',+ 20: '#461373',+ 25: '#52237b',+ 30: '#5d3283',+ 35: '#69408b',+ 40: '#744e92',+ 45: '#7f5c9a',+ 50: '#8b6aa2',+ 55: '#9877b0',+ 60: '#a584bd',+ 65: '#b391cb',+ 70: '#c19ed9',+ 75: '#cfabe8',+ 80: '#ddb9f6',+ 85: '#eac8ff',+ 90: '#f2daff',+ 95: '#f9ecff',+ 100: '#ffffff',+ },+ red: {+ 0: '#000000',+ 5: '#3e0000',+ 10: '#490000',+ 15: '#550000',+ 20: '#62100f',+ 25: '#6d211c',+ 30: '#773029',+ 35: '#823f36',+ 40: '#8c4d44',+ 45: '#955b52',+ 50: '#9f6961',+ 55: '#ad766d',+ 60: '#bb837a',+ 65: '#c99087',+ 70: '#d79d94',+ 75: '#e6aba1',+ 80: '#f4b8ae',+ 85: '#ffc7bd',+ 90: '#ffdad3',+ 95: '#ffece8',+ 100: '#ffffff',+ },+ teal: {+ 0: '#000000',+ 5: '#001f00',+ 10: '#00280b',+ 15: '#003216',+ 20: '#003d22',+ 25: '#00482d',+ 30: '#005439',+ 35: '#005f45',+ 40: '#136b52',+ 45: '#30775f',+ 50: '#46826d',+ 55: '#528f79',+ 60: '#5f9d86',+ 65: '#6caa93',+ 70: '#7ab8a0',+ 75: '#87c5ae',+ 80: '#94d3bb',+ 85: '#a2e1c9',+ 90: '#b0f0d7',+ 95: '#befee5',+ 100: '#ffffff',+ },+ yellow: {+ 0: '#000000',+ 5: '#1e1200',+ 10: '#271c00',+ 15: '#2e2700',+ 20: '#373200',+ 25: '#413e00',+ 30: '#4c4a00',+ 35: '#575600',+ 40: '#646200',+ 45: '#726e00',+ 50: '#817a00',+ 55: '#8e860e',+ 60: '#9c9320',+ 65: '#aba02f',+ 70: '#b9ae3d',+ 75: '#c7bb4a',+ 80: '#d6c957',+ 85: '#e5d765',+ 90: '#f4e572',+ 95: '#fff294',+ 100: '#ffffff',+ },+ neutral: {+ 0: '#000000',+ 5: '#051124',+ 10: '#101c2f',+ 15: '#1b263a',+ 20: '#273045',+ 25: '#333b4f',+ 30: '#3f4759',+ 35: '#4b5264',+ 40: '#585e6f',+ 45: '#656a79',+ 50: '#727784',+ 55: '#7f8491',+ 60: '#8c909f',+ 65: '#999eac',+ 70: '#a6abba',+ 75: '#b4b9c7',+ 80: '#c1c6d5',+ 85: '#cfd4e3',+ 90: '#dde2f2',+ 95: '#ebf0ff',+ 100: '#ffffff',+ },+ accent: {+ 0: '#000000',+ 5: '#00085e',+ 10: '#00136c',+ 15: '#001c7e',+ 20: '#002592',+ 25: '#002fa7',+ 30: '#0039be',+ 35: '#0043d7',+ 40: '#004df0',+ 45: '#0759ff',+ 50: '#4a67ff',+ 55: '#6875ff',+ 60: '#8083ff',+ 65: '#9492ff',+ 70: '#a6a1ff',+ 75: '#b6b0ff',+ 80: '#c6bfff',+ 85: '#d5cfff',+ 90: '#e3dfff',+ 95: '#f1efff',+ 100: '#ffffff',+ },+ error: {+ 0: '#000000',+ 5: '#470000',+ 10: '#530000',+ 15: '#600000',+ 20: '#6d0000',+ 25: '#771210',+ 30: '#82261e',+ 35: '#8c372c',+ 40: '#96463b',+ 45: '#a0564a',+ 50: '#a96559',+ 55: '#b77265',+ 60: '#c57e72',+ 65: '#d48b7e',+ 70: '#e2998b',+ 75: '#f1a698',+ 80: '#ffb4a6',+ 85: '#ffc7bc',+ 90: '#ffdad2',+ 95: '#ffece8',+ 100: '#ffffff',+ },+ warning: {+ 0: '#000000',+ 5: '#270c00',+ 10: '#301800',+ 15: '#3b2200',+ 20: '#472c00',+ 25: '#543700',+ 30: '#614200',+ 35: '#6f4d00',+ 40: '#7d5800',+ 45: '#8b6400',+ 50: '#9a7000',+ 55: '#a97d00',+ 60: '#b88900',+ 65: '#c89600',+ 70: '#d8a300',+ 75: '#e7b100',+ 80: '#f7be00',+ 85: '#ffcd51',+ 90: '#ffde9c',+ 95: '#ffeed0',+ 100: '#ffffff',+ },+ success: {+ 0: '#000000',+ 5: '#001a00',+ 10: '#092300',+ 15: '#0b2e00',+ 20: '#043b00',+ 25: '#004700',+ 30: '#005400',+ 35: '#036100',+ 40: '#136e00',+ 45: '#277b00',+ 50: '#448700',+ 55: '#529400',+ 60: '#60a105',+ 65: '#6eaf1d',+ 70: '#7cbd2e',+ 75: '#8bcb3c',+ 80: '#99d94b',+ 85: '#a7e758',+ 90: '#b5f566',+ 95: '#ccff88',+ 100: '#ffffff',+ },+} as const;diff --git a/packages/cli/templates/themes/butter/icons.tsx b/packages/cli/templates/themes/butter/icons.tsxnew file mode 100644index 0000000000..516f53195f--- /dev/null+++ b/packages/cli/templates/themes/butter/icons.tsx@@ -0,0 +1,77 @@+// Copyright (c) Meta Platforms, Inc. and affiliates.++/**+ * @file icons.tsx+ * @input Uses lucide-react icon components, IconRegistry type+ * @output Exports butterIconRegistry for the butter theme+ * @position Icon configuration for the butter theme; consumed by index.ts+ *+ * Maps semantic icon names to Lucide icon components.+ * These icons are bundled with the theme, not with @astryxdesign/core.+ */++import React from 'react';+import type {IconRegistry} from '@astryxdesign/core/Icon';++import {+ X,+ ChevronDown,+ ChevronLeft,+ ChevronRight,+ Check,+ CheckCircle,+ XCircle,+ AlertTriangle,+ Info,+ Calendar,+ Clock,+ ExternalLink,+ Menu,+ MoreHorizontal,+ Search,+ ArrowUp,+ ArrowDown,+ ArrowUpDown,+ Filter,+ EyeOff,+ Columns,+ Copy,+ CheckCheck,+ Wrench,+ Square,+ Mic,+} from 'lucide-react';++const iconProps = {+ size: '1em',+ 'aria-hidden': true as const,+};++export const butterIconRegistry: IconRegistry = {+ close: <X {...iconProps} />,+ chevronDown: <ChevronDown {...iconProps} />,+ chevronLeft: <ChevronLeft {...iconProps} />,+ chevronRight: <ChevronRight {...iconProps} />,+ check: <Check {...iconProps} />,+ success: <CheckCircle {...iconProps} />,+ error: <XCircle {...iconProps} />,+ warning: <AlertTriangle {...iconProps} />,+ info: <Info {...iconProps} />,+ calendar: <Calendar {...iconProps} />,+ clock: <Clock {...iconProps} />,+ externalLink: <ExternalLink {...iconProps} />,+ menu: <Menu {...iconProps} />,+ moreHorizontal: <MoreHorizontal {...iconProps} />,+ search: <Search {...iconProps} />,+ arrowUp: <ArrowUp {...iconProps} />,+ arrowDown: <ArrowDown {...iconProps} />,+ arrowsUpDown: <ArrowUpDown {...iconProps} />,+ funnel: <Filter {...iconProps} />,+ eyeSlash: <EyeOff {...iconProps} />,+ viewColumns: <Columns {...iconProps} />,+ copy: <Copy {...iconProps} />,+ checkDouble: <CheckCheck {...iconProps} />,+ wrench: <Wrench {...iconProps} />,+ stop: <Square {...iconProps} />,+ microphone: <Mic {...iconProps} />,+};diff --git a/packages/cli/templates/themes/chocolate/chocolateTheme.ts b/packages/cli/templates/themes/chocolate/chocolateTheme.tsnew file mode 100644index 0000000000..aca7447887--- /dev/null+++ b/packages/cli/templates/themes/chocolate/chocolateTheme.ts@@ -0,0 +1,226 @@+// Copyright (c) Meta Platforms, Inc. and affiliates.++/**+ * Chocolate Theme+ *+ * A warm, cozy theme inspired by rich chocolate and caramel tones.+ * Core palette: #8C5927, #B88859, #C4AC95, #EDE4D4, #FFFCF7+ * Uses Fraunces for headings and Albert Sans for body text.+ */++import {defineTheme, defineSyntaxTheme} from '@astryxdesign/core/theme';+import {chocolateIconRegistry} from './icons';++/** Chocolate syntax palette — warm browns and amber tones. */+const chocolateSyntax = defineSyntaxTheme({+ name: 'xds-chocolate',+ tokens: {+ keyword: ['#8C5927', '#d4a06a'],+ string: ['#2e6b4a', '#7bc49e'],+ comment: ['#B88859', '#B88859'],+ number: ['#a06018', '#d4b870'],+ function: ['#3a5e8c', '#7ba8d4'],+ type: ['#6b4a8c', '#b08ed4'],+ variable: ['#4a3520', '#EDE4D4'],+ operator: ['#B88859', '#c4a882'],+ constant: ['#a06018', '#d4b870'],+ tag: ['#8c3a3a', '#d47a7a'],+ attribute: ['#8C5927', '#d4a06a'],+ property: ['#3a7c6b', '#70c4b0'],+ punctuation: ['#B88859', '#6b5540'],+ background: ['#FFFCF7', '#1c1610'],+ },+});++export const chocolateTheme = defineTheme({+ name: 'chocolate',++ typography: {+ scale: {base: 14, ratio: 1.2},+ body: {+ family: 'Albert Sans',+ fallbacks:+ '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif',+ },+ heading: {+ family: 'Fraunces',+ fallbacks: 'Georgia, "Times New Roman", Times, serif',+ weights: {3: 'bold', 4: 'bold'},+ },+ code: {+ family: 'JetBrains Mono',+ fallbacks: '"SF Mono", Monaco, Consolas, monospace',+ },+ },++ motion: {fast: 125, medium: 300, slow: 700, ratio: 0.75},++ syntax: chocolateSyntax,++ tokens: {+ // =========================================================================+ // Colors — warm chocolate palette+ // Core: #8C5927, #B88859, #C4AC95, #EDE4D4, #FFFCF7+ // =========================================================================++ // Core semantic+ '--color-accent': ['#8C5927', '#d4a06a'],+ '--color-accent-muted': ['#8C592714', '#d4a06a20'],+ '--color-neutral': ['#8C59270F', '#EDE4D41A'],+ '--color-background-surface': ['#FFFCF7', '#1c1610'],+ '--color-background-body': ['#FFFCF7', '#141010'],+ '--color-overlay': ['#4a352080', '#140e0aCC'],+ '--color-overlay-hover': ['#4a35200D', '#EDE4D40D'],+ '--color-overlay-pressed': ['#4a35201A', '#EDE4D41A'],+ '--color-background-muted': ['#EDE4D4', '#2a2018'],++ // Text+ '--color-text-primary': ['#4a3520', '#EDE4D4'],+ '--color-text-secondary': ['#B88859', '#c4a882'],+ '--color-text-disabled': ['#C4AC95', '#6b5540'],+ '--color-text-accent': ['#8C5927', '#d4a06a'],+ '--color-on-dark': '#FFFCF7',+ '--color-on-light': '#4a3520',+ '--color-on-accent': ['#FFFFFF', '#4a3520'],+ '--color-on-success': ['#FFFFFF', '#4a3520'],+ '--color-on-error': ['#FFFFFF', '#4a3520'],+ '--color-on-warning': ['#4a3520', '#4a3520'],++ // Icon+ '--color-icon-accent': ['#8C5927', '#d4a06a'],+ '--color-icon-primary': ['#4a3520', '#EDE4D4'],+ '--color-icon-secondary': ['#B88859', '#c4a882'],+ '--color-icon-disabled': ['#C4AC95', '#6b5540'],++ // Surface variants+ '--color-background-card': ['#EDE4D4', '#2a2018'],+ '--color-background-popover': ['#FFFCF7', '#2a2018'],+ '--color-background-inverted': ['#4a3520', '#EDE4D4'],++ // Status / Sentiment+ '--color-success': ['#709900', '#96bf2a'],+ '--color-success-muted': ['#70990020', '#96bf2a20'],+ '--color-error': ['#FD0000', '#ff5c5c'],+ '--color-error-muted': ['#FD000020', '#ff5c5c20'],+ '--color-warning': ['#FFB600', '#ffc940'],+ '--color-warning-muted': ['#FFB60020', '#ffc94020'],++ // Border+ '--color-border': ['#C4AC95', '#EDE4D41A'],+ '--color-border-emphasized': ['#B88859', '#6b5540'],++ // Effects+ '--color-skeleton': ['#C4AC95', '#6b5540'],+ '--color-shadow': ['#4a35201A', '#0000004D'],+ '--color-tint-hover': ['black', 'white'],++ // Categorical — Blue+ '--color-background-blue': ['#3a5e8c33', '#3a5e8c33'],+ '--color-border-blue': ['#3a5e8c', '#7ba8d4'],+ '--color-icon-blue': ['#3a5e8c', '#7ba8d4'],+ '--color-text-blue': ['#2e4a6e', '#8dbce0'],++ // Categorical — Cyan+ '--color-background-cyan': ['#3a7c7c33', '#3a7c7c33'],+ '--color-border-cyan': ['#3a7c7c', '#70c4c4'],+ '--color-icon-cyan': ['#3a7c7c', '#70c4c4'],+ '--color-text-cyan': ['#2e6060', '#82d4d4'],++ // Categorical — Gray+ '--color-background-gray': ['#B8885933', '#6b554033'],+ '--color-border-gray': ['#B88859', '#B88859'],+ '--color-icon-gray': ['#B88859', '#c4a882'],+ '--color-text-gray': ['#4a3520', '#EDE4D4'],++ // Categorical — Green+ '--color-background-green': ['#70990033', '#96bf2a33'],+ '--color-border-green': ['#709900', '#96bf2a'],+ '--color-icon-green': ['#709900', '#96bf2a'],+ '--color-text-green': ['#5a7a00', '#a8d43a'],++ // Categorical — Orange+ '--color-background-orange': ['#c4762033', '#d4903a33'],+ '--color-border-orange': ['#c47620', '#d4903a'],+ '--color-icon-orange': ['#c47620', '#d4903a'],+ '--color-text-orange': ['#a06018', '#e0a04a'],++ // Categorical — Pink+ '--color-background-pink': ['#c44a7033', '#e07a9a33'],+ '--color-border-pink': ['#c44a70', '#e07a9a'],+ '--color-icon-pink': ['#c44a70', '#e07a9a'],+ '--color-text-pink': ['#a03a5a', '#f08aaa'],++ // Categorical — Purple+ '--color-background-purple': ['#6b4a8c33', '#b08ed433'],+ '--color-border-purple': ['#6b4a8c', '#b08ed4'],+ '--color-icon-purple': ['#6b4a8c', '#b08ed4'],+ '--color-text-purple': ['#553a70', '#c0a0e0'],++ // Categorical — Red+ '--color-background-red': ['#FD000033', '#ff5c5c33'],+ '--color-border-red': ['#FD0000', '#ff5c5c'],+ '--color-icon-red': ['#FD0000', '#ff5c5c'],+ '--color-text-red': ['#cc0000', '#ff7a7a'],++ // Categorical — Teal+ '--color-background-teal': ['#2e6b5a33', '#5ab89833'],+ '--color-border-teal': ['#2e6b5a', '#5ab898'],+ '--color-icon-teal': ['#2e6b5a', '#5ab898'],+ '--color-text-teal': ['#245546', '#6ccaaa'],++ // Categorical — Yellow+ '--color-background-yellow': ['#FFB60033', '#ffc94033'],+ '--color-border-yellow': ['#FFB600', '#ffc940'],+ '--color-icon-yellow': ['#FFB600', '#ffc940'],+ '--color-text-yellow': ['#cc9200', '#ffd960'],++ // =========================================================================+ // Radius — soft and rounded+ // =========================================================================+ '--radius-none': '0.125rem',+ '--radius-inner': '0.375rem',+ '--radius-element': '0.625rem',+ '--radius-container': '0.75rem',+ '--radius-page': '1.5rem',+ '--radius-full': '9999px',++ // =========================================================================+ // Shadows — warm-toned+ // =========================================================================+ '--shadow-low': '0 2px 4px #4a35200D, 0 4px 8px #4a35201A',+ '--shadow-med': '0 2px 4px #4a35200D, 0 4px 12px #4a35201A',+ '--shadow-high': '0 4px 6px #4a35201A, 0 12px 24px #4a352026',+ '--shadow-inset-hover': 'inset 0px 0px 0px 2px #8C592730',+ '--shadow-inset-selected': 'inset 0px 0px 0px 2px #8C592750',+ '--shadow-inset-success': 'inset 0px 0px 0px 2px #70990050',+ '--shadow-inset-warning': 'inset 0px 0px 0px 2px #FFB60050',+ '--shadow-inset-error': 'inset 0px 0px 0px 2px #FD000050',+ },++ components: {+ button: {+ base: {+ borderRadius: 'var(--radius-full)',+ },+ 'variant:secondary': {+ borderWidth: '1px',+ borderStyle: 'solid',+ borderColor: 'var(--color-border-emphasized)',+ },+ },++ card: {+ base: {+ padding: 'var(--spacing-3)',+ },+ },++ section: {+ base: {+ padding: 'var(--spacing-3)',+ },+ },+ },++ icons: chocolateIconRegistry,+});diff --git a/packages/cli/templates/themes/chocolate/icons.tsx b/packages/cli/templates/themes/chocolate/icons.tsxnew file mode 100644index 0000000000..5ce9f3042d--- /dev/null+++ b/packages/cli/templates/themes/chocolate/icons.tsx@@ -0,0 +1,77 @@+// Copyright (c) Meta Platforms, Inc. and affiliates.++/**+ * @file icons.tsx+ * @input Uses lucide-react icon components, IconRegistry type+ * @output Exports chocolateIconRegistry for the neutral theme+ * @position Icon configuration for the neutral theme; consumed by index.ts+ *+ * Maps semantic icon names to Lucide icon components.+ * These icons are bundled with the theme, not with @astryxdesign/core.+ */++import React from 'react';+import type {IconRegistry} from '@astryxdesign/core/Icon';++import {+ X,+ ChevronDown,+ ChevronLeft,+ ChevronRight,+ Check,+ CheckCircle,+ XCircle,+ AlertTriangle,+ Info,+ Calendar,+ Clock,+ ExternalLink,+ Menu,+ MoreHorizontal,+ Search,+ ArrowUp,+ ArrowDown,+ ArrowUpDown,+ Filter,+ EyeOff,+ Columns,+ Copy,+ CheckCheck,+ Wrench,+ Square,+ Mic,+} from 'lucide-react';++const iconProps = {+ size: '1em',+ 'aria-hidden': true as const,+};++export const chocolateIconRegistry: IconRegistry = {+ close: <X {...iconProps} />,+ chevronDown: <ChevronDown {...iconProps} />,+ chevronLeft: <ChevronLeft {...iconProps} />,+ chevronRight: <ChevronRight {...iconProps} />,+ check: <Check {...iconProps} />,+ success: <CheckCircle {...iconProps} />,+ error: <XCircle {...iconProps} />,+ warning: <AlertTriangle {...iconProps} />,+ info: <Info {...iconProps} />,+ calendar: <Calendar {...iconProps} />,+ clock: <Clock {...iconProps} />,+ externalLink: <ExternalLink {...iconProps} />,+ menu: <Menu {...iconProps} />,+ moreHorizontal: <MoreHorizontal {...iconProps} />,+ search: <Search {...iconProps} />,+ arrowUp: <ArrowUp {...iconProps} />,+ arrowDown: <ArrowDown {...iconProps} />,+ arrowsUpDown: <ArrowUpDown {...iconProps} />,+ funnel: <Filter {...iconProps} />,+ eyeSlash: <EyeOff {...iconProps} />,+ viewColumns: <Columns {...iconProps} />,+ copy: <Copy {...iconProps} />,+ checkDouble: <CheckCheck {...iconProps} />,+ wrench: <Wrench {...iconProps} />,+ stop: <Square {...iconProps} />,+ microphone: <Mic {...iconProps} />,+};diff --git a/packages/cli/templates/themes/gothic/gothicTheme.ts b/packages/cli/templates/themes/gothic/gothicTheme.tsnew file mode 100644index 0000000000..2cf1720d1a--- /dev/null+++ b/packages/cli/templates/themes/gothic/gothicTheme.ts@@ -0,0 +1,657 @@+// Copyright (c) Meta Platforms, Inc. and affiliates.++/**+ * Gothic Theme — dark only+ *+ * A dark-only theme with deep blue-gray tones and a distressed display+ * heading. Inspired by ink, manuscript, and noir typography.+ *+ * Core palette: #E8F1F6, #96A0AB, #495056, #24292D, #101314+ * Categorical colors follow a pastel-on-dark pattern (light backgrounds+ * with dark text) — same in any system color preference.+ *+ * Uses Manufacturing Consent for headings and Fustat for body text.+ */++import {defineTheme, defineSyntaxTheme} from '@astryxdesign/core/theme';+import {gothicIconRegistry} from './icons';++/**+ * Gothic syntax palette — atmospheric tones drawn from the gothic+ * categorical palette: deep purples (cathedral), blood crimson (tags),+ * aged gold (numbers), forest moss (strings), midnight indigo (functions).+ *+ * Single values (no tuples) since this is a dark-only theme.+ */+const gothicSyntax = defineSyntaxTheme({+ name: 'xds-gothic',+ tokens: {+ keyword: '#c39adb', // Cathedral plum+ string: '#a3c987', // Forest moss+ comment: '#6b7079', // Faded ink+ number: '#dec074', // Aged gold+ function: '#8aa1d8', // Midnight indigo+ type: '#c39adb', // Cathedral plum+ variable: '#E8F1F6', // Parchment+ operator: '#96A0AB', // Mid neutral+ constant: '#e6b85e', // Candlelight amber+ tag: '#d97580', // Blood crimson+ attribute: '#dec074', // Aged gold+ property: '#7cc5b3', // Verdigris+ punctuation: '#7a8290', // Mid neutral+ background: '#101314',+ },+});++export const gothicTheme = defineTheme({+ name: 'gothic',++ typography: {+ // base 16 / ratio 1.25 — larger scale so the (optically small) blackletter+ // display sizes read large enough to carry the theme.+ scale: {base: 16, ratio: 1.25},+ body: {+ family: 'Fustat',+ fallbacks:+ '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif',+ },+ // Headings (h1-h6) use Fustat to match the body — Manufacturing Consent+ // is reserved for display sizes only (see component overrides below).+ heading: {+ family: 'Fustat',+ fallbacks:+ '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif',+ weights: {3: 'bold', 4: 'bold'},+ },+ code: {+ family: 'JetBrains Mono',+ fallbacks: '"SF Mono", Monaco, Consolas, monospace',+ },+ },++ // Slower, theatrical motion — gothic doesn't rush.+ motion: {fast: 150, medium: 350, slow: 800, ratio: 0.75},++ syntax: gothicSyntax,++ tokens: {+ // =========================================================================+ // Colors — gothic dark palette (single values, dark-only)+ // Core: #E8F1F6, #96A0AB, #495056, #24292D, #101314+ // =========================================================================++ // Core semantic+ '--color-accent': '#E8F1F6',+ '--color-accent-muted': '#E8F1F620',+ '--color-neutral': '#E8F1F61A',+ '--color-background-surface': '#101314',+ '--color-background-body': '#101314',+ '--color-overlay': '#101314CC',+ '--color-overlay-hover': '#E8F1F60D',+ '--color-overlay-pressed': '#E8F1F61A',+ '--color-background-muted': '#24292D',++ // Text+ '--color-text-primary': '#E8F1F6',+ '--color-text-secondary': '#96A0AB',+ '--color-text-disabled': '#495056',+ '--color-text-accent': '#E8F1F6',+ '--color-on-dark': '#E8F1F6',+ '--color-on-light': '#101314',+ '--color-on-accent': '#101314',+ '--color-on-success': '#101314',+ '--color-on-error': '#101314',+ '--color-on-warning': '#101314',++ // Icon+ '--color-icon-accent': '#E8F1F6',+ '--color-icon-primary': '#E8F1F6',+ '--color-icon-secondary': '#96A0AB',+ '--color-icon-disabled': '#495056',++ // Surface variants+ '--color-background-card': '#1a1d20',+ '--color-background-popover': '#24292D',+ '--color-background-inverted': '#E8F1F6',++ // Status / Sentiment — dusty pastels matching the categorical+ // pattern. Used for status surfaces, destructive button bg, etc.+ '--color-success': '#b3c79a', // sage moss+ '--color-success-muted': '#b3c79a',+ '--color-error': '#c6a6a2', // dusty rose+ '--color-error-muted': '#c6a6a2',+ '--color-warning': '#d3c490', // aged gold+ '--color-warning-muted': '#d3c490',++ // Border+ '--color-border': '#E8F1F61A',+ '--color-border-emphasized': '#495056',++ // Effects+ '--color-skeleton': '#495056',+ '--color-shadow': '#0000004D',+ '--color-tint-hover': 'white',++ // =========================================================================+ // Categorical — dusty pastel-on-dark pattern+ // Hand-tuned dusty pastels (T75 with reduced chroma) — confident+ // but never bright. Neutral is a dark slate with white text — the+ // "no-color" variant earns its hierarchy by matching the page mood.+ // =========================================================================++ // Blue (periwinkle midnight)+ '--color-background-blue': '#a3b5d6',+ '--color-border-blue': '#8696b8',+ '--color-icon-blue': '#2a3b6e',+ '--color-text-blue': '#1f2c54',++ // Cyan (cathedral mist)+ '--color-background-cyan': '#a3c2cf',+ '--color-border-cyan': '#86a4b1',+ '--color-icon-cyan': '#2a5e75',+ '--color-text-cyan': '#204858',++ // Gray (dark slate — special: dark bg + light text)+ '--color-background-gray': '#3d4248',+ '--color-border-gray': '#5d646b',+ '--color-icon-gray': '#E8F1F6',+ '--color-text-gray': '#E8F1F6',++ // Green (sage moss)+ '--color-background-green': '#b3c79a',+ '--color-border-green': '#96a880',+ '--color-icon-green': '#3a5e2c',+ '--color-text-green': '#244023',++ // Orange (warm tan)+ '--color-background-orange': '#d3b89a',+ '--color-border-orange': '#b6987d',+ '--color-icon-orange': '#8a4818',+ '--color-text-orange': '#6e3812',++ // Pink (dusty rose)+ '--color-background-pink': '#c89aab',+ '--color-border-pink': '#aa7d8e',+ '--color-icon-pink': '#8d2d4c',+ '--color-text-pink': '#71223c',++ // Purple (muted plum)+ '--color-background-purple': '#b29bc4',+ '--color-border-purple': '#947da6',+ '--color-icon-purple': '#5a2370',+ '--color-text-purple': '#481b58',++ // Red (dusty rose)+ '--color-background-red': '#c6a6a2',+ '--color-border-red': '#a48581',+ '--color-icon-red': '#5e3a35',+ '--color-text-red': '#4a2520',++ // Teal (sage verdigris)+ '--color-background-teal': '#a3c2b6',+ '--color-border-teal': '#86a499',+ '--color-icon-teal': '#1f5e52',+ '--color-text-teal': '#174a40',++ // Yellow (aged gold)+ '--color-background-yellow': '#d3c490',+ '--color-border-yellow': '#b6a775',+ '--color-icon-yellow': '#876515',+ '--color-text-yellow': '#6c5010',++ // =========================================================================+ // Radius — subtle rounding (original gothic)+ // =========================================================================+ '--radius-none': '0.125rem',+ '--radius-inner': '0.25rem',+ '--radius-element': '0.5rem',+ '--radius-container': '0.75rem',+ '--radius-page': '1.5rem',+ '--radius-full': '9999px',++ // =========================================================================+ // Shadows — restrained, atmospheric+ // =========================================================================+ '--shadow-low': '0 2px 4px #00000033, 0 4px 8px #00000040',+ '--shadow-med': '0 2px 4px #00000033, 0 4px 12px #00000040',+ '--shadow-high': '0 4px 6px #00000040, 0 12px 24px #0000004D',+ '--shadow-inset-hover': 'inset 0px 0px 0px 1px #96A0AB30',+ '--shadow-inset-selected': 'inset 0px 0px 0px 2px #96A0AB50',+ '--shadow-inset-success': 'inset 0px 0px 0px 1px #87b06a50',+ '--shadow-inset-warning': 'inset 0px 0px 0px 1px #d6b56a50',+ '--shadow-inset-error': 'inset 0px 0px 0px 1px #d4485150',+ },++ components: {+ button: {+ // Primary inherits default — light pill with dark text via+ // --color-accent / --color-on-accent (matches the cream badge).+ // Secondary uses the dark-slate "neutral" badge treatment.+ 'variant:secondary': {+ backgroundColor: 'var(--color-background-gray)',+ color: 'var(--color-text-gray)',+ borderColor: 'transparent',+ borderWidth: '0',+ },+ 'variant:ghost': {+ ':hover': {+ backgroundColor: 'var(--color-overlay-hover)',+ },+ },+ // Destructive uses the dusty rose bg with dark warm-brown text+ // (matches the red badge).+ 'variant:destructive': {+ backgroundColor: 'var(--color-error)',+ color: 'var(--color-text-red)',+ },+ },++ badge: {+ base: {+ borderRadius: 'var(--radius-element)',+ fontWeight: 'var(--font-weight-medium)',+ },+ 'variant:info': {+ backgroundColor: 'var(--color-background-blue)',+ color: 'var(--color-text-blue)',+ },+ 'variant:neutral': {+ backgroundColor: 'var(--color-background-gray)',+ color: 'var(--color-text-gray)',+ },+ 'variant:success': {+ backgroundColor: 'var(--color-background-green)',+ color: 'var(--color-text-green)',+ },+ 'variant:warning': {+ backgroundColor: 'var(--color-background-yellow)',+ color: 'var(--color-text-yellow)',+ },+ 'variant:error': {+ backgroundColor: 'var(--color-background-red)',+ color: 'var(--color-text-red)',+ },+ },++ banner: {+ base: {+ borderRadius: 'var(--radius-element)',+ },+ 'status:info': {+ backgroundColor: 'var(--color-background-blue)',+ '--color-text-primary': 'var(--color-text-blue)',+ '--color-text-secondary': 'var(--color-text-blue)',+ '--color-accent': 'var(--color-text-blue)',+ },+ 'status:success': {+ backgroundColor: 'var(--color-background-green)',+ '--color-text-primary': 'var(--color-text-green)',+ '--color-text-secondary': 'var(--color-text-green)',+ '--color-success': 'var(--color-text-green)',+ },+ 'status:warning': {+ backgroundColor: 'var(--color-background-yellow)',+ '--color-text-primary': 'var(--color-text-yellow)',+ '--color-text-secondary': 'var(--color-text-yellow)',+ '--color-warning': 'var(--color-text-yellow)',+ },+ 'status:error': {+ backgroundColor: 'var(--color-background-red)',+ '--color-text-primary': 'var(--color-text-red)',+ '--color-text-secondary': 'var(--color-text-red)',+ '--color-error': 'var(--color-text-red)',+ },+ },++ card: {+ base: {+ padding: 'var(--spacing-3)',+ borderRadius: 'var(--radius-container)',+ },+ // Categorical variants — flip --color-text-primary so child+ // XDSText labels stay readable against the dusty pastel bg.+ 'variant:blue': {+ '--color-text-primary': 'var(--color-text-blue)',+ '--color-text-secondary': 'var(--color-text-blue)',+ },+ 'variant:cyan': {+ '--color-text-primary': 'var(--color-text-cyan)',+ '--color-text-secondary': 'var(--color-text-cyan)',+ },+ 'variant:gray': {+ '--color-text-primary': 'var(--color-text-gray)',+ '--color-text-secondary': 'var(--color-text-gray)',+ },+ 'variant:green': {+ '--color-text-primary': 'var(--color-text-green)',+ '--color-text-secondary': 'var(--color-text-green)',+ },+ 'variant:orange': {+ '--color-text-primary': 'var(--color-text-orange)',+ '--color-text-secondary': 'var(--color-text-orange)',+ },+ 'variant:pink': {+ '--color-text-primary': 'var(--color-text-pink)',+ '--color-text-secondary': 'var(--color-text-pink)',+ },+ 'variant:purple': {+ '--color-text-primary': 'var(--color-text-purple)',+ '--color-text-secondary': 'var(--color-text-purple)',+ },+ 'variant:red': {+ '--color-text-primary': 'var(--color-text-red)',+ '--color-text-secondary': 'var(--color-text-red)',+ },+ 'variant:teal': {+ '--color-text-primary': 'var(--color-text-teal)',+ '--color-text-secondary': 'var(--color-text-teal)',+ },+ 'variant:yellow': {+ '--color-text-primary': 'var(--color-text-yellow)',+ '--color-text-secondary': 'var(--color-text-yellow)',+ },+ },++ section: {+ base: {+ padding: 'var(--spacing-3)',+ },+ },++ field: {+ base: {+ borderRadius: 'var(--radius-element)',+ },+ },++ // Display sizes use Manufacturing Consent — the signature gothic+ // display font, reserved for hero/marketing-scale text only.+ text: {+ 'type:display-1': {+ fontFamily:+ '"Manufacturing Consent", "UnifrakturMaguntia", "Old English Text MT", serif',+ },+ 'type:display-2': {+ fontFamily:+ '"Manufacturing Consent", "UnifrakturMaguntia", "Old English Text MT", serif',+ },+ 'type:display-3': {+ fontFamily:+ '"Manufacturing Consent", "UnifrakturMaguntia", "Old English Text MT", serif',+ },+ },+ },++ icons: gothicIconRegistry,+});++/**+ * Raw tonal palettes — every color at every tone step (0–100 in 5s).+ * Use these for custom components or data visualization.+ *+ * Categorical hues (blue, green, etc.) follow gothic gem-tone hues.+ * Neutral mirrors the original gothic blue-gray palette (H≈210).+ */+export const gothicPalettes = {+ // Neutral — H=210 C=4 (cool blue-gray, original gothic)+ neutral: {+ hue: 210,+ chroma: 4,+ 0: '#000000',+ 5: '#0a0d0f',+ 10: '#101314',+ 15: '#181c1f',+ 20: '#24292D',+ 25: '#2c3236',+ 30: '#363c40',+ 35: '#40464b',+ 40: '#495056',+ 45: '#535a61',+ 50: '#5d646b',+ 55: '#676f76',+ 60: '#727a82',+ 65: '#7e8690',+ 70: '#8a929c',+ 75: '#96A0AB',+ 80: '#a8b1bb',+ 85: '#bbc3cb',+ 90: '#cdd5db',+ 95: '#E8F1F6',+ 100: '#ffffff',+ },+ // Blue — H=255 C=20 (midnight indigo)+ blue: {+ hue: 255,+ chroma: 20,+ 0: '#000000',+ 5: '#050930',+ 10: '#0c143f',+ 15: '#161e4d',+ 20: '#1f2c54',+ 25: '#2a3565',+ 30: '#2a3b6e',+ 35: '#3a4783',+ 40: '#475497',+ 45: '#5462ab',+ 50: '#6170bf',+ 55: '#6a85cf',+ 60: '#7793d6',+ 65: '#8aa1d8',+ 70: '#a3b5e0',+ 75: '#b6c5e7',+ 80: '#c4d1ec',+ 85: '#d2dcef',+ 90: '#dde2f1',+ 95: '#e8ecf6',+ 100: '#ffffff',+ },+ // Cyan — H=200 C=25 (cathedral mist)+ cyan: {+ hue: 200,+ chroma: 25,+ 0: '#000000',+ 5: '#001724',+ 10: '#062436',+ 15: '#0d3046',+ 20: '#204858',+ 25: '#1c4a66',+ 30: '#2a5e75',+ 35: '#3a6e85',+ 40: '#487d94',+ 45: '#598ea3',+ 50: '#6a9eb1',+ 55: '#7ab0c0',+ 60: '#8cc3d8',+ 65: '#a0cce0',+ 70: '#b1d3e5',+ 75: '#bcdaeb',+ 80: '#c5dfee',+ 85: '#cbe4f0',+ 90: '#d6e6ee',+ 95: '#e3eef3',+ 100: '#ffffff',+ },+ // Green — H=140 C=18 (forest moss)+ green: {+ hue: 140,+ chroma: 18,+ 0: '#000000',+ 5: '#0c1a08',+ 10: '#152511',+ 15: '#1c321a',+ 20: '#2c4a20',+ 25: '#2c4d2a',+ 30: '#3a5e2c',+ 35: '#446a39',+ 40: '#557c44',+ 45: '#658d50',+ 50: '#779e5d',+ 55: '#87b06a',+ 60: '#96bd76',+ 65: '#a3c987',+ 70: '#b5d397',+ 75: '#bdd99e',+ 80: '#c8e0ad',+ 85: '#d4e6bd',+ 90: '#dde6d4',+ 95: '#eaf3df',+ 100: '#ffffff',+ },+ // Orange — H=40 C=35 (rust copper)+ orange: {+ hue: 40,+ chroma: 35,+ 0: '#000000',+ 5: '#1f0d00',+ 10: '#2c1606',+ 15: '#3a200d',+ 20: '#6e3812',+ 25: '#5a371a',+ 30: '#8a4818',+ 35: '#9a5824',+ 40: '#a05728',+ 45: '#b66839',+ 50: '#c87a4a',+ 55: '#d6905a',+ 60: '#dca275',+ 65: '#e1b288',+ 70: '#e8b894',+ 75: '#ebbf9d',+ 80: '#eecfb5',+ 85: '#efddcd',+ 90: '#f3e5d8',+ 95: '#f9eee5',+ 100: '#ffffff',+ },+ // Pink — H=345 C=22 (rose madder)+ pink: {+ hue: 345,+ chroma: 22,+ 0: '#000000',+ 5: '#22060e',+ 10: '#2e0c16',+ 15: '#3a131e',+ 20: '#71223c',+ 25: '#572235',+ 30: '#8d2d4c',+ 35: '#9b3358',+ 40: '#a04563',+ 45: '#a04a6e',+ 50: '#b15876',+ 55: '#c26988',+ 60: '#cf7593',+ 65: '#d56891',+ 70: '#dc82a4',+ 75: '#e094b1',+ 80: '#e7a5be',+ 85: '#ebb6ca',+ 90: '#eed6df',+ 95: '#f5e3eb',+ 100: '#ffffff',+ },+ // Purple — H=290 C=30 (cathedral plum)+ purple: {+ hue: 290,+ chroma: 30,+ 0: '#000000',+ 5: '#1e0c25',+ 10: '#2a1334',+ 15: '#371b43',+ 20: '#481b58',+ 25: '#502163',+ 30: '#5a2370',+ 35: '#6e3088',+ 40: '#82409c',+ 45: '#9352ad',+ 50: '#a363bd',+ 55: '#b06ec9',+ 60: '#bb7cd1',+ 65: '#c084d6',+ 70: '#c692db',+ 75: '#cd9be0',+ 80: '#d2a3df',+ 85: '#dab3e6',+ 90: '#e6daee',+ 95: '#f0e6f4',+ 100: '#ffffff',+ },+ // Red — H=15 C=12 (dusty rose) — gothic uses a desaturated rose+ // family rather than vibrant crimson; #c6a6a2 sits near T80.+ red: {+ hue: 15,+ chroma: 12,+ 0: '#000000',+ 5: '#1c0d09',+ 10: '#26140f',+ 15: '#301b16',+ 20: '#3a231d',+ 25: '#452c25',+ 30: '#50352d',+ 35: '#5b3e36',+ 40: '#66483e',+ 45: '#725347',+ 50: '#7d5e51',+ 55: '#896a5b',+ 60: '#957565',+ 65: '#a18170',+ 70: '#ad8d7b',+ 75: '#b99a87',+ 80: '#c6a6a2',+ 85: '#d2b4af',+ 90: '#dec2bc',+ 95: '#ebd0ca',+ 100: '#ffffff',+ },+ // Teal — H=170 C=20 (verdigris)+ teal: {+ hue: 170,+ chroma: 20,+ 0: '#000000',+ 5: '#001b14',+ 10: '#062821',+ 15: '#0d3530',+ 20: '#174a40',+ 25: '#194e44',+ 30: '#1f5e52',+ 35: '#2c6c5f',+ 40: '#3a7b6c',+ 45: '#498a7a',+ 50: '#5aa091',+ 55: '#5db5a3',+ 60: '#6cbeab',+ 65: '#7cc5b3',+ 70: '#90d0c0',+ 75: '#9fd4c5',+ 80: '#b1ddcf',+ 85: '#c0e1d6',+ 90: '#d4e7e2',+ 95: '#e1efe9',+ 100: '#ffffff',+ },+ // Yellow — H=80 C=40 (aged gold)+ yellow: {+ hue: 80,+ chroma: 40,+ 0: '#000000',+ 5: '#2c1d00',+ 10: '#3a2900',+ 15: '#4a3500',+ 20: '#6c5010',+ 25: '#6c5010',+ 30: '#876515',+ 35: '#9c7b1f',+ 40: '#b18e2f',+ 45: '#c39e3e',+ 50: '#cca74c',+ 55: '#d6b56a',+ 60: '#dec074',+ 65: '#e2c884',+ 70: '#e6d091',+ 75: '#e9d29a',+ 80: '#ebd9a7',+ 85: '#ebe1c4',+ 90: '#f0e8d6',+ 95: '#f7f1e3',+ 100: '#ffffff',+ },+} as const;diff --git a/packages/cli/templates/themes/gothic/icons.tsx b/packages/cli/templates/themes/gothic/icons.tsxnew file mode 100644index 0000000000..4fc5fb653d--- /dev/null+++ b/packages/cli/templates/themes/gothic/icons.tsx@@ -0,0 +1,77 @@+// Copyright (c) Meta Platforms, Inc. and affiliates.++/**+ * @file icons.tsx+ * @input Uses lucide-react icon components, IconRegistry type+ * @output Exports gothicIconRegistry for the neutral theme+ * @position Icon configuration for the neutral theme; consumed by index.ts+ *+ * Maps semantic icon names to Lucide icon components.+ * These icons are bundled with the theme, not with @astryxdesign/core.+ */++import React from 'react';+import type {IconRegistry} from '@astryxdesign/core/Icon';++import {+ X,+ ChevronDown,+ ChevronLeft,+ ChevronRight,+ Check,+ CheckCircle,+ XCircle,+ AlertTriangle,+ Info,+ Calendar,+ Clock,+ ExternalLink,+ Menu,+ MoreHorizontal,+ Search,+ ArrowUp,+ ArrowDown,+ ArrowUpDown,+ Filter,+ EyeOff,+ Columns,+ Copy,+ CheckCheck,+ Wrench,+ Square,+ Mic,+} from 'lucide-react';++const iconProps = {+ size: '1em',+ 'aria-hidden': true as const,+};++export const gothicIconRegistry: IconRegistry = {+ close: <X {...iconProps} />,+ chevronDown: <ChevronDown {...iconProps} />,+ chevronLeft: <ChevronLeft {...iconProps} />,+ chevronRight: <ChevronRight {...iconProps} />,+ check: <Check {...iconProps} />,+ success: <CheckCircle {...iconProps} />,+ error: <XCircle {...iconProps} />,+ warning: <AlertTriangle {...iconProps} />,+ info: <Info {...iconProps} />,+ calendar: <Calendar {...iconProps} />,+ clock: <Clock {...iconProps} />,+ externalLink: <ExternalLink {...iconProps} />,+ menu: <Menu {...iconProps} />,+ moreHorizontal: <MoreHorizontal {...iconProps} />,+ search: <Search {...iconProps} />,+ arrowUp: <ArrowUp {...iconProps} />,+ arrowDown: <ArrowDown {...iconProps} />,+ arrowsUpDown: <ArrowUpDown {...iconProps} />,+ funnel: <Filter {...iconProps} />,+ eyeSlash: <EyeOff {...iconProps} />,+ viewColumns: <Columns {...iconProps} />,+ copy: <Copy {...iconProps} />,+ checkDouble: <CheckCheck {...iconProps} />,+ wrench: <Wrench {...iconProps} />,+ stop: <Square {...iconProps} />,+ microphone: <Mic {...iconProps} />,+};diff --git a/packages/cli/templates/themes/manifest.json b/packages/cli/templates/themes/manifest.jsonnew file mode 100644index 0000000000..90fa0a2f27--- /dev/null+++ b/packages/cli/templates/themes/manifest.json@@ -0,0 +1,90 @@+{+ "version": 1,+ "generatedBy": "scripts/generate-cli-themes.mjs",+ "themes": [+ {+ "slug": "butter",+ "displayName": "Butter",+ "description": "Warm, creamy yellows with a friendly blue accent. Playful enough for consumer surfaces, soft enough to stay readable.",+ "maintained": false,+ "entry": "butterTheme.ts",+ "exportName": "butterTheme",+ "files": [+ "butterTheme.ts",+ "icons.tsx"+ ]+ },+ {+ "slug": "chocolate",+ "displayName": "Chocolate",+ "description": "Warm chocolate theme for Astryx — rich brown palette with Fraunces headings, Albert Sans body, and Lucide icons",+ "maintained": false,+ "entry": "chocolateTheme.ts",+ "exportName": "chocolateTheme",+ "files": [+ "chocolateTheme.ts",+ "icons.tsx"+ ]+ },+ {+ "slug": "gothic",+ "displayName": "Gothic",+ "description": "Deep blue-grays and a signature display serif. Dramatic and editorial, for surfaces that want to be remembered.",+ "maintained": false,+ "entry": "gothicTheme.ts",+ "exportName": "gothicTheme",+ "files": [+ "gothicTheme.ts",+ "icons.tsx"+ ]+ },+ {+ "slug": "matcha",+ "displayName": "Matcha",+ "description": "Earthy greens with a calm, organic feel. Naturalistic and grounded, great for wellness or content-first apps.",+ "maintained": false,+ "entry": "matchaTheme.ts",+ "exportName": "matchaTheme",+ "files": [+ "matchaTheme.ts",+ "icons.tsx"+ ]+ },+ {+ "slug": "neutral",+ "displayName": "Neutral",+ "description": "Restrained warm grays. Minimal and quiet, so the content stays the focus.",+ "maintained": true,+ "entry": "neutralTheme.ts",+ "exportName": "neutralTheme",+ "files": [+ "neutralTheme.ts",+ "icons.tsx"+ ]+ },+ {+ "slug": "stone",+ "displayName": "Stone",+ "description": "Warm stone and slate, earthy and understated, with just enough character to feel handcrafted.",+ "maintained": false,+ "entry": "stoneTheme.ts",+ "exportName": "stoneTheme",+ "files": [+ "stoneTheme.ts",+ "icons.tsx"+ ]+ },+ {+ "slug": "y2k",+ "displayName": "Y2K",+ "description": "Hot pinks, lime greens, and Poppins. Bubbly, playful, and unmistakably retro.",+ "maintained": false,+ "entry": "y2kTheme.ts",+ "exportName": "y2kTheme",+ "files": [+ "y2kTheme.ts",+ "icons.tsx"+ ]+ }+ ]+}diff --git a/packages/cli/templates/themes/matcha/icons.tsx b/packages/cli/templates/themes/matcha/icons.tsxnew file mode 100644index 0000000000..b5a9a83cde--- /dev/null+++ b/packages/cli/templates/themes/matcha/icons.tsx@@ -0,0 +1,67 @@+// Copyright (c) Meta Platforms, Inc. and affiliates.++import React from 'react';+import type {IconRegistry} from '@astryxdesign/core/Icon';++import {+ X,+ ChevronDown,+ ChevronLeft,+ ChevronRight,+ Check,+ CheckCircle,+ XCircle,+ AlertTriangle,+ Info,+ Calendar,+ Clock,+ ExternalLink,+ Menu,+ MoreHorizontal,+ Search,+ ArrowUp,+ ArrowDown,+ ArrowUpDown,+ Filter,+ EyeOff,+ Columns,+ Copy,+ CheckCheck,+ Wrench,+ Square,+ Mic,+} from 'lucide-react';++const iconProps = {+ size: '1em',+ 'aria-hidden': true as const,+};++export const matchaIconRegistry: IconRegistry = {+ close: <X {...iconProps} />,+ chevronDown: <ChevronDown {...iconProps} />,+ chevronLeft: <ChevronLeft {...iconProps} />,+ chevronRight: <ChevronRight {...iconProps} />,+ check: <Check {...iconProps} />,+ success: <CheckCircle {...iconProps} />,+ error: <XCircle {...iconProps} />,+ warning: <AlertTriangle {...iconProps} />,+ info: <Info {...iconProps} />,+ calendar: <Calendar {...iconProps} />,+ clock: <Clock {...iconProps} />,+ externalLink: <ExternalLink {...iconProps} />,+ menu: <Menu {...iconProps} />,+ moreHorizontal: <MoreHorizontal {...iconProps} />,+ search: <Search {...iconProps} />,+ arrowUp: <ArrowUp {...iconProps} />,+ arrowDown: <ArrowDown {...iconProps} />,+ arrowsUpDown: <ArrowUpDown {...iconProps} />,+ funnel: <Filter {...iconProps} />,+ eyeSlash: <EyeOff {...iconProps} />,+ viewColumns: <Columns {...iconProps} />,+ copy: <Copy {...iconProps} />,+ checkDouble: <CheckCheck {...iconProps} />,+ wrench: <Wrench {...iconProps} />,+ stop: <Square {...iconProps} />,+ microphone: <Mic {...iconProps} />,+};diff --git a/packages/cli/templates/themes/matcha/matchaTheme.ts b/packages/cli/templates/themes/matcha/matchaTheme.tsnew file mode 100644index 0000000000..6bcc2d4599--- /dev/null+++ b/packages/cli/templates/themes/matcha/matchaTheme.ts@@ -0,0 +1,247 @@+// Copyright (c) Meta Platforms, Inc. and affiliates.++/**+ * Matcha Theme+ *+ * An earthy green theme inspired by matcha tea and natural botanicals.+ * Core palette: #3E481D, #707E46, #C0CBA9, #F0F0E0, #FFFFFF+ * Uses Playwrite US Trad for headings and DM Sans for body text.+ */++import {defineTheme, defineSyntaxTheme} from '@astryxdesign/core/theme';+import {matchaIconRegistry} from './icons';++/** Matcha syntax palette — earthy greens and warm tones. */+const matchaSyntax = defineSyntaxTheme({+ name: 'xds-matcha',+ tokens: {+ keyword: ['#5a6b2a', '#a8bf6a'],+ string: ['#2e6b4a', '#7bc49e'],+ comment: ['#707E46', '#707E46'],+ number: ['#8c6b30', '#d4b870'],+ function: ['#3a5e8c', '#7ba8d4'],+ type: ['#6b4a8c', '#b08ed4'],+ variable: ['#3E481D', '#C0CBA9'],+ operator: ['#707E46', '#94a468'],+ constant: ['#8c6b30', '#d4b870'],+ tag: ['#8c3a3a', '#d47a7a'],+ attribute: ['#7c5e3a', '#c4a882'],+ property: ['#3a7c6b', '#70c4b0'],+ punctuation: ['#707E46', '#5a6440'],+ background: ['#F0F0E0', '#1a1c14'],+ },+});++export const matchaTheme = defineTheme({+ name: 'matcha',++ typography: {+ // base 16 / ratio 1.25 — aligned with the other themes' geometric scale.+ scale: {base: 16, ratio: 1.25},+ body: {+ family: 'DM Sans',+ fallbacks:+ '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif',+ },+ heading: {+ family: 'Playwrite US Trad',+ fallbacks: 'Georgia, "Times New Roman", Times, serif',+ },+ code: {+ family: 'JetBrains Mono',+ fallbacks: '"SF Mono", Monaco, Consolas, monospace',+ },+ },++ motion: {fast: 125, medium: 300, slow: 700, ratio: 0.75},++ syntax: matchaSyntax,++ tokens: {+ // =========================================================================+ // Colors — earthy matcha palette+ // Core: #3E481D, #707E46, #C0CBA9, #F0F0E0, #FFFFFF+ // =========================================================================++ // Core semantic+ '--color-accent': ['#3E481D', '#C0CBA9'],+ '--color-accent-muted': ['#3E481D14', '#C0CBA920'],+ '--color-neutral': ['#3E481D0F', '#C0CBA91A'],+ '--color-background-surface': ['#FFFFFF', '#1a1c14'],+ '--color-background-body': ['#F0F0E0', '#12140e'],+ '--color-overlay': ['#3E481D80', '#3E481DCC'],+ '--color-overlay-hover': ['#3E481D0D', '#C0CBA90D'],+ '--color-overlay-pressed': ['#3E481D1A', '#C0CBA91A'],+ '--color-background-muted': ['#F0F0E0', '#3E481D'],++ // Text+ '--color-text-primary': ['#3E481D', '#C0CBA9'],+ '--color-text-secondary': ['#707E46', '#94a468'],+ '--color-text-disabled': ['#C0CBA9', '#5a6440'],+ '--color-text-accent': ['#3E481D', '#C0CBA9'],+ '--color-on-dark': '#FFFFFF',+ '--color-on-light': '#3E481D',+ '--color-on-accent': ['#FFFFFF', '#3E481D'],+ '--color-on-success': ['#FFFFFF', '#3E481D'],+ '--color-on-error': ['#FFFFFF', '#3E481D'],+ '--color-on-warning': ['#3E481D', '#3E481D'],++ // Icon+ '--color-icon-accent': ['#3E481D', '#C0CBA9'],+ '--color-icon-primary': ['#3E481D', '#C0CBA9'],+ '--color-icon-secondary': ['#707E46', '#94a468'],+ '--color-icon-disabled': ['#C0CBA9', '#5a6440'],++ // Surface variants+ '--color-background-card': ['#FFFFFF', '#1e2016'],+ '--color-background-popover': ['#FFFFFF', '#3E481D'],+ '--color-background-inverted': ['#3E481D', '#C0CBA9'],++ // Status / Sentiment+ '--color-success': ['#4D9900', '#6dbf2a'],+ '--color-success-muted': ['#4D990020', '#6dbf2a20'],+ '--color-error': ['#FD0000', '#ff5c5c'],+ '--color-error-muted': ['#FD000020', '#ff5c5c20'],+ '--color-warning': ['#FFB600', '#ffc940'],+ '--color-warning-muted': ['#FFB60020', '#ffc94020'],++ // Border+ // Softer sage borders (default + emphasized/card) in light mode.+ '--color-border': ['#DCE3CE', '#C0CBA91A'],+ '--color-border-emphasized': ['#B7C29E', '#5a6440'],++ // Effects+ '--color-skeleton': ['#C0CBA9', '#5a6440'],+ '--color-shadow': ['#3E481D1A', '#0000004D'],+ '--color-tint-hover': ['black', 'white'],++ // Categorical — Blue+ '--color-background-blue': ['#3a5e8c33', '#3a5e8c33'],+ '--color-border-blue': ['#3a5e8c', '#7ba8d4'],+ '--color-icon-blue': ['#3a5e8c', '#7ba8d4'],+ '--color-text-blue': ['#2e4a6e', '#8dbce0'],++ // Categorical — Cyan+ '--color-background-cyan': ['#3a7c7c33', '#3a7c7c33'],+ '--color-border-cyan': ['#3a7c7c', '#70c4c4'],+ '--color-icon-cyan': ['#3a7c7c', '#70c4c4'],+ '--color-text-cyan': ['#2e6060', '#82d4d4'],++ // Categorical — Gray+ '--color-background-gray': ['#707E4633', '#5a644033'],+ '--color-border-gray': ['#707E46', '#707E46'],+ '--color-icon-gray': ['#707E46', '#94a468'],+ '--color-text-gray': ['#3E481D', '#C0CBA9'],++ // Categorical — Green+ '--color-background-green': ['#4D990033', '#6dbf2a33'],+ '--color-border-green': ['#4D9900', '#6dbf2a'],+ '--color-icon-green': ['#4D9900', '#6dbf2a'],+ '--color-text-green': ['#3d7a00', '#80d43a'],++ // Categorical — Orange+ '--color-background-orange': ['#c4762033', '#d4903a33'],+ '--color-border-orange': ['#c47620', '#d4903a'],+ '--color-icon-orange': ['#c47620', '#d4903a'],+ '--color-text-orange': ['#a06018', '#e0a04a'],++ // Categorical — Pink+ '--color-background-pink': ['#c44a7033', '#e07a9a33'],+ '--color-border-pink': ['#c44a70', '#e07a9a'],+ '--color-icon-pink': ['#c44a70', '#e07a9a'],+ '--color-text-pink': ['#a03a5a', '#f08aaa'],++ // Categorical — Purple+ '--color-background-purple': ['#6b4a8c33', '#b08ed433'],+ '--color-border-purple': ['#6b4a8c', '#b08ed4'],+ '--color-icon-purple': ['#6b4a8c', '#b08ed4'],+ '--color-text-purple': ['#553a70', '#c0a0e0'],++ // Categorical — Red+ '--color-background-red': ['#FD000033', '#ff5c5c33'],+ '--color-border-red': ['#FD0000', '#ff5c5c'],+ '--color-icon-red': ['#FD0000', '#ff5c5c'],+ '--color-text-red': ['#cc0000', '#ff7a7a'],++ // Categorical — Teal+ '--color-background-teal': ['#2e6b5a33', '#5ab89833'],+ '--color-border-teal': ['#2e6b5a', '#5ab898'],+ '--color-icon-teal': ['#2e6b5a', '#5ab898'],+ '--color-text-teal': ['#245546', '#6ccaaa'],++ // Categorical — Yellow+ '--color-background-yellow': ['#FFB60033', '#ffc94033'],+ '--color-border-yellow': ['#FFB600', '#ffc940'],+ '--color-icon-yellow': ['#FFB600', '#ffc940'],+ '--color-text-yellow': ['#cc9200', '#ffd960'],++ // =========================================================================+ // Spacing+ // =========================================================================+ '--spacing-0-5': '3px',+ '--spacing-1': '6px',+ '--spacing-1-5': '9px',+ '--spacing-2': '12px',+ '--spacing-3': '18px',+ '--spacing-4': '24px',+ '--spacing-5': '30px',+ '--spacing-6': '36px',+ '--spacing-7': '42px',+ '--spacing-8': '48px',+ '--spacing-9': '54px',+ '--spacing-10': '60px',+ '--spacing-11': '66px',+ '--spacing-12': '72px',++ // =========================================================================+ // Radius — soft and rounded+ // =========================================================================+ '--radius-inner': '6px',+ '--radius-element': '12px',+ '--radius-container': '18px',+ '--radius-page': '42px',++ // No explicit --font-size-* overrides — font sizes come from+ // typography.scale above, keeping the scale the single source of truth.++ // =========================================================================+ // Element sizes+ // =========================================================================+ '--size-element-sm': '36px',+ '--size-element-md': '40px',+ '--size-element-lg': '44px',++ // =========================================================================+ // Shadows+ // =========================================================================+ '--shadow-low': '0 2px 4px #3E481D0D, 0 4px 8px #3E481D1A',+ '--shadow-med': '0 2px 4px #3E481D0D, 0 4px 12px #3E481D1A',+ '--shadow-high': '0 4px 6px #3E481D1A, 0 12px 24px #3E481D26',+ '--shadow-inset-hover': 'inset 0px 0px 0px 2px #3E481D30',+ '--shadow-inset-selected': 'inset 0px 0px 0px 2px #3E481D50',+ '--shadow-inset-success': 'inset 0px 0px 0px 2px #4D990050',+ '--shadow-inset-warning': 'inset 0px 0px 0px 2px #FFB60050',+ '--shadow-inset-error': 'inset 0px 0px 0px 2px #FD000050',+ },++ components: {+ button: {+ base: {+ borderRadius: 'var(--radius-full)',+ },+ },+ card: {+ base: {+ borderRadius: 'var(--radius-page)',+ padding: 'var(--spacing-3)',+ },+ },+ section: {+ base: {+ padding: 'var(--spacing-3)',+ },+ },+ },++ icons: matchaIconRegistry,+});diff --git a/packages/cli/templates/themes/neutral/icons.tsx b/packages/cli/templates/themes/neutral/icons.tsxnew file mode 100644index 0000000000..ea093d9b58--- /dev/null+++ b/packages/cli/templates/themes/neutral/icons.tsx@@ -0,0 +1,77 @@+// Copyright (c) Meta Platforms, Inc. and affiliates.++/**+ * @file icons.tsx+ * @input Uses lucide-react icon components, IconRegistry type+ * @output Exports neutralIconRegistry for the neutral theme+ * @position Icon configuration for the neutral theme; consumed by index.ts+ *+ * Maps semantic icon names to Lucide icon components.+ * These icons are bundled with the theme, not with @astryxdesign/core.+ */++import React from 'react';+import type {IconRegistry} from '@astryxdesign/core/Icon';++import {+ X,+ ChevronDown,+ ChevronLeft,+ ChevronRight,+ Check,+ CheckCircle,+ XCircle,+ AlertTriangle,+ Info,+ Calendar,+ Clock,+ ExternalLink,+ Menu,+ MoreHorizontal,+ Search,+ ArrowUp,+ ArrowDown,+ ArrowUpDown,+ Filter,+ EyeOff,+ Columns,+ Copy,+ CheckCheck,+ Wrench,+ Square,+ Mic,+} from 'lucide-react';++const iconProps = {+ size: '1em',+ 'aria-hidden': true as const,+};++export const neutralIconRegistry: IconRegistry = {+ close: <X {...iconProps} />,+ chevronDown: <ChevronDown {...iconProps} />,+ chevronLeft: <ChevronLeft {...iconProps} />,+ chevronRight: <ChevronRight {...iconProps} />,+ check: <Check {...iconProps} />,+ success: <CheckCircle {...iconProps} />,+ error: <XCircle {...iconProps} />,+ warning: <AlertTriangle {...iconProps} />,+ info: <Info {...iconProps} />,+ calendar: <Calendar {...iconProps} />,+ clock: <Clock {...iconProps} />,+ externalLink: <ExternalLink {...iconProps} />,+ menu: <Menu {...iconProps} />,+ moreHorizontal: <MoreHorizontal {...iconProps} />,+ search: <Search {...iconProps} />,+ arrowUp: <ArrowUp {...iconProps} />,+ arrowDown: <ArrowDown {...iconProps} />,+ arrowsUpDown: <ArrowUpDown {...iconProps} />,+ funnel: <Filter {...iconProps} />,+ eyeSlash: <EyeOff {...iconProps} />,+ viewColumns: <Columns {...iconProps} />,+ copy: <Copy {...iconProps} />,+ checkDouble: <CheckCheck {...iconProps} />,+ wrench: <Wrench {...iconProps} />,+ stop: <Square {...iconProps} />,+ microphone: <Mic {...iconProps} />,+};diff --git a/packages/cli/templates/themes/neutral/neutralTheme.ts b/packages/cli/templates/themes/neutral/neutralTheme.tsnew file mode 100644index 0000000000..d28c6f60a8--- /dev/null+++ b/packages/cli/templates/themes/neutral/neutralTheme.ts@@ -0,0 +1,603 @@+// Copyright (c) Meta Platforms, Inc. and affiliates.++/**+ * Neutral Theme+ *+ * A pure grayscale spine with a from-scratch OKLCH-derived categorical+ * palette. Hues are placed at evenly-spaced positions on the OKLCH wheel,+ * chosen to keep each color recognizable at every tone (no red drift for+ * orange, no blue drift for purple) and well-separated from its neighbors.+ *+ * Core neutral palette: #fafafa, #f5f5f5, #e5e5e5, #737373, #262626, #0a0a0a+ *+ * Categorical hues (OKLCH; chroma = max-in-gamut at the saturated stop):+ * Red H=25 Orange H=65 Yellow H=90 Green H=145+ * Teal H=180 Cyan H=215 Blue H=250 Purple H=320 Pink H=355+ *+ * Saturated badge stops:+ * • Cool/medium hues sit at OKLCH L=0.48–0.50 with white text (AA+)+ * • Bright warm hues (orange L=0.68, yellow L=0.80) use dark text+ *+ * Token tonal stops:+ * bg = T90 (light) / T20 (dark)+ * border = T80 / T30+ * icon = T30 / T80+ * text = T30 / T80+ *+ * All 9 saturated badge values pass WCAG AA (5.6–9.6 contrast range).+ *+ * Only overrides tokens that differ from the defaults.+ */++import {defineTheme, defineSyntaxTheme} from '@astryxdesign/core/theme';+import {neutralIconRegistry} from './icons';++/**+ * Neutral syntax palette — pulled from the OKLCH T30 (light) / T80 (dark)+ * stops of the categorical ramps. Same colors used by --color-icon-* tokens.+ */+const neutralSyntax = defineSyntaxTheme({+ name: 'xds-neutral',+ tokens: {+ keyword: ['#700084', '#efa8ff'], // purple T30/T80+ string: ['#005600', '#a6d2a2'], // green (sat T30 / pastel T80)+ comment: ['#737373', '#a3a3a3'], // neutral+ number: ['#6e3500', '#ffb37f'], // orange+ function: ['#00458c', '#a0caff'], // blue T30/T80 H=255+ type: ['#700084', '#efa8ff'], // purple+ variable: ['#171717', '#e5e5e5'], // near-black / near-white+ operator: ['#737373', '#a3a3a3'], // neutral+ constant: ['#6e3500', '#ffb37f'], // orange+ tag: ['#89001a', '#ffaeaa'], // red+ attribute: ['#584400', '#eec12f'], // yellow+ property: ['#005348', '#83dac9'], // teal+ punctuation: ['#a3a3a3', '#525252'], // neutral+ background: ['#fafafa', '#0a0a0a'],+ },+});++export const neutralTheme = defineTheme({+ name: 'neutral',++ // Typography: Figtree across body, heading, and display sizes (display+ // size tokens inherit from heading.family). Monospace stays as the+ // platform default for code.+ // Scale: base=14, ratio=1.2. Bold weights on h3/h4 for subsection hierarchy.+ typography: {+ scale: {base: 14, ratio: 1.2},+ body: {+ family: 'Figtree',+ fallbacks:+ '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif',+ },+ heading: {+ family: 'Figtree',+ fallbacks:+ '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif',+ weights: {3: 'bold', 4: 'bold'},+ },+ code: {+ family: 'ui-monospace',+ fallbacks:+ '"SF Mono", Monaco, Consolas, "Liberation Mono", "Courier New", monospace',+ },+ },++ // Motion: snappier than default to match shadcn/Tailwind conventions.+ // Produces: fast-min=95ms, fast=125ms, fast-max=165ms,+ // medium-min=225ms, medium=300ms, medium-max=400ms.+ motion: {fast: 125, medium: 300, slow: 700, ratio: 0.75},++ syntax: neutralSyntax,++ tokens: {+ // =========================================================================+ // Core — pure grayscale spine (Tailwind neutral)+ // 50:#fafafa 100:#f5f5f5 200:#e5e5e5 300:#d4d4d4 400:#a3a3a3+ // 500:#737373 600:#525252 700:#404040 800:#262626 900:#171717 950:#0a0a0a+ // =========================================================================++ // =========================================================================+ // Backgrounds — Figma-style flat with a single lifted surface.+ //+ // Dark mode collapses card / popover / muted to body T10. Cards and+ // popovers lift purely via shadow + inset highlight (see --shadow-*+ // below) — they don't need a distinct tone.+ //+ // Surface is the exception: it's tonally LIGHTER than body (T15) so+ // interactive components that sit on top of body have a clear,+ // differentiated foreground. Real consumers of --color-background-surface+ // are: switches, radios, checkboxes, multi-selectors, dialogs, app+ // shells, sections — all things that need to lift above the canvas.+ //+ // surface T15 #262626 — interactive surfaces lifted above body+ // body T10 #1b1b1b — main canvas+ // card T10 #1b1b1b — same as body, lifts via --shadow-low+ // popover T10 #1b1b1b — same as body, lifts via --shadow-med+ // muted T10 #1b1b1b — same as body+ //+ // Light mode keeps the standard ladder (white surfaces float on tinted+ // body; shadows do most of the lifting):+ // surface T100 #ffffff+ // body T95 #f1f1f1+ // card T100 #ffffff+ // popover T100 #ffffff+ // muted T95 #f1f1f1+ //+ // All values use the OKLCH Neutral tonal palette (chroma=0).+ // =========================================================================+ '--color-background-surface': ['#ffffff', '#262626'],+ '--color-background-body': ['#f1f1f1', '#1b1b1b'],+ '--color-background-card': ['#ffffff', '#1b1b1b'],+ '--color-background-popover': ['#ffffff', '#1b1b1b'],+ '--color-background-muted': ['#f1f1f1', '#1b1b1b'],++ // Accent + neutral surface tints (sit alongside backgrounds)+ '--color-accent': ['#262626', '#ebebeb'],+ '--color-accent-muted': ['#f1f1f1', '#262626'],+ '--color-neutral': ['#0000000F', '#FFFFFF1A'],++ // Overlays (modal scrims, hover/pressed tints)+ '--color-overlay': ['#00000080', '#000000CC'],+ '--color-overlay-hover': ['#0000000D', '#FFFFFF0D'],+ '--color-overlay-pressed': ['#0000001A', '#FFFFFF1A'],++ // Text+ '--color-text-primary': ['#171717', '#fafafa'],+ '--color-text-secondary': ['#737373', '#a3a3a3'],+ '--color-text-disabled': ['#a3a3a3', '#525252'],+ '--color-text-accent': ['#262626', '#ebebeb'],+ '--color-on-dark': '#ffffff',+ '--color-on-light': '#171717',+ // Contrast: neutral accent is near-black (L) / near-white (D)+ '--color-on-accent': ['#ffffff', '#171717'],+ '--color-on-success': ['#ffffff', '#171717'],+ '--color-on-error': ['#ffffff', '#171717'],+ '--color-on-warning': '#171717',++ // Icon+ '--color-icon-accent': ['#262626', '#ebebeb'],+ '--color-icon-primary': ['#171717', '#fafafa'],+ '--color-icon-secondary': ['#737373', '#a3a3a3'],+ '--color-icon-disabled': ['#a3a3a3', '#525252'],++ // Status / Sentiment — dark mode follows the issue #2150 rubric:+ //+ // Light mode: pastel T90 banner bg + dark T30/T40 text/icon. Locked+ // light values for cards/banners/inputs/destructive btn.+ // Dark mode : tinted-dark T20 bg + light pastel T80 text. INVERTED+ // from light. Avoids the §5 "pastel-in-both-modes"+ // anti-pattern (locked pastels glow against a dark body).+ //+ // --color-X = "saturated text/icon stop":+ // light = T40 dark colored (sits on light pastel)+ // dark = T80 light pastel (sits on dark tinted bg)+ // Used by destructive button text, input border/icon+ // (in light), banner-status-* text overrides.+ // --color-X-muted = "muted bg stop":+ // light = T90 light pastel+ // dark = hue-tinted alpha overlay (T70 stop @ 24%)+ // Used by banner bg, status-input message bg,+ // destructive button bg. Dark mode uses an alpha+ // overlay rather than a solid T20 tinted bg so+ // the surface composes onto whatever sits behind+ // it (body, card, popover) rather than reading+ // as a hard colored panel.+ //+ // 24% alpha = '3D' suffix. Hue values match --color-icon-{X} dark+ // slots (palette T70). Composited onto body #1b1b1b, the effective+ // bg luminance hits ~1.65-1.70:1 vs body — visible colored surface+ // without the heaviness of a solid T20 panel.+ '--color-success': ['#007004', '#9fe59b'],+ '--color-error': ['#a50c25', '#ffc6c1'],+ '--color-warning': ['#745b00', '#fdcf4f'],+ '--color-success-muted': ['#c5e5c0', '#84c9803D'],+ '--color-error-muted': ['#facecb', '#ff9e973D'],+ '--color-warning-muted': ['#f8da9d', '#deb4333D'],++ // Border+ '--color-border': ['#ebebeb', '#FFFFFF1A'],+ '--color-border-emphasized': ['#d4d4d4', '#525252'],++ // Effects+ '--color-skeleton': ['#ebebeb', '#525252'],+ '--color-shadow': ['#0000001A', '#0000004D'],+ '--color-tint-hover': ['black', 'white'],++ // =========================================================================+ // Categorical — light mode uses pastel surfaces + dark colored text;+ // dark mode INVERTS to a hue-tinted alpha overlay surface ++ // light pastel text (per #2150 rubric §3 — pick the tone+ // that satisfies required contrast against every surface+ // the token touches).+ //+ // Per-token tone choice (CIELab L*):+ // bg light=T87-T90 pastel dark=T70 hue @ 24% alpha overlay+ // (composites onto body to ~1.65:1+ // vs body — colored surface that+ // feels lighter than a solid T20+ // panel; same hue as --color-icon-X+ // dark slot, just at lower opacity)+ // border light=T80 pastel dark=T60 mid-bright (>=5.8:1 vs body)+ // icon light=T30 dark colored dark=T70 light pastel+ // text light=T30 dark colored dark=T80 light pastel (>=7:1 on bg)+ //+ // Light pastels still use the per-hue chroma table (red/blue C=0.05,+ // orange/green/purple/pink C=0.06, teal/cyan C=0.07, yellow H=85 C=0.10)+ // for equal PERCEIVED saturation. Dark stops (T60/T70/T80) come from+ // the dark-mode tonal palette (chroma×0.85, +5 tone lift tapering 80-95).+ // =========================================================================++ // Each row's dark slots are HCT-derived from the source hex listed in+ // apps/sandbox/src/app/(fullscreen)/pages/neutral-palette/page.tsx via+ // the canonical dark-ramp transform (chroma×0.85, +5 tone-lift taper)+ // — same algorithm the Tonal Palettes preview renders. Border=T60,+ // icon=T70, text=T80. Background uses the T70 hue at 24% alpha so the+ // overlay surface composites onto body to ~1.65:1 luminance.++ // Red H=22 — source #eb183a+ '--color-background-red': ['#facecb', '#ff9e973D'],+ '--color-border-red': ['#e6bab8', '#ff6f6c'],+ '--color-icon-red': ['#89001a', '#ff9e97'],+ '--color-text-red': ['#89001a', '#ffc6c1'],++ // Orange H=55 — source #d57113+ '--color-background-orange': ['#fad0b5', '#ffa2583D'],+ '--color-border-orange': ['#e6bda2', '#e2883e'],+ '--color-icon-orange': ['#6e3500', '#ffa258'],+ '--color-text-orange': ['#6e3500', '#ffc9a2'],++ // Yellow H=90 — source #f8c723+ // Light-mode butter-yellow pastel at H=85 C=0.085 L=0.90 — yellow+ // sits at the green-cyan luminance peak so it feels louder than the+ // other status hues at the same canonical L. Picker decision: pull+ // L down one step (0.91→0.90) and C down to its identity floor+ // (0.10→0.085, just above the bronze threshold) so it sits closer+ // to red/blue's perceived brightness without losing yellow identity.+ // Dark-mode comes from the canonical H=90 ramp for tonal-palette+ // consistency.+ '--color-background-yellow': ['#f8da9d', '#deb4333D'],+ '--color-border-yellow': ['#e4c279', '#c0990e'],+ '--color-icon-yellow': ['#584400', '#deb433'],+ '--color-text-yellow': ['#584400', '#fdcf4f'],++ // Green H=144 — source #358a3a+ '--color-background-green': ['#c5e5c0', '#84c9803D'],+ '--color-border-green': ['#b2d1ac', '#69ad67'],+ '--color-icon-green': ['#0c5700', '#84c980'],+ '--color-text-green': ['#0c5700', '#9fe59b'],++ // Teal H=180 — source #0c7365+ // Light pastel uses L=0.87 C=0.065 (a step darker + less chroma than+ // the L=0.888 C=0.07 used by other hues) to compensate for the+ // green-cyan luminance overshoot — at the same OKLCH L, teal/cyan read+ // ~5% brighter than red/blue because the eye's luminance response+ // peaks in this band. Dropping L+C brings perceived brightness in+ // line with the rest of the palette without losing hue identity.+ '--color-background-teal': ['#a5e3d6', '#7ec6b83D'],+ '--color-border-teal': ['#94d6c8', '#63ab9d'],+ '--color-icon-teal': ['#005348', '#7ec6b8'],+ '--color-text-teal': ['#005348', '#99e2d3'],++ // Cyan H=215 — source #0c6f82+ // Same L=0.87 C=0.065 pastel as teal (luminance overshoot compensation).+ '--color-background-cyan': ['#a3e0ef', '#83c2d43D'],+ '--color-border-cyan': ['#91d3e3', '#67a7b8'],+ '--color-icon-cyan': ['#00505f', '#83c2d4'],+ '--color-text-cyan': ['#00505f', '#9edef0'],++ // Blue H=255 — source #0074e2+ // T50 #0074e2 reserved for filled Info badge / progressbar / inset hover.+ '--color-background-blue': ['#c4ddfb', '#9eb7ff3D'],+ '--color-border-blue': ['#b1c9e7', '#6d9cfe'],+ '--color-icon-blue': ['#00458c', '#9eb7ff'],+ '--color-text-blue': ['#00458c', '#c7d3ff'],++ // Purple H=320 — source #980fb2+ '--color-background-purple': ['#eccef3', '#f297ff3D'],+ '--color-border-purple': ['#d8bbdf', '#dd74f0'],+ '--color-icon-purple': ['#700084', '#f297ff'],+ '--color-text-purple': ['#700084', '#fac1ff'],++ // Pink H=355 — source #b10e69+ '--color-background-pink': ['#fccadc', '#ff99c33D'],+ '--color-border-pink': ['#e7b7c8', '#f273aa'],+ '--color-icon-pink': ['#83004b', '#ff99c3'],+ '--color-text-pink': ['#83004b', '#ffc3da'],++ // Gray (categorical neutral, chroma 0)+ // Light: #e5e5e5 (Neutral 200) so it's visibly distinct from the+ // lighter body / muted surface (both #f5f5f5).+ // Dark : var(--color-neutral) — semi-transparent white wash+ // (#FFFFFF1A, 10%). Matches the same treatment the gray+ // badge uses; clearly distinct from the body T10 #1b1b1b+ // while staying chroma-0 neutral. Solid T15 #1c1c1c was+ // indistinguishable from --color-background-muted.+ '--color-background-gray': ['#e5e5e5', 'var(--color-neutral)'],+ '--color-border-gray': ['#d4d4d4', '#262626'],+ '--color-icon-gray': ['#525252', '#a3a3a3'],+ '--color-text-gray': ['#262626', '#e5e5e5'],++ // =========================================================================+ // Radius — slightly larger than default (kept as-is)+ // =========================================================================+ '--radius-none': '0.25rem',+ '--radius-inner': '0.375rem',+ '--radius-element': '0.625rem',+ '--radius-container': '0.75rem',+ '--radius-page': '1.75rem',+ '--radius-full': '9999px',++ // =========================================================================+ // Shadows+ //+ // Light mode: matches origin/main exactly (5%/10% low+med, 10%/15% high).+ // Subtle drops; light surfaces don't need rim highlights.+ //+ // Dark mode: deepened drops + an all-around 1px white inset that wraps+ // every edge ("Figma-style bezel"). The inset mimics ambient light+ // catching the surface's rim on every side, giving cards/popovers/modals+ // a substantial "lit from above" feel that drop shadows alone can't+ // achieve against a dark canvas.+ // low : drops 25%/40% + 8% white all-around inset+ // med : drops 35%/50% + 12% white all-around inset+ // high : drops 50%/70% + 15% white all-around inset+ //+ // The inset layer uses light-dark(transparent, ...) so light mode is+ // unaffected — main's exact light values are preserved.+ // =========================================================================+ '--shadow-low':+ '0 2px 4px light-dark(oklch(0 0 0 / 5%), oklch(0 0 0 / 25%)), ' ++ '0 4px 8px light-dark(oklch(0 0 0 / 10%), oklch(0 0 0 / 40%)), ' ++ 'inset 0 0 0 1px light-dark(transparent, oklch(1 0 0 / 8%))',+ '--shadow-med':+ '0 2px 4px light-dark(oklch(0 0 0 / 5%), oklch(0 0 0 / 35%)), ' ++ '0 4px 12px light-dark(oklch(0 0 0 / 10%), oklch(0 0 0 / 50%)), ' ++ 'inset 0 0 0 1px light-dark(transparent, oklch(1 0 0 / 12%))',+ '--shadow-high':+ '0 4px 6px light-dark(oklch(0 0 0 / 10%), oklch(0 0 0 / 50%)), ' ++ '0 12px 24px light-dark(oklch(0 0 0 / 15%), oklch(0 0 0 / 70%)), ' ++ 'inset 0 0 0 1px light-dark(transparent, oklch(1 0 0 / 15%))',+ '--shadow-inset-hover': 'inset 0px 0px 0px 2px #0074e24D',+ '--shadow-inset-selected': 'inset 0px 0px 0px 2px #0074e280',+ '--shadow-inset-success': 'inset 0px 0px 0px 2px #1981004D',+ '--shadow-inset-warning': 'inset 0px 0px 0px 2px #ffce2f4D',+ '--shadow-inset-error': 'inset 0px 0px 0px 2px #e33f4a4D',+ },++ components: {+ // =========================================================================+ // Button — primary gets white text, secondary gets a border, destructive+ // uses the OKLCH red filled treatment.+ // =========================================================================+ button: {+ 'variant:destructive': {+ backgroundColor: 'var(--color-error-muted)', // locked pastel red bg+ color: 'var(--color-error)', // locked T30 red — matches banner/input error text+ },+ },++ // =========================================================================+ // Badge —+ // Semantic (info/success/warning/error): filled saturated T50 + contrasting+ // text (white, or dark on yellow). The filled-button rule from #2150+ // §3 — text contrast locks the bg tone, so this stays at T50 in+ // BOTH modes, unlike pastel surfaces which invert by mode.+ // Categorical (blue/green/red/orange/etc.): pastel-tinted hue surface ++ // colored text — light mode = soft T87-T90 + dark T30 text; dark mode+ // = T20 tinted + T80 light pastel text (sources: --color-background-X+ // and --color-text-X tokens).+ // Neutral: light gray bg + dark text (or inverted in dark mode).+ // =========================================================================+ badge: {+ // Semantic — filled saturated bg + contrasting text.+ // Light: vivid T45-T55 from the OKLCH palette + white text+ // (~4.5-5:1 — Material/Linear/Vercel pop).+ // Dark : T60 stop from the dark-mode tonal palette (chroma×0.85,+ // +5 tone-lift taper from issue #2150 §4) + DARK text.+ // T60+white fails AA-large (~2.7:1); T60+dark hits 6.6-7:1+ // and tames the §4 vibration. Same dark-text-on-bright-bg+ // treatment that warning yellow uses in both modes.+ 'variant:info': {+ // Light: T50 #0074e2 (palette saturated stop)+ // Dark : T60 stop from dark-mode tonal palette of source #0074e2+ backgroundColor: 'light-dark(#0074e2, #6d9cfe)',+ color: 'light-dark(#ffffff, #171717)',+ },+ 'variant:neutral': {+ // Mirrors the gray categorical badge — same neutral chip treatment+ // (Neutral 200 light / semi-transparent white wash dark) sourced+ // from the gray hue tokens, so a single change at the token layer+ // updates both variants.+ backgroundColor: 'var(--color-background-gray)',+ color: 'var(--color-text-gray)',+ },+ 'variant:success': {+ // Light: T45 #198100 (palette saturated stop)+ // Dark : T60 stop from dark-mode tonal palette of source #198100+ backgroundColor: 'light-dark(#198100, #64af4c)',+ color: 'light-dark(#ffffff, #171717)',+ },+ 'variant:warning': {+ // Yellow stays at the same hex in both modes — chroma reduction+ // is barely visible at T85, and dark text on yellow doesn't+ // suffer from the §4 vibration concern.+ backgroundColor: '#ffce2f',+ color: '#171717',+ },+ 'variant:error': {+ // Light: T55 #e33f4a (palette saturated stop)+ // Dark : T60 stop from dark-mode tonal palette of Tailwind red-600+ // source #dc2626 (kept on H=27 alarm-red rather than coral)+ backgroundColor: 'light-dark(#e33f4a, #ff705d)',+ color: 'light-dark(#ffffff, #171717)',+ },++ // Categorical — bg + text reference the per-hue tokens, so behavior+ // tracks the categorical palette automatically:+ // Light: pastel T87-T90 bg + dark T30 colored text (low-key chip)+ // Dark : tinted T20 bg + light T80 colored text (per #2150 §5,+ // inverted from light to avoid the "pastel-in-both-modes"+ // anti-pattern that makes locked light pastels glow on a+ // dark body)+ 'variant:red': {+ backgroundColor: 'var(--color-background-red)',+ color: 'var(--color-text-red)',+ },+ 'variant:orange': {+ backgroundColor: 'var(--color-background-orange)',+ color: 'var(--color-text-orange)',+ },+ 'variant:yellow': {+ backgroundColor: 'var(--color-background-yellow)',+ color: 'var(--color-text-yellow)',+ },+ 'variant:green': {+ backgroundColor: 'var(--color-background-green)',+ color: 'var(--color-text-green)',+ },+ 'variant:teal': {+ backgroundColor: 'var(--color-background-teal)',+ color: 'var(--color-text-teal)',+ },+ 'variant:cyan': {+ backgroundColor: 'var(--color-background-cyan)',+ color: 'var(--color-text-cyan)',+ },+ 'variant:blue': {+ backgroundColor: 'var(--color-background-blue)',+ color: 'var(--color-text-blue)',+ },+ 'variant:purple': {+ backgroundColor: 'var(--color-background-purple)',+ color: 'var(--color-text-purple)',+ },+ 'variant:pink': {+ backgroundColor: 'var(--color-background-pink)',+ color: 'var(--color-text-pink)',+ },+ 'variant:gray': {+ backgroundColor: 'var(--color-background-gray)',+ color: 'var(--color-text-gray)',+ },+ },++ // =========================================================================+ // Banner — sits on a hue-tinted surface with colored text/icon:+ // Light: pastel T90 bg (pulled from --color-{X}-muted / --color-background-blue)+ // + dark T30 colored text (--color-text-{hue}).+ // Dark : tinted T20 bg (same tokens, dark slot) + light T80 colored text.+ // Per #2150 §5 — large hue-tinted surfaces in dark mode invert+ // to a deep tinted bg + light text rather than locking the+ // light-mode pastel.+ //+ // The inner-header *-muted token is forced transparent so the outer+ // tinted background shows through cleanly.+ //+ // Status overrides reference --color-text-{hue} so text/icon colors+ // stay in sync with the palette anchors automatically.+ banner: {+ 'status:info': {+ backgroundColor: 'var(--color-background-blue)',+ '--color-accent-muted': 'transparent',+ '--color-text-primary': 'var(--color-text-blue)',+ '--color-text-secondary': 'var(--color-text-blue)',+ '--color-accent': 'var(--color-text-blue)',+ },+ // success/warning/error banner bgs come from --color-{X}-muted, which+ // already carries the correct light/dark tinted values. We only need+ // to redirect the text/icon to the palette colored stop.+ 'status:success': {+ '--color-text-primary': 'var(--color-text-green)',+ '--color-text-secondary': 'var(--color-text-green)',+ '--color-success': 'var(--color-text-green)',+ },+ 'status:warning': {+ '--color-text-primary': 'var(--color-text-yellow)',+ '--color-text-secondary': 'var(--color-text-yellow)',+ '--color-warning': 'var(--color-text-yellow)',+ },+ 'status:error': {+ '--color-text-primary': 'var(--color-text-red)',+ '--color-text-secondary': 'var(--color-text-red)',+ '--color-error': 'var(--color-text-red)',+ },+ },++ // =========================================================================+ // TextInput — no per-status overrides needed. The global tokens+ // --color-{success,error,warning} carry the correct values in both+ // modes (light=T40 dark colored, dark=T80 light pastel) for both+ // surfaces the input border/icon touches: the input surface+ // (white/T15-dark) and the status message bubble (light pastel T90 /+ // dark T20). Verified all six combinations clear AA non-text 3:1.+ // =========================================================================++ // =========================================================================+ // Switch — off-state track uses the same lifted-neutral surface as the+ // ProgressBar track (--color-border-emphasized). Aligns the two+ // "channel-on-body" components so their off-states share one visual+ // language: light T85 #d4d4d4 sits one step darker than the body T95+ // bg, dark T35 #525252 sits one step lighter than the body T10. Each+ // is a defined channel, not a wash that blends in.+ // =========================================================================+ switch: {+ base: {+ '--color-background-gray': 'var(--color-border-emphasized)',+ },+ },++ progressbar: {+ base: {+ // Track uses --color-background-muted; override it to+ // --color-border-emphasized (Neutral T85 #d4d4d4 in light mode) so+ // the track is clearly darker than the body bg (Neutral T95 #f1f1f1)+ // and reads as a defined channel rather than blending in. Dark+ // mode inherits T35 #525252 — same one-step-lighter behavior.+ '--color-background-muted': 'var(--color-border-emphasized)',+ },+ // Vivid stops match the filled semantic badge colors (info/success/+ // warning/error variants in the badge override above). Same hex+ // values; documented per role with palette provenance.+ 'variant:accent': {+ // Blue T50 saturated stop (= variant:info badge bg)+ '--color-accent': '#0074e2',+ },+ 'variant:success': {+ // Green T45 saturated stop (= variant:success badge bg)+ '--color-success': '#198100',+ },+ 'variant:warning': {+ // Yellow T85 saturated stop (= variant:warning badge bg)+ '--color-warning': '#ffce2f',+ },+ 'variant:error': {+ // Red T55 saturated stop (= variant:error badge bg)+ '--color-error': '#e33f4a',+ },+ },++ // =========================================================================+ // Card — tighter padding via public card padding token+ // =========================================================================+ card: {+ base: {+ padding: 'var(--spacing-3)',+ },+ },++ // =========================================================================+ // Section — tighter padding via public section padding token+ // =========================================================================+ section: {+ base: {+ padding: 'var(--spacing-3)',+ },+ },++ // Heading and text component overrides are auto-generated by typography.scale.+ // h3/h4 bold weights come from typography.heading.weights above.+ },++ icons: neutralIconRegistry,+});diff --git a/packages/cli/templates/themes/stone/icons.tsx b/packages/cli/templates/themes/stone/icons.tsxnew file mode 100644index 0000000000..88c0f1a9ca--- /dev/null+++ b/packages/cli/templates/themes/stone/icons.tsx@@ -0,0 +1,77 @@+// Copyright (c) Meta Platforms, Inc. and affiliates.++/**+ * @file icons.tsx+ * @input Uses lucide-react icon components, IconRegistry type+ * @output Exports stoneIconRegistry for the neutral theme+ * @position Icon configuration for the neutral theme; consumed by index.ts+ *+ * Maps semantic icon names to Lucide icon components.+ * These icons are bundled with the theme, not with @astryxdesign/core.+ */++import React from 'react';+import type {IconRegistry} from '@astryxdesign/core/Icon';++import {+ X,+ ChevronDown,+ ChevronLeft,+ ChevronRight,+ Check,+ CheckCircle,+ XCircle,+ AlertTriangle,+ Info,+ Calendar,+ Clock,+ ExternalLink,+ Menu,+ MoreHorizontal,+ Search,+ ArrowUp,+ ArrowDown,+ ArrowUpDown,+ Filter,+ EyeOff,+ Columns,+ Copy,+ CheckCheck,+ Wrench,+ Square,+ Mic,+} from 'lucide-react';++const iconProps = {+ size: '1em',+ 'aria-hidden': true as const,+};++export const stoneIconRegistry: IconRegistry = {+ close: <X {...iconProps} />,+ chevronDown: <ChevronDown {...iconProps} />,+ chevronLeft: <ChevronLeft {...iconProps} />,+ chevronRight: <ChevronRight {...iconProps} />,+ check: <Check {...iconProps} />,+ success: <CheckCircle {...iconProps} />,+ error: <XCircle {...iconProps} />,+ warning: <AlertTriangle {...iconProps} />,+ info: <Info {...iconProps} />,+ calendar: <Calendar {...iconProps} />,+ clock: <Clock {...iconProps} />,+ externalLink: <ExternalLink {...iconProps} />,+ menu: <Menu {...iconProps} />,+ moreHorizontal: <MoreHorizontal {...iconProps} />,+ search: <Search {...iconProps} />,+ arrowUp: <ArrowUp {...iconProps} />,+ arrowDown: <ArrowDown {...iconProps} />,+ arrowsUpDown: <ArrowUpDown {...iconProps} />,+ funnel: <Filter {...iconProps} />,+ eyeSlash: <EyeOff {...iconProps} />,+ viewColumns: <Columns {...iconProps} />,+ copy: <Copy {...iconProps} />,+ checkDouble: <CheckCheck {...iconProps} />,+ wrench: <Wrench {...iconProps} />,+ stop: <Square {...iconProps} />,+ microphone: <Mic {...iconProps} />,+};diff --git a/packages/cli/templates/themes/stone/stoneTheme.ts b/packages/cli/templates/themes/stone/stoneTheme.tsnew file mode 100644index 0000000000..c226561ec7--- /dev/null+++ b/packages/cli/templates/themes/stone/stoneTheme.ts@@ -0,0 +1,652 @@+// Copyright (c) Meta Platforms, Inc. and affiliates.++/**+ * Stone Theme+ *+ * A warm, earthy neutral theme inspired by natural stone and sandstone.+ * Core palette: #28282A, #84848B, #D8D8DB, #f3f3f5, #FFFFFF+ * Montserrat for headings, Figtree for body, JetBrains Mono for code.+ */++import {defineTheme, defineSyntaxTheme} from '@astryxdesign/core/theme';+import {stoneIconRegistry} from './icons';++/**+ * Input status border overrides (per-component, per-status). All 9 input+ * components share inputStatusBorderStyles in core, which read+ * --color-{success,warning,error} (T30 light / T80 dark = saturated text+ * tone). Stone redefines those vars inside each input's status scope to+ * T60 light / T70 dark so the border (and the matching status icon) reads+ * as a softer hue rim, in line with the gentle T90 status message bubble.+ */+const INPUT_STATUS_VARS = {+ 'status:success': {+ '--color-success': 'light-dark(#7f977e, #99b298)', // Green T60 / T70+ },+ 'status:warning': {+ '--color-warning': 'light-dark(#9f8f68, #bbaa81)', // Yellow T60 / T70+ },+ 'status:error': {+ '--color-error': 'light-dark(#a58b86, #c0a5a1)', // Red T60 / T70+ },+} as const;++/**+ * Stone syntax palette — light values snap to T40 / T45 stops on the+ * stone categorical ramps (per audit drawer); dark values stay at T70.+ *+ * `string` and `property` both land on Teal T40 — intentional; the audit+ * unified them since green and teal are visually adjacent at T40 and+ * the stone neutral palette doesn't carry a distinct green stop.+ */+const stoneSyntax = defineSyntaxTheme({+ name: 'xds-stone',+ tokens: {+ keyword: ['#645a72', '#b2a7c1'], // Purple T40 / T70+ string: ['#4e6357', '#9bb19a'], // Teal T40 / Green T70+ comment: ['#5e5e5e', '#ababb0'], // Stone Neutral T40 / T70+ number: ['#755752', '#bea792'], // Red T40 / Orange T70+ function: ['#506072', '#99adc6'], // Blue T40 / T70+ type: ['#645a72', '#b2a7c1'], // Purple T40 / T70+ variable: ['#5e5e5e', '#ababb0'], // Stone Neutral T40 / T70+ operator: ['#5e5e5e', '#ababb0'], // Stone Neutral T40 / T70+ constant: ['#755752', '#bea792'], // Red T40 / Orange T70+ tag: ['#775751', '#c7a39d'], // Red T40 / T70+ attribute: ['#79693f', '#b6aa90'], // Yellow T45 / T70+ property: ['#4e6357', '#94b2a0'], // Teal T40 / T70+ punctuation: ['#5e5e5e', '#ababb0'], // Stone Neutral T40 / T70+ background: ['#f3f3f5', '#171719'],+ },+});++export const stoneTheme = defineTheme({+ name: 'stone',++ typography: {+ scale: {base: 14, ratio: 1.25},+ body: {+ family: 'Figtree',+ fallbacks:+ '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif',+ },+ heading: {+ family: 'Montserrat',+ fallbacks:+ '"Figtree", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif',+ weights: {3: 'bold', 4: 'bold'},+ },+ code: {+ family: 'JetBrains Mono',+ fallbacks: '"SF Mono", Monaco, Consolas, monospace',+ },+ },++ motion: {fast: 125, medium: 300, slow: 700, ratio: 0.75},++ syntax: stoneSyntax,++ tokens: {+ // =========================================================================+ // Colors — warm stone palette+ // Core: #28282A, #84848B, #D8D8DB, #f3f3f5, #FFFFFF+ // =========================================================================++ // Core semantic — all neutrals H=291+ // Stone 900 T=16 C=1.4, Stone 500 T=55 C=4, Stone 300 T=86 C=1.6, Stone 100 T=96 C=1+ '--color-accent': ['#25252a', '#f3f3f5'], // light: Stone Neutral T15+ '--color-accent-muted': ['#25252a14', '#f3f3f5'], // light: Stone Neutral T15 · 8%+ '--color-neutral': ['#25252a0f', '#f3f3f51a'], // light: Stone Neutral T15 · 6% / dark: T96 · 10%+ '--color-background-surface': ['#ffffff', '#1b1b1f'], // dark: Stone Neutral T10+ '--color-background-body': ['#f3f3f5', '#111015'], // dark: Stone Neutral T5+ '--color-overlay': ['#25252a80', '#28282a'], // light: Stone Neutral T15 · 50%+ '--color-overlay-hover': ['#25252a0d', '#f3f3f5'], // light: Stone Neutral T15 · 5%+ '--color-overlay-pressed': ['#25252a1a', '#f3f3f5'], // light: Stone Neutral T15 · 10%+ '--color-background-muted': ['#e2e2e8', '#3b3b3f'], // light: Stone Neutral T90++ // Text — H=291+ '--color-text-primary': ['#25252a', '#f3f3f5'], // light: Stone Neutral T15+ '--color-text-secondary': ['#83838a', '#9d9da3'], // T55 C=4 / T65 C=3+ '--color-text-disabled': ['#d7d7da', '#5e5e61'], // T86 C=1.6 / T40 C=2+ '--color-text-accent': ['#25252a', '#f3f3f5'], // light: Stone Neutral T15+ '--color-on-dark': '#FFFFFF',+ '--color-on-light': ['#25252a', '#28282a'], // light: Stone Neutral T15+ '--color-on-accent': ['#ffffff', '#25252a'], // dark: Stone Neutral T15+ // Text on top of matching status surface (badge fill, banner content).+ '--color-on-success': ['#374c36', '#d0e9ce'], // Green T30 / T90+ '--color-on-error': ['#58413e', '#f9dcd7'], // Red T30 / T90+ '--color-on-warning': ['#524622', '#f4e1b7'], // Yellow T30 / T90++ // Icon — H=291+ '--color-icon-accent': ['#25252a', '#f3f3f5'], // light: Stone Neutral T15+ '--color-icon-primary': ['#25252a', '#f3f3f5'], // light: Stone Neutral T15+ '--color-icon-secondary': ['#83838a', '#9d9da3'], // T55 C=4 / T65 C=3+ '--color-icon-disabled': ['#d7d7da', '#5e5e61'], // T86 C=1.6 / T40 C=2++ // Surface variants — H=291+ '--color-background-card': ['#FFFFFF', '#242325'], // T14+ '--color-background-popover': ['#ffffff', '#25252a'], // dark: Stone Neutral T15+ '--color-background-inverted': ['#25252a', '#f3f3f5'], // light: Stone Neutral T15++ // Status / Sentiment — T50 from palette for icons/borders (visible color)+ '--color-success': ['#374c36', '#b4cdb2'], // Green T30 / T80+ '--color-success-muted': ['#d0e9ce', '#b4cdb2'], // Green T90 / T80+ '--color-error': ['#58413e', '#dcc0bc'], // Red T30 / T80+ '--color-error-muted': ['#f9dcd7', '#dcc0bc'], // Red T90 / T80+ '--color-warning': ['#524622', '#d7c59c'], // Yellow T30 / T80+ '--color-warning-muted': ['#f4e1b7', '#d7c59c'], // Yellow T90 / T80++ // Border — H=291+ '--color-border': ['#e2e2e8', '#f3f3f5'], // light: Stone Neutral T90+ '--color-border-emphasized': ['#83838a', '#5e5e61'], // T55 C=4 / T40 C=2++ // Effects — H=291+ '--color-skeleton': ['#d4d4da', '#5e5e64'], // T85 / T40 from H=291 C=3+ '--color-shadow': ['#25252a1a', '#000000'], // light: Stone Neutral T15 · 10%+ '--color-tint-hover': ['black', 'white'],++ // Typography override+ '--text-supporting-size': '12px',++ // Categorical hues+ // Light: T90 solid bg + T30 text (pastel surface, dark text)+ // Dark: T35 solid bg + T90 text — snaps to canonical palette stops+ // per theming-infra.mdc §7. T90 dark text is the SAME hex as+ // the light-mode bg pastel — clean palette symmetry, ~6–9:1+ // contrast on the T35 surface across all hues (passes AA Body).+ // Borders: light T85 / dark T25 — one step inward from surface in both+ // modes, matching the light-mode T90/T85 spacing.++ // Categorical — Blue H=265 C=10+ '--color-background-blue': ['#d7e4f5', '#485362'], // light T90 / dark T35+ '--color-border-blue': ['#c9d6e7', '#313c4a'], // light T85 / dark T25+ '--color-icon-blue': ['#3c4856', '#d7e4f5'], // light T30 / dark T90+ '--color-text-blue': ['#3c4856', '#d7e4f5'],++ // Categorical — Cyan H=190 C=10+ '--color-background-cyan': ['#cce8e5', '#3e5755'],+ '--color-border-cyan': ['#bedad7', '#28403e'],+ '--color-icon-cyan': ['#334b49', '#cce8e5'],+ '--color-text-cyan': ['#334b49', '#cce8e5'],++ // Categorical — Gray (pure neutral, C=0). Same T35/T25/T90 pattern from+ // the neutral H=291 C=3 ramp.+ '--color-background-gray': ['#e2e2e8', '#525257'], // light: Stone Neutral T90+ '--color-border-gray': ['#d4d4da', '#3b3b3f'], // light: Stone Neutral T85+ '--color-icon-gray': ['#46464b', '#e2e2e8'], // light: Stone Neutral T30+ '--color-text-gray': ['#46464b', '#e2e2e8'], // light: Stone Neutral T30++ // Categorical — Green H=142 C=17+ '--color-background-green': ['#d0e9ce', '#425841'],+ '--color-border-green': ['#c2dbc0', '#2b402b'],+ '--color-icon-green': ['#374c36', '#d0e9ce'],+ '--color-text-green': ['#374c36', '#d0e9ce'],++ // Categorical — Orange H=70 C=22+ '--color-background-orange': ['#ffdcbb', '#684d32'],+ '--color-border-orange': ['#f1ceae', '#4f361c'],+ '--color-icon-orange': ['#5b4227', '#ffdcbb'],+ '--color-text-orange': ['#5b4227', '#ffdcbb'],++ // Categorical — Pink H=340 C=9+ '--color-background-pink': ['#f0dde8', '#5e4e57'],+ '--color-border-pink': ['#e2cfda', '#463740'],+ '--color-icon-pink': ['#52424c', '#f0dde8'],+ '--color-text-pink': ['#52424c', '#f0dde8'],++ // Categorical — Purple H=307 C=11+ '--color-background-purple': ['#e8dff3', '#564f60'],+ '--color-border-purple': ['#d9d1e5', '#3f3949'],+ '--color-icon-purple': ['#4b4454', '#e8dff3'],+ '--color-text-purple': ['#4b4454', '#e8dff3'],++ // Categorical — Red H=33 C=11+ '--color-background-red': ['#f9dcd7', '#644d49'],+ '--color-border-red': ['#ebcec9', '#4c3633'],+ '--color-icon-red': ['#58413e', '#f9dcd7'],+ '--color-text-red': ['#58413e', '#f9dcd7'],++ // Categorical — Teal H=158 C=9+ '--color-background-teal': ['#d4e7dc', '#46564d'],+ '--color-border-teal': ['#c6d9ce', '#303f36'],+ '--color-icon-teal': ['#3b4a41', '#d4e7dc'],+ '--color-text-teal': ['#3b4a41', '#d4e7dc'],++ // Categorical — Yellow H=90 C=23+ '--color-background-yellow': ['#f4e1b7', '#5e512d'],+ '--color-border-yellow': ['#e5d3a9', '#463a18'],+ '--color-icon-yellow': ['#524622', '#f4e1b7'],+ '--color-text-yellow': ['#524622', '#f4e1b7'],++ // =========================================================================+ // Radius — clean and subtle+ // =========================================================================+ '--radius-none': '0.125rem',+ '--radius-inner': '0.25rem',+ '--radius-element': '0.5rem',+ '--radius-container': '0.75rem',+ '--radius-page': '1.5rem',+ '--radius-full': '9999px',++ // =========================================================================+ // Shadows+ // =========================================================================+ '--shadow-low': '0 2px 4px #28282A0D, 0 4px 8px #28282A1A',+ '--shadow-med': '0 2px 4px #28282A0D, 0 4px 12px #28282A1A',+ '--shadow-high': '0 4px 6px #28282A1A, 0 12px 24px #28282A26',+ '--shadow-inset-hover': 'inset 0px 0px 0px 2px #28282A30',+ '--shadow-inset-selected': 'inset 0px 0px 0px 2px #28282A50',+ '--shadow-inset-success': 'inset 0px 0px 0px 2px #83838a30',+ '--shadow-inset-warning': 'inset 0px 0px 0px 2px #83838a30',+ '--shadow-inset-error': 'inset 0px 0px 0px 2px #83838a30',+ },++ components: {+ button: {+ base: {+ borderRadius: 'var(--radius-full)',+ },+ 'variant:secondary': {+ backgroundColor: 'transparent',+ borderWidth: '1.5px',+ borderStyle: 'solid',+ borderColor: 'var(--color-border-emphasized)',+ ':hover': {+ backgroundColor: 'var(--color-neutral)',+ },+ },+ 'variant:destructive': {+ backgroundColor: 'var(--color-background-red)',+ color: 'var(--color-text-red)',+ },+ },++ // Semantic variants point at categorical hue tokens — single source of truth.+ badge: {+ 'variant:info': {+ backgroundColor: 'var(--color-background-blue)',+ color: 'var(--color-text-blue)',+ },+ 'variant:neutral': {+ backgroundColor: 'var(--color-background-gray)',+ color: 'var(--color-text-gray)',+ },+ 'variant:success': {+ backgroundColor: 'var(--color-background-green)',+ color: 'var(--color-text-green)',+ },+ 'variant:warning': {+ backgroundColor: 'var(--color-background-yellow)',+ color: 'var(--color-text-yellow)',+ },+ 'variant:error': {+ backgroundColor: 'var(--color-background-red)',+ color: 'var(--color-text-red)',+ },+ },++ // StyleX paints the banner surface from @layer priority4 (above+ // @layer astryx-theme), so a direct backgroundColor override loses the+ // cascade. Redefine the muted token instead so StyleX's var() resolves+ // to the categorical bg in our scope.+ banner: {+ 'status:info': {+ '--color-accent-muted': 'var(--color-background-blue)',+ '--color-text-primary': 'var(--color-text-blue)',+ '--color-text-secondary': 'var(--color-text-blue)',+ '--color-accent': 'var(--color-text-blue)',+ },+ 'status:success': {+ '--color-success-muted': 'var(--color-background-green)',+ '--color-text-primary': 'var(--color-text-green)',+ '--color-text-secondary': 'var(--color-text-green)',+ '--color-success': 'var(--color-text-green)',+ },+ 'status:warning': {+ '--color-warning-muted': 'var(--color-background-yellow)',+ '--color-text-primary': 'var(--color-text-yellow)',+ '--color-text-secondary': 'var(--color-text-yellow)',+ '--color-warning': 'var(--color-text-yellow)',+ },+ 'status:error': {+ '--color-error-muted': 'var(--color-background-red)',+ '--color-text-primary': 'var(--color-text-red)',+ '--color-text-secondary': 'var(--color-text-red)',+ '--color-error': 'var(--color-text-red)',+ },+ },++ // Fill: light = T90 (same hex as banner/badge surface — fill reads as+ // the same color family as the matching status surface). Dark = T70.+ // Hexes from the preview Tonal Palettes ramp. accent (default) ++ // indeterminate both route to blue for the in-progress / loading look.+ 'progressbar-fill': {+ 'variant:accent': {+ backgroundColor: 'light-dark(#d7e4f5, #a0acbc)', // Blue T90 / T70+ },+ 'variant:success': {+ backgroundColor: 'light-dark(#d0e9ce, #9ab298)', // Green T90 / T70+ },+ 'variant:warning': {+ backgroundColor: 'light-dark(#f4e1b7, #bbaa82)', // Yellow T90 / T70+ },+ 'variant:error': {+ backgroundColor: 'light-dark(#f9dcd7, #c0a5a0)', // Red T90 / T70+ },+ },++ // Track default --color-background-muted reads near-body in stone;+ // redirect to --color-skeleton so the channel stays visible.+ 'progressbar-track': {+ base: {+ backgroundColor: 'var(--color-skeleton)',+ },+ },++ // Switch off-state track reads --color-background-gray by default.+ // Redefine it inside the switch scope to --color-skeleton, matching+ // the ProgressBar track. The on-state reads --color-accent (unaffected);+ // disabled-off also picks up --color-skeleton for consistency.+ switch: {+ base: {+ '--color-background-gray': 'var(--color-skeleton)',+ },+ },++ // FieldStatus surface matches badge — see badge override above.+ 'field-status': {+ 'type:success': {+ backgroundColor: 'var(--color-background-green)',+ },+ 'type:warning': {+ backgroundColor: 'var(--color-background-yellow)',+ },+ 'type:error': {+ backgroundColor: 'var(--color-background-red)',+ },+ },++ // Input status borders + icons across all 9 input components share the+ // same softer T60/T70 redirection. See INPUT_STATUS_VARS above.+ 'text-input': INPUT_STATUS_VARS,+ textarea: INPUT_STATUS_VARS,+ 'number-input': INPUT_STATUS_VARS,+ 'date-input': INPUT_STATUS_VARS,+ 'time-input': INPUT_STATUS_VARS,+ selector: INPUT_STATUS_VARS,+ 'multi-selector': INPUT_STATUS_VARS,+ typeahead: INPUT_STATUS_VARS,+ tokenizer: INPUT_STATUS_VARS,++ card: {+ base: {+ padding: 'var(--spacing-3)',+ },+ },++ section: {+ base: {+ padding: 'var(--spacing-3)',+ },+ },+ },++ icons: stoneIconRegistry,+});++/**+ * Raw tonal palettes — every color at every tone step (0–100 in 5s).+ * Same hue and chroma used to derive all theme tokens.+ * Use these for custom components or data visualization.+ */+export const stonePalettes = {+ neutral: {+ hue: 291,+ chroma: 3,+ 0: '#000000',+ 5: '#111015',+ 10: '#1b1b1f',+ 15: '#25252a',+ 20: '#303034',+ 25: '#3b3b3f',+ 30: '#46464b',+ 35: '#525257',+ 40: '#5e5e63',+ 45: '#6a6a6f',+ 50: '#77777c',+ 55: '#838388',+ 60: '#909095',+ 65: '#9d9da3',+ 70: '#ababb0',+ 75: '#b8b8be',+ 80: '#c6c6cc',+ 85: '#d4d4da',+ 90: '#e2e2e8',+ 95: '#f0f0f6',+ 100: '#ffffff',+ },+ blue: {+ hue: 265,+ chroma: 10,+ 0: '#000000',+ 5: '#04121e',+ 10: '#111c29',+ 15: '#1b2734',+ 20: '#26313f',+ 25: '#313c4a',+ 30: '#3c4856',+ 35: '#485362',+ 40: '#545f6e',+ 45: '#606c7b',+ 50: '#6c7888',+ 55: '#798595',+ 60: '#8692a2',+ 65: '#939faf',+ 70: '#a0acbd',+ 75: '#adbacb',+ 80: '#bbc8d9',+ 85: '#c9d6e7',+ 90: '#d7e4f5',+ 95: '#e7f2ff',+ 100: '#ffffff',+ },+ cyan: {+ hue: 190,+ chroma: 10,+ 0: '#000000',+ 5: '#001613',+ 10: '#071f1e',+ 15: '#122a28',+ 20: '#1d3433',+ 25: '#28403e',+ 30: '#334b49',+ 35: '#3e5755',+ 40: '#4a6361',+ 45: '#566f6d',+ 50: '#627c7a',+ 55: '#6f8986',+ 60: '#7b9693',+ 65: '#88a3a0',+ 70: '#95b1ae',+ 75: '#a3bebb',+ 80: '#b0ccc9',+ 85: '#bedad7',+ 90: '#cce8e5',+ 95: '#daf7f4',+ 100: '#ffffff',+ },+ green: {+ hue: 142,+ chroma: 17,+ 0: '#000000',+ 5: '#001700',+ 10: '#0c200a',+ 15: '#162a16',+ 20: '#213521',+ 25: '#2b402b',+ 30: '#374c36',+ 35: '#425841',+ 40: '#4e644d',+ 45: '#5a7059',+ 50: '#667d65',+ 55: '#728a71',+ 60: '#7f977e',+ 65: '#8ca48b',+ 70: '#99b298',+ 75: '#a7bfa5',+ 80: '#b4cdb2',+ 85: '#c2dbc0',+ 90: '#d0e9ce',+ 95: '#def8dc',+ 100: '#ffffff',+ },+ teal: {+ hue: 158,+ chroma: 9,+ 0: '#000000',+ 5: '#00150a',+ 10: '#101e17',+ 15: '#1a2921',+ 20: '#25342b',+ 25: '#303f36',+ 30: '#3b4a41',+ 35: '#46564d',+ 40: '#526259',+ 45: '#5e6e65',+ 50: '#6a7b71',+ 55: '#77887e',+ 60: '#83958a',+ 65: '#90a297',+ 70: '#9dafa5',+ 75: '#abbdb2',+ 80: '#b8cbc0',+ 85: '#c6d9ce',+ 90: '#d4e7dc',+ 95: '#e2f5ea',+ 100: '#ffffff',+ },+ yellow: {+ hue: 90,+ chroma: 23,+ 0: '#000000',+ 5: '#1f0f00',+ 10: '#261a00',+ 15: '#2f2500',+ 20: '#3a2f0d',+ 25: '#463a18',+ 30: '#524622',+ 35: '#5e512d',+ 40: '#6b5d39',+ 45: '#786944',+ 50: '#857650',+ 55: '#92825c',+ 60: '#9f8f68',+ 65: '#ad9c75',+ 70: '#bbaa81',+ 75: '#c9b78e',+ 80: '#d7c59c',+ 85: '#e5d3a9',+ 90: '#f4e1b7',+ 95: '#ffefc7',+ 100: '#ffffff',+ },+ orange: {+ hue: 70,+ chroma: 22,+ 0: '#000000',+ 5: '#250a00',+ 10: '#2d1700',+ 15: '#372104',+ 20: '#432c12',+ 25: '#4f361c',+ 30: '#5b4227',+ 35: '#684d32',+ 40: '#75593d',+ 45: '#826548',+ 50: '#8f7154',+ 55: '#9d7e60',+ 60: '#aa8b6d',+ 65: '#b89879',+ 70: '#c6a586',+ 75: '#d4b393',+ 80: '#e3c0a0',+ 85: '#f1ceae',+ 90: '#ffdcbb',+ 95: '#ffeddc',+ 100: '#ffffff',+ },+ red: {+ hue: 33,+ chroma: 11,+ 0: '#000000',+ 5: '#210a04',+ 10: '#2a1714',+ 15: '#35211e',+ 20: '#402b28',+ 25: '#4c3633',+ 30: '#58413e',+ 35: '#644d49',+ 40: '#715955',+ 45: '#7e6561',+ 50: '#8a716d',+ 55: '#987e7a',+ 60: '#a58b86',+ 65: '#b39893',+ 70: '#c0a5a1',+ 75: '#ceb3ae',+ 80: '#dcc0bc',+ 85: '#ebcec9',+ 90: '#f9dcd7',+ 95: '#ffece9',+ 100: '#ffffff',+ },+ pink: {+ hue: 340,+ chroma: 9,+ 0: '#000000',+ 5: '#1b0c16',+ 10: '#251720',+ 15: '#30222a',+ 20: '#3b2c35',+ 25: '#463740',+ 30: '#52424c',+ 35: '#5e4e57',+ 40: '#6a5a63',+ 45: '#776670',+ 50: '#83727c',+ 55: '#907f89',+ 60: '#9d8c96',+ 65: '#ab99a3',+ 70: '#b8a6b1',+ 75: '#c6b4be',+ 80: '#d4c1cc',+ 85: '#e2cfda',+ 90: '#f0dde8',+ 95: '#ffebf7',+ 100: '#ffffff',+ },+ purple: {+ hue: 307,+ chroma: 11,+ 0: '#000000',+ 5: '#150e1d',+ 10: '#1f1927',+ 15: '#292332',+ 20: '#342e3d',+ 25: '#3f3949',+ 30: '#4b4454',+ 35: '#564f60',+ 40: '#635b6d',+ 45: '#6f6779',+ 50: '#7b7486',+ 55: '#888193',+ 60: '#958da0',+ 65: '#a39aad',+ 70: '#b0a8bb',+ 75: '#beb5c9',+ 80: '#cbc3d7',+ 85: '#d9d1e5',+ 90: '#e8dff3',+ 95: '#f6edff',+ 100: '#ffffff',+ },+} as const;diff --git a/packages/cli/templates/themes/y2k/icons.tsx b/packages/cli/templates/themes/y2k/icons.tsxnew file mode 100644index 0000000000..6240795740--- /dev/null+++ b/packages/cli/templates/themes/y2k/icons.tsx@@ -0,0 +1,67 @@+// Copyright (c) Meta Platforms, Inc. and affiliates.++import React from 'react';+import type {IconRegistry} from '@astryxdesign/core/Icon';++import {+ X,+ ChevronDown,+ ChevronLeft,+ ChevronRight,+ Check,+ CheckCircle,+ XCircle,+ AlertTriangle,+ Info,+ Calendar,+ Clock,+ ExternalLink,+ Menu,+ MoreHorizontal,+ Search,+ ArrowUp,+ ArrowDown,+ ArrowUpDown,+ Filter,+ EyeOff,+ Columns,+ Copy,+ CheckCheck,+ Wrench,+ Square,+ Mic,+} from 'lucide-react';++const iconProps = {+ size: '1em',+ 'aria-hidden': true as const,+};++export const y2kIconRegistry: IconRegistry = {+ close: <X {...iconProps} />,+ chevronDown: <ChevronDown {...iconProps} />,+ chevronLeft: <ChevronLeft {...iconProps} />,+ chevronRight: <ChevronRight {...iconProps} />,+ check: <Check {...iconProps} />,+ success: <CheckCircle {...iconProps} />,+ error: <XCircle {...iconProps} />,+ warning: <AlertTriangle {...iconProps} />,+ info: <Info {...iconProps} />,+ calendar: <Calendar {...iconProps} />,+ clock: <Clock {...iconProps} />,+ externalLink: <ExternalLink {...iconProps} />,+ menu: <Menu {...iconProps} />,+ moreHorizontal: <MoreHorizontal {...iconProps} />,+ search: <Search {...iconProps} />,+ arrowUp: <ArrowUp {...iconProps} />,+ arrowDown: <ArrowDown {...iconProps} />,+ arrowsUpDown: <ArrowUpDown {...iconProps} />,+ funnel: <Filter {...iconProps} />,+ eyeSlash: <EyeOff {...iconProps} />,+ viewColumns: <Columns {...iconProps} />,+ copy: <Copy {...iconProps} />,+ checkDouble: <CheckCheck {...iconProps} />,+ wrench: <Wrench {...iconProps} />,+ stop: <Square {...iconProps} />,+ microphone: <Mic {...iconProps} />,+};diff --git a/packages/cli/templates/themes/y2k/y2kTheme.ts b/packages/cli/templates/themes/y2k/y2kTheme.tsnew file mode 100644index 0000000000..c3233c9939--- /dev/null+++ b/packages/cli/templates/themes/y2k/y2kTheme.ts@@ -0,0 +1,617 @@+// Copyright (c) Meta Platforms, Inc. and affiliates.++/**+ * Y2K Theme+ *+ * A bubbly, playful pop theme inspired by early 2000s aesthetics.+ * Periwinkle body (#CCCFFA), charcoal accent, Poppins for body/headings, and+ * Crimson Text for display sizes.+ * Core neutral: H=75 C=8 (warm cream neutral derived from #FFF6ED)+ */++import {defineTheme, defineSyntaxTheme} from '@astryxdesign/core/theme';+import {y2kIconRegistry} from './icons';++const y2kSyntax = defineSyntaxTheme({+ name: 'xds-y2k',+ tokens: {+ keyword: ['#615a7a', '#aea6ca'],+ string: ['#586242', '#a5af8b'],+ comment: ['#5e5e5e', '#ababab'],+ number: ['#775843', '#c8a48c'],+ function: ['#39637d', '#87b0cd'],+ type: ['#615a7a', '#aea6ca'],+ variable: ['#5e5e5e', '#ababab'],+ operator: ['#5e5e5e', '#ababab'],+ constant: ['#775843', '#c8a48c'],+ tag: ['#7f5351', '#d19f9d'],+ attribute: ['#6c5c3e', '#bca987'],+ property: ['#3c6755', '#87b5a1'],+ punctuation: ['#5e5e5e', '#ababab'],+ background: ['#FFF6ED', '#190f00'],+ },+});++export const y2kTheme = defineTheme({+ name: 'y2k',++ typography: {+ scale: {base: 16, ratio: 1.25},+ body: {+ family: 'Poppins',+ fallbacks:+ '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif',+ },+ heading: {+ family: 'Poppins',+ fallbacks:+ '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif',+ },+ code: {+ family: 'JetBrains Mono',+ fallbacks: '"SF Mono", Monaco, Consolas, monospace',+ },+ },++ radius: {base: 4, multiplier: 0},++ motion: {fast: 100, medium: 250, slow: 600, ratio: 0.8},++ syntax: y2kSyntax,++ tokens: {+ // =========================================================================+ // Spacing — comfortable preset (base=6)+ // =========================================================================+ '--spacing-0-5': '3px',+ '--spacing-1': '6px',+ '--spacing-1-5': '9px',+ '--spacing-2': '12px',+ '--spacing-3': '18px',+ '--spacing-4': '24px',+ '--spacing-5': '30px',+ '--spacing-6': '36px',+ '--spacing-7': '42px',+ '--spacing-8': '48px',++ // Size — comfortable preset+ '--size-element-sm': '32px',+ '--size-element-md': '40px',+ '--size-element-lg': '48px',++ // =========================================================================+ // Colors — Y2K pop palette+ // Neutral: H=75 C=8 (warm cream)+ // Accent: charcoal (#292427)+ // =========================================================================++ // Core semantic — neutral H=75 C=8 (cream)+ '--color-accent': ['#2d241b', '#EDEFFC'],+ '--color-accent-muted': ['#2d241b14', '#EDEFFC20'],+ '--color-neutral': ['#2d241b10', '#EDEFFC1A'],+ '--color-background-surface': ['#FFFFFF', '#16182b'],+ '--color-background-body': ['#CCCFFA', '#0e0f1a'],+ '--color-overlay': ['#2d241b80', '#0a0b14CC'],+ '--color-overlay-hover': ['#2d241b0D', '#EDEFFC0D'],+ '--color-overlay-pressed': ['#2d241b1A', '#EDEFFC1A'],+ '--color-background-muted': ['#ede0d4', '#1f2238'],++ // Text — neutral H=75 (cream)+ '--color-text-primary': ['#2d241b', '#EDEFFC'],+ '--color-text-secondary': ['#675d52', '#a6acd6'],+ '--color-text-disabled': ['#d1c5b8', '#4a4f6b'],+ '--color-text-accent': ['#2d241b', '#EDEFFC'],+ '--color-on-dark': '#FFFFFF',+ '--color-on-light': '#2d241b',+ '--color-on-accent': ['#FFFFFF', '#16182b'],+ '--color-on-success': ['#3a5500', '#1e3200'],+ '--color-on-error': ['#8b1d24', '#5c0008'],+ '--color-on-warning': ['#614400', '#3f2600'],++ // Icon — neutral H=75 (cream)+ '--color-icon-accent': ['#2d241b', '#EDEFFC'],+ '--color-icon-primary': ['#2d241b', '#EDEFFC'],+ '--color-icon-secondary': ['#675d52', '#a6acd6'],+ '--color-icon-disabled': ['#d1c5b8', '#4a4f6b'],++ // Surface variants — white cards, cream body+ '--color-background-card': ['#FFFFFF', '#16182b'],+ '--color-background-popover': ['#FFFFFF', '#1f2238'],+ '--color-background-inverted': ['#2d241b', '#EDEFFC'],++ // Status / Sentiment — same in light and dark+ '--color-success': ['#C5E17A', '#C5E17A'],+ '--color-success-muted': ['#C5E17A', '#C5E17A'],+ '--color-error': ['#FFC5C3', '#FFC5C3'],+ '--color-error-muted': ['#FFC5C3', '#FFC5C3'],+ '--color-warning': ['#FFE08A', '#FFE08A'],+ '--color-warning-muted': ['#FFE08A', '#FFE08A'],++ // Bold charcoal borders in light mode (default + card) for the heavy-outline+ // Y2K look. Dark mode unchanged.+ '--color-border': ['#2F292E', '#EDEFFC1A'],+ '--color-border-emphasized': ['#2F292E', '#3a3f5e'],++ // Effects+ '--color-skeleton': ['#d1c5b8', '#2a2e47'],+ '--color-shadow': ['#2d241b1A', '#0000004D'],+ '--color-tint-hover': ['#2d241b', '#EDEFFC'],++ // Typography override+ '--text-supporting-size': '12px',++ // Categorical — hand-tuned for equal optical brightness, same light/dark+ '--color-background-green': ['#C5E17A', '#C5E17A'],+ '--color-border-green': ['#B5D16A', '#B5D16A'],+ '--color-icon-green': ['#3a5500', '#1e3200'],+ '--color-text-green': ['#3a5500', '#1e3200'],++ '--color-background-red': ['#FFC5C3', '#FFC5C3'],+ '--color-border-red': ['#FF9E9A', '#FF9E9A'],+ '--color-icon-red': ['#8b1d24', '#5c0008'],+ '--color-text-red': ['#8b1d24', '#5c0008'],++ '--color-background-yellow': ['#FFE08A', '#FFE08A'],+ '--color-border-yellow': ['#FFCC55', '#FFCC55'],+ '--color-icon-yellow': ['#614400', '#3f2600'],+ '--color-text-yellow': ['#614400', '#3f2600'],++ '--color-background-blue': ['#B8E0FF', '#B8E0FF'],+ '--color-border-blue': ['#8ECFFF', '#8ECFFF'],+ '--color-icon-blue': ['#004e74', '#002c4d'],+ '--color-text-blue': ['#004e74', '#002c4d'],++ '--color-background-pink': ['#FFC8E0', '#FFC8E0'],+ '--color-border-pink': ['#FFA0C8', '#FFA0C8'],+ '--color-icon-pink': ['#822050', '#580030'],+ '--color-text-pink': ['#822050', '#580030'],++ '--color-background-purple': ['#DDD0FF', '#DDD0FF'],+ '--color-border-purple': ['#C0AAFF', '#C0AAFF'],+ '--color-icon-purple': ['#453080', '#201058'],+ '--color-text-purple': ['#453080', '#201058'],++ '--color-background-cyan': ['#A8F0E2', '#A8F0E2'],+ '--color-border-cyan': ['#70E8D0', '#70E8D0'],+ '--color-icon-cyan': ['#005548', '#003028'],+ '--color-text-cyan': ['#005548', '#003028'],++ '--color-background-orange': ['#FFCCA0', '#FFCCA0'],+ '--color-border-orange': ['#FFAA66', '#FFAA66'],+ '--color-icon-orange': ['#703500', '#4a1800'],+ '--color-text-orange': ['#703500', '#4a1800'],++ '--color-background-teal': ['#A8EED0', '#A8EED0'],+ '--color-border-teal': ['#78E0B0', '#78E0B0'],+ '--color-icon-teal': ['#005530', '#003018'],+ '--color-text-teal': ['#005530', '#003018'],++ // Gray (cream neutral H=75 C=8)+ '--color-background-gray': ['#ede0d4', '#ede0d4'],+ '--color-border-gray': ['#dfd2c6', '#dfd2c6'],+ '--color-icon-gray': ['#4f453b', '#2d241b'],+ '--color-text-gray': ['#4f453b', '#2d241b'],++ // =========================================================================+ // Radius — sharp / brutalist (multiplier: 0 via radius config + explicit)+ // =========================================================================+ '--radius-none': '0px',+ '--radius-inner': '0px',+ '--radius-element': '0px',+ '--radius-container': '0px',+ '--radius-page': '0px',+ '--radius-full': '0px',++ // =========================================================================+ // Shadows — warm cream neutral+ // =========================================================================+ '--shadow-low': '0 2px 4px #2d241b0D, 0 4px 8px #2d241b1A',+ '--shadow-med': '0 2px 4px #2d241b0D, 0 4px 12px #2d241b1A',+ '--shadow-high': '0 4px 6px #2d241b1A, 0 12px 24px #2d241b26',+ '--shadow-inset-hover': 'inset 0px 0px 0px 2px #2d241b30',+ '--shadow-inset-selected': 'inset 0px 0px 0px 2px #2d241b50',+ '--shadow-inset-success': 'inset 0px 0px 0px 2px #3a550050',+ '--shadow-inset-warning': 'inset 0px 0px 0px 2px #61440050',+ '--shadow-inset-error': 'inset 0px 0px 0px 2px #8b1d2450',+ },++ components: {+ // Display sizes use a Crimson Text serif, distinct from the Poppins+ // used for body/headings.+ text: {+ 'type:display-1': {+ fontFamily: '"Crimson Text", Georgia, "Times New Roman", Times, serif',+ },+ 'type:display-2': {+ fontFamily: '"Crimson Text", Georgia, "Times New Roman", Times, serif',+ },+ 'type:display-3': {+ fontFamily: '"Crimson Text", Georgia, "Times New Roman", Times, serif',+ },+ },++ // TopNav items: drop the pill background on the selected state and rely on+ // weight + primary text color for emphasis. Hover/active keep the neutral+ // overlay from the base styles.+ 'top-nav-item': {+ selected: {+ backgroundColor: 'transparent',+ ':hover': {+ backgroundColor: 'var(--color-overlay-hover)',+ },+ ':active': {+ backgroundColor: 'var(--color-overlay-pressed)',+ },+ },+ },+ button: {+ base: {+ borderRadius: '0px',+ borderWidth: '1px',+ borderStyle: 'solid',+ borderColor: 'var(--color-border)',+ },+ 'variant:primary': {+ backgroundColor: 'var(--color-text-primary)',+ color: 'var(--color-background-body)',+ borderColor: 'transparent',+ },+ 'variant:secondary': {+ backgroundColor: 'var(--color-background-green)',+ borderWidth: '1px',+ borderStyle: 'solid',+ borderColor: 'var(--color-text-green)',+ color: 'var(--color-text-green)',+ ':hover': {+ backgroundColor: 'var(--color-border-green)',+ },+ },+ 'variant:ghost': {+ borderColor: 'transparent',+ },+ 'variant:destructive': {+ backgroundColor: 'var(--color-background-red)',+ color: 'var(--color-text-red)',+ borderWidth: '1px',+ borderStyle: 'solid',+ borderColor: 'var(--color-text-red)',+ },+ },++ badge: {+ base: {+ borderRadius: '9999px',+ borderWidth: '1.5px',+ borderStyle: 'solid',+ borderColor: 'color-mix(in srgb, currentColor 30%, transparent)',+ },+ 'variant:info': {+ backgroundColor: 'var(--color-background-blue)',+ color: 'var(--color-text-blue)',+ },+ 'variant:neutral': {+ backgroundColor: 'var(--color-background-gray)',+ color: 'var(--color-text-gray)',+ },+ 'variant:success': {+ backgroundColor: 'var(--color-background-green)',+ color: 'var(--color-text-green)',+ },+ 'variant:warning': {+ backgroundColor: 'var(--color-background-yellow)',+ color: 'var(--color-text-yellow)',+ },+ 'variant:error': {+ backgroundColor: 'var(--color-background-red)',+ color: 'var(--color-text-red)',+ },+ },++ banner: {+ base: {+ borderRadius: '0px',+ },+ 'status:info': {+ backgroundColor: 'var(--color-background-blue)',+ '--color-text-primary': 'var(--color-text-blue)',+ '--color-text-secondary': 'var(--color-text-blue)',+ '--color-accent': 'var(--color-text-blue)',+ },+ 'status:success': {+ backgroundColor: 'var(--color-background-green)',+ '--color-text-primary': 'var(--color-text-green)',+ '--color-text-secondary': 'var(--color-text-green)',+ '--color-success': 'var(--color-text-green)',+ },+ 'status:warning': {+ backgroundColor: 'var(--color-background-yellow)',+ '--color-text-primary': 'var(--color-text-yellow)',+ '--color-text-secondary': 'var(--color-text-yellow)',+ '--color-warning': 'var(--color-text-yellow)',+ },+ 'status:error': {+ backgroundColor: 'var(--color-background-red)',+ '--color-text-primary': 'var(--color-text-red)',+ '--color-text-secondary': 'var(--color-text-red)',+ '--color-error': 'var(--color-text-red)',+ },+ },++ field: {+ base: {+ borderRadius: '0px',+ },+ },++ card: {+ base: {+ borderRadius: '0px',+ padding: 'var(--spacing-3)',+ },+ },++ section: {+ base: {+ padding: 'var(--spacing-3)',+ },+ },+ },++ icons: y2kIconRegistry,+});++/**+ * Raw tonal palettes — every color at every tone step (0-100 in 5s).+ */+export const y2kPalettes = {+ neutral: {+ hue: 75,+ chroma: 8,+ 0: '#000000',+ 5: '#190f00',+ 10: '#221a10',+ 15: '#2d241b',+ 20: '#382f25',+ 25: '#433a30',+ 30: '#4f453b',+ 35: '#5b5146',+ 40: '#675d52',+ 45: '#73695e',+ 50: '#80756a',+ 55: '#8d8276',+ 60: '#9a8f83',+ 65: '#a79c90',+ 70: '#b5a99d',+ 75: '#c3b7ab',+ 80: '#d1c5b8',+ 85: '#dfd2c6',+ 90: '#ede0d4',+ 95: '#fbefe2',+ 100: '#ffffff',+ },+ green: {+ hue: 120,+ chroma: 60,+ 0: '#000000',+ 5: '#061800',+ 10: '#132200',+ 15: '#152d00',+ 20: '#173900',+ 25: '#1e4500',+ 30: '#285100',+ 35: '#355d00',+ 40: '#426900',+ 45: '#4f7600',+ 50: '#5c830b',+ 55: '#69901d',+ 60: '#779d2c',+ 65: '#84aa39',+ 70: '#92b847',+ 75: '#a0c654',+ 80: '#aed461',+ 85: '#bce26e',+ 90: '#caf07b',+ 95: '#d9fe89',+ 100: '#ffffff',+ },+ red: {+ hue: 25,+ chroma: 55,+ 0: '#000000',+ 5: '#480000',+ 10: '#540000',+ 15: '#620002',+ 20: '#700012',+ 25: '#7f001b',+ 30: '#8e1126',+ 35: '#9c2330',+ 40: '#ab313b',+ 45: '#ba3f47',+ 50: '#c94d52',+ 55: '#d95b5e',+ 60: '#e8686b',+ 65: '#f87677',+ 70: '#ff8787',+ 75: '#ff9d9b',+ 80: '#ffb2af',+ 85: '#ffc6c3',+ 90: '#ffd9d7',+ 95: '#ffeceb',+ 100: '#ffffff',+ },+ yellow: {+ hue: 85,+ chroma: 65,+ 0: '#000000',+ 5: '#270c00',+ 10: '#301800',+ 15: '#3b2200',+ 20: '#472c00',+ 25: '#533700',+ 30: '#604200',+ 35: '#6d4d00',+ 40: '#7b5900',+ 45: '#896500',+ 50: '#977100',+ 55: '#a67e00',+ 60: '#b58b01',+ 65: '#c39819',+ 70: '#d2a52a',+ 75: '#e2b239',+ 80: '#f1c047',+ 85: '#ffcd55',+ 90: '#ffde9b',+ 95: '#ffeecf',+ 100: '#ffffff',+ },+ blue: {+ hue: 250,+ chroma: 40,+ 0: '#000000',+ 5: '#001939',+ 10: '#002244',+ 15: '#002c4d',+ 20: '#003759',+ 25: '#004266',+ 30: '#004e74',+ 35: '#005a83',+ 40: '#006693',+ 45: '#0073a3',+ 50: '#0080b4',+ 55: '#008ec4',+ 60: '#0e9bd2',+ 65: '#2fa8e0',+ 70: '#45b6ef',+ 75: '#57c3fd',+ 80: '#7ed0ff',+ 85: '#a3dbff',+ 90: '#c4e7ff',+ 95: '#e1f3ff',+ 100: '#ffffff',+ },+ pink: {+ hue: 350,+ chroma: 45,+ 0: '#000000',+ 5: '#3d001d',+ 10: '#490027',+ 15: '#560032',+ 20: '#64003d',+ 25: '#711248',+ 30: '#7f2154',+ 35: '#8c2f60',+ 40: '#9a3c6c',+ 45: '#a84979',+ 50: '#b75685',+ 55: '#c56392',+ 60: '#d371a0',+ 65: '#e27ead',+ 70: '#f18bbb',+ 75: '#ff99c8',+ 80: '#ffaed3',+ 85: '#ffc3de',+ 90: '#ffd7e9',+ 95: '#ffebf4',+ 100: '#ffffff',+ },+ purple: {+ hue: 300,+ chroma: 40,+ 0: '#000000',+ 5: '#020840',+ 10: '#11144b',+ 15: '#1f1e57',+ 20: '#2c2864',+ 25: '#393370',+ 30: '#453e7d',+ 35: '#524a8a',+ 40: '#5f5697',+ 45: '#6c62a4',+ 50: '#796eb2',+ 55: '#867bc0',+ 60: '#9387ce',+ 65: '#a194dc',+ 70: '#afa2ea',+ 75: '#bdaff8',+ 80: '#cbbeff',+ 85: '#d9ceff',+ 90: '#e6deff',+ 95: '#f3eeff',+ 100: '#ffffff',+ },+ cyan: {+ hue: 185,+ chroma: 35,+ 0: '#000000',+ 5: '#001e14',+ 10: '#00261f',+ 15: '#003029',+ 20: '#003b34',+ 25: '#00473f',+ 30: '#00534a',+ 35: '#005f56',+ 40: '#006c62',+ 45: '#00796f',+ 50: '#00867b',+ 55: '#0f9488',+ 60: '#29a195',+ 65: '#3bafa2',+ 70: '#4cbcb0',+ 75: '#5bcabd',+ 80: '#6ad8cb',+ 85: '#79e7d9',+ 90: '#87f5e7',+ 95: '#a6fff5',+ 100: '#ffffff',+ },+ orange: {+ hue: 60,+ chroma: 60,+ 0: '#000000',+ 5: '#340000',+ 10: '#420500',+ 15: '#520b00',+ 20: '#601700',+ 25: '#6d2400',+ 30: '#7b3000',+ 35: '#893c00',+ 40: '#984800',+ 45: '#a75409',+ 50: '#b66019',+ 55: '#c56d26',+ 60: '#d47a33',+ 65: '#e48740',+ 70: '#f3944c',+ 75: '#ffa25c',+ 80: '#ffb682',+ 85: '#ffc9a3',+ 90: '#ffdbc3',+ 95: '#ffede1',+ 100: '#ffffff',+ },+ teal: {+ hue: 165,+ chroma: 30,+ 0: '#000000',+ 5: '#001d00',+ 10: '#00240f',+ 15: '#002f1a',+ 20: '#003a24',+ 25: '#00462f',+ 30: '#00513a',+ 35: '#115e45',+ 40: '#226a51',+ 45: '#30775d',+ 50: '#3d8469',+ 55: '#4a9175',+ 60: '#589e82',+ 65: '#65ab8f',+ 70: '#72b99c',+ 75: '#7fc7a9',+ 80: '#8dd5b7',+ 85: '#9be3c5',+ 90: '#a9f2d3',+ 95: '#b6ffe1',+ 100: '#ffffff',+ },+} as const;diff --git a/scripts/generate-cli-themes.mjs b/scripts/generate-cli-themes.mjsnew file mode 100644index 0000000000..a46e2dfa2c--- /dev/null+++ b/scripts/generate-cli-themes.mjs@@ -0,0 +1,132 @@+// Copyright (c) Meta Platforms, Inc. and affiliates.++/**+ * @file Bundles each theme's source (`src/<slug>Theme.ts` + `icons.tsx`) and a+ * `manifest.json` into `packages/cli/templates/themes/` so `astryx theme add`+ * can scaffold a theme without the package installed — like page templates.+ * Run from the repo root; commit the output so the published CLI carries it.+ */++import * as fs from 'node:fs';+import * as path from 'node:path';+import {fileURLToPath} from 'node:url';++const __dirname = path.dirname(fileURLToPath(import.meta.url));+const REPO_ROOT = path.resolve(__dirname, '..');+const THEMES_SRC_ROOT = path.join(REPO_ROOT, 'packages', 'themes');+const CLI_THEMES_OUT = path.join(+ REPO_ROOT,+ 'packages',+ 'cli',+ 'templates',+ 'themes',+);++// Flagged in the manifest so `theme list` can mark it "(maintained)".+const MAINTAINED_SLUG = 'neutral';++function toIdentifier(slug) {+ return slug.replace(/-([a-z])/g, (_, c) => c.toUpperCase());+}++/** Title-case a slug for display ("y2k" → "Y2K" is special-cased). */+function toDisplayName(slug) {+ if (slug === 'y2k') return 'Y2K';+ return slug.charAt(0).toUpperCase() + slug.slice(1);+}++function readJSON(file) {+ return JSON.parse(fs.readFileSync(file, 'utf-8'));+}++function listThemeSlugs() {+ if (!fs.existsSync(THEMES_SRC_ROOT)) return [];+ return fs+ .readdirSync(THEMES_SRC_ROOT, {withFileTypes: true})+ .filter(e => e.isDirectory())+ .map(e => e.name)+ .filter(slug => {+ // A theme dir must have a package.json + a src/<slug>Theme.ts to qualify.+ const pkg = path.join(THEMES_SRC_ROOT, slug, 'package.json');+ const themeFile = path.join(+ THEMES_SRC_ROOT,+ slug,+ 'src',+ `${toIdentifier(slug)}Theme.ts`,+ );+ return fs.existsSync(pkg) && fs.existsSync(themeFile);+ })+ .sort();+}++function main() {+ const slugs = listThemeSlugs();+ if (slugs.length === 0) {+ console.warn('generate-cli-themes: no theme packages found — skipping.');+ return;+ }++ // Reset the output dir so removed themes don't linger.+ fs.rmSync(CLI_THEMES_OUT, {recursive: true, force: true});+ fs.mkdirSync(CLI_THEMES_OUT, {recursive: true});++ const entries = [];++ for (const slug of slugs) {+ const id = toIdentifier(slug);+ const srcDir = path.join(THEMES_SRC_ROOT, slug, 'src');+ const themeFileName = `${id}Theme.ts`;+ const themeFile = path.join(srcDir, themeFileName);++ // The theme file imports './icons', so bundle it too (optional).+ const iconsFile = path.join(srcDir, 'icons.tsx');+ const hasIcons = fs.existsSync(iconsFile);++ const outDir = path.join(CLI_THEMES_OUT, slug);+ fs.mkdirSync(outDir, {recursive: true});++ const files = [themeFileName];+ fs.copyFileSync(themeFile, path.join(outDir, themeFileName));+ if (hasIcons) {+ files.push('icons.tsx');+ fs.copyFileSync(iconsFile, path.join(outDir, 'icons.tsx'));+ }++ // Pull the human description from the package.json (falls back to empty).+ let description = '';+ try {+ const pkg = readJSON(path.join(THEMES_SRC_ROOT, slug, 'package.json'));+ description = pkg.description || '';+ } catch {+ /* best-effort */+ }++ entries.push({+ slug,+ displayName: toDisplayName(slug),+ description,+ maintained: slug === MAINTAINED_SLUG,+ entry: themeFileName,+ exportName: `${id}Theme`,+ files,+ });++ console.log(` bundled theme "${slug}" (${files.length} files)`);+ }++ const manifest = {+ version: 1,+ generatedBy: 'scripts/generate-cli-themes.mjs',+ themes: entries,+ };+ fs.writeFileSync(+ path.join(CLI_THEMES_OUT, 'manifest.json'),+ JSON.stringify(manifest, null, 2) + '\n',+ );++ console.log(+ `generate-cli-themes: wrote ${entries.length} themes + manifest to ${path.relative(REPO_ROOT, CLI_THEMES_OUT)}`,+ );+}++main();