mirror of
https://github.com/hanzoai/shadcn.git
synced 2026-10-30 18:22:59 +00:00
- Fix app/ TypeScript errors: broken imports, missing types, unused ts-expect-error directives, META_THEME_COLORS declaration - Fix registry/v4 config.ts: refine -> superRefine for zod 4 compat - Fix registry/v4 docs-integration.ts: remove non-existent properties, add nullish coalescing for optional type field - Fix apps/v4 lint: remove duplicate SortingState value import - Fix pkg/ui test assertions: update class names and component defaults to match post-merge component behavior - Add tsconfig excludes for legacy orphaned files (cards, colors, v4) - Add re-export shims for backward-compat toast/registry imports
23 lines
469 B
TypeScript
23 lines
469 B
TypeScript
import { useAtom } from "jotai"
|
|
import { atomWithStorage } from "jotai/utils"
|
|
|
|
import type { Style } from "@/registry/styles"
|
|
import type { Theme } from "@/registry/themes"
|
|
|
|
type Config = {
|
|
style: Style["name"]
|
|
theme: Theme["name"]
|
|
radius: number
|
|
installationType?: "cli" | "manual"
|
|
}
|
|
|
|
const configAtom = atomWithStorage<Config>("config", {
|
|
style: "default",
|
|
theme: "neutral",
|
|
radius: 0.5,
|
|
})
|
|
|
|
export function useConfig() {
|
|
return useAtom(configAtom)
|
|
}
|