non-spooky-react-cookie 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1 -0
- package/LICENSE +21 -0
- package/README.md +577 -0
- package/dist/index.cjs +856 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +137 -0
- package/dist/index.d.ts +137 -0
- package/dist/index.js +837 -0
- package/dist/index.js.map +1 -0
- package/dist/resolve-texts-yAIbWOUX.d.cts +456 -0
- package/dist/resolve-texts-yAIbWOUX.d.ts +456 -0
- package/dist/server.cjs +26 -0
- package/dist/server.cjs.map +1 -0
- package/dist/server.d.cts +28 -0
- package/dist/server.d.ts +28 -0
- package/dist/server.js +23 -0
- package/dist/server.js.map +1 -0
- package/dist/storage-Cqed-yMR.cjs +373 -0
- package/dist/storage-Cqed-yMR.cjs.map +1 -0
- package/dist/storage-WH-kuxkg.js +296 -0
- package/dist/storage-WH-kuxkg.js.map +1 -0
- package/dist/styles.css +624 -0
- package/package.json +119 -0
- package/server/README.md +25 -0
- package/server/package.json +5 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["nav","createContext","DEFAULT_STORAGE_KEY","useMemo","resolveStorage","resolveTexts","useId","useState","useCallback","useRef","readPreferences","useContext","useId","useState","useRef","useState","useContext","useCallback","useSyncExternalStore"],"sources":["../src/integrations/global-privacy-control.ts","../src/integrations/google-tracker.ts","../src/integrations/script-runtime.ts","../src/integrations/script-loader.ts","../src/CookieBannerConfigurationProvider.tsx","../src/hooks/usePreferences.ts","../src/ui.tsx","../src/CookieSettingsDialog.tsx","../src/CookieBanner.tsx","../src/CookieSettingsLink.tsx","../src/hooks/useConsentScript.ts"],"sourcesContent":["/**\n * Global Privacy Control (https://w3c.github.io/gpc/) is a browser-level\n * \"do not sell or share my data\" signal. When the visitor turns it on, the\n * browser sends `Sec-GPC: 1` with every request and exposes\n * `navigator.globalPrivacyControl === true` to scripts; when it is off the\n * header is absent and the property is `false` (or missing entirely in\n * browsers without native support, where extensions may define it).\n *\n * Returns `true` only for an active signal. Safe to call on the server.\n */\nexport function readGlobalPrivacyControl(): boolean {\n if (typeof navigator === \"undefined\") return false;\n\n // Not in TypeScript's DOM lib yet, hence the local widening.\n const nav = navigator as Navigator & { globalPrivacyControl?: unknown };\n return nav.globalPrivacyControl === true;\n}\n","import type { PreferenceCategory, PreferencesState } from \"../types\";\n\ntype ConsentValue = \"granted\" | \"denied\";\n\ndeclare global {\n interface Window {\n dataLayer?: unknown[];\n /**\n * Google tag manager stub. Declared with a permissive signature so\n * consumers can call any standard gtag command (`js`, `config`,\n * `event`, `consent`, …) — the real `gtag.js` replaces this at runtime.\n */\n gtag?: (...args: unknown[]) => void;\n }\n}\n\nfunction ensureGtag(): Window[\"gtag\"] | null {\n if (typeof window === \"undefined\") return null;\n\n window.dataLayer = window.dataLayer ?? [];\n window.gtag =\n window.gtag ??\n function gtag() {\n // Google's own snippet pushes the `arguments` object, not an array;\n // gtag.js relies on that exact shape when it replays the queue.\n // biome-ignore lint/complexity/noArguments: required by gtag.js\n window.dataLayer?.push(arguments);\n };\n\n return window.gtag;\n}\n\n/**\n * Initializes Google's consent mode with everything denied.\n * Call this before any Google tag loads.\n */\nexport function initGoogleTracker(): void {\n const gtag = ensureGtag();\n if (!gtag) return;\n\n gtag(\"consent\", \"default\", {\n ad_storage: \"denied\",\n ad_user_data: \"denied\",\n ad_personalization: \"denied\",\n analytics_storage: \"denied\",\n });\n}\n\n/**\n * Updates Google's consent mode based on the stored preferences.\n *\n * Without `categories`, the category ids `analytics` / `marketing` in the\n * accepted map drive the signals. With `categories`, a category grants its\n * signals when the category OR any of its fine-grained items is accepted,\n * so item-level consent (e.g. \"only Google Ads\") is respected.\n */\nexport function updateGoogleTracker(\n state: PreferencesState,\n categories?: PreferenceCategory[],\n): void {\n const gtag = ensureGtag();\n if (!gtag) return;\n\n const toValue = (id: string): ConsentValue => {\n const category = categories?.find((candidate) => candidate.id === id);\n const allowed =\n Boolean(state.accepted[id]) ||\n Boolean(category?.items?.some((item) => state.accepted[item.id]));\n return allowed ? \"granted\" : \"denied\";\n };\n\n const analytics = toValue(\"analytics\");\n const marketing = toValue(\"marketing\");\n\n gtag(\"consent\", \"update\", {\n analytics_storage: analytics,\n ad_storage: marketing,\n ad_user_data: marketing,\n ad_personalization: marketing,\n });\n}\n","/**\n * The reactive runtime store for per-script load status.\n *\n * This is the single source of truth for the 4-state lifecycle\n * (`blocked | loading | loaded | error`) of every managed script.\n * The provider drives this store (consent-gated) and `useConsentScript`\n * subscribes to it via `useSyncExternalStore`.\n *\n * The store is module-level (one per browser tab), keyed by script id.\n * It is intentionally framework-agnostic: no React imports here.\n */\n\nexport type ScriptStatus = \"blocked\" | \"loading\" | \"loaded\" | \"error\";\n\ntype RuntimeEntry = {\n status: ScriptStatus;\n error?: unknown;\n listeners: Set<() => void>;\n};\n\nconst runtimes = new Map<string, RuntimeEntry>();\n\nfunction getEntry(id: string): RuntimeEntry {\n let entry = runtimes.get(id);\n if (!entry) {\n entry = { status: \"blocked\", listeners: new Set() };\n runtimes.set(id, entry);\n }\n return entry;\n}\n\n/**\n * Subscribe a listener to status changes for `id`.\n * Returns an unsubscribe function. Safe to call on the server\n * (returns a no-op) so `useSyncExternalStore` never crashes during SSR.\n */\nexport function subscribeScript(id: string, notify: () => void): () => void {\n if (typeof window === \"undefined\") return () => {};\n getEntry(id).listeners.add(notify);\n return () => {\n getEntry(id).listeners.delete(notify);\n };\n}\n\n/** Primitive snapshot for `useSyncExternalStore` (must be stable). */\nexport function getScriptStatus(id: string): ScriptStatus {\n return getEntry(id).status;\n}\n\n/** The last error for `id`, if any. */\nexport function getScriptError(id: string): unknown {\n return getEntry(id).error;\n}\n\n/**\n * Sets the status (and error, if any) for `id` and notifies subscribers.\n * The error is always replaced, so a later `loaded` clears an old failure.\n */\nexport function setScriptStatus(id: string, status: ScriptStatus, error?: unknown): void {\n const entry = getEntry(id);\n entry.status = status;\n entry.error = error;\n entry.listeners.forEach((listener) => {\n try {\n listener();\n } catch {\n // A broken subscriber must never break consent enforcement.\n }\n });\n}\n","/**\n * Internal DOM + status primitives used by the provider to load and remove\n * consent-gated scripts. Not exported — the provider is the single place\n * that ever inserts a `<script>` element.\n */\nimport type { ConsentScript } from \"../types\";\nimport { getScriptStatus, setScriptStatus } from \"./script-runtime\";\n\n/** Runs a consumer callback; its errors must never break consent enforcement. */\nfunction safeCall(fn?: () => void): void {\n try {\n fn?.();\n } catch {\n // swallowed on purpose\n }\n}\n\nfunction findScriptElement(id: string): HTMLScriptElement | null {\n const element = document.getElementById(id);\n return element instanceof HTMLScriptElement ? element : null;\n}\n\nexport type LoadScriptOptions = {\n id: string;\n src?: string;\n attrs?: Record<string, string>;\n children?: string;\n /** Set `script.async`. Wins over `defer` when both are set. */\n async?: boolean;\n /** Set `script.defer`. Ignored when `async` is set. */\n defer?: boolean;\n onLoad?: () => void;\n onError?: () => void;\n};\n\nexport function loadScript({\n id,\n src,\n attrs,\n children,\n async: asyncFlag,\n defer,\n onLoad,\n onError,\n}: LoadScriptOptions): HTMLScriptElement | null {\n if (typeof document === \"undefined\") return null;\n\n const existing = findScriptElement(id);\n if (existing) return existing;\n\n const script = document.createElement(\"script\");\n script.id = id;\n\n // Setting both is invalid HTML, so async wins; the default is async.\n if (defer && !asyncFlag) {\n script.defer = true;\n } else {\n script.async = true;\n }\n\n if (src) script.src = src;\n if (children) script.text = children;\n if (onLoad) script.addEventListener(\"load\", onLoad);\n if (onError) script.addEventListener(\"error\", onError);\n\n Object.entries(attrs ?? {}).forEach(([key, value]) => {\n script.setAttribute(key, value);\n });\n\n document.head.appendChild(script);\n return script;\n}\n\n/**\n * Removes the script element with `id` and runs the optional\n * `cleanup` function.\n *\n * Caveat: this does NOT undo cookies or network requests the script\n * already made — use `cleanup` for integration-specific teardown.\n */\nexport function unloadScript(id: string, cleanup?: () => void): void {\n if (typeof document === \"undefined\") return;\n\n findScriptElement(id)?.remove();\n safeCall(cleanup);\n}\n\n/**\n * Ensures the script under `id` is loaded, driving the runtime store.\n *\n * - Already in the DOM → status `loaded` (dedup, `onLoad` not re-fired).\n * - Not in the DOM → status `loading`, then `loaded`/`error` when the\n * element settles. `def.onLoad` / `def.onError` run (wrapped so a throw\n * never breaks consent enforcement).\n */\nexport function ensureScript(id: string, def: ConsentScript): void {\n if (typeof document === \"undefined\") return;\n\n if (findScriptElement(id)) {\n setScriptStatus(id, \"loaded\");\n return;\n }\n\n const handleLoad = () => {\n setScriptStatus(id, \"loaded\");\n safeCall(def.onLoad);\n };\n\n setScriptStatus(id, \"loading\");\n\n const element = loadScript({\n id,\n src: def.src,\n attrs: def.attrs,\n children: def.children,\n async: def.async,\n defer: def.defer,\n onLoad: handleLoad,\n onError: () => {\n setScriptStatus(id, \"error\", new Error(`Script \"${id}\" failed to load.`));\n safeCall(def.onError);\n },\n });\n\n // Inline scripts (no `src`) execute synchronously on insertion and do NOT\n // fire the `load` event, so we settle the status immediately.\n if (element && !def.src) handleLoad();\n}\n\n/**\n * Removes the script under `id` from the DOM (running `cleanup`) and\n * resets its status back to `blocked`. A script that is already blocked\n * and not in the DOM is left alone, so `cleanup` runs only after a real load.\n */\nexport function removeScript(id: string, cleanup?: () => void): void {\n if (typeof document === \"undefined\") return;\n if (getScriptStatus(id) === \"blocked\" && !findScriptElement(id)) return;\n\n unloadScript(id, cleanup);\n setScriptStatus(id, \"blocked\");\n}\n","\"use client\";\n\nimport type * as React from \"react\";\nimport {\n createContext,\n useCallback,\n useEffect,\n useId,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport { readGlobalPrivacyControl } from \"./integrations/global-privacy-control\";\nimport { initGoogleTracker, updateGoogleTracker } from \"./integrations/google-tracker\";\nimport { ensureScript, removeScript } from \"./integrations/script-loader\";\nimport { resolveTexts } from \"./resolve-texts\";\nimport {\n DEFAULT_STORAGE_KEY,\n readPreferences,\n removePreferences,\n resolveStorage,\n writePreferences,\n} from \"./storage\";\nimport type {\n ConsentConfig,\n CookieBannerConfigurationProviderProps,\n CookieBannerContextValue,\n CookieStorageOptions,\n PreferenceCategory,\n PreferencesState,\n PreferencesUpdate,\n ThemePalette,\n} from \"./types\";\n\nconst DEFAULT_VERSION = \"1\";\n\nconst defaultCategories: PreferenceCategory[] = [\n { id: \"necessary\", required: true },\n { id: \"preferences\" },\n { id: \"analytics\" },\n { id: \"marketing\" },\n];\n\n/** Maps the object-map `config` prop to the internal category array. */\nfunction configToCategories(config: ConsentConfig): PreferenceCategory[] {\n return Object.entries(config.categories).map(([id, category]) => ({\n id,\n title: category.name,\n description: category.description,\n required: category.required,\n items: category.items\n ? Object.entries(category.items).map(([itemId, item]) => ({\n id: itemId,\n title: item.name,\n description: item.description,\n }))\n : undefined,\n }));\n}\n\nexport const CookieBannerContext = createContext<CookieBannerContextValue | null>(null);\n\n/**\n * Builds a complete state. Required categories are always on; optional\n * categories and every item follow `acceptOptional`.\n */\nfunction buildState(\n version: string,\n categories: PreferenceCategory[],\n acceptOptional: boolean,\n): PreferencesState {\n const accepted: Record<string, boolean> = {};\n\n categories.forEach((category) => {\n accepted[category.id] = Boolean(category.required) || acceptOptional;\n category.items?.forEach((item) => {\n accepted[item.id] = acceptOptional;\n });\n });\n\n return { version, updatedAt: new Date().toISOString(), accepted };\n}\n\nconst themeVariables: Record<keyof ThemePalette, string> = {\n primaryColor: \"--nsr-primary\",\n primaryTextColor: \"--nsr-primary-text\",\n primaryHoverColor: \"--nsr-primary-hover\",\n secondaryColor: \"--nsr-secondary\",\n secondaryTextColor: \"--nsr-secondary-text\",\n accentColor: \"--nsr-accent\",\n surfaceColor: \"--nsr-surface\",\n surfaceMutedColor: \"--nsr-surface-muted\",\n textColor: \"--nsr-text\",\n mutedTextColor: \"--nsr-muted\",\n borderColor: \"--nsr-border\",\n ringColor: \"--nsr-ring\",\n switchOffColor: \"--nsr-switch-off\",\n switchThumbColor: \"--nsr-switch-thumb\",\n backdropColor: \"--nsr-backdrop\",\n};\n\n/** The attribute that scopes a provider's theme rules to its elements. */\nexport const THEME_ATTRIBUTE = \"data-nsr-theme\";\n\n/**\n * Keeps a palette value safe to embed in a stylesheet: a value is a single\n * CSS color, so it never needs a declaration or block terminator.\n */\nfunction sanitizeCssValue(value: string): string {\n return value.replace(/[;{}<>]/g, \"\").trim();\n}\n\n/** `[--nsr-x, value]` pairs for the set entries of a palette. */\nfunction themeEntries(theme: ThemePalette): Array<[string, string]> {\n return Object.entries(themeVariables).flatMap(([key, variable]) => {\n const value = theme[key as keyof ThemePalette];\n return value ? [[variable, sanitizeCssValue(value)] as [string, string]] : [];\n });\n}\n\n/** Resolves the theme palette into CSS custom properties (set values only). */\nfunction themeToStyle(theme: ThemePalette): React.CSSProperties {\n return Object.fromEntries(themeEntries(theme)) as React.CSSProperties;\n}\n\n/**\n * Builds the scoped stylesheet for one provider. `theme` applies to every\n * element carrying the provider's theme attribute; `darkTheme` applies to the\n * same elements under a `.dark` / `[data-theme=\"dark\"]` ancestor. Returns an\n * empty string when neither palette sets anything, so nothing is rendered.\n */\nexport function buildThemeCss(\n id: string,\n theme: ThemePalette,\n darkTheme: ThemePalette,\n): string {\n const scope = `[${THEME_ATTRIBUTE}=\"${id.replace(/[\"\\\\]/g, \"\")}\"]`;\n const block = (entries: Array<[string, string]>) =>\n entries.map(([variable, value]) => ` ${variable}: ${value};`).join(\"\\n\");\n\n const light = themeEntries(theme);\n const dark = themeEntries(darkTheme);\n const rules: string[] = [];\n\n if (light.length > 0) rules.push(`${scope} {\\n${block(light)}\\n}`);\n if (dark.length > 0) {\n rules.push(`:is(.dark, [data-theme=\"dark\"]) ${scope} {\\n${block(dark)}\\n}`);\n }\n\n return rules.join(\"\\n\");\n}\n\nexport function CookieBannerConfigurationProvider({\n children,\n config,\n scripts,\n language = \"en\",\n texts: textOverrides,\n theme = {},\n darkTheme = {},\n components = {},\n storageKey = DEFAULT_STORAGE_KEY,\n storage = \"localStorage\",\n cookieOptions,\n initialPreferences,\n version = DEFAULT_VERSION,\n googleConsentMode = false,\n windowJustDont = true,\n respectGlobalPrivacyControl = true,\n onDecision,\n}: Readonly<CookieBannerConfigurationProviderProps>) {\n // Keyed on the serialized options so an inline `cookieOptions={{ ... }}`\n // does not create a new store (and re-run the hydration effect) per render.\n const cookieOptionsKey = JSON.stringify(cookieOptions ?? null);\n const store = useMemo(\n () =>\n resolveStorage(\n storage,\n (JSON.parse(cookieOptionsKey) as CookieStorageOptions | null) ?? undefined,\n ),\n [storage, cookieOptionsKey],\n );\n const categories = useMemo(\n () => (config ? configToCategories(config) : defaultCategories),\n [config],\n );\n const texts = useMemo(\n () => resolveTexts(language, textOverrides),\n [language, textOverrides],\n );\n\n // Theme rules live in a <style> scoped by this attribute (not inline\n // styles) so `darkTheme` can win under a `.dark` ancestor. Keyed on the\n // serialized palettes so an inline `theme={{ ... }}` literal is free.\n const themeId = useId();\n const themeKey = JSON.stringify(theme);\n const darkThemeKey = JSON.stringify(darkTheme);\n const themeStyle = useMemo(\n () => themeToStyle(JSON.parse(themeKey) as ThemePalette),\n [themeKey],\n );\n const themeCss = useMemo(\n () =>\n buildThemeCss(\n themeId,\n JSON.parse(themeKey) as ThemePalette,\n JSON.parse(darkThemeKey) as ThemePalette,\n ),\n [darkThemeKey, themeId, themeKey],\n );\n const themeAttributes = useMemo(() => ({ [THEME_ATTRIBUTE]: themeId }), [themeId]);\n\n // Which category owns each item (used to resolve item labels).\n const itemToCategory = useMemo(() => {\n const owners: Record<string, string> = {};\n categories.forEach((category) => {\n category.items?.forEach((item) => {\n owners[item.id] = category.id;\n });\n });\n return owners;\n }, [categories]);\n\n // A server-read decision (same version only) seeds the first render so it\n // matches the server markup; the effect below re-reads the client storage.\n const restoredInitial =\n initialPreferences?.version === version ? initialPreferences : null;\n\n const [loaded, setLoaded] = useState(initialPreferences !== undefined);\n const [hasDecision, setHasDecision] = useState(restoredInitial !== null);\n const [globalPrivacyControl, setGlobalPrivacyControl] = useState(false);\n const [settingsOpen, setSettingsOpen] = useState(false);\n const [state, setState] = useState<PreferencesState>(\n () => restoredInitial ?? buildState(version, categories, false),\n );\n\n const syncGoogle = useCallback(\n (next: PreferencesState) => {\n if (googleConsentMode) updateGoogleTracker(next, categories);\n },\n [categories, googleConsentMode],\n );\n\n // The hydration effect reads `onDecision` through a ref so an inline\n // callback (new identity every render) never re-runs it.\n const onDecisionRef = useRef(onDecision);\n useEffect(() => {\n onDecisionRef.current = onDecision;\n }, [onDecision]);\n\n // Restore the stored decision (same version only) after hydration.\n useEffect(() => {\n if (googleConsentMode) initGoogleTracker();\n\n const stored = readPreferences(store, storageKey);\n const restored = stored?.version === version ? stored : null;\n const gpc = respectGlobalPrivacyControl && readGlobalPrivacyControl();\n const next = restored ?? buildState(version, categories, false);\n\n // An explicit answer on this site always wins. Without one, an active\n // Global Privacy Control signal counts as \"Reject all\" — `next` already\n // is that state — so the banner never shows. It is kept in memory only:\n // the signal is live, and turning it off should bring the banner back.\n const decidedByGpc = restored === null && gpc;\n\n setState(next);\n setHasDecision(restored !== null || decidedByGpc);\n setGlobalPrivacyControl(gpc);\n syncGoogle(next);\n setLoaded(true);\n if (decidedByGpc) onDecisionRef.current?.(next);\n }, [\n categories,\n googleConsentMode,\n respectGlobalPrivacyControl,\n storageKey,\n store,\n syncGoogle,\n version,\n ]);\n\n // On unmount (or a new `scripts` map) unload exactly the declared scripts.\n useEffect(() => {\n const entries = Object.entries(scripts ?? {});\n return () => {\n for (const [id, def] of entries) {\n removeScript(id, def.cleanup);\n }\n };\n }, [scripts]);\n\n // Central consent enforcement: a script loads when its own category or\n // item id is accepted (items are not gated by their parent category) and\n // is removed, with cleanup, when that consent is withdrawn.\n useEffect(() => {\n if (!loaded) return;\n\n Object.entries(scripts ?? {}).forEach(([id, def]) => {\n if (state.accepted[def.category]) {\n ensureScript(id, def);\n } else {\n removeScript(id, def.cleanup);\n }\n });\n }, [loaded, scripts, state.accepted]);\n\n const persist = useCallback(\n (next: PreferencesState) => {\n setState(next);\n setHasDecision(true);\n setSettingsOpen(false);\n writePreferences(store, storageKey, next);\n syncGoogle(next);\n onDecision?.(next);\n },\n [onDecision, storageKey, store, syncGoogle],\n );\n\n const acceptAll = useCallback(\n () => persist(buildState(version, categories, true)),\n [categories, persist, version],\n );\n\n const rejectAll = useCallback(\n () => persist(buildState(version, categories, false)),\n [categories, persist, version],\n );\n\n const savePreferences = useCallback(\n (partial: PreferencesUpdate) =>\n persist({\n version,\n updatedAt: new Date().toISOString(),\n accepted: { ...state.accepted, ...partial.accepted },\n }),\n [persist, state.accepted, version],\n );\n\n const resetPreferences = useCallback(() => {\n const initial = buildState(version, categories, false);\n removePreferences(store, storageKey);\n setState(initial);\n setHasDecision(false);\n setSettingsOpen(false);\n syncGoogle(initial);\n onDecision?.(initial);\n }, [categories, onDecision, storageKey, store, syncGoogle, version]);\n\n const openSettings = useCallback(() => setSettingsOpen(true), []);\n const closeSettings = useCallback(() => setSettingsOpen(false), []);\n\n const isAllowed = useCallback(\n (id: string) => Boolean(state.accepted[id]),\n [state.accepted],\n );\n\n /**\n * Resolves the display title/description for a category or item,\n * preferring the config values, then the texts, then the id.\n */\n const resolveLabel = useCallback(\n (\n id: string,\n config?: { title?: string; description?: string },\n ): { title: string; description: string } => {\n const parent = itemToCategory[id];\n const source = parent\n ? texts.categories[parent]?.items?.[id]\n : texts.categories[id];\n\n return {\n title: config?.title ?? source?.title ?? id,\n description: config?.description ?? source?.description ?? \"\",\n };\n },\n [itemToCategory, texts],\n );\n\n const value = useMemo<CookieBannerContextValue>(\n () => ({\n loaded,\n hasDecision,\n showBanner: loaded && !hasDecision,\n globalPrivacyControl,\n settingsOpen,\n preferences: state,\n texts,\n categories,\n scripts: scripts ?? {},\n theme,\n darkTheme,\n components,\n themeStyle,\n themeAttributes,\n acceptAll,\n rejectAll,\n savePreferences,\n resetPreferences,\n openSettings,\n closeSettings,\n isAllowed,\n resolveLabel,\n }),\n [\n acceptAll,\n categories,\n closeSettings,\n components,\n darkTheme,\n globalPrivacyControl,\n hasDecision,\n isAllowed,\n loaded,\n openSettings,\n rejectAll,\n resetPreferences,\n resolveLabel,\n savePreferences,\n scripts,\n settingsOpen,\n state,\n texts,\n theme,\n themeAttributes,\n themeStyle,\n ],\n );\n\n // One global function, `window.justDont()`, that rejects all optional\n // categories — aimed at console snippets and \"I don't care about\n // cookies\"-style browser extensions. No opt-in needed: it is registered\n // as soon as the provider mounts, and re-registered whenever `rejectAll`\n // changes so the global never holds a stale closure.\n useEffect(() => {\n if (!windowJustDont || typeof window === \"undefined\") return;\n\n const w = window as unknown as { justDont?: () => void };\n if (typeof w.justDont === \"function\") {\n console.warn(\n \"[non-spooky-react-cookie] window.justDont already exists; the \" +\n \"cookie banner will overwrite it.\",\n );\n }\n\n w.justDont = rejectAll;\n return () => {\n // Only clear the slot when we still own it, so an unmount never\n // removes a global a later-mounted provider registered.\n if (w.justDont === rejectAll) delete w.justDont;\n };\n }, [rejectAll, windowJustDont]);\n\n return (\n <CookieBannerContext.Provider value={value}>\n {themeCss ? <style data-nsr-theme-style={themeId}>{themeCss}</style> : null}\n {children}\n </CookieBannerContext.Provider>\n );\n}\n","\"use client\";\n\nimport { useContext } from \"react\";\nimport { CookieBannerContext } from \"../CookieBannerConfigurationProvider\";\n\n/**\n * Access the cookie banner state and actions from anywhere\n * inside a CookieBannerConfigurationProvider.\n */\nexport function usePreferences() {\n const context = useContext(CookieBannerContext);\n\n if (!context) {\n throw new Error(\n \"usePreferences must be used within a CookieBannerConfigurationProvider\",\n );\n }\n\n return context;\n}\n","\"use client\";\n\nimport { useId, useState } from \"react\";\nimport type { ButtonLikeProps, CollapsibleProps, SwitchLikeProps } from \"./types\";\n\nexport function cn(...classes: Array<string | false | null | undefined>) {\n return classes.filter(Boolean).join(\" \");\n}\n\n/**\n * Default Button.\n * Colors come from the `--nsr-*` variables: defaults in `styles.css`,\n * overrides from the provider's `theme` prop.\n */\nexport function Button({ className, variant = \"secondary\", ...props }: ButtonLikeProps) {\n return (\n <button\n className={cn(\"nsr-button\", `nsr-button--${variant}`, className)}\n {...props}\n />\n );\n}\n\n/**\n * Default Switch.\n * The \"on\" color follows the theme's primary color.\n */\nexport function Switch({\n checked,\n disabled,\n onCheckedChange,\n \"aria-label\": ariaLabel,\n}: Readonly<SwitchLikeProps>) {\n return (\n <button\n type=\"button\"\n role=\"switch\"\n aria-checked={checked}\n aria-label={ariaLabel}\n disabled={disabled}\n onClick={() => onCheckedChange(!checked)}\n className=\"nsr-switch\"\n >\n <span className=\"nsr-switch__thumb\" />\n </button>\n );\n}\n\n/**\n * Default Collapsible.\n * A disclosure that hides its children until the trigger is pressed.\n * Works controlled (`open` + `onOpenChange`) or self-managed (`defaultOpen`).\n * The chevron follows the theme's primary color.\n */\nexport function Collapsible({\n children,\n count,\n label,\n open,\n onOpenChange,\n defaultOpen,\n className,\n contentClassName,\n}: Readonly<CollapsibleProps>) {\n const regionId = useId();\n const [internalOpen, setInternalOpen] = useState(defaultOpen ?? false);\n const isOpen = open ?? internalOpen;\n\n const toggle = () => {\n const next = !isOpen;\n if (open === undefined) setInternalOpen(next);\n onOpenChange?.(next);\n };\n\n return (\n <div className={cn(\"nsr-collapsible\", isOpen && \"nsr-collapsible--open\")}>\n <button\n type=\"button\"\n aria-controls={regionId}\n aria-expanded={isOpen}\n className={cn(\"nsr-collapsible__trigger\", className)}\n onClick={toggle}\n >\n <span className=\"nsr-collapsible__label\">\n {label} ({count})\n </span>\n <svg\n className=\"nsr-collapsible__chevron\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={2}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n viewBox=\"0 0 24 24\"\n aria-hidden=\"true\"\n >\n <path d=\"M6 9l6 6 6-6\" />\n </svg>\n </button>\n {isOpen ? (\n <div className={cn(\"nsr-collapsible__content\", contentClassName)} id={regionId}>\n {children}\n </div>\n ) : null}\n </div>\n );\n}\n","\"use client\";\n\nimport type * as React from \"react\";\nimport { useEffect, useRef, useState } from \"react\";\nimport { usePreferences } from \"./hooks/usePreferences\";\nimport type { CookieSettingsDialogProps } from \"./types\";\nimport { Button, Collapsible, cn, Switch } from \"./ui\";\n\n/** Renders nothing while closed; the open dialog mounts fresh each time. */\nexport function CookieSettingsDialog(props: Readonly<CookieSettingsDialogProps>) {\n const { settingsOpen } = usePreferences();\n return settingsOpen ? <OpenSettingsDialog {...props} /> : null;\n}\n\nfunction OpenSettingsDialog({\n className,\n overlayClassName,\n contentClassName,\n headerClassName,\n bodyClassName,\n footerClassName,\n categoryCardClassName,\n itemClassName,\n buttonClassName,\n components: ownComponents,\n}: Readonly<CookieSettingsDialogProps>) {\n const {\n categories,\n closeSettings,\n components: providerComponents,\n preferences,\n resolveLabel,\n savePreferences,\n texts,\n themeAttributes,\n } = usePreferences();\n const dialogRef = useRef<HTMLDialogElement>(null);\n // Mounted only while open, so the initial value is the current decision.\n const [draft, setDraft] = useState(preferences.accepted);\n\n // showModal() gives us the top layer, focus trap, and Escape-to-close.\n useEffect(() => {\n const dialog = dialogRef.current;\n if (dialog && !dialog.open && typeof dialog.showModal === \"function\") {\n dialog.showModal();\n }\n }, []);\n\n const components = { ...providerComponents, ...ownComponents };\n const ButtonComponent = components.Button ?? Button;\n const SwitchComponent = components.Switch ?? Switch;\n const CollapsibleComponent = components.Collapsible ?? Collapsible;\n\n const setAccepted = (ids: string[], value: boolean) =>\n setDraft((current) => {\n const next = { ...current };\n for (const id of ids) {\n next[id] = value;\n }\n return next;\n });\n\n const handleCancel = (event: React.SyntheticEvent) => {\n // Escape (native cancel): prevent the native close and let the parent's\n // state change unmount the dialog instead, so state stays in sync.\n event.preventDefault();\n closeSettings();\n };\n\n return (\n <dialog\n aria-labelledby=\"nsr-settings-title\"\n className={cn(\"nsr-settings-dialog\", className)}\n onCancel={handleCancel}\n ref={dialogRef}\n {...themeAttributes}\n >\n {/*\n Click-to-close backdrop as a real (visually inert) button, sitting\n behind the content panel. Out of the tab order; mouse/touch only.\n */}\n <button\n aria-label={texts.dialog.close}\n className={cn(\"nsr-dialog__overlay\", overlayClassName)}\n onClick={closeSettings}\n tabIndex={-1}\n type=\"button\"\n />\n <div className={cn(\"nsr-dialog__panel\", contentClassName)}>\n <div className={cn(\"nsr-dialog__header\", headerClassName)}>\n <h2 id=\"nsr-settings-title\" className=\"nsr-dialog__title\">\n {texts.dialog.title}\n </h2>\n <p className=\"nsr-dialog__description\">{texts.dialog.description}</p>\n </div>\n\n <div className={cn(\"nsr-dialog__body\", bodyClassName)}>\n {categories.map((category) => {\n const { title, description } = resolveLabel(category.id, category);\n const required = Boolean(category.required);\n const items = category.items ?? [];\n\n return (\n <section\n className={cn(\n \"nsr-category\",\n required && \"nsr-category--required\",\n categoryCardClassName,\n )}\n key={category.id}\n >\n <div className=\"nsr-category__header\">\n <div>\n <h3 className=\"nsr-category__title\">{title}</h3>\n {description ? (\n <p className=\"nsr-category__description\">{description}</p>\n ) : null}\n </div>\n {/* Master switch: toggles the category and all of its items. */}\n <SwitchComponent\n aria-label={title}\n checked={Boolean(draft[category.id])}\n disabled={required}\n onCheckedChange={(value) =>\n setAccepted([category.id, ...items.map((item) => item.id)], value)\n }\n />\n </div>\n\n {items.length > 0 ? (\n <CollapsibleComponent\n count={items.length}\n label={texts.dialog.itemsLabel}\n contentClassName=\"nsr-category__items\"\n >\n {items.map((item) => {\n const itemLabel = resolveLabel(item.id, item);\n\n return (\n <div className={cn(\"nsr-item\", itemClassName)} key={item.id}>\n <div>\n <h4 className=\"nsr-item__title\">{itemLabel.title}</h4>\n {itemLabel.description ? (\n <p className=\"nsr-item__description\">\n {itemLabel.description}\n </p>\n ) : null}\n </div>\n <SwitchComponent\n aria-label={itemLabel.title}\n checked={Boolean(draft[item.id])}\n disabled={required}\n onCheckedChange={(value) => setAccepted([item.id], value)}\n />\n </div>\n );\n })}\n </CollapsibleComponent>\n ) : null}\n </section>\n );\n })}\n </div>\n\n <div className={cn(\"nsr-dialog__footer\", footerClassName)}>\n <ButtonComponent\n className={cn(\"nsr-dialog__button\", buttonClassName)}\n onClick={closeSettings}\n type=\"button\"\n variant=\"ghost\"\n >\n {texts.dialog.close}\n </ButtonComponent>\n <ButtonComponent\n className={cn(\"nsr-dialog__button\", buttonClassName)}\n onClick={() => savePreferences({ accepted: draft })}\n type=\"button\"\n variant=\"primary\"\n >\n {texts.dialog.save}\n </ButtonComponent>\n </div>\n </div>\n </dialog>\n );\n}\n","\"use client\";\n\nimport { CookieSettingsDialog } from \"./CookieSettingsDialog\";\nimport { usePreferences } from \"./hooks/usePreferences\";\nimport type { CookieBannerProps } from \"./types\";\nimport { Button, cn } from \"./ui\";\n\nexport function CookieBanner({\n policyUrl,\n className,\n contentClassName,\n titleClassName,\n descriptionClassName,\n actionsClassName,\n buttonClassName,\n components,\n dialogProps,\n}: Readonly<CookieBannerProps>) {\n const {\n acceptAll,\n components: providerComponents,\n openSettings,\n rejectAll,\n showBanner,\n texts,\n themeAttributes,\n } = usePreferences();\n\n const ButtonComponent = components?.Button ?? providerComponents.Button ?? Button;\n\n return (\n <>\n {showBanner ? (\n <section\n aria-label={texts.banner.title}\n className={cn(\"nsr-banner\", className)}\n {...themeAttributes}\n >\n <div className={cn(\"nsr-banner__card\", contentClassName)}>\n <div className=\"nsr-banner__text\">\n <h2 className={cn(\"nsr-banner__title\", titleClassName)}>\n {texts.banner.title}\n </h2>\n <p className={cn(\"nsr-banner__description\", descriptionClassName)}>\n {texts.banner.description}\n {policyUrl ? (\n <>\n {\" \"}\n <a className=\"nsr-banner__link\" href={policyUrl}>\n {texts.banner.policyLink}\n </a>\n </>\n ) : null}\n </p>\n </div>\n\n <div className={cn(\"nsr-banner__actions\", actionsClassName)}>\n <ButtonComponent\n className={buttonClassName}\n onClick={rejectAll}\n type=\"button\"\n variant=\"secondary\"\n >\n {texts.banner.rejectAll}\n </ButtonComponent>\n <ButtonComponent\n className={buttonClassName}\n onClick={openSettings}\n type=\"button\"\n variant=\"secondary\"\n >\n {texts.banner.settings}\n </ButtonComponent>\n <ButtonComponent\n className={buttonClassName}\n onClick={acceptAll}\n type=\"button\"\n variant=\"primary\"\n >\n {texts.banner.acceptAll}\n </ButtonComponent>\n </div>\n </div>\n </section>\n ) : null}\n <CookieSettingsDialog\n {...dialogProps}\n components={{ ...components, ...dialogProps?.components }}\n />\n </>\n );\n}\n","\"use client\";\n\nimport { usePreferences } from \"./hooks/usePreferences\";\nimport type { CookieSettingsLinkProps } from \"./types\";\nimport { cn } from \"./ui\";\n\n/**\n * A small link (e.g. in a footer) that opens the cookie settings dialog.\n * Renders your children, or the built-in \"Cookie settings\" text.\n */\nexport function CookieSettingsLink({\n children,\n className,\n type = \"button\",\n onClick,\n ...props\n}: Readonly<CookieSettingsLinkProps>) {\n const { openSettings, texts, themeAttributes } = usePreferences();\n\n return (\n <button\n className={cn(\"nsr-settings-link\", className)}\n {...themeAttributes}\n onClick={(event) => {\n // Open the dialog first, then let the consumer's handler run — the\n // spread below must not be able to silently override the built-in.\n openSettings();\n onClick?.(event);\n }}\n type={type}\n {...props}\n >\n {children ?? texts.footerLink}\n </button>\n );\n}\n","\"use client\";\n\nimport { useCallback, useContext, useSyncExternalStore } from \"react\";\nimport { CookieBannerContext } from \"../CookieBannerConfigurationProvider\";\nimport type { ScriptStatus } from \"../integrations/script-runtime\";\nimport {\n getScriptError,\n getScriptStatus,\n subscribeScript,\n} from \"../integrations/script-runtime\";\n\nexport type UseConsentScriptResult = {\n /**\n * - `blocked` — consent for the script's category is not granted.\n * - `loading` — consent granted, script is being fetched.\n * - `loaded` — the `<script>` is in the DOM and finished loading.\n * - `error` — the script failed to load, is not declared in the provider's\n * `scripts` map, or the hook is rendered outside a provider.\n */\n status: ScriptStatus;\n /** Present when `status === \"error\"`. */\n error?: unknown;\n};\n\n/**\n * Reactive, consent-gated load status for a script declared in the\n * provider's `scripts` map.\n *\n * The status is gated on the script's `category`: denied → `blocked`;\n * granted → the provider drives `loading` → `loaded`/`error`. The hook never\n * loads anything itself — the provider is the single enforcement point.\n *\n * Must be rendered inside a `CookieBannerConfigurationProvider`.\n */\nexport function useConsentScript(id: string): UseConsentScriptResult {\n const context = useContext(CookieBannerContext);\n const def = context?.scripts[id];\n\n // Two subscriptions on purpose: the store mutates entries in place, so a\n // single object snapshot would never look \"changed\" to React.\n const subscribe = useCallback(\n (notify: () => void) => subscribeScript(id, notify),\n [id],\n );\n const runtimeStatus = useSyncExternalStore<ScriptStatus>(\n subscribe,\n () => getScriptStatus(id),\n () => \"blocked\",\n );\n const runtimeError = useSyncExternalStore(\n subscribe,\n () => getScriptError(id),\n () => undefined,\n );\n\n if (!context) {\n return {\n status: \"error\",\n error: new Error(\n `useConsentScript(\"${id}\") must be used within a CookieBannerConfigurationProvider.`,\n ),\n };\n }\n\n if (!def) {\n return {\n status: \"error\",\n error: new Error(\n `useConsentScript(\"${id}\"): script is not declared in the provider's \\`scripts\\` map.`,\n ),\n };\n }\n\n if (!context.isAllowed(def.category)) {\n return { status: \"blocked\" };\n }\n\n // Consent granted. A not-yet-started script is presented as `loading` to\n // avoid a `blocked` flash before the provider's load effect runs.\n const status = runtimeStatus === \"blocked\" ? \"loading\" : runtimeStatus;\n return { status, error: status === \"error\" ? runtimeError : undefined };\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAUA,SAAgB,2BAAoC;CAClD,IAAI,OAAO,cAAc,aAAa,OAAO;CAI7C,OAAOA,UAAI,yBAAyB;AACtC;;;ACAA,SAAS,aAAoC;CAC3C,IAAI,OAAO,WAAW,aAAa,OAAO;CAE1C,OAAO,YAAY,OAAO,aAAa,CAAC;CACxC,OAAO,OACL,OAAO,QACP,SAAS,OAAO;EAId,OAAO,WAAW,KAAK,SAAS;CAClC;CAEF,OAAO,OAAO;AAChB;;;;;AAMA,SAAgB,oBAA0B;CACxC,MAAM,OAAO,WAAW;CACxB,IAAI,CAAC,MAAM;CAEX,KAAK,WAAW,WAAW;EACzB,YAAY;EACZ,cAAc;EACd,oBAAoB;EACpB,mBAAmB;CACrB,CAAC;AACH;;;;;;;;;AAUA,SAAgB,oBACd,OACA,YACM;CACN,MAAM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E as PreferencesUpdate, O as SwitchLikeProps, S as PreferenceComponents, T as PreferencesStorage, _ as CookieStorageOptions, a as CategoryTexts, b as ItemTexts, c as ConsentConfig, d as ConsentScripts, f as CookieBannerConfigurationProviderProps, g as CookieSettingsLinkProps, h as CookieSettingsDialogProps, i as ButtonLikeProps, j as ThemePalette, k as TextOverrides, l as ConsentItemConfig, m as CookieBannerProps, n as BuiltInLanguage, o as CollapsibleProps, p as CookieBannerContextValue, r as getBuiltInTexts, s as ConsentCategoryConfig, t as BUILT_IN_LANGUAGES, u as ConsentScript, v as DeepPartial, w as PreferencesState, x as PreferenceCategory, y as DeepPartialNullable } from "./resolve-texts-yAIbWOUX.cjs";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
//#region src/CookieBanner.d.ts
|
|
4
|
+
export declare function CookieBanner({ policyUrl, className, contentClassName, titleClassName, descriptionClassName, actionsClassName, buttonClassName, components, dialogProps }: Readonly<CookieBannerProps>): import("react").JSX.Element;
|
|
5
|
+
//#endregion
|
|
6
|
+
//#region src/CookieBannerConfigurationProvider.d.ts
|
|
7
|
+
/** The attribute that scopes a provider's theme rules to its elements. */
|
|
8
|
+
export declare const THEME_ATTRIBUTE = "data-nsr-theme";
|
|
9
|
+
export declare function CookieBannerConfigurationProvider({ children, config, scripts, language, texts: textOverrides, theme, darkTheme, components, storageKey, storage, cookieOptions, initialPreferences, version, googleConsentMode, windowJustDont, respectGlobalPrivacyControl, onDecision }: Readonly<CookieBannerConfigurationProviderProps>): React.JSX.Element;
|
|
10
|
+
//#endregion
|
|
11
|
+
//#region src/CookieSettingsDialog.d.ts
|
|
12
|
+
/** Renders nothing while closed; the open dialog mounts fresh each time. */
|
|
13
|
+
export declare function CookieSettingsDialog(props: Readonly<CookieSettingsDialogProps>): React.JSX.Element | null;
|
|
14
|
+
//#endregion
|
|
15
|
+
//#region src/CookieSettingsLink.d.ts
|
|
16
|
+
/**
|
|
17
|
+
* A small link (e.g. in a footer) that opens the cookie settings dialog.
|
|
18
|
+
* Renders your children, or the built-in "Cookie settings" text.
|
|
19
|
+
*/
|
|
20
|
+
export declare function CookieSettingsLink({ children, className, type, onClick, ...props }: Readonly<CookieSettingsLinkProps>): import("react").JSX.Element;
|
|
21
|
+
//#endregion
|
|
22
|
+
//#region src/integrations/script-runtime.d.ts
|
|
23
|
+
/**
|
|
24
|
+
* The reactive runtime store for per-script load status.
|
|
25
|
+
*
|
|
26
|
+
* This is the single source of truth for the 4-state lifecycle
|
|
27
|
+
* (`blocked | loading | loaded | error`) of every managed script.
|
|
28
|
+
* The provider drives this store (consent-gated) and `useConsentScript`
|
|
29
|
+
* subscribes to it via `useSyncExternalStore`.
|
|
30
|
+
*
|
|
31
|
+
* The store is module-level (one per browser tab), keyed by script id.
|
|
32
|
+
* It is intentionally framework-agnostic: no React imports here.
|
|
33
|
+
*/
|
|
34
|
+
type ScriptStatus = "blocked" | "loading" | "loaded" | "error";
|
|
35
|
+
//#endregion
|
|
36
|
+
//#region src/hooks/useConsentScript.d.ts
|
|
37
|
+
type UseConsentScriptResult = {
|
|
38
|
+
/**
|
|
39
|
+
* - `blocked` — consent for the script's category is not granted.
|
|
40
|
+
* - `loading` — consent granted, script is being fetched.
|
|
41
|
+
* - `loaded` — the `<script>` is in the DOM and finished loading.
|
|
42
|
+
* - `error` — the script failed to load, is not declared in the provider's
|
|
43
|
+
* `scripts` map, or the hook is rendered outside a provider.
|
|
44
|
+
*/
|
|
45
|
+
status: ScriptStatus;
|
|
46
|
+
/** Present when `status === "error"`. */
|
|
47
|
+
error?: unknown;
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* Reactive, consent-gated load status for a script declared in the
|
|
51
|
+
* provider's `scripts` map.
|
|
52
|
+
*
|
|
53
|
+
* The status is gated on the script's `category`: denied → `blocked`;
|
|
54
|
+
* granted → the provider drives `loading` → `loaded`/`error`. The hook never
|
|
55
|
+
* loads anything itself — the provider is the single enforcement point.
|
|
56
|
+
*
|
|
57
|
+
* Must be rendered inside a `CookieBannerConfigurationProvider`.
|
|
58
|
+
*/
|
|
59
|
+
export declare function useConsentScript(id: string): UseConsentScriptResult;
|
|
60
|
+
//#endregion
|
|
61
|
+
//#region src/hooks/usePreferences.d.ts
|
|
62
|
+
/**
|
|
63
|
+
* Access the cookie banner state and actions from anywhere
|
|
64
|
+
* inside a CookieBannerConfigurationProvider.
|
|
65
|
+
*/
|
|
66
|
+
export declare function usePreferences(): CookieBannerContextValue;
|
|
67
|
+
//#endregion
|
|
68
|
+
//#region src/integrations/google-tracker.d.ts
|
|
69
|
+
declare global {
|
|
70
|
+
interface Window {
|
|
71
|
+
dataLayer?: unknown[];
|
|
72
|
+
/**
|
|
73
|
+
* Google tag manager stub. Declared with a permissive signature so
|
|
74
|
+
* consumers can call any standard gtag command (`js`, `config`,
|
|
75
|
+
* `event`, `consent`, …) — the real `gtag.js` replaces this at runtime.
|
|
76
|
+
*/
|
|
77
|
+
gtag?: (...args: unknown[]) => void;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Initializes Google's consent mode with everything denied.
|
|
82
|
+
* Call this before any Google tag loads.
|
|
83
|
+
*/
|
|
84
|
+
export declare function initGoogleTracker(): void;
|
|
85
|
+
/**
|
|
86
|
+
* Updates Google's consent mode based on the stored preferences.
|
|
87
|
+
*
|
|
88
|
+
* Without `categories`, the category ids `analytics` / `marketing` in the
|
|
89
|
+
* accepted map drive the signals. With `categories`, a category grants its
|
|
90
|
+
* signals when the category OR any of its fine-grained items is accepted,
|
|
91
|
+
* so item-level consent (e.g. "only Google Ads") is respected.
|
|
92
|
+
*/
|
|
93
|
+
export declare function updateGoogleTracker(state: PreferencesState, categories?: PreferenceCategory[]): void;
|
|
94
|
+
//#endregion
|
|
95
|
+
//#region src/storage/adapters.d.ts
|
|
96
|
+
/** The default: `window.localStorage`, keyed by `storageKey`. */
|
|
97
|
+
export declare const localStorageAdapter: PreferencesStorage;
|
|
98
|
+
/**
|
|
99
|
+
* Stores the decision in a cookie named `storageKey`, so a server can read it
|
|
100
|
+
* (see `readPreferencesFromCookies`). The value is the url-encoded JSON state,
|
|
101
|
+
* a few hundred bytes for typical configs — far below the 4 KB cookie limit.
|
|
102
|
+
*/
|
|
103
|
+
export declare function createCookieStorage(options?: CookieStorageOptions): PreferencesStorage;
|
|
104
|
+
/**
|
|
105
|
+
* Writes to the cookie **and** localStorage; reads the cookie first and falls
|
|
106
|
+
* back to localStorage. The cookie wins because it is the copy a server can
|
|
107
|
+
* see; the fallback keeps visitors who decided before a site switched from
|
|
108
|
+
* localStorage to cookies from being asked again.
|
|
109
|
+
*/
|
|
110
|
+
export declare function createBothStorage(options?: CookieStorageOptions): PreferencesStorage;
|
|
111
|
+
//#endregion
|
|
112
|
+
//#region src/storage/index.d.ts
|
|
113
|
+
export declare const DEFAULT_STORAGE_KEY = "non-spooky-react-cookie";
|
|
114
|
+
//#endregion
|
|
115
|
+
//#region src/ui.d.ts
|
|
116
|
+
export declare function cn(...classes: Array<string | false | null | undefined>): string;
|
|
117
|
+
/**
|
|
118
|
+
* Default Button.
|
|
119
|
+
* Colors come from the `--nsr-*` variables: defaults in `styles.css`,
|
|
120
|
+
* overrides from the provider's `theme` prop.
|
|
121
|
+
*/
|
|
122
|
+
export declare function Button({ className, variant, ...props }: ButtonLikeProps): import("react").JSX.Element;
|
|
123
|
+
/**
|
|
124
|
+
* Default Switch.
|
|
125
|
+
* The "on" color follows the theme's primary color.
|
|
126
|
+
*/
|
|
127
|
+
export declare function Switch({ checked, disabled, onCheckedChange, "aria-label": ariaLabel }: Readonly<SwitchLikeProps>): import("react").JSX.Element;
|
|
128
|
+
/**
|
|
129
|
+
* Default Collapsible.
|
|
130
|
+
* A disclosure that hides its children until the trigger is pressed.
|
|
131
|
+
* Works controlled (`open` + `onOpenChange`) or self-managed (`defaultOpen`).
|
|
132
|
+
* The chevron follows the theme's primary color.
|
|
133
|
+
*/
|
|
134
|
+
export declare function Collapsible({ children, count, label, open, onOpenChange, defaultOpen, className, contentClassName }: Readonly<CollapsibleProps>): import("react").JSX.Element;
|
|
135
|
+
//#endregion
|
|
136
|
+
export { BUILT_IN_LANGUAGES, type BuiltInLanguage, type ButtonLikeProps, type CategoryTexts, type CollapsibleProps, type ConsentCategoryConfig, type ConsentConfig, type ConsentItemConfig, type ConsentScript, type ConsentScripts, type CookieBannerConfigurationProviderProps, type CookieBannerContextValue, type CookieBannerProps, type CookieSettingsDialogProps, type CookieSettingsLinkProps, type CookieStorageOptions, type DeepPartial, type DeepPartialNullable, type ItemTexts, type PreferenceCategory, type PreferenceComponents, type PreferenceItem, type PreferencesState, type PreferencesStorage, type PreferencesUpdate, type ScriptStatus, type StorageKind, type SwitchLikeProps, type TextOverrides, type Texts, type ThemePalette, type UseConsentScriptResult, getBuiltInTexts };
|
|
137
|
+
//# sourceMappingURL=index.d.cts.map
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { A as Texts, C as PreferenceItem, D as StorageKind, E as PreferencesUpdate, O as SwitchLikeProps, S as PreferenceComponents, T as PreferencesStorage, _ as CookieStorageOptions, a as CategoryTexts, b as ItemTexts, c as ConsentConfig, d as ConsentScripts, f as CookieBannerConfigurationProviderProps, g as CookieSettingsLinkProps, h as CookieSettingsDialogProps, i as ButtonLikeProps, j as ThemePalette, k as TextOverrides, l as ConsentItemConfig, m as CookieBannerProps, n as BuiltInLanguage, o as CollapsibleProps, p as CookieBannerContextValue, r as getBuiltInTexts, s as ConsentCategoryConfig, t as BUILT_IN_LANGUAGES, u as ConsentScript, v as DeepPartial, w as PreferencesState, x as PreferenceCategory, y as DeepPartialNullable } from "./resolve-texts-yAIbWOUX.js";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
//#region src/CookieBanner.d.ts
|
|
4
|
+
export declare function CookieBanner({ policyUrl, className, contentClassName, titleClassName, descriptionClassName, actionsClassName, buttonClassName, components, dialogProps }: Readonly<CookieBannerProps>): import("react").JSX.Element;
|
|
5
|
+
//#endregion
|
|
6
|
+
//#region src/CookieBannerConfigurationProvider.d.ts
|
|
7
|
+
/** The attribute that scopes a provider's theme rules to its elements. */
|
|
8
|
+
export declare const THEME_ATTRIBUTE = "data-nsr-theme";
|
|
9
|
+
export declare function CookieBannerConfigurationProvider({ children, config, scripts, language, texts: textOverrides, theme, darkTheme, components, storageKey, storage, cookieOptions, initialPreferences, version, googleConsentMode, windowJustDont, respectGlobalPrivacyControl, onDecision }: Readonly<CookieBannerConfigurationProviderProps>): React.JSX.Element;
|
|
10
|
+
//#endregion
|
|
11
|
+
//#region src/CookieSettingsDialog.d.ts
|
|
12
|
+
/** Renders nothing while closed; the open dialog mounts fresh each time. */
|
|
13
|
+
export declare function CookieSettingsDialog(props: Readonly<CookieSettingsDialogProps>): React.JSX.Element | null;
|
|
14
|
+
//#endregion
|
|
15
|
+
//#region src/CookieSettingsLink.d.ts
|
|
16
|
+
/**
|
|
17
|
+
* A small link (e.g. in a footer) that opens the cookie settings dialog.
|
|
18
|
+
* Renders your children, or the built-in "Cookie settings" text.
|
|
19
|
+
*/
|
|
20
|
+
export declare function CookieSettingsLink({ children, className, type, onClick, ...props }: Readonly<CookieSettingsLinkProps>): import("react").JSX.Element;
|
|
21
|
+
//#endregion
|
|
22
|
+
//#region src/integrations/script-runtime.d.ts
|
|
23
|
+
/**
|
|
24
|
+
* The reactive runtime store for per-script load status.
|
|
25
|
+
*
|
|
26
|
+
* This is the single source of truth for the 4-state lifecycle
|
|
27
|
+
* (`blocked | loading | loaded | error`) of every managed script.
|
|
28
|
+
* The provider drives this store (consent-gated) and `useConsentScript`
|
|
29
|
+
* subscribes to it via `useSyncExternalStore`.
|
|
30
|
+
*
|
|
31
|
+
* The store is module-level (one per browser tab), keyed by script id.
|
|
32
|
+
* It is intentionally framework-agnostic: no React imports here.
|
|
33
|
+
*/
|
|
34
|
+
type ScriptStatus = "blocked" | "loading" | "loaded" | "error";
|
|
35
|
+
//#endregion
|
|
36
|
+
//#region src/hooks/useConsentScript.d.ts
|
|
37
|
+
type UseConsentScriptResult = {
|
|
38
|
+
/**
|
|
39
|
+
* - `blocked` — consent for the script's category is not granted.
|
|
40
|
+
* - `loading` — consent granted, script is being fetched.
|
|
41
|
+
* - `loaded` — the `<script>` is in the DOM and finished loading.
|
|
42
|
+
* - `error` — the script failed to load, is not declared in the provider's
|
|
43
|
+
* `scripts` map, or the hook is rendered outside a provider.
|
|
44
|
+
*/
|
|
45
|
+
status: ScriptStatus;
|
|
46
|
+
/** Present when `status === "error"`. */
|
|
47
|
+
error?: unknown;
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* Reactive, consent-gated load status for a script declared in the
|
|
51
|
+
* provider's `scripts` map.
|
|
52
|
+
*
|
|
53
|
+
* The status is gated on the script's `category`: denied → `blocked`;
|
|
54
|
+
* granted → the provider drives `loading` → `loaded`/`error`. The hook never
|
|
55
|
+
* loads anything itself — the provider is the single enforcement point.
|
|
56
|
+
*
|
|
57
|
+
* Must be rendered inside a `CookieBannerConfigurationProvider`.
|
|
58
|
+
*/
|
|
59
|
+
export declare function useConsentScript(id: string): UseConsentScriptResult;
|
|
60
|
+
//#endregion
|
|
61
|
+
//#region src/hooks/usePreferences.d.ts
|
|
62
|
+
/**
|
|
63
|
+
* Access the cookie banner state and actions from anywhere
|
|
64
|
+
* inside a CookieBannerConfigurationProvider.
|
|
65
|
+
*/
|
|
66
|
+
export declare function usePreferences(): CookieBannerContextValue;
|
|
67
|
+
//#endregion
|
|
68
|
+
//#region src/integrations/google-tracker.d.ts
|
|
69
|
+
declare global {
|
|
70
|
+
interface Window {
|
|
71
|
+
dataLayer?: unknown[];
|
|
72
|
+
/**
|
|
73
|
+
* Google tag manager stub. Declared with a permissive signature so
|
|
74
|
+
* consumers can call any standard gtag command (`js`, `config`,
|
|
75
|
+
* `event`, `consent`, …) — the real `gtag.js` replaces this at runtime.
|
|
76
|
+
*/
|
|
77
|
+
gtag?: (...args: unknown[]) => void;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Initializes Google's consent mode with everything denied.
|
|
82
|
+
* Call this before any Google tag loads.
|
|
83
|
+
*/
|
|
84
|
+
export declare function initGoogleTracker(): void;
|
|
85
|
+
/**
|
|
86
|
+
* Updates Google's consent mode based on the stored preferences.
|
|
87
|
+
*
|
|
88
|
+
* Without `categories`, the category ids `analytics` / `marketing` in the
|
|
89
|
+
* accepted map drive the signals. With `categories`, a category grants its
|
|
90
|
+
* signals when the category OR any of its fine-grained items is accepted,
|
|
91
|
+
* so item-level consent (e.g. "only Google Ads") is respected.
|
|
92
|
+
*/
|
|
93
|
+
export declare function updateGoogleTracker(state: PreferencesState, categories?: PreferenceCategory[]): void;
|
|
94
|
+
//#endregion
|
|
95
|
+
//#region src/storage/adapters.d.ts
|
|
96
|
+
/** The default: `window.localStorage`, keyed by `storageKey`. */
|
|
97
|
+
export declare const localStorageAdapter: PreferencesStorage;
|
|
98
|
+
/**
|
|
99
|
+
* Stores the decision in a cookie named `storageKey`, so a server can read it
|
|
100
|
+
* (see `readPreferencesFromCookies`). The value is the url-encoded JSON state,
|
|
101
|
+
* a few hundred bytes for typical configs — far below the 4 KB cookie limit.
|
|
102
|
+
*/
|
|
103
|
+
export declare function createCookieStorage(options?: CookieStorageOptions): PreferencesStorage;
|
|
104
|
+
/**
|
|
105
|
+
* Writes to the cookie **and** localStorage; reads the cookie first and falls
|
|
106
|
+
* back to localStorage. The cookie wins because it is the copy a server can
|
|
107
|
+
* see; the fallback keeps visitors who decided before a site switched from
|
|
108
|
+
* localStorage to cookies from being asked again.
|
|
109
|
+
*/
|
|
110
|
+
export declare function createBothStorage(options?: CookieStorageOptions): PreferencesStorage;
|
|
111
|
+
//#endregion
|
|
112
|
+
//#region src/storage/index.d.ts
|
|
113
|
+
export declare const DEFAULT_STORAGE_KEY = "non-spooky-react-cookie";
|
|
114
|
+
//#endregion
|
|
115
|
+
//#region src/ui.d.ts
|
|
116
|
+
export declare function cn(...classes: Array<string | false | null | undefined>): string;
|
|
117
|
+
/**
|
|
118
|
+
* Default Button.
|
|
119
|
+
* Colors come from the `--nsr-*` variables: defaults in `styles.css`,
|
|
120
|
+
* overrides from the provider's `theme` prop.
|
|
121
|
+
*/
|
|
122
|
+
export declare function Button({ className, variant, ...props }: ButtonLikeProps): import("react").JSX.Element;
|
|
123
|
+
/**
|
|
124
|
+
* Default Switch.
|
|
125
|
+
* The "on" color follows the theme's primary color.
|
|
126
|
+
*/
|
|
127
|
+
export declare function Switch({ checked, disabled, onCheckedChange, "aria-label": ariaLabel }: Readonly<SwitchLikeProps>): import("react").JSX.Element;
|
|
128
|
+
/**
|
|
129
|
+
* Default Collapsible.
|
|
130
|
+
* A disclosure that hides its children until the trigger is pressed.
|
|
131
|
+
* Works controlled (`open` + `onOpenChange`) or self-managed (`defaultOpen`).
|
|
132
|
+
* The chevron follows the theme's primary color.
|
|
133
|
+
*/
|
|
134
|
+
export declare function Collapsible({ children, count, label, open, onOpenChange, defaultOpen, className, contentClassName }: Readonly<CollapsibleProps>): import("react").JSX.Element;
|
|
135
|
+
//#endregion
|
|
136
|
+
export { BUILT_IN_LANGUAGES, type BuiltInLanguage, type ButtonLikeProps, type CategoryTexts, type CollapsibleProps, type ConsentCategoryConfig, type ConsentConfig, type ConsentItemConfig, type ConsentScript, type ConsentScripts, type CookieBannerConfigurationProviderProps, type CookieBannerContextValue, type CookieBannerProps, type CookieSettingsDialogProps, type CookieSettingsLinkProps, type CookieStorageOptions, type DeepPartial, type DeepPartialNullable, type ItemTexts, type PreferenceCategory, type PreferenceComponents, type PreferenceItem, type PreferencesState, type PreferencesStorage, type PreferencesUpdate, type ScriptStatus, type StorageKind, type SwitchLikeProps, type TextOverrides, type Texts, type ThemePalette, type UseConsentScriptResult, getBuiltInTexts };
|
|
137
|
+
//# sourceMappingURL=index.d.ts.map
|