{"_id":"@emanuelmardsjo/design-tokens-v1","name":"@emanuelmardsjo/design-tokens-v1","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@emanuelmardsjo/design-tokens-v1","version":"0.1.0","description":"JAG design tokens package with JS API, JSON artifacts, and CSS variables/themes","type":"module","sideEffects":false,"main":"./dist/index.cjs","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs","default":"./dist/index.js"},"./variables.css":"./dist/variables.css","./themes.css":"./dist/themes.css","./tokens.json":"./dist/tokens.json","./tokens.flat.json":"./dist/tokens.flat.json","./package.json":"./package.json"},"publishConfig":{"access":"public"},"scripts":{"clean":"rm -rf dist","build":"node scripts/build.mjs","lint":"node --check scripts/build.mjs && node --check scripts/validate-build.mjs","validate":"node scripts/validate-build.mjs","prepack":"npm run clean && npm run build && npm run validate"},"_id":"@emanuelmardsjo/design-tokens-v1@0.1.0","_nodeVersion":"24.6.0","_npmVersion":"11.5.1","dist":{"integrity":"sha512-FDv65NUW6P4wB0in3SqVx1aDQJMfxozp4Mf8A4CKN1qv01jBVGJ1GZ3vjvF5CBmOsk6vvRCLuW4FKxxZZgtKWQ==","shasum":"cbce15afe38e54d297fc2d2565d1f0fee029b6ba","tarball":"https://registry.npmjs.org/@emanuelmardsjo/design-tokens-v1/-/design-tokens-v1-0.1.0.tgz","fileCount":9,"unpackedSize":784082,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDPyqPlmbRLURhg6OEk1C6Vqse+ginJSVXDpqZ19Nr+eQIgVaDrDJwPPn+z7qV1ahVT3GH74qg2RHCBlJrdn6S7L6o="}]},"_npmUser":{"name":"emanuelmardsjo","email":"emanuel.mardsjo@knowit.se"},"directories":{},"maintainers":[{"name":"emanuelmardsjo","email":"emanuel.mardsjo@knowit.se"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/design-tokens-v1_0.1.0_1770642727469_0.9710803040791356"},"_hasShrinkwrap":false}},"time":{"created":"2026-02-09T13:12:07.409Z","0.1.0":"2026-02-09T13:12:07.627Z","modified":"2026-02-09T13:12:07.787Z"},"maintainers":[{"name":"emanuelmardsjo","email":"emanuel.mardsjo@knowit.se"}],"description":"JAG design tokens package with JS API, JSON artifacts, and CSS variables/themes","readme":"# @emanuelmardsjo/design-tokens-v1\n\nPublishable design-token package for JAG foundations.\n\n## Install\n\n```bash\nnpm i @emanuelmardsjo/design-tokens-v1\n```\n\n## JavaScript / TypeScript usage\n\n```ts\nimport { tokens, themes, cssVariables, toCSSVariables, toTokenJSON } from \"@emanuelmardsjo/design-tokens-v1\";\n\nconsole.log(tokens.color[\"Blue Light Mode\"].background.default.default);\nconsole.log(themes.defaultMode);\nconsole.log(toCSSVariables(cssVariables));\nconsole.log(toTokenJSON(tokens, { pretty: true }));\n```\n\n## CommonJS usage\n\n```js\nconst { tokens, themes, cssVariables } = require(\"@emanuelmardsjo/design-tokens-v1\");\n\nconsole.log(tokens.color[\"Blue Light Mode\"].background.default.default);\nconsole.log(themes.defaultMode);\nconsole.log(cssVariables[\"--ds-surface-base\"]);\n```\n\n## CSS usage\n\n```ts\nimport \"@emanuelmardsjo/design-tokens-v1/variables.css\";\nimport \"@emanuelmardsjo/design-tokens-v1/themes.css\";\n```\n\n`variables.css` provides token custom properties and mode selectors (for example `:root[data-color=\"Blue Light Mode\"]`).\n\n`themes.css` provides semantic `--ds-*` aliases and theme selectors (for example `[data-theme=\"blue-light-mode\"]` and `.theme-blue-light-mode`).\n\n## JSON artifacts for non-TS consumers\n\n```ts\nimport tokensJson from \"@emanuelmardsjo/design-tokens-v1/tokens.json\";\nimport flatTokens from \"@emanuelmardsjo/design-tokens-v1/tokens.flat.json\";\n```\n\nYou can also read package metadata from:\n\n```ts\nimport pkg from \"@emanuelmardsjo/design-tokens-v1/package.json\";\nconsole.log(pkg.version);\n```\n\n`tokens.json` schema:\n- `schemaVersion`: number\n- `defaultModes`: default mode per token collection\n- `collections`: nested object by `collection -> mode -> token path`\n\n`tokens.flat.json` schema:\n- flat object map of `collection.mode.path` -> value\n- color values are serialized to CSS-friendly color strings\n\nIf your runtime does not support JSON module imports directly, load these files as static assets from `node_modules/@emanuelmardsjo/design-tokens-v1/dist`.\n\n## Build and validate\n\n```bash\nnpm run build\nnpm run validate\n```\n\n## Publish\n\n```bash\nnpm pack --dry-run\nnpm publish --access public\n```\n\nFrom the monorepo root you can run:\n\n```bash\nnpm run -w @emanuelmardsjo/design-tokens-v1 build\nnpm run -w @emanuelmardsjo/design-tokens-v1 validate\ncd packages/design-tokens\nnpm pack --dry-run\n```\n","readmeFilename":"README.md","_rev":"1-d73b2b33d454e6d5f38febef6b7ce63b"}