ionbit-ui 0.1.11 → 0.1.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/tokens.css +71 -14
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -381,7 +381,7 @@ ${label}`));
|
|
|
381
381
|
const program = new Command();
|
|
382
382
|
program.name("ionbit-ui").description(
|
|
383
383
|
"Ionbit UI CLI — install source-owned components from the Ionbit UI registry."
|
|
384
|
-
).version("0.1.
|
|
384
|
+
).version("0.1.13");
|
|
385
385
|
program.command("init").description(
|
|
386
386
|
"Initialize Ionbit UI in your project. Creates a ionbit-ui.config.json and installs design tokens."
|
|
387
387
|
).option("-y, --yes", "Skip confirmation prompts and use defaults").option("-f, --force", "Force overwrite of existing configuration").option(
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/config.ts","../src/utils/fs.ts","../src/utils/npm.ts","../src/utils/registry.ts","../src/commands/add.ts","../src/commands/init.ts","../src/commands/list.ts","../src/index.ts"],"sourcesContent":["export const REGISTRY_URL =\n \"https://raw.githubusercontent.com/rostislaw9/ionbit-ui/main/registry.json\";\n\nexport const REGISTRY_ITEM_URL =\n \"https://raw.githubusercontent.com/rostislaw9/ionbit-ui/main/registry/items\";\n\nexport interface RegistryItem {\n name: string;\n type: string;\n title: string;\n description: string;\n dependencies?: string[];\n devDependencies?: string[];\n registryDependencies?: string[];\n files: RegistryFile[];\n}\n\nexport interface RegistryFile {\n path: string;\n type: string;\n content: string;\n}\n\nexport interface Registry {\n $schema: string;\n name: string;\n homepage: string;\n items: RegistryItem[];\n}\n\nexport interface Config {\n $schema: string;\n style: string;\n tailwind: {\n css: string;\n cssVariables: boolean;\n };\n aliases: {\n components: string;\n motion: string;\n lib: string;\n styles: string;\n };\n}\n\nexport const DEFAULT_CONFIG: Config = {\n $schema: \"https://ui.shadcn.com/schema/registry.json\",\n style: \"digital\",\n tailwind: {\n css: \"src/index.css\",\n cssVariables: true,\n },\n aliases: {\n components: \"src/components/ui\",\n motion: \"src/components/motion\",\n lib: \"src/lib\",\n styles: \"src/styles\",\n },\n};\n\nexport const CONFIG_FILE = \"ionbit-ui.config.json\";\n","import type { Config } from \"../config\";\n\nimport { existsSync, mkdirSync, readFileSync, writeFileSync } from \"node:fs\";\nimport { dirname, resolve } from \"node:path\";\n\nimport { CONFIG_FILE } from \"../config\";\n\nexport function loadConfig(cwd = process.cwd()): Config | null {\n const configPath = resolve(cwd, CONFIG_FILE);\n if (!existsSync(configPath)) return null;\n return JSON.parse(readFileSync(configPath, \"utf-8\")) as Config;\n}\n\nexport function saveConfig(config: Config, cwd = process.cwd()): void {\n const configPath = resolve(cwd, CONFIG_FILE);\n writeFileSync(configPath, JSON.stringify(config, null, 2) + \"\\n\");\n}\n\nexport function ensureDir(filePath: string): void {\n const dir = dirname(filePath);\n if (!existsSync(dir)) mkdirSync(dir, { recursive: true });\n}\n\nexport function writeFile(filePath: string, content: string): void {\n ensureDir(filePath);\n writeFileSync(filePath, content);\n}\n\nexport function resolveTargetPath(\n target: string,\n config: Config,\n cwd = process.cwd(),\n): string {\n // Map registry target paths to the user's configured aliases.\n // e.g. \"components/ui/button.tsx\" -> \"{cwd}/components/ui/button.tsx\"\n // \"components/motion/spotlight.tsx\" -> \"{cwd}/components/motion/spotlight.tsx\"\n // \"lib/utils.ts\" -> \"{cwd}/lib/utils.ts\"\n // \"styles/tokens.css\" -> \"{cwd}/styles/tokens.css\"\n let resolved = target;\n\n if (target.startsWith(\"components/ui/\")) {\n resolved = target.replace(\n \"components/ui/\",\n config.aliases.components + \"/\",\n );\n } else if (target.startsWith(\"components/motion/\")) {\n resolved = target.replace(\n \"components/motion/\",\n config.aliases.motion + \"/\",\n );\n } else if (target.startsWith(\"lib/\")) {\n resolved = target.replace(\"lib/\", config.aliases.lib + \"/\");\n } else if (target.startsWith(\"styles/\")) {\n resolved = target.replace(\"styles/\", config.aliases.styles + \"/\");\n }\n\n return resolve(cwd, resolved);\n}\n","import { execSync } from \"node:child_process\";\nimport { existsSync } from \"node:fs\";\nimport { resolve } from \"node:path\";\n\nexport type PackageManager = \"npm\" | \"pnpm\" | \"yarn\" | \"bun\";\n\nexport function detectPackageManager(cwd: string): PackageManager {\n if (existsSync(resolve(cwd, \"bun.lockb\"))) return \"bun\";\n if (existsSync(resolve(cwd, \"bun.lock\"))) return \"bun\";\n if (existsSync(resolve(cwd, \"pnpm-lock.yaml\"))) return \"pnpm\";\n if (existsSync(resolve(cwd, \"yarn.lock\"))) return \"yarn\";\n return \"npm\";\n}\n\nexport function installNpmDeps(deps: string[], cwd: string): void {\n if (deps.length === 0) return;\n const pm = detectPackageManager(cwd);\n const cmd =\n pm === \"pnpm\"\n ? `pnpm add ${deps.join(\" \")}`\n : pm === \"yarn\"\n ? `yarn add ${deps.join(\" \")}`\n : pm === \"bun\"\n ? `bun add ${deps.join(\" \")}`\n : `npm install ${deps.join(\" \")}`;\n execSync(cmd, { cwd, stdio: \"inherit\" });\n}\n","import type { Registry, RegistryItem } from \"../config\";\n\nimport { existsSync, readFileSync } from \"node:fs\";\nimport { dirname, resolve } from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\n\nimport { REGISTRY_ITEM_URL, REGISTRY_URL } from \"../config\";\n\nconst __dirname = dirname(fileURLToPath(import.meta.url));\n\n/**\n * Find the registry.json — checks local paths first, then falls back to the\n * remote GitHub URL. This allows development/testing without pushing to GitHub.\n */\nfunction findLocalRegistry(): string | null {\n const candidates = [\n // Relative to cwd (user's project)\n resolve(process.cwd(), \"registry.json\"),\n // Relative to CLI dist (packages/cli/dist -> ../../../registry.json)\n resolve(__dirname, \"../../../registry.json\"),\n // Relative to CLI src/utils (packages/cli/src/utils -> ../../../../registry.json)\n resolve(__dirname, \"../../../../registry.json\"),\n ];\n for (const p of candidates) {\n if (existsSync(p)) return p;\n }\n return null;\n}\n\nfunction findLocalRegistryItem(name: string): string | null {\n const candidates = [\n resolve(process.cwd(), \"registry/items\", `${name}.json`),\n resolve(__dirname, \"../../../registry/items\", `${name}.json`),\n resolve(__dirname, \"../../../../registry/items\", `${name}.json`),\n ];\n for (const p of candidates) {\n if (existsSync(p)) return p;\n }\n return null;\n}\n\nexport async function fetchRegistry(): Promise<Registry> {\n const localPath = findLocalRegistry();\n if (localPath) {\n return JSON.parse(readFileSync(localPath, \"utf-8\")) as Registry;\n }\n\n const res = await fetch(REGISTRY_URL);\n if (!res.ok) {\n throw new Error(\n `Failed to fetch registry: ${res.status} ${res.statusText}`,\n );\n }\n return (await res.json()) as Registry;\n}\n\nexport async function fetchRegistryItem(name: string): Promise<RegistryItem> {\n const localPath = findLocalRegistryItem(name);\n if (localPath) {\n return JSON.parse(readFileSync(localPath, \"utf-8\")) as RegistryItem;\n }\n\n const res = await fetch(`${REGISTRY_ITEM_URL}/${name}.json`);\n if (!res.ok) {\n throw new Error(\n `Failed to fetch registry item \"${name}\": ${res.status} ${res.statusText}`,\n );\n }\n return (await res.json()) as RegistryItem;\n}\n\nexport async function fetchRegistryItems(\n names: string[],\n): Promise<RegistryItem[]> {\n return Promise.all(names.map(fetchRegistryItem));\n}\n","import type { Config, RegistryItem } from \"../config\";\n\nimport chalk from \"chalk\";\nimport { existsSync } from \"node:fs\";\n\nimport { loadConfig, resolveTargetPath, writeFile } from \"../utils/fs\";\nimport { installNpmDeps } from \"../utils/npm\";\nimport { fetchRegistry, fetchRegistryItems } from \"../utils/registry\";\n\nexport async function add(\n components: string[],\n options: { overwrite?: boolean },\n): Promise<void> {\n const cwd = process.cwd();\n const config = loadConfig(cwd);\n\n if (!config) {\n console.log(\n chalk.red(\"No ionbit-ui.config.json found. Run `ionbit-ui init` first.\"),\n );\n process.exit(1);\n }\n\n // Fetch the full registry to resolve names and dependencies\n const registry = await fetchRegistry();\n const allNames = new Set(registry.items.map((i) => i.name));\n\n // Validate requested components\n for (const name of components) {\n if (!allNames.has(name)) {\n console.log(\n chalk.red(\n `Component \"${name}\" not found in registry. Run \\`ionbit-ui list\\` to see available components.`,\n ),\n );\n process.exit(1);\n }\n }\n\n // Resolve transitive registry dependencies\n const toInstall = resolveDependencies(components, registry.items);\n\n console.log(chalk.dim(`Installing ${toInstall.length} item(s)...`));\n console.log(\"\");\n\n // Fetch all items with embedded content\n const items = await fetchRegistryItems(toInstall);\n\n for (const item of items) {\n await installItem(item, config, cwd, options.overwrite ?? false);\n }\n\n // Collect and install npm dependencies\n const npmDeps = new Set<string>();\n for (const item of items) {\n for (const dep of item.dependencies ?? []) {\n npmDeps.add(dep);\n }\n }\n\n if (npmDeps.size > 0) {\n console.log(\"\");\n installNpmDeps([...npmDeps], cwd);\n }\n\n console.log(\"\");\n console.log(chalk.green(`✓ Added ${items.length} component(s).`));\n}\n\nfunction resolveDependencies(\n names: string[],\n allItems: { name: string; registryDependencies?: string[] }[],\n): string[] {\n const resolved = new Set<string>();\n const queue = [...names];\n\n while (queue.length > 0) {\n const name = queue.shift()!;\n if (resolved.has(name)) continue;\n resolved.add(name);\n\n const item = allItems.find((i) => i.name === name);\n if (item?.registryDependencies) {\n for (const dep of item.registryDependencies) {\n if (!resolved.has(dep)) queue.push(dep);\n }\n }\n }\n\n return [...resolved];\n}\n\nasync function installItem(\n item: RegistryItem,\n config: Config,\n cwd: string,\n overwrite: boolean,\n): Promise<void> {\n for (const file of item.files) {\n const targetPath = resolveTargetPath(file.path, config, cwd);\n\n if (existsSync(targetPath) && !overwrite) {\n console.log(\n chalk.yellow(\n ` ⚠ ${file.path} already exists — skipping (use --overwrite)`,\n ),\n );\n continue;\n }\n\n writeFile(targetPath, file.content);\n console.log(chalk.green(` ✓ ${file.path}`));\n }\n}\n","import type { Config, RegistryItem } from \"../config\";\n\nimport chalk from \"chalk\";\nimport { existsSync, mkdirSync, readFileSync, writeFileSync } from \"node:fs\";\nimport { relative, resolve } from \"node:path\";\n\nimport { CONFIG_FILE, DEFAULT_CONFIG } from \"../config\";\nimport { resolveTargetPath, saveConfig, writeFile } from \"../utils/fs\";\nimport { installNpmDeps } from \"../utils/npm\";\nimport { fetchRegistryItems } from \"../utils/registry\";\n\nconst CURSOR_CSS = `@layer base {\n button:not(:disabled),\n [role=\"button\"]:not(:disabled) {\n cursor: pointer;\n }\n}`;\n\n/** Items that every project needs — installed automatically during init. */\nconst BASE_ITEMS = [\"cn\", \"tokens\"];\n\nexport async function init(options: {\n yes?: boolean;\n force?: boolean;\n pointer?: boolean;\n}): Promise<void> {\n const cwd = process.cwd();\n const configPath = resolve(cwd, CONFIG_FILE);\n\n if (existsSync(configPath) && !options.force) {\n console.log(\n chalk.yellow(\n `${CONFIG_FILE} already exists. Use --force to reinitialize.`,\n ),\n );\n return;\n }\n\n const config: Config = { ...DEFAULT_CONFIG };\n\n saveConfig(config, cwd);\n console.log(chalk.green(`✓ Created ${CONFIG_FILE}`));\n\n // Create directory structure\n const dirs = [\n config.aliases.components,\n config.aliases.motion,\n config.aliases.lib,\n config.aliases.styles,\n ];\n\n for (const dir of dirs) {\n const dirPath = resolve(cwd, dir);\n if (!existsSync(dirPath)) {\n mkdirSync(dirPath, { recursive: true });\n console.log(chalk.dim(` Created ${dir}/`));\n }\n }\n\n // Install base items (cn utility + design tokens)\n console.log(chalk.dim(\"Installing base items (cn, tokens)...\"));\n const items = await fetchRegistryItems(BASE_ITEMS);\n for (const item of items) {\n installBaseItem(item, config, cwd);\n }\n\n // Add token CSS imports to the user's stylesheet\n setupCssImports(config, cwd);\n\n // Collect and install npm dependencies for base items\n const npmDeps = new Set<string>();\n for (const item of items) {\n for (const dep of item.dependencies ?? []) {\n npmDeps.add(dep);\n }\n }\n installNpmDeps([...npmDeps], cwd);\n\n // Optionally add cursor: pointer CSS\n if (options.pointer) {\n const cssPath = resolve(cwd, config.tailwind.css);\n if (existsSync(cssPath)) {\n const existing = readFileSync(cssPath, \"utf-8\");\n if (!existing.includes(\"cursor: pointer\")) {\n writeFileSync(cssPath, existing + \"\\n\" + CURSOR_CSS);\n console.log(\n chalk.green(`✓ Added cursor: pointer to ${config.tailwind.css}`),\n );\n } else {\n console.log(\n chalk.dim(\n ` ${config.tailwind.css} already has cursor: pointer — skipping`,\n ),\n );\n }\n } else {\n writeFileSync(cssPath, CURSOR_CSS);\n console.log(\n chalk.green(`✓ Created ${config.tailwind.css} with cursor: pointer`),\n );\n }\n }\n\n console.log(\"\");\n console.log(chalk.bold(\"Ionbit UI initialized!\"));\n console.log(\"\");\n console.log(chalk.dim(\"Next steps:\"));\n console.log(` ${chalk.cyan(\"ionbit-ui add button\")} — add a component`);\n console.log(\n ` ${chalk.cyan(\"ionbit-ui list\")} — browse available components`,\n );\n console.log(\"\");\n}\n\nfunction installBaseItem(\n item: RegistryItem,\n config: Config,\n cwd: string,\n): void {\n for (const file of item.files) {\n const targetPath = resolveTargetPath(file.path, config, cwd);\n if (existsSync(targetPath)) {\n console.log(chalk.dim(` ⚠ ${file.path} already exists — skipping`));\n continue;\n }\n writeFile(targetPath, file.content);\n console.log(chalk.green(` ✓ ${file.path}`));\n }\n}\n\nfunction setupCssImports(config: Config, cwd: string): void {\n const cssPath = resolve(cwd, config.tailwind.css);\n const stylesDir = config.aliases.styles;\n\n // Build the import lines relative to the CSS file's directory\n const tokensImport = `@import \"./${relativePath(cssPath, resolve(cwd, stylesDir, \"tokens.css\"))}\";`;\n const baseImport = `@import \"./${relativePath(cssPath, resolve(cwd, stylesDir, \"base.css\"))}\";`;\n const utilitiesImport = `@import \"./${relativePath(cssPath, resolve(cwd, stylesDir, \"utilities.css\"))}\";`;\n\n if (!existsSync(cssPath)) {\n // Create the CSS file with token imports\n const content = `@import \"tailwindcss\";\\n\\n${tokensImport}\\n${baseImport}\\n${utilitiesImport}\\n`;\n writeFileSync(cssPath, content);\n console.log(\n chalk.green(`✓ Created ${config.tailwind.css} with token imports`),\n );\n return;\n }\n\n const existing = readFileSync(cssPath, \"utf-8\");\n const lines: string[] = [];\n\n if (!existing.includes(\"tokens.css\")) {\n lines.push(tokensImport);\n }\n if (!existing.includes(\"base.css\")) {\n lines.push(baseImport);\n }\n if (!existing.includes(\"utilities.css\")) {\n lines.push(utilitiesImport);\n }\n\n if (lines.length > 0) {\n // Add imports after @import \"tailwindcss\" if present, otherwise at the top\n let updated: string;\n if (existing.includes('@import \"tailwindcss\"')) {\n updated = existing.replace(\n /(@import\\s+\"tailwindcss\"[^\\n]*)/,\n `$1\\n${lines.join(\"\\n\")}`,\n );\n } else {\n updated = lines.join(\"\\n\") + \"\\n\" + existing;\n }\n writeFileSync(cssPath, updated);\n console.log(chalk.green(`✓ Added token imports to ${config.tailwind.css}`));\n } else {\n console.log(\n chalk.dim(\n ` ${config.tailwind.css} already has token imports — skipping`,\n ),\n );\n }\n}\n\nfunction relativePath(from: string, to: string): string {\n let rel = relative(from, to).replace(/\\\\/g, \"/\");\n // Remove the leading \"../\" if the CSS file is in the same or parent directory\n if (rel.startsWith(\"../\")) rel = rel.slice(3);\n return rel;\n}\n","import chalk from \"chalk\";\n\nimport { fetchRegistry } from \"../utils/registry\";\n\nexport async function list(): Promise<void> {\n const registry = await fetchRegistry();\n\n const groups: Record<string, typeof registry.items> = {};\n\n for (const item of registry.items) {\n const category = item.type.replace(\"registry:\", \"\");\n if (!groups[category]) groups[category] = [];\n groups[category].push(item);\n }\n\n const categoryOrder = [\"lib\", \"base\", \"ui\"];\n const sortedCategories = Object.keys(groups).sort((a, b) => {\n const ai = categoryOrder.indexOf(a);\n const bi = categoryOrder.indexOf(b);\n if (ai !== -1 && bi !== -1) return ai - bi;\n if (ai !== -1) return -1;\n if (bi !== -1) return 1;\n return a.localeCompare(b);\n });\n\n for (const category of sortedCategories) {\n const items = groups[category];\n if (!items) continue;\n const label =\n category === \"lib\"\n ? \"Libraries\"\n : category === \"base\"\n ? \"Foundation\"\n : \"Components\";\n\n console.log(chalk.bold(`\\n${label}`));\n\n for (const item of items) {\n const deps = item.dependencies?.length\n ? chalk.dim(` (${item.dependencies.length} deps)`)\n : \"\";\n console.log(` ${chalk.cyan(item.name.padEnd(18))} ${item.title}${deps}`);\n }\n }\n\n console.log(\"\");\n console.log(chalk.dim(`Total: ${registry.items.length} items`));\n console.log(chalk.dim(`Install with: ionbit-ui add <name>`));\n console.log(\"\");\n}\n","import { Command } from \"commander\";\n\nimport { add } from \"./commands/add\";\nimport { init } from \"./commands/init\";\nimport { list } from \"./commands/list\";\n\nconst program = new Command();\n\nprogram\n .name(\"ionbit-ui\")\n .description(\n \"Ionbit UI CLI — install source-owned components from the Ionbit UI registry.\",\n )\n .version(\"0.1.11\");\n\nprogram\n .command(\"init\")\n .description(\n \"Initialize Ionbit UI in your project. Creates a ionbit-ui.config.json and installs design tokens.\",\n )\n .option(\"-y, --yes\", \"Skip confirmation prompts and use defaults\")\n .option(\"-f, --force\", \"Force overwrite of existing configuration\")\n .option(\n \"--pointer\",\n \"Add cursor: pointer CSS for buttons (Tailwind v4 defaults to cursor: default)\",\n )\n .action(init);\n\nprogram\n .command(\"add <components...>\")\n .description(\n \"Add components to your project. e.g. ionbit-ui add button card accordion\",\n )\n .option(\"-o, --overwrite\", \"Overwrite existing files\")\n .action(add);\n\nprogram\n .command(\"list\")\n .description(\"List all available components in the registry.\")\n .action(list);\n\nprogram.parse();\n"],"names":["__dirname"],"mappings":";;;;;;;AAAO,MAAM,eACX;AAEK,MAAM,oBACX;AAyCK,MAAM,iBAAyB;AAAA,EACpC,SAAS;AAAA,EACT,OAAO;AAAA,EACP,UAAU;AAAA,IACR,KAAK;AAAA,IACL,cAAc;AAAA,EAAA;AAAA,EAEhB,SAAS;AAAA,IACP,YAAY;AAAA,IACZ,QAAQ;AAAA,IACR,KAAK;AAAA,IACL,QAAQ;AAAA,EAAA;AAEZ;AAEO,MAAM,cAAc;ACrDpB,SAAS,WAAW,MAAM,QAAQ,OAAsB;AAC7D,QAAM,aAAa,QAAQ,KAAK,WAAW;AAC3C,MAAI,CAAC,WAAW,UAAU,EAAG,QAAO;AACpC,SAAO,KAAK,MAAM,aAAa,YA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AAI,EAAE;AAAA,IAC1E;AAAA,EACF;AAEA,UAAQ,IAAI,EAAE;AACd,UAAQ,IAAI,MAAM,IAAI,UAAU,SAAS,MAAM,MAAM,QAAQ,CAAC;AAC9D,UAAQ,IAAI,MAAM,IAAI,oCAAoC,CAAC;AAC3D,UAAQ,IAAI,EAAE;AAChB;AC3CA,MAAM,UAAU,IAAI,QAAA;AAEpB,QACG,KAAK,WAAW,EAChB;AAAA,EACC;AACF,EACC,QAAQ,QAAQ;AAEnB,QACG,QAAQ,MAAM,EACd;AAAA,EACC;AACF,EACC,OAAO,aAAa,4CAA4C,EAChE,OAAO,eAAe,2CAA2C,EACjE;AAAA,EACC;AAAA,EACA;AACF,EACC,OAAO,IAAI;AAEd,QACG,QAAQ,qBAAqB,EAC7B;AAAA,EACC;AACF,EACC,OAAO,mBAAmB,0BAA0B,EACpD,OAAO,GAAG;AAEb,QACG,QAAQ,MAAM,EACd,YAAY,gDAAgD,EAC5D,OAAO,IAAI;AAEd,QAAQ,MAAA;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/config.ts","../src/utils/fs.ts","../src/utils/npm.ts","../src/utils/registry.ts","../src/commands/add.ts","../src/commands/init.ts","../src/commands/list.ts","../src/index.ts"],"sourcesContent":["export const REGISTRY_URL =\n \"https://raw.githubusercontent.com/rostislaw9/ionbit-ui/main/registry.json\";\n\nexport const REGISTRY_ITEM_URL =\n \"https://raw.githubusercontent.com/rostislaw9/ionbit-ui/main/registry/items\";\n\nexport interface RegistryItem {\n name: string;\n type: string;\n title: string;\n description: string;\n dependencies?: string[];\n devDependencies?: string[];\n registryDependencies?: string[];\n files: RegistryFile[];\n}\n\nexport interface RegistryFile {\n path: string;\n type: string;\n content: string;\n}\n\nexport interface Registry {\n $schema: string;\n name: string;\n homepage: string;\n items: RegistryItem[];\n}\n\nexport interface Config {\n $schema: string;\n style: string;\n tailwind: {\n css: string;\n cssVariables: boolean;\n };\n aliases: {\n components: string;\n motion: string;\n lib: string;\n styles: string;\n };\n}\n\nexport const DEFAULT_CONFIG: Config = {\n $schema: \"https://ui.shadcn.com/schema/registry.json\",\n style: \"digital\",\n tailwind: {\n css: \"src/index.css\",\n cssVariables: true,\n },\n aliases: {\n components: \"src/components/ui\",\n motion: \"src/components/motion\",\n lib: \"src/lib\",\n styles: \"src/styles\",\n },\n};\n\nexport const CONFIG_FILE = \"ionbit-ui.config.json\";\n","import type { Config } from \"../config\";\n\nimport { existsSync, mkdirSync, readFileSync, writeFileSync } from \"node:fs\";\nimport { dirname, resolve } from \"node:path\";\n\nimport { CONFIG_FILE } from \"../config\";\n\nexport function loadConfig(cwd = process.cwd()): Config | null {\n const configPath = resolve(cwd, CONFIG_FILE);\n if (!existsSync(configPath)) return null;\n return JSON.parse(readFileSync(configPath, \"utf-8\")) as Config;\n}\n\nexport function saveConfig(config: Config, cwd = process.cwd()): void {\n const configPath = resolve(cwd, CONFIG_FILE);\n writeFileSync(configPath, JSON.stringify(config, null, 2) + \"\\n\");\n}\n\nexport function ensureDir(filePath: string): void {\n const dir = dirname(filePath);\n if (!existsSync(dir)) mkdirSync(dir, { recursive: true });\n}\n\nexport function writeFile(filePath: string, content: string): void {\n ensureDir(filePath);\n writeFileSync(filePath, content);\n}\n\nexport function resolveTargetPath(\n target: string,\n config: Config,\n cwd = process.cwd(),\n): string {\n // Map registry target paths to the user's configured aliases.\n // e.g. \"components/ui/button.tsx\" -> \"{cwd}/components/ui/button.tsx\"\n // \"components/motion/spotlight.tsx\" -> \"{cwd}/components/motion/spotlight.tsx\"\n // \"lib/utils.ts\" -> \"{cwd}/lib/utils.ts\"\n // \"styles/tokens.css\" -> \"{cwd}/styles/tokens.css\"\n let resolved = target;\n\n if (target.startsWith(\"components/ui/\")) {\n resolved = target.replace(\n \"components/ui/\",\n config.aliases.components + \"/\",\n );\n } else if (target.startsWith(\"components/motion/\")) {\n resolved = target.replace(\n \"components/motion/\",\n config.aliases.motion + \"/\",\n );\n } else if (target.startsWith(\"lib/\")) {\n resolved = target.replace(\"lib/\", config.aliases.lib + \"/\");\n } else if (target.startsWith(\"styles/\")) {\n resolved = target.replace(\"styles/\", config.aliases.styles + \"/\");\n }\n\n return resolve(cwd, resolved);\n}\n","import { execSync } from \"node:child_process\";\nimport { existsSync } from \"node:fs\";\nimport { resolve } from \"node:path\";\n\nexport type PackageManager = \"npm\" | \"pnpm\" | \"yarn\" | \"bun\";\n\nexport function detectPackageManager(cwd: string): PackageManager {\n if (existsSync(resolve(cwd, \"bun.lockb\"))) return \"bun\";\n if (existsSync(resolve(cwd, \"bun.lock\"))) return \"bun\";\n if (existsSync(resolve(cwd, \"pnpm-lock.yaml\"))) return \"pnpm\";\n if (existsSync(resolve(cwd, \"yarn.lock\"))) return \"yarn\";\n return \"npm\";\n}\n\nexport function installNpmDeps(deps: string[], cwd: string): void {\n if (deps.length === 0) return;\n const pm = detectPackageManager(cwd);\n const cmd =\n pm === \"pnpm\"\n ? `pnpm add ${deps.join(\" \")}`\n : pm === \"yarn\"\n ? `yarn add ${deps.join(\" \")}`\n : pm === \"bun\"\n ? `bun add ${deps.join(\" \")}`\n : `npm install ${deps.join(\" \")}`;\n execSync(cmd, { cwd, stdio: \"inherit\" });\n}\n","import type { Registry, RegistryItem } from \"../config\";\n\nimport { existsSync, readFileSync } from \"node:fs\";\nimport { dirname, resolve } from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\n\nimport { REGISTRY_ITEM_URL, REGISTRY_URL } from \"../config\";\n\nconst __dirname = dirname(fileURLToPath(import.meta.url));\n\n/**\n * Find the registry.json — checks local paths first, then falls back to the\n * remote GitHub URL. This allows development/testing without pushing to GitHub.\n */\nfunction findLocalRegistry(): string | null {\n const candidates = [\n // Relative to cwd (user's project)\n resolve(process.cwd(), \"registry.json\"),\n // Relative to CLI dist (packages/cli/dist -> ../../../registry.json)\n resolve(__dirname, \"../../../registry.json\"),\n // Relative to CLI src/utils (packages/cli/src/utils -> ../../../../registry.json)\n resolve(__dirname, \"../../../../registry.json\"),\n ];\n for (const p of candidates) {\n if (existsSync(p)) return p;\n }\n return null;\n}\n\nfunction findLocalRegistryItem(name: string): string | null {\n const candidates = [\n resolve(process.cwd(), \"registry/items\", `${name}.json`),\n resolve(__dirname, \"../../../registry/items\", `${name}.json`),\n resolve(__dirname, \"../../../../registry/items\", `${name}.json`),\n ];\n for (const p of candidates) {\n if (existsSync(p)) return p;\n }\n return null;\n}\n\nexport async function fetchRegistry(): Promise<Registry> {\n const localPath = findLocalRegistry();\n if (localPath) {\n return JSON.parse(readFileSync(localPath, \"utf-8\")) as Registry;\n }\n\n const res = await fetch(REGISTRY_URL);\n if (!res.ok) {\n throw new Error(\n `Failed to fetch registry: ${res.status} ${res.statusText}`,\n );\n }\n return (await res.json()) as Registry;\n}\n\nexport async function fetchRegistryItem(name: string): Promise<RegistryItem> {\n const localPath = findLocalRegistryItem(name);\n if (localPath) {\n return JSON.parse(readFileSync(localPath, \"utf-8\")) as RegistryItem;\n }\n\n const res = await fetch(`${REGISTRY_ITEM_URL}/${name}.json`);\n if (!res.ok) {\n throw new Error(\n `Failed to fetch registry item \"${name}\": ${res.status} ${res.statusText}`,\n );\n }\n return (await res.json()) as RegistryItem;\n}\n\nexport async function fetchRegistryItems(\n names: string[],\n): Promise<RegistryItem[]> {\n return Promise.all(names.map(fetchRegistryItem));\n}\n","import type { Config, RegistryItem } from \"../config\";\n\nimport chalk from \"chalk\";\nimport { existsSync } from \"node:fs\";\n\nimport { loadConfig, resolveTargetPath, writeFile } from \"../utils/fs\";\nimport { installNpmDeps } from \"../utils/npm\";\nimport { fetchRegistry, fetchRegistryItems } from \"../utils/registry\";\n\nexport async function add(\n components: string[],\n options: { overwrite?: boolean },\n): Promise<void> {\n const cwd = process.cwd();\n const config = loadConfig(cwd);\n\n if (!config) {\n console.log(\n chalk.red(\"No ionbit-ui.config.json found. Run `ionbit-ui init` first.\"),\n );\n process.exit(1);\n }\n\n // Fetch the full registry to resolve names and dependencies\n const registry = await fetchRegistry();\n const allNames = new Set(registry.items.map((i) => i.name));\n\n // Validate requested components\n for (const name of components) {\n if (!allNames.has(name)) {\n console.log(\n chalk.red(\n `Component \"${name}\" not found in registry. Run \\`ionbit-ui list\\` to see available components.`,\n ),\n );\n process.exit(1);\n }\n }\n\n // Resolve transitive registry dependencies\n const toInstall = resolveDependencies(components, registry.items);\n\n console.log(chalk.dim(`Installing ${toInstall.length} item(s)...`));\n console.log(\"\");\n\n // Fetch all items with embedded content\n const items = await fetchRegistryItems(toInstall);\n\n for (const item of items) {\n await installItem(item, config, cwd, options.overwrite ?? false);\n }\n\n // Collect and install npm dependencies\n const npmDeps = new Set<string>();\n for (const item of items) {\n for (const dep of item.dependencies ?? []) {\n npmDeps.add(dep);\n }\n }\n\n if (npmDeps.size > 0) {\n console.log(\"\");\n installNpmDeps([...npmDeps], cwd);\n }\n\n console.log(\"\");\n console.log(chalk.green(`✓ Added ${items.length} component(s).`));\n}\n\nfunction resolveDependencies(\n names: string[],\n allItems: { name: string; registryDependencies?: string[] }[],\n): string[] {\n const resolved = new Set<string>();\n const queue = [...names];\n\n while (queue.length > 0) {\n const name = queue.shift()!;\n if (resolved.has(name)) continue;\n resolved.add(name);\n\n const item = allItems.find((i) => i.name === name);\n if (item?.registryDependencies) {\n for (const dep of item.registryDependencies) {\n if (!resolved.has(dep)) queue.push(dep);\n }\n }\n }\n\n return [...resolved];\n}\n\nasync function installItem(\n item: RegistryItem,\n config: Config,\n cwd: string,\n overwrite: boolean,\n): Promise<void> {\n for (const file of item.files) {\n const targetPath = resolveTargetPath(file.path, config, cwd);\n\n if (existsSync(targetPath) && !overwrite) {\n console.log(\n chalk.yellow(\n ` ⚠ ${file.path} already exists — skipping (use --overwrite)`,\n ),\n );\n continue;\n }\n\n writeFile(targetPath, file.content);\n console.log(chalk.green(` ✓ ${file.path}`));\n }\n}\n","import type { Config, RegistryItem } from \"../config\";\n\nimport chalk from \"chalk\";\nimport { existsSync, mkdirSync, readFileSync, writeFileSync } from \"node:fs\";\nimport { relative, resolve } from \"node:path\";\n\nimport { CONFIG_FILE, DEFAULT_CONFIG } from \"../config\";\nimport { resolveTargetPath, saveConfig, writeFile } from \"../utils/fs\";\nimport { installNpmDeps } from \"../utils/npm\";\nimport { fetchRegistryItems } from \"../utils/registry\";\n\nconst CURSOR_CSS = `@layer base {\n button:not(:disabled),\n [role=\"button\"]:not(:disabled) {\n cursor: pointer;\n }\n}`;\n\n/** Items that every project needs — installed automatically during init. */\nconst BASE_ITEMS = [\"cn\", \"tokens\"];\n\nexport async function init(options: {\n yes?: boolean;\n force?: boolean;\n pointer?: boolean;\n}): Promise<void> {\n const cwd = process.cwd();\n const configPath = resolve(cwd, CONFIG_FILE);\n\n if (existsSync(configPath) && !options.force) {\n console.log(\n chalk.yellow(\n `${CONFIG_FILE} already exists. Use --force to reinitialize.`,\n ),\n );\n return;\n }\n\n const config: Config = { ...DEFAULT_CONFIG };\n\n saveConfig(config, cwd);\n console.log(chalk.green(`✓ Created ${CONFIG_FILE}`));\n\n // Create directory structure\n const dirs = [\n config.aliases.components,\n config.aliases.motion,\n config.aliases.lib,\n config.aliases.styles,\n ];\n\n for (const dir of dirs) {\n const dirPath = resolve(cwd, dir);\n if (!existsSync(dirPath)) {\n mkdirSync(dirPath, { recursive: true });\n console.log(chalk.dim(` Created ${dir}/`));\n }\n }\n\n // Install base items (cn utility + design tokens)\n console.log(chalk.dim(\"Installing base items (cn, tokens)...\"));\n const items = await fetchRegistryItems(BASE_ITEMS);\n for (const item of items) {\n installBaseItem(item, config, cwd);\n }\n\n // Add token CSS imports to the user's stylesheet\n setupCssImports(config, cwd);\n\n // Collect and install npm dependencies for base items\n const npmDeps = new Set<string>();\n for (const item of items) {\n for (const dep of item.dependencies ?? []) {\n npmDeps.add(dep);\n }\n }\n installNpmDeps([...npmDeps], cwd);\n\n // Optionally add cursor: pointer CSS\n if (options.pointer) {\n const cssPath = resolve(cwd, config.tailwind.css);\n if (existsSync(cssPath)) {\n const existing = readFileSync(cssPath, \"utf-8\");\n if (!existing.includes(\"cursor: pointer\")) {\n writeFileSync(cssPath, existing + \"\\n\" + CURSOR_CSS);\n console.log(\n chalk.green(`✓ Added cursor: pointer to ${config.tailwind.css}`),\n );\n } else {\n console.log(\n chalk.dim(\n ` ${config.tailwind.css} already has cursor: pointer — skipping`,\n ),\n );\n }\n } else {\n writeFileSync(cssPath, CURSOR_CSS);\n console.log(\n chalk.green(`✓ Created ${config.tailwind.css} with cursor: pointer`),\n );\n }\n }\n\n console.log(\"\");\n console.log(chalk.bold(\"Ionbit UI initialized!\"));\n console.log(\"\");\n console.log(chalk.dim(\"Next steps:\"));\n console.log(` ${chalk.cyan(\"ionbit-ui add button\")} — add a component`);\n console.log(\n ` ${chalk.cyan(\"ionbit-ui list\")} — browse available components`,\n );\n console.log(\"\");\n}\n\nfunction installBaseItem(\n item: RegistryItem,\n config: Config,\n cwd: string,\n): void {\n for (const file of item.files) {\n const targetPath = resolveTargetPath(file.path, config, cwd);\n if (existsSync(targetPath)) {\n console.log(chalk.dim(` ⚠ ${file.path} already exists — skipping`));\n continue;\n }\n writeFile(targetPath, file.content);\n console.log(chalk.green(` ✓ ${file.path}`));\n }\n}\n\nfunction setupCssImports(config: Config, cwd: string): void {\n const cssPath = resolve(cwd, config.tailwind.css);\n const stylesDir = config.aliases.styles;\n\n // Build the import lines relative to the CSS file's directory\n const tokensImport = `@import \"./${relativePath(cssPath, resolve(cwd, stylesDir, \"tokens.css\"))}\";`;\n const baseImport = `@import \"./${relativePath(cssPath, resolve(cwd, stylesDir, \"base.css\"))}\";`;\n const utilitiesImport = `@import \"./${relativePath(cssPath, resolve(cwd, stylesDir, \"utilities.css\"))}\";`;\n\n if (!existsSync(cssPath)) {\n // Create the CSS file with token imports\n const content = `@import \"tailwindcss\";\\n\\n${tokensImport}\\n${baseImport}\\n${utilitiesImport}\\n`;\n writeFileSync(cssPath, content);\n console.log(\n chalk.green(`✓ Created ${config.tailwind.css} with token imports`),\n );\n return;\n }\n\n const existing = readFileSync(cssPath, \"utf-8\");\n const lines: string[] = [];\n\n if (!existing.includes(\"tokens.css\")) {\n lines.push(tokensImport);\n }\n if (!existing.includes(\"base.css\")) {\n lines.push(baseImport);\n }\n if (!existing.includes(\"utilities.css\")) {\n lines.push(utilitiesImport);\n }\n\n if (lines.length > 0) {\n // Add imports after @import \"tailwindcss\" if present, otherwise at the top\n let updated: string;\n if (existing.includes('@import \"tailwindcss\"')) {\n updated = existing.replace(\n /(@import\\s+\"tailwindcss\"[^\\n]*)/,\n `$1\\n${lines.join(\"\\n\")}`,\n );\n } else {\n updated = lines.join(\"\\n\") + \"\\n\" + existing;\n }\n writeFileSync(cssPath, updated);\n console.log(chalk.green(`✓ Added token imports to ${config.tailwind.css}`));\n } else {\n console.log(\n chalk.dim(\n ` ${config.tailwind.css} already has token imports — skipping`,\n ),\n );\n }\n}\n\nfunction relativePath(from: string, to: string): string {\n let rel = relative(from, to).replace(/\\\\/g, \"/\");\n // Remove the leading \"../\" if the CSS file is in the same or parent directory\n if (rel.startsWith(\"../\")) rel = rel.slice(3);\n return rel;\n}\n","import chalk from \"chalk\";\n\nimport { fetchRegistry } from \"../utils/registry\";\n\nexport async function list(): Promise<void> {\n const registry = await fetchRegistry();\n\n const groups: Record<string, typeof registry.items> = {};\n\n for (const item of registry.items) {\n const category = item.type.replace(\"registry:\", \"\");\n if (!groups[category]) groups[category] = [];\n groups[category].push(item);\n }\n\n const categoryOrder = [\"lib\", \"base\", \"ui\"];\n const sortedCategories = Object.keys(groups).sort((a, b) => {\n const ai = categoryOrder.indexOf(a);\n const bi = categoryOrder.indexOf(b);\n if (ai !== -1 && bi !== -1) return ai - bi;\n if (ai !== -1) return -1;\n if (bi !== -1) return 1;\n return a.localeCompare(b);\n });\n\n for (const category of sortedCategories) {\n const items = groups[category];\n if (!items) continue;\n const label =\n category === \"lib\"\n ? \"Libraries\"\n : category === \"base\"\n ? \"Foundation\"\n : \"Components\";\n\n console.log(chalk.bold(`\\n${label}`));\n\n for (const item of items) {\n const deps = item.dependencies?.length\n ? chalk.dim(` (${item.dependencies.length} deps)`)\n : \"\";\n console.log(` ${chalk.cyan(item.name.padEnd(18))} ${item.title}${deps}`);\n }\n }\n\n console.log(\"\");\n console.log(chalk.dim(`Total: ${registry.items.length} items`));\n console.log(chalk.dim(`Install with: ionbit-ui add <name>`));\n console.log(\"\");\n}\n","import { Command } from \"commander\";\n\nimport { add } from \"./commands/add\";\nimport { init } from \"./commands/init\";\nimport { list } from \"./commands/list\";\n\nconst program = new Command();\n\nprogram\n .name(\"ionbit-ui\")\n .description(\n \"Ionbit UI CLI — install source-owned components from the Ionbit UI registry.\",\n )\n .version(\"0.1.13\");\n\nprogram\n .command(\"init\")\n .description(\n \"Initialize Ionbit UI in your project. Creates a ionbit-ui.config.json and installs design tokens.\",\n )\n .option(\"-y, --yes\", \"Skip confirmation prompts and use defaults\")\n .option(\"-f, --force\", \"Force overwrite of existing configuration\")\n .option(\n \"--pointer\",\n \"Add cursor: pointer CSS for buttons (Tailwind v4 defaults to cursor: default)\",\n )\n .action(init);\n\nprogram\n .command(\"add <components...>\")\n .description(\n \"Add components to your project. e.g. ionbit-ui add button card accordion\",\n )\n .option(\"-o, --overwrite\", \"Overwrite existing files\")\n .action(add);\n\nprogram\n .command(\"list\")\n .description(\"List all available components in the registry.\")\n .action(list);\n\nprogram.parse();\n"],"names":["__dirname"],"mappings":";;;;;;;AAAO,MAAM,eACX;AAEK,MAAM,oBACX;AAyCK,MAAM,iBAAyB;AAAA,EACpC,SAAS;AAAA,EACT,OAAO;AAAA,EACP,UAAU;AAAA,IACR,KAAK;AAAA,IACL,cAAc;AAAA,EAAA;AAAA,EAEhB,SAAS;AAAA,IACP,YAAY;AAAA,IACZ,QAAQ;AAAA,IACR,KAAK;AAAA,IACL,QAAQ;AAAA,EAAA;AAEZ;AAEO,MAAM,cAAc;ACrDpB,SAAS,WAAW,MAAM,QAAQ,OAAsB;AAC7D,QAAM,aAAa,QAAQ,KAAK,WAAW;AAC3C,MAAI,CAAC,WAAW,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,OAAO,EAAE,CAAC,CAAC,IAAI,KAAK,KAAK,GAAG,IAAI,EAAE;AAAA,IAC1E;AAAA,EACF;AAEA,UAAQ,IAAI,EAAE;AACd,UAAQ,IAAI,MAAM,IAAI,UAAU,SAAS,MAAM,MAAM,QAAQ,CAAC;AAC9D,UAAQ,IAAI,MAAM,IAAI,oCAAoC,CAAC;AAC3D,UAAQ,IAAI,EAAE;AAChB;AC3CA,MAAM,UAAU,IAAI,QAAA;AAEpB,QACG,KAAK,WAAW,EAChB;AAAA,EACC;AACF,EACC,QAAQ,QAAQ;AAEnB,QACG,QAAQ,MAAM,EACd;AAAA,EACC;AACF,EACC,OAAO,aAAa,4CAA4C,EAChE,OAAO,eAAe,2CAA2C,EACjE;AAAA,EACC;AAAA,EACA;AACF,EACC,OAAO,IAAI;AAEd,QACG,QAAQ,qBAAqB,EAC7B;AAAA,EACC;AACF,EACC,OAAO,mBAAmB,0BAA0B,EACpD,OAAO,GAAG;AAEb,QACG,QAAQ,MAAM,EACd,YAAY,gDAAgD,EAC5D,OAAO,IAAI;AAEd,QAAQ,MAAA;"}
|
package/dist/tokens.css
CHANGED
|
@@ -36,19 +36,38 @@
|
|
|
36
36
|
--border-strong: oklch(1 0 0 / 0.14);
|
|
37
37
|
--border-accent: oklch(0.78 0.16 238 / 0.5);
|
|
38
38
|
--border-error: oklch(0.62 0.24 5 / 0.5);
|
|
39
|
+
--border-success: oklch(0.78 0.15 155 / 0.5);
|
|
40
|
+
--border-warning: oklch(0.82 0.15 80 / 0.5);
|
|
41
|
+
--border-info: oklch(0.82 0.14 230 / 0.5);
|
|
39
42
|
|
|
40
43
|
/* Accent — electric cyan/blue family. Configurable. */
|
|
41
44
|
--accent: oklch(0.78 0.17 238);
|
|
42
45
|
--accent-hover: oklch(0.82 0.18 238);
|
|
43
46
|
--accent-muted: oklch(0.78 0.17 238 / 0.16);
|
|
47
|
+
--accent-subtle: oklch(0.78 0.17 238 / 0.08);
|
|
44
48
|
--accent-foreground: oklch(0.1 0.02 238);
|
|
45
49
|
|
|
46
50
|
/* Semantic status — restrained, not neon. */
|
|
47
51
|
--success: oklch(0.78 0.15 155);
|
|
52
|
+
--success-hover: oklch(0.72 0.14 155);
|
|
53
|
+
--success-muted: oklch(0.78 0.15 155 / 0.16);
|
|
54
|
+
--success-subtle: oklch(0.78 0.15 155 / 0.08);
|
|
55
|
+
--success-foreground: oklch(0.1 0.03 155);
|
|
48
56
|
--warning: oklch(0.82 0.15 80);
|
|
57
|
+
--warning-hover: oklch(0.76 0.14 80);
|
|
58
|
+
--warning-muted: oklch(0.82 0.15 80 / 0.16);
|
|
59
|
+
--warning-subtle: oklch(0.82 0.15 80 / 0.08);
|
|
60
|
+
--warning-foreground: oklch(0.1 0.03 80);
|
|
49
61
|
--error: oklch(0.62 0.24 5);
|
|
62
|
+
--error-hover: oklch(0.56 0.22 5);
|
|
63
|
+
--error-muted: oklch(0.62 0.24 5 / 0.16);
|
|
64
|
+
--error-subtle: oklch(0.62 0.24 5 / 0.08);
|
|
50
65
|
--error-foreground: oklch(0.1 0.04 5);
|
|
51
66
|
--info: oklch(0.82 0.14 230);
|
|
67
|
+
--info-hover: oklch(0.76 0.13 230);
|
|
68
|
+
--info-muted: oklch(0.82 0.14 230 / 0.16);
|
|
69
|
+
--info-subtle: oklch(0.82 0.14 230 / 0.08);
|
|
70
|
+
--info-foreground: oklch(0.1 0.03 230);
|
|
52
71
|
|
|
53
72
|
/* Focus ring — accent-tinted, visible but not loud. */
|
|
54
73
|
--ring: oklch(0.82 0.16 238 / 0.55);
|
|
@@ -141,27 +160,46 @@
|
|
|
141
160
|
--background: oklch(0.99 0.002 250);
|
|
142
161
|
--surface: oklch(0.98 0.003 250);
|
|
143
162
|
--surface-elevated: oklch(1 0 0);
|
|
144
|
-
--surface-hover: oklch(0.
|
|
163
|
+
--surface-hover: oklch(0.95 0.005 250);
|
|
145
164
|
|
|
146
|
-
--foreground: oklch(0.
|
|
147
|
-
--foreground-muted: oklch(0.
|
|
148
|
-
--foreground-subtle: oklch(0.
|
|
165
|
+
--foreground: oklch(0.18 0.012 250);
|
|
166
|
+
--foreground-muted: oklch(0.42 0.012 250);
|
|
167
|
+
--foreground-subtle: oklch(0.58 0.012 250);
|
|
149
168
|
|
|
150
|
-
--border: oklch(0 0 0 / 0.
|
|
151
|
-
--border-strong: oklch(0 0 0 / 0.
|
|
169
|
+
--border: oklch(0 0 0 / 0.1);
|
|
170
|
+
--border-strong: oklch(0 0 0 / 0.16);
|
|
152
171
|
--border-accent: oklch(0.62 0.18 238 / 0.5);
|
|
153
172
|
--border-error: oklch(0.52 0.24 5 / 0.5);
|
|
154
|
-
|
|
155
|
-
--
|
|
156
|
-
--
|
|
157
|
-
|
|
173
|
+
--border-success: oklch(0.58 0.16 155 / 0.5);
|
|
174
|
+
--border-warning: oklch(0.62 0.17 80 / 0.5);
|
|
175
|
+
--border-info: oklch(0.58 0.16 238 / 0.5);
|
|
176
|
+
|
|
177
|
+
--accent: oklch(0.56 0.2 238);
|
|
178
|
+
--accent-hover: oklch(0.5 0.21 238);
|
|
179
|
+
--accent-muted: oklch(0.56 0.2 238 / 0.14);
|
|
180
|
+
--accent-subtle: oklch(0.56 0.2 238 / 0.07);
|
|
158
181
|
--accent-foreground: oklch(0.99 0 0);
|
|
159
182
|
|
|
160
|
-
--success: oklch(0.
|
|
161
|
-
--
|
|
162
|
-
--
|
|
183
|
+
--success: oklch(0.56 0.16 155);
|
|
184
|
+
--success-hover: oklch(0.5 0.15 155);
|
|
185
|
+
--success-muted: oklch(0.56 0.16 155 / 0.14);
|
|
186
|
+
--success-subtle: oklch(0.56 0.16 155 / 0.07);
|
|
187
|
+
--success-foreground: oklch(0.99 0 0);
|
|
188
|
+
--warning: oklch(0.6 0.17 80);
|
|
189
|
+
--warning-hover: oklch(0.54 0.16 80);
|
|
190
|
+
--warning-muted: oklch(0.6 0.17 80 / 0.14);
|
|
191
|
+
--warning-subtle: oklch(0.6 0.17 80 / 0.07);
|
|
192
|
+
--warning-foreground: oklch(0.99 0 0);
|
|
193
|
+
--error: oklch(0.5 0.24 5);
|
|
194
|
+
--error-hover: oklch(0.44 0.22 5);
|
|
195
|
+
--error-muted: oklch(0.5 0.24 5 / 0.14);
|
|
196
|
+
--error-subtle: oklch(0.5 0.24 5 / 0.07);
|
|
163
197
|
--error-foreground: oklch(0.99 0 0);
|
|
164
|
-
--info: oklch(0.
|
|
198
|
+
--info: oklch(0.56 0.16 238);
|
|
199
|
+
--info-hover: oklch(0.5 0.15 238);
|
|
200
|
+
--info-muted: oklch(0.56 0.16 238 / 0.14);
|
|
201
|
+
--info-subtle: oklch(0.56 0.16 238 / 0.07);
|
|
202
|
+
--info-foreground: oklch(0.99 0 0);
|
|
165
203
|
|
|
166
204
|
--ring: oklch(0.62 0.18 238 / 0.5);
|
|
167
205
|
|
|
@@ -201,15 +239,34 @@
|
|
|
201
239
|
--color-border-strong: var(--border-strong);
|
|
202
240
|
--color-border-accent: var(--border-accent);
|
|
203
241
|
--color-border-error: var(--border-error);
|
|
242
|
+
--color-border-success: var(--border-success);
|
|
243
|
+
--color-border-warning: var(--border-warning);
|
|
244
|
+
--color-border-info: var(--border-info);
|
|
204
245
|
--color-accent: var(--accent);
|
|
205
246
|
--color-accent-hover: var(--accent-hover);
|
|
206
247
|
--color-accent-muted: var(--accent-muted);
|
|
248
|
+
--color-accent-subtle: var(--accent-subtle);
|
|
207
249
|
--color-accent-foreground: var(--accent-foreground);
|
|
208
250
|
--color-success: var(--success);
|
|
251
|
+
--color-success-hover: var(--success-hover);
|
|
252
|
+
--color-success-muted: var(--success-muted);
|
|
253
|
+
--color-success-subtle: var(--success-subtle);
|
|
254
|
+
--color-success-foreground: var(--success-foreground);
|
|
209
255
|
--color-warning: var(--warning);
|
|
256
|
+
--color-warning-hover: var(--warning-hover);
|
|
257
|
+
--color-warning-muted: var(--warning-muted);
|
|
258
|
+
--color-warning-subtle: var(--warning-subtle);
|
|
259
|
+
--color-warning-foreground: var(--warning-foreground);
|
|
210
260
|
--color-error: var(--error);
|
|
261
|
+
--color-error-hover: var(--error-hover);
|
|
262
|
+
--color-error-muted: var(--error-muted);
|
|
263
|
+
--color-error-subtle: var(--error-subtle);
|
|
211
264
|
--color-error-foreground: var(--error-foreground);
|
|
212
265
|
--color-info: var(--info);
|
|
266
|
+
--color-info-hover: var(--info-hover);
|
|
267
|
+
--color-info-muted: var(--info-muted);
|
|
268
|
+
--color-info-subtle: var(--info-subtle);
|
|
269
|
+
--color-info-foreground: var(--info-foreground);
|
|
213
270
|
--color-ring: var(--ring);
|
|
214
271
|
|
|
215
272
|
/* Fonts */
|