{"_id":"@arctura/theme","_rev":"4-3ac6954c740f940e7f5dcd399a6eec3e","name":"@arctura/theme","dist-tags":{"latest":"1.0.0"},"versions":{"0.0.1":{"name":"@arctura/theme","version":"0.0.1","_id":"@arctura/theme@0.0.1","maintainers":[{"name":"marcomg-byte","email":"marcomg_777@outlook.com"}],"homepage":"https://github.com/marcomg-byte/arctura#readme","bugs":{"url":"https://github.com/marcomg-byte/arctura/issues"},"bin":{"arctura-theme":"dist/cli.js"},"dist":{"shasum":"c784ea49e5252674c111eb370a1dc4b0caeff7db","tarball":"https://registry.npmjs.org/@arctura/theme/-/theme-0.0.1.tgz","fileCount":20,"integrity":"sha512-MnQ+HKdpSxu8I3IMMbeCjr5ekEahfgbI+96+eWI1echErp0TiHz/wLkmxsyREJ8dXUHsTog20F9djRUW6mJ2ig==","signatures":[{"sig":"MEYCIQCKvEWO7cDvosldpP0OwWYpl7nkGEg6v2S6ueZf+6X5iQIhAOMfs9efpfhIlJiLUiPAyAgMIOvL5vu29PPnI6UnH9O1","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":28433},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./parser":{"types":"./dist/parser.d.ts","import":"./dist/parser.js","require":"./dist/parser.cjs"}},"gitHead":"719fb1e94b4f8f774a9531e7e9128e8100031468","scripts":{"lint":"eslint .","test":"vitest run","build":"vite build && tsc -p tsconfig.json && rimraf dist/errors","clean":"rimraf dist theme.css","test:ui":"vitest --ui","lint:fix":"eslint . --fix","test:cov":"vitest run --coverage","typecheck":"tsc -p tsconfig.eslint.json","test:debug":"vitest --inspect-brk --no-file-parallelism","test:watch":"vitest watch","theme:parse":"tsx src/cli.ts"},"_npmUser":{"name":"marcomg-byte","email":"marcomg_777@outlook.com"},"repository":{"url":"git+https://github.com/marcomg-byte/arctura.git"},"_npmVersion":"11.13.0","description":"","directories":{},"sideEffects":false,"_nodeVersion":"24.17.0","dependencies":{"react":"^19.2.7","colord":"^2.9.3","postcss":"^8.5.6","react-dom":"^19.2.7","postcss-js":"^5.1.0"},"_hasShrinkwrap":false,"packageManager":"yarn@4.11.0","devDependencies":{"tsx":"^4.22.4","vite":"^8.0.12","jsdom":"^29.1.1","eslint":"^9.39.1","rimraf":"^6.1.3","vitest":"4.1.8","typescript":"^6.0.3","@types/node":"^25.9.3","@types/react":"^19.2.14","@types/react-dom":"^19","@vitest/coverage-v8":"4.1.8","@testing-library/dom":"^10.4.1","@testing-library/react":"^16.3.2"},"_npmOperationalInternal":{"tmp":"tmp/theme_0.0.1_1781987522776_0.03111816191689476","host":"s3://npm-registry-packages-npm-production"}},"0.0.2":{"name":"@arctura/theme","version":"0.0.2","license":"MIT","_id":"@arctura/theme@0.0.2","maintainers":[{"name":"marcomg-byte","email":"marcomg_777@outlook.com"}],"homepage":"https://github.com/marcomg-byte/arctura#readme","bugs":{"url":"https://github.com/marcomg-byte/arctura/issues"},"bin":{"arctura-theme":"dist/cli.js"},"dist":{"shasum":"69a989189848897d906a7f5d8895659a4dc0e5f8","tarball":"https://registry.npmjs.org/@arctura/theme/-/theme-0.0.2.tgz","fileCount":20,"integrity":"sha512-yM2OyW8E4+O7D/iBHFJthHF9+WNmNeMzZetTtUqxSP78kye5A5MNt5cVNNIvrBo0Ji9ZF2JCGAlUYlnxSRR8PA==","signatures":[{"sig":"MEYCIQDocW+oyLrlUxaYzRRl9JBHU9dEVDQ4waq+SBqxqFtuHgIhALVAItprWzqlc8LFH7ZD0uPJMvEgWE4M/rS4YhlvvzTb","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":31897},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./parser":{"types":"./dist/parser.d.ts","import":"./dist/parser.js","require":"./dist/parser.cjs"}},"gitHead":"18689bf1192e379f926e04f651fdd960fe844eaa","scripts":{"lint":"eslint .","test":"vitest run","build":"vite build && tsc -p tsconfig.json && rimraf dist/errors","clean":"rimraf dist theme.css","test:ui":"vitest --ui","lint:fix":"eslint . --fix","test:cov":"vitest run --coverage","typecheck":"tsc -p tsconfig.eslint.json","test:debug":"vitest --inspect-brk --no-file-parallelism","test:watch":"vitest watch","theme:parse":"tsx src/cli.ts"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:6d714b75-bcc0-4db0-926a-51e26c274749"}},"repository":{"url":"git+https://github.com/marcomg-byte/arctura.git"},"_npmVersion":"11.13.0","description":"Theme token utilities, CSS generation, and a client-side hook for switching themes.","directories":{},"sideEffects":false,"_nodeVersion":"24.16.0","dependencies":{"react":"^19.2.7","colord":"^2.9.3","postcss":"^8.5.6","react-dom":"^19.2.7","postcss-js":"^5.1.0"},"_hasShrinkwrap":false,"packageManager":"yarn@4.11.0","devDependencies":{"tsx":"^4.22.4","vite":"^8.0.12","jsdom":"^29.1.1","eslint":"^9.39.1","rimraf":"^6.1.3","vitest":"4.1.8","typescript":"^6.0.3","@types/node":"^25.9.3","@types/react":"^19.2.14","@types/react-dom":"^19","@vitest/coverage-v8":"4.1.8","@testing-library/dom":"^10.4.1","@testing-library/react":"^16.3.2"},"_npmOperationalInternal":{"tmp":"tmp/theme_0.0.2_1782145872362_0.6320261777761604","host":"s3://npm-registry-packages-npm-production"}},"0.0.3":{"name":"@arctura/theme","version":"0.0.3","license":"MIT","_id":"@arctura/theme@0.0.3","maintainers":[{"name":"marcomg-byte","email":"marcomg_777@outlook.com"}],"homepage":"https://github.com/marcomg-byte/arctura#readme","bugs":{"url":"https://github.com/marcomg-byte/arctura/issues"},"bin":{"arctura-theme":"dist/cli.js"},"dist":{"shasum":"5993de5a3049bd8fddaf12693667668db8be827a","tarball":"https://registry.npmjs.org/@arctura/theme/-/theme-0.0.3.tgz","fileCount":20,"integrity":"sha512-DvtcLVVsFgyScmW5eRajYHFxhSHv+94BdVqjqoAuH4qNx7EpwrTRu1zd7sW9jdp+UMgC8hmHMjiVjgJ71+cVKw==","signatures":[{"sig":"MEUCIQDBzKdTet4OB9Y48uw2AcNMCbwNbwrsfVlZ/yhn9sc74gIgKxSPnn1U5J9JzPPjjEj5BlA56icXHeHB20FOI+pRfJI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@arctura%2ftheme@0.0.3","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":31917},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./parser":{"types":"./dist/parser.d.ts","import":"./dist/parser.js","require":"./dist/parser.cjs"}},"gitHead":"d5050e85cb54903a986ea3190b6a7580c9831147","scripts":{"lint":"eslint .","test":"vitest run","build":"vite build && tsc -p tsconfig.json && rimraf dist/errors","clean":"rimraf dist theme.css","test:ui":"vitest --ui","lint:fix":"eslint . --fix","test:cov":"vitest run --coverage","typecheck":"tsc -p tsconfig.eslint.json","test:debug":"vitest --inspect-brk --no-file-parallelism","test:watch":"vitest watch","theme:parse":"tsx src/cli.ts"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:6d714b75-bcc0-4db0-926a-51e26c274749"}},"repository":{"url":"git+https://github.com/marcomg-byte/arctura.git"},"_npmVersion":"11.13.0","description":"Theme token utilities, CSS generation, and a client-side hook for switching themes.","directories":{},"sideEffects":false,"_nodeVersion":"24.16.0","dependencies":{"react":"^19.2.7","colord":"^2.9.3","postcss":"^8.5.6","react-dom":"^19.2.7","postcss-js":"^5.1.0"},"_hasShrinkwrap":false,"packageManager":"yarn@4.11.0","devDependencies":{"tsx":"^4.22.4","vite":"^8.0.12","jsdom":"^29.1.1","eslint":"^9.39.1","rimraf":"^6.1.3","vitest":"4.1.8","typescript":"^6.0.3","@types/node":"^25.9.3","@types/react":"^19.2.14","@types/react-dom":"^19","@vitest/coverage-v8":"4.1.8","@testing-library/dom":"^10.4.1","@testing-library/react":"^16.3.2"},"_npmOperationalInternal":{"tmp":"tmp/theme_0.0.3_1782225559575_0.47129235387660184","host":"s3://npm-registry-packages-npm-production"}},"1.0.0":{"name":"@arctura/theme","version":"1.0.0","type":"module","packageManager":"yarn@4.11.0","license":"MIT","main":"./dist/index.cjs","module":"./dist/index.js","types":"./dist/index.d.ts","repository":{"url":"git+https://github.com/marcomg-byte/arctura.git"},"bin":{"arctura-theme":"dist/cli.js"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./parser":{"types":"./dist/parser.d.ts","import":"./dist/parser.js","require":"./dist/parser.cjs"}},"sideEffects":false,"scripts":{"build":"vite build && tsc -p tsconfig.json && rimraf dist/errors","clean":"rimraf dist theme.css","lint":"eslint .","lint:fix":"eslint . --fix","test":"vitest run","test:cov":"vitest run --coverage","test:debug":"vitest --inspect-brk --no-file-parallelism","test:ui":"vitest --ui","test:watch":"vitest watch","theme:parse":"tsx src/cli.ts","typecheck":"tsc -p tsconfig.eslint.json"},"dependencies":{"colord":"^2.9.3","postcss":"^8.5.6","postcss-js":"^5.1.0","react":"^19.2.7","react-dom":"^19.2.7"},"devDependencies":{"@testing-library/dom":"^10.4.1","@testing-library/react":"^16.3.2","@types/node":"^25.9.3","@types/react":"^19.2.14","@types/react-dom":"^19","@vitest/coverage-v8":"4.1.8","eslint":"^9.39.1","jsdom":"^29.1.1","rimraf":"^6.1.3","tsx":"^4.22.4","typescript":"^6.0.3","vite":"^8.0.12","vitest":"4.1.8"},"gitHead":"443d4b7a5d8996b7edf4992ffefb0a0913c31d4c","_id":"@arctura/theme@1.0.0","description":"Theme token utilities, CSS generation, and a client-side hook for switching themes.","bugs":{"url":"https://github.com/marcomg-byte/arctura/issues"},"homepage":"https://github.com/marcomg-byte/arctura#readme","_nodeVersion":"24.16.0","_npmVersion":"11.13.0","dist":{"integrity":"sha512-vOSr5WLNtyvc+XVCEUcpJ2o29YPpDGs6amy7r7s05QHBbibEM3dL8NR8RgLKY6ZOzOyZKyJNBlNKduddgslA4w==","shasum":"1265092a47b3806e2ff3fa4a0bb76301c2993c0b","tarball":"https://registry.npmjs.org/@arctura/theme/-/theme-1.0.0.tgz","fileCount":21,"unpackedSize":32999,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@arctura%2ftheme@1.0.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCrhJY2Ikr3ioDQlvpc2qmGhd+DM9+wbWWG0tBolT9N5QIhAJz7ivSVaj+a5mgSO7dpzer2oksCIgRp4rOkzZJQe0UD"}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:6d714b75-bcc0-4db0-926a-51e26c274749"}},"directories":{},"maintainers":[{"name":"marcomg-byte","email":"marcomg_777@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/theme_1.0.0_1782260714960_0.7378494169460903"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-20T20:32:02.610Z","modified":"2026-06-24T00:25:15.527Z","0.0.1":"2026-06-20T20:32:02.913Z","0.0.2":"2026-06-22T16:31:12.549Z","0.0.3":"2026-06-23T14:39:19.734Z","1.0.0":"2026-06-24T00:25:15.140Z"},"bugs":{"url":"https://github.com/marcomg-byte/arctura/issues"},"license":"MIT","homepage":"https://github.com/marcomg-byte/arctura#readme","repository":{"url":"git+https://github.com/marcomg-byte/arctura.git"},"description":"Theme token utilities, CSS generation, and a client-side hook for switching themes.","maintainers":[{"name":"marcomg-byte","email":"marcomg_777@outlook.com"}],"readme":"# @arctura/theme\n\nTheme token utilities, CSS generation, and a client-side hook for switching themes.\n\n## Install\n\n```bash\nyarn add @arctura/theme\n```\n\n## Current Version\n\n`1.0.0`\n\n## Versions\n\n- `1.0.0` - current package version\n- `0.0.3` - alpha version\n- `0.0.2` - alpha version\n\n## Exports\n\n```tsx\nimport { useTheme } from '@arctura/theme';\nimport { colorRefToCssVar, generateTheme } from '@arctura/theme/parser';\n```\n\n## What It Does\n\n- Reads a design-token JSON file.\n- Generates CSS custom properties for base colors, spacing, border widths, breakpoints, and typography.\n- Emits semantic theme variables for light and dark modes.\n- Writes a ready-to-use stylesheet such as `theme.css`.\n\n## CLI\n\nThe package exposes a CLI binary named `arctura-theme`.\n\n```bash\nyarn theme:parse\n```\n\nOr run it directly with explicit input and output paths:\n\n```bash\narctura-theme --tokens ./tokens.json --output ./theme.css\n```\n\nShort flags are also supported:\n\n- `-t` or `--tokens`\n- `-o` or `--output`\n\nIf no arguments are provided, the CLI defaults to:\n\n- `./tokens.json` for input\n- `./theme.css` for output\n\n## Programmatic Parse\n\nIf you want to generate theme CSS from code instead of the CLI, use the parser exports directly.\n\n```ts\nimport tokens from './tokens.json' with { type: 'json' };\nimport { buildCssFile, generateTheme } from '@arctura/theme/parser';\n\nconst css = generateTheme(tokens);\n\nawait buildCssFile(css, './theme.css');\n```\n\nIf you already have the tokens object in memory, `generateTheme(tokens)` returns the CSS string and you can write it wherever you need.\n\n## Token Shape\n\nThe parser expects a root object with at least:\n\n- `colors`: base color families and scale values\n- `theme.colors.palette.light` and `theme.colors.palette.dark`: semantic color references\n- `theme.spacing`: spacing scale with a required `space-unit`\n- `theme.borderWidth`: border width tokens\n- `theme.breakpoints`: responsive breakpoint tokens\n- `theme.typography.fontSize`: optional typography tokens\n\nExample:\n\n```json\n{\n  \"colors\": {\n    \"sky\": {\n      \"500\": \"#0077ff\"\n    },\n    \"white\": \"#ffffff\"\n  },\n  \"theme\": {\n    \"colors\": {\n      \"palette\": {\n        \"light\": {\n          \"background\": {\n            \"primary\": \"colors.white\"\n          },\n          \"text\": {\n            \"primary\": \"colors.sky.500\"\n          }\n        },\n        \"dark\": {\n          \"background\": {\n            \"primary\": \"colors.sky.500\"\n          },\n          \"text\": {\n            \"primary\": \"colors.white\"\n          }\n        }\n      }\n    },\n    \"spacing\": {\n      \"space-unit\": \"8px\",\n      \"sm\": 1.5\n    },\n    \"borderWidth\": {\n      \"1\": \"1px\"\n    },\n    \"breakpoints\": {\n      \"sm\": \"40rem\"\n    },\n    \"typography\": {\n      \"fontSize\": {\n        \"sm\": \"0.875rem\"\n      }\n    }\n  }\n}\n```\n\n## Runtime Hook\n\n`useTheme()` stores the selected theme mode in `localStorage`, mirrors it to `document.documentElement[data-theme]`, and follows the system color scheme when the mode is `system`.\n\n```tsx\nimport { useTheme } from '@arctura/theme';\n\nfunction ThemeToggle() {\n  const { mode, setMode } = useTheme();\n\n  return (\n    <button onClick={() => setMode(mode === 'dark' ? 'light' : 'dark')}>\n      Current mode: {mode}\n    </button>\n  );\n}\n```\n\n## Development\n\nFrom the repository root:\n\n```bash\nyarn workspace @arctura/theme build\nyarn workspace @arctura/theme lint\nyarn workspace @arctura/theme test\nyarn workspace @arctura/theme typecheck\nyarn workspace @arctura/theme theme:parse\n```\n","readmeFilename":"README.md"}