{"_id":"@atlantum/utils","_rev":"5-cae625e6d14e63d28ae72e204313cda9","name":"@atlantum/utils","dist-tags":{"latest":"0.1.4"},"versions":{"0.1.0":{"name":"@atlantum/utils","version":"0.1.0","keywords":["design-system","react","hooks","provider"],"author":{"name":"Qualifine"},"license":"MIT","_id":"@atlantum/utils@0.1.0","maintainers":[{"name":"arthurivanov","email":"artur.dsgn@yandex.ru"}],"homepage":"https://github.com/ArthurIvanov/atlantum-ui#readme","bugs":{"url":"https://github.com/ArthurIvanov/atlantum-ui/issues"},"dist":{"shasum":"dd71c0c19a3df88acf967d7eff682c33e8f3a1ba","tarball":"https://registry.npmjs.org/@atlantum/utils/-/utils-0.1.0.tgz","fileCount":9,"integrity":"sha512-51D2In3k/Ul5hiT004PENKrVrgyA6z48XY2xiS54YHnbfK9/Xp/wKTgRDUxAqlEF1f2eOmRDj5/eCpuPxWUaMA==","signatures":[{"sig":"MEYCIQDnYVnTS4TFvJu0wSWMpvIrPbECA4ZKN+TddKNTzAYbCAIhAK/hLK2+6wu4ZQLqd/JsxRZw7SiJ7lsWJiHNNlxgI0k+","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":10570},"main":"./dist/index.js","type":"module","_from":"file:atlantum-utils-0.1.0.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"lint":"eslint src","build":"tsup src/index.ts --format esm --dts --clean --external react,react-dom","clean":"rm -rf dist","typecheck":"tsc --noEmit"},"_npmUser":{"name":"arthurivanov","email":"artur.dsgn@yandex.ru"},"_resolved":"/tmp/55c52f5ae82335955f1347d0d705bf9e/atlantum-utils-0.1.0.tgz","_integrity":"sha512-51D2In3k/Ul5hiT004PENKrVrgyA6z48XY2xiS54YHnbfK9/Xp/wKTgRDUxAqlEF1f2eOmRDj5/eCpuPxWUaMA==","repository":{"url":"git+https://github.com/ArthurIvanov/atlantum-ui.git","type":"git","directory":"packages/utils"},"_npmVersion":"10.8.2","description":"AtlantumUI — provider, hooks and utilities","directories":{},"sideEffects":false,"_nodeVersion":"20.20.2","dependencies":{"@atlantum/core":"0.4.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.6.0","@types/react":"^18.3.3","@types/react-dom":"^18.3.0"},"peerDependencies":{"react":">=18.0.0","react-dom":">=18.0.0"},"_npmOperationalInternal":{"tmp":"tmp/utils_0.1.0_1782674787769_0.7204884589209402","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@atlantum/utils","version":"0.1.1","keywords":["design-system","react","hooks","provider"],"author":{"name":"Qualifine"},"license":"MIT","_id":"@atlantum/utils@0.1.1","maintainers":[{"name":"arthurivanov","email":"artur.dsgn@yandex.ru"}],"homepage":"https://github.com/ArthurIvanov/atlantum-ui#readme","bugs":{"url":"https://github.com/ArthurIvanov/atlantum-ui/issues"},"dist":{"shasum":"47dc8ba9d2d7a9f833bf5655922d62b991db37c4","tarball":"https://registry.npmjs.org/@atlantum/utils/-/utils-0.1.1.tgz","fileCount":9,"integrity":"sha512-+8AezbvHno0pePH0ghrya9XLodWVHrIYI+LU7K0pZdHLU60v1ZbYBRAfGFcDEbNpUZF0eZ7NSPCi4vn9o/BPJA==","signatures":[{"sig":"MEUCIQC8d3ufp1IFN9uSCSXbWevRWqf2aJEjyAAn+f9uZ2VCNAIgLFDmwp5CD+1fnva52N/ryUoyqHMXeWJUkifSXOfMLZE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":10570},"main":"./dist/index.js","type":"module","_from":"file:atlantum-utils-0.1.1.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"lint":"eslint src","build":"tsup src/index.ts --format esm --dts --clean --external react,react-dom","clean":"rm -rf dist","typecheck":"tsc --noEmit"},"_npmUser":{"name":"arthurivanov","email":"artur.dsgn@yandex.ru"},"_resolved":"/tmp/eeb8add2a9e5913fd3e0a4795accc727/atlantum-utils-0.1.1.tgz","_integrity":"sha512-+8AezbvHno0pePH0ghrya9XLodWVHrIYI+LU7K0pZdHLU60v1ZbYBRAfGFcDEbNpUZF0eZ7NSPCi4vn9o/BPJA==","repository":{"url":"git+https://github.com/ArthurIvanov/atlantum-ui.git","type":"git","directory":"packages/utils"},"_npmVersion":"10.8.2","description":"AtlantumUI — provider, hooks and utilities","directories":{},"sideEffects":false,"_nodeVersion":"20.20.2","dependencies":{"@atlantum/core":"0.5.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.6.0","@types/react":"^18.3.3","@types/react-dom":"^18.3.0"},"peerDependencies":{"react":">=18.0.0","react-dom":">=18.0.0"},"_npmOperationalInternal":{"tmp":"tmp/utils_0.1.1_1782718425606_0.905918087499749","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@atlantum/utils","version":"0.1.2","keywords":["design-system","react","hooks","provider"],"author":{"name":"Qualifine"},"license":"MIT","_id":"@atlantum/utils@0.1.2","maintainers":[{"name":"arthurivanov","email":"artur.dsgn@yandex.ru"}],"homepage":"https://github.com/ArthurIvanov/atlantum-ui#readme","bugs":{"url":"https://github.com/ArthurIvanov/atlantum-ui/issues"},"dist":{"shasum":"fb116c4ab35709c158d5da50f3050ed438f46235","tarball":"https://registry.npmjs.org/@atlantum/utils/-/utils-0.1.2.tgz","fileCount":10,"integrity":"sha512-VXlV6+4cz0DMDP/klDn0dEOp2k1XErKjBh9+XKBg6h+Keap38PnUVL2D4Bry/4BFM7iGMwYeVUv7lPoVukrxpQ==","signatures":[{"sig":"MEYCIQD3NOYpY8I6tT1zY89GxzTmtFmOHqUv66dmqbf6LzQhYgIhAM6RbdEoQg36mzOMj6+h1C5AdUmc4OFHsxQ3V+Mqcd4e","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":14855},"main":"./dist/index.js","type":"module","_from":"file:atlantum-utils-0.1.2.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"lint":"eslint src","build":"tsup src/index.ts --format esm --dts --clean --external react,react-dom","clean":"rm -rf dist","typecheck":"tsc --noEmit"},"_npmUser":{"name":"arthurivanov","email":"artur.dsgn@yandex.ru"},"_resolved":"/tmp/f8f9097ca0bd13800fd3caa9bd008df8/atlantum-utils-0.1.2.tgz","_integrity":"sha512-VXlV6+4cz0DMDP/klDn0dEOp2k1XErKjBh9+XKBg6h+Keap38PnUVL2D4Bry/4BFM7iGMwYeVUv7lPoVukrxpQ==","repository":{"url":"git+https://github.com/ArthurIvanov/atlantum-ui.git","type":"git","directory":"packages/utils"},"_npmVersion":"10.8.2","description":"AtlantumUI — provider, hooks and utilities","directories":{},"sideEffects":false,"_nodeVersion":"20.20.2","dependencies":{"@atlantum/core":"0.5.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.6.0","@types/react":"^18.3.3","@types/react-dom":"^18.3.0"},"peerDependencies":{"react":">=18.0.0","react-dom":">=18.0.0"},"_npmOperationalInternal":{"tmp":"tmp/utils_0.1.2_1782728506030_0.9752383510398153","host":"s3://npm-registry-packages-npm-production"}},"0.1.3":{"name":"@atlantum/utils","version":"0.1.3","keywords":["design-system","react","hooks","provider"],"author":{"name":"Qualifine"},"license":"MIT","_id":"@atlantum/utils@0.1.3","maintainers":[{"name":"arthurivanov","email":"artur.dsgn@yandex.ru"}],"homepage":"https://github.com/ArthurIvanov/atlantum-ui#readme","bugs":{"url":"https://github.com/ArthurIvanov/atlantum-ui/issues"},"dist":{"shasum":"329f332f3f42e5d55dcc317864e228e779f72ee6","tarball":"https://registry.npmjs.org/@atlantum/utils/-/utils-0.1.3.tgz","fileCount":10,"integrity":"sha512-jdfuKgmMEtL/gSTdoRporswcyI/HyLeFcrOStnAyAczbMY8FMasbF7CcA1NSSwEAnTRRZXppj8GOzQ6PUY1y1Q==","signatures":[{"sig":"MEUCICr9OzguXQIJtiGXiBGyhiIkCWkMjhSZ+xBIWtpYmpdWAiEAxTQv2Vc/JFACfyySw36lX4wn/gFKiV0EssptEc7jjIo=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":14855},"main":"./dist/index.js","type":"module","_from":"file:atlantum-utils-0.1.3.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"lint":"eslint src","build":"tsup src/index.ts --format esm --dts --clean --external react,react-dom","clean":"rm -rf dist","typecheck":"tsc --noEmit"},"_npmUser":{"name":"arthurivanov","email":"artur.dsgn@yandex.ru"},"_resolved":"/tmp/ec8aa2fcc4ba6cde05fb09701f7a9076/atlantum-utils-0.1.3.tgz","_integrity":"sha512-jdfuKgmMEtL/gSTdoRporswcyI/HyLeFcrOStnAyAczbMY8FMasbF7CcA1NSSwEAnTRRZXppj8GOzQ6PUY1y1Q==","repository":{"url":"git+https://github.com/ArthurIvanov/atlantum-ui.git","type":"git","directory":"packages/utils"},"_npmVersion":"10.8.2","description":"AtlantumUI — provider, hooks and utilities","directories":{},"sideEffects":false,"_nodeVersion":"20.20.2","dependencies":{"@atlantum/core":"0.5.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.6.0","@types/react":"^18.3.3","@types/react-dom":"^18.3.0"},"peerDependencies":{"react":">=18.0.0","react-dom":">=18.0.0"},"_npmOperationalInternal":{"tmp":"tmp/utils_0.1.3_1782730363909_0.7245651012490255","host":"s3://npm-registry-packages-npm-production"}},"0.1.4":{"name":"@atlantum/utils","version":"0.1.4","description":"AtlantumUI — provider, hooks and utilities","license":"MIT","author":{"name":"Qualifine"},"repository":{"type":"git","url":"git+https://github.com/ArthurIvanov/atlantum-ui.git","directory":"packages/utils"},"homepage":"https://github.com/ArthurIvanov/atlantum-ui#readme","bugs":{"url":"https://github.com/ArthurIvanov/atlantum-ui/issues"},"keywords":["design-system","react","hooks","provider"],"sideEffects":false,"type":"module","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"publishConfig":{"access":"public"},"dependencies":{"@atlantum/core":"0.5.3"},"peerDependencies":{"react":">=18.0.0","react-dom":">=18.0.0"},"devDependencies":{"@types/react":"^18.3.3","@types/react-dom":"^18.3.0","typescript":"^5.6.0"},"scripts":{"build":"tsup src/index.ts --format esm --dts --clean --external react,react-dom","typecheck":"tsc --noEmit","lint":"eslint src","clean":"rm -rf dist"},"main":"./dist/index.js","module":"./dist/index.js","types":"./dist/index.d.ts","_id":"@atlantum/utils@0.1.4","_integrity":"sha512-B3Ec1xpA829ypUvOhBoV+iHZcwLbl5Aq0YAuoil8s5ycmnEWMb1Y7QPb2KKOrVCMeBFnJA+1MGhO1z9Sy1l0Ug==","_resolved":"/tmp/75df18c45b58a0366c5e88e8b19379b8/atlantum-utils-0.1.4.tgz","_from":"file:atlantum-utils-0.1.4.tgz","_nodeVersion":"20.20.2","_npmVersion":"10.8.2","dist":{"integrity":"sha512-B3Ec1xpA829ypUvOhBoV+iHZcwLbl5Aq0YAuoil8s5ycmnEWMb1Y7QPb2KKOrVCMeBFnJA+1MGhO1z9Sy1l0Ug==","shasum":"b2be363357888fac02d16449713ea40c13c08cd8","tarball":"https://registry.npmjs.org/@atlantum/utils/-/utils-0.1.4.tgz","fileCount":10,"unpackedSize":14855,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCBB5nZ++6HakGUr9tnKyuTsn2uST1OvjWwPloBWkF4nAIgPd82g78zS9bO8E8G872eAoMTwDHqb2fKLfvmDSiW2/c="}]},"_npmUser":{"name":"arthurivanov","email":"artur.dsgn@yandex.ru"},"directories":{},"maintainers":[{"name":"arthurivanov","email":"artur.dsgn@yandex.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/utils_0.1.4_1782743183026_0.01464847237247846"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-28T19:26:27.499Z","modified":"2026-06-29T14:26:23.346Z","0.1.0":"2026-06-28T19:26:27.945Z","0.1.1":"2026-06-29T07:33:45.754Z","0.1.2":"2026-06-29T10:21:46.163Z","0.1.3":"2026-06-29T10:52:44.035Z","0.1.4":"2026-06-29T14:26:23.195Z"},"bugs":{"url":"https://github.com/ArthurIvanov/atlantum-ui/issues"},"author":{"name":"Qualifine"},"license":"MIT","homepage":"https://github.com/ArthurIvanov/atlantum-ui#readme","keywords":["design-system","react","hooks","provider"],"repository":{"type":"git","url":"git+https://github.com/ArthurIvanov/atlantum-ui.git","directory":"packages/utils"},"description":"AtlantumUI — provider, hooks and utilities","maintainers":[{"name":"arthurivanov","email":"artur.dsgn@yandex.ru"}],"readme":"# @atlantum/utils\n\nProvider, hooks, and utilities for the [AtlantumUI](https://github.com/ArthurIvanov/atlantum-ui) design system.\n\n## Installation\n\n```bash\nnpm i @atlantum/utils\n# or\npnpm add @atlantum/utils\n```\n\n**Peer dependencies:**\n\n```bash\nnpm i react react-dom @atlantum/core\n```\n\n## `AtlantumUIProvider`\n\nWraps your application to enable theme switching and runtime token overrides.\n\n```tsx\nimport { AtlantumUIProvider } from \"@atlantum/utils\";\nimport \"@atlantum/core/foundation.css\";\nimport \"@atlantum/core/themes/dark.css\";\n\nfunction App() {\n  return (\n    <AtlantumUIProvider theme=\"dark\">\n      <YourApp />\n    </AtlantumUIProvider>\n  );\n}\n```\n\n### Runtime token overrides\n\nPass a `tokens` prop to override specific CSS variables at runtime. Use the `tokens` object from `@atlantum/core` to reference token names safely:\n\n```tsx\nimport { AtlantumUIProvider } from \"@atlantum/utils\";\nimport { tokens } from \"@atlantum/core\";\nimport type { TokenOverrides } from \"@atlantum/core\";\n\nconst brandOverrides: TokenOverrides = {\n  [tokens.bgAccentLoudEnabled]: \"#7c3aed\",\n  [tokens.brand500]: \"#6d28d9\",\n};\n\n<AtlantumUIProvider tokens={brandOverrides}>\n  <YourApp />\n</AtlantumUIProvider>\n```\n\n### Props\n\n| Prop        | Type             | Default | Description                                                  |\n|-------------|------------------|---------|--------------------------------------------------------------|\n| `children`  | `ReactNode`      | —       | Required. Content to wrap.                                   |\n| `theme`     | `\"light\" \\| \"dark\"` | —    | Sets `data-theme` attribute on the wrapper element.          |\n| `tokens`    | `TokenOverrides` | —       | CSS variable overrides applied to `document.documentElement`.|\n| `className` | `string`         | —       | Additional CSS class on the wrapper `div`.                   |\n\nThe wrapper renders as `display: contents` so it does not affect layout.\n\n---\n\n## Hooks\n\n### `useFocusTrap(active: boolean)`\n\nTraps keyboard focus inside a container while `active` is `true`. Restores focus to the previously active element on deactivation.\n\n```tsx\nimport { useFocusTrap } from \"@atlantum/utils\";\n\nfunction Modal({ open }: { open: boolean }) {\n  const containerRef = useFocusTrap(open);\n\n  return (\n    <div ref={containerRef} role=\"dialog\" aria-modal=\"true\">\n      <button>First focusable</button>\n      <button>Last focusable</button>\n    </div>\n  );\n}\n```\n\n| Parameter | Type      | Description                              |\n|-----------|-----------|------------------------------------------|\n| `active`  | `boolean` | Enables or disables the focus trap.      |\n\nReturns `RefObject<HTMLElement>` — attach to the container element.\n\n---\n\n### `useControlled<T>({ controlled, default })`\n\nManages the controlled/uncontrolled state pattern for form components.\n\n```tsx\nimport { useControlled } from \"@atlantum/utils\";\n\nfunction Toggle({ checked, defaultChecked }: ToggleProps) {\n  const [value, setValue] = useControlled({\n    controlled: checked,\n    default: defaultChecked ?? false,\n  });\n\n  return <button onClick={() => setValue(!value)}>{value ? \"On\" : \"Off\"}</button>;\n}\n```\n\n| Parameter    | Type        | Description                                                  |\n|--------------|-------------|--------------------------------------------------------------|\n| `controlled` | `T \\| undefined` | Value from the consumer (controlled mode when defined). |\n| `default`    | `T`         | Initial value when uncontrolled.                             |\n\nReturns `[T, (value: T) => void]` — current value and setter. The setter is a no-op in controlled mode.\n\n---\n\n### `useMediaQuery(query: string)`\n\nReactively tracks a CSS media query. SSR-safe (returns `false` on the server).\n\n```tsx\nimport { useMediaQuery } from \"@atlantum/utils\";\n\nfunction ResponsiveLayout() {\n  const isDesktop = useMediaQuery(\"(min-width: 1024px)\");\n\n  return isDesktop ? <DesktopNav /> : <MobileNav />;\n}\n```\n\n| Parameter | Type     | Description              |\n|-----------|----------|--------------------------|\n| `query`   | `string` | A valid CSS media query. |\n\nReturns `boolean` — `true` when the query matches.\n\n## Changelog\n\nSee [CHANGELOG.md](./CHANGELOG.md) for the full version history.\n\n## License\n\nMIT\n","readmeFilename":"README.md"}