{"_id":"@alfiexco/settings","name":"@alfiexco/settings","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@alfiexco/settings","version":"0.1.0","description":"A typed React settings provider factory with optional localStorage persistence.","license":"MIT","type":"module","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"}},"sideEffects":false,"scripts":{"build":"tsup src/index.ts --format esm,cjs --dts --external react --clean","clean":"node -e \"require('fs').rmSync('dist', { recursive: true, force: true })\"","typecheck":"tsc -p tsconfig.json --noEmit"},"peerDependencies":{"react":">=18"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/alfredosa/alfies-web-components.git","directory":"packages/settings"},"_id":"@alfiexco/settings@0.1.0","gitHead":"90a40b342dc26fd3270eaa1391572be299f2c198","bugs":{"url":"https://github.com/alfredosa/alfies-web-components/issues"},"homepage":"https://github.com/alfredosa/alfies-web-components#readme","_nodeVersion":"20.20.2","_npmVersion":"10.8.2","dist":{"integrity":"sha512-HUfzptM1zqv53/MRq5m34+KOXo9e/9Ao5OrnGcao5k63pxCJBPFEMDySuWprflzniCM9Y38fusz2mCfLFsLexQ==","shasum":"ed67e5a295880d0ccf82df546d04db9fbb911948","tarball":"https://registry.npmjs.org/@alfiexco/settings/-/settings-0.1.0.tgz","fileCount":6,"unpackedSize":10605,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@alfiexco%2fsettings@0.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIEcYBusHGHgHfmpT7wRVHRJaGwnA680ET63Y+snZcdTyAiA1AZsh3dExxMAiYs+KmnJXthv/wHnEr9gJeH1Bcy6TZg=="}]},"_npmUser":{"name":"alfiexco","email":"alfiexco@proton.me"},"directories":{},"maintainers":[{"name":"alfiexco","email":"alfiexco@proton.me"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/settings_0.1.0_1782054409631_0.6006141480904585"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-21T15:06:49.423Z","0.1.0":"2026-06-21T15:06:49.763Z","modified":"2026-06-21T15:06:50.249Z"},"maintainers":[{"name":"alfiexco","email":"alfiexco@proton.me"}],"description":"A typed React settings provider factory with optional localStorage persistence.","homepage":"https://github.com/alfredosa/alfies-web-components#readme","repository":{"type":"git","url":"git+https://github.com/alfredosa/alfies-web-components.git","directory":"packages/settings"},"bugs":{"url":"https://github.com/alfredosa/alfies-web-components/issues"},"license":"MIT","readme":"# @alfiexco/settings\n\nTyped React settings runtime migrated from Inksight's standalone settings\npackage. It creates a provider/hook pair for a settings schema and can persist\nto `localStorage`.\n\n```tsx\nimport { createSettings } from \"@alfiexco/settings\";\n\ntype AppSettings = {\n  theme: \"light\" | \"dark\";\n  rain: { intensity: number };\n};\n\nconst appSettings = createSettings<AppSettings>({\n  defaultSettings: {\n    theme: \"dark\",\n    rain: { intensity: 0.65 },\n  },\n  storageKey: \"app-settings\",\n  getStyle: (settings) => ({\n    \"--rain-intensity\": String(settings.rain.intensity),\n  }),\n});\n\nexport const SettingsProvider = appSettings.SettingsProvider;\nexport const useSettings = appSettings.useSettings;\n```\n\nUse `normalize` when stored settings need validation, clamping, migration, or\ndeep merging with nested defaults.\n\n## API\n\n- `createSettings({ defaultSettings })` returns `SettingsProvider` and\n  `useSettings`.\n- `storageKey` enables browser `localStorage` persistence.\n- `getStyle` maps settings into inherited CSS variables or inline styles.\n- `normalize` converts partially trusted stored data into a full settings\n  object.\n- The hook exposes `settings`, `setSettings`, `update`, `patch`, and `reset`.\n","readmeFilename":"README.md","_rev":"1-0d7e078f954a8026268c4c26a8366214"}