@c15t/react 2.2.1 → 3.0.0-alpha.1
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/AGENTS.md +89 -141
- package/README.md +2 -2
- package/dist/aggregate-components.js +2 -0
- package/dist/chunk-warming.js +1 -0
- package/dist/component-hooks/use-headless-consent-ui.js +2 -0
- package/dist/component-hooks/use-headless-iab-consent-ui.js +2 -0
- package/dist/component-hooks/use-manager.js +2 -0
- package/dist/component-hooks/use-panel-trigger.js +2 -0
- package/dist/component-hooks/use-translations.js +2 -0
- package/dist/components/consent-preferences-link/consent-preferences-link.js +2 -1
- package/dist/components/consent-preferences-link/index.js +1 -0
- package/dist/components/frame/atoms.js +1 -1
- package/dist/components/frame/frame.js +2 -1
- package/dist/components/frame/index.js +2 -1
- package/dist/components/iab-panel/atoms/card.js +2 -0
- package/dist/components/iab-panel/atoms/content.js +2 -0
- package/dist/components/iab-panel/atoms/footer.js +2 -0
- package/dist/components/iab-panel/atoms/header.js +2 -0
- package/dist/components/iab-panel/atoms/overlay.js +2 -0
- package/dist/components/iab-panel/atoms/purpose-item.js +2 -0
- package/dist/components/iab-panel/atoms/root.js +2 -0
- package/dist/components/iab-panel/atoms/stack-item.js +2 -0
- package/dist/components/iab-panel/atoms/tabs.js +2 -0
- package/dist/components/iab-panel/atoms/vendor-list.js +2 -0
- package/dist/components/iab-panel/hooks/use-display-model.js +2 -0
- package/dist/components/iab-panel/hooks/use-gvl-data.js +2 -0
- package/dist/components/iab-panel/iab-panel.js +2 -0
- package/dist/components/iab-panel/index.js +2 -0
- package/dist/components/iab-panel/use-iab-translations.js +1 -0
- package/dist/components/iab-prompt/atoms/button-group.js +2 -0
- package/dist/components/iab-prompt/atoms/card.js +2 -0
- package/dist/components/iab-prompt/atoms/description.js +2 -0
- package/dist/components/iab-prompt/atoms/footer.js +2 -0
- package/dist/components/iab-prompt/atoms/header.js +2 -0
- package/dist/components/iab-prompt/atoms/overlay.js +2 -0
- package/dist/components/iab-prompt/atoms/root.js +2 -0
- package/dist/components/iab-prompt/atoms/title.js +2 -0
- package/dist/components/iab-prompt/iab-prompt.js +2 -0
- package/dist/components/iab-prompt/index.js +2 -0
- package/dist/components/panel/atoms/card.js +2 -0
- package/dist/components/panel/atoms/overlay.js +1 -0
- package/dist/components/panel/atoms/root.js +2 -0
- package/dist/components/panel/index.js +2 -0
- package/dist/components/panel/panel.js +2 -0
- package/dist/components/{consent-dialog-link → panel-link}/index.js +1 -0
- package/dist/components/panel-trigger/atoms/button.js +2 -0
- package/dist/components/panel-trigger/atoms/icon.js +2 -0
- package/dist/components/panel-trigger/atoms/root.js +2 -0
- package/dist/components/panel-trigger/atoms/text.js +2 -0
- package/dist/components/panel-trigger/atoms/toolbar.js +2 -0
- package/dist/components/panel-trigger/index.js +2 -0
- package/dist/components/panel-trigger/panel-trigger-toolbar.js +2 -0
- package/dist/components/panel-trigger/panel-trigger.js +2 -0
- package/dist/components/panel-trigger/use-draggable.js +2 -0
- package/dist/components/preferences/atoms/accordion.js +1 -0
- package/dist/components/preferences/atoms/button.js +1 -0
- package/dist/components/preferences/atoms/footer.js +1 -0
- package/dist/components/preferences/atoms/root.js +2 -0
- package/dist/components/preferences/index.js +2 -0
- package/dist/components/preferences/policy-actions.js +2 -0
- package/dist/components/preferences/preferences.js +2 -0
- package/dist/components/prompt/atoms/overlay.js +1 -0
- package/dist/components/prompt/atoms/root.js +2 -0
- package/dist/components/prompt/components.js +1 -0
- package/dist/components/prompt/error-boundary.js +2 -0
- package/dist/components/prompt/index.js +2 -0
- package/dist/components/prompt/policy-actions.js +2 -0
- package/dist/components/prompt/prompt.js +2 -0
- package/dist/components/prompt/resolve-banner-primary-actions.js +1 -0
- package/dist/components/prompt/surface-context.js +2 -0
- package/dist/components/prompt/use-banner-copy.js +2 -0
- package/dist/components/shared/libs/recursive-clone-children.js +1 -1
- package/dist/components/shared/libs/slot.js +1 -1
- package/dist/components/shared/libs/use-controllable-state.js +1 -1
- package/dist/components/shared/policy-actions.js +2 -1
- package/dist/components/shared/primitives/box.js +2 -1
- package/dist/components/shared/primitives/button.js +1 -1
- package/dist/components/shared/primitives/legal-links/index.js +1 -1
- package/dist/components/shared/ui/accordion/accordion.js +2 -1
- package/dist/components/shared/ui/animated-collapse/animated-collapse.js +2 -1
- package/dist/components/shared/ui/branding.js +1 -1
- package/dist/components/shared/ui/button/button.js +1 -1
- package/dist/components/shared/ui/collapsible/collapsible.js +2 -1
- package/dist/components/shared/ui/dialog/dialog.js +2 -1
- package/dist/components/shared/ui/icon.js +1 -1
- package/dist/components/shared/ui/logo.js +1 -1
- package/dist/components/shared/ui/preference-item/preference-item.js +2 -1
- package/dist/components/shared/ui/switch/switch.js +1 -1
- package/dist/components/shared/ui/tabs/tabs.js +2 -1
- package/dist/context/consent-tracking-context.js +1 -0
- package/dist/context/iab-context-value.js +1 -0
- package/dist/context/index.js +1 -0
- package/dist/context/theme-context.js +2 -1
- package/dist/context.js +1 -0
- package/dist/devtools.js +2 -0
- package/dist/draft.js +2 -0
- package/dist/external-iab-context.js +2 -0
- package/dist/frame.js +2 -0
- package/dist/headless.js +1 -1
- package/dist/hooks/use-color-scheme.js +2 -1
- package/dist/hooks/use-component-config.js +2 -1
- package/dist/hooks/use-focus-trap.js +2 -1
- package/dist/hooks/use-headless-iab-consent-ui.js +2 -1
- package/dist/hooks/use-iab-manager.js +2 -0
- package/dist/hooks/use-is-hydrated.js +2 -0
- package/dist/hooks/use-reduced-motion.js +2 -1
- package/dist/hooks/use-scroll-lock.js +2 -1
- package/dist/hooks/use-text-direction.js +2 -1
- package/dist/hooks/use-theme.js +2 -1
- package/dist/hooks.js +1 -0
- package/dist/iab/styles.css +1 -1
- package/dist/iab/styles.tw3.css +27 -19
- package/dist/iab-context.js +2 -0
- package/dist/iab.js +1 -1
- package/dist/index.js +1 -1
- package/dist/module-hooks/iframe-blocker.js +2 -0
- package/dist/module-hooks/network-blocker.js +2 -0
- package/dist/module-hooks/persistence.js +2 -0
- package/dist/module-hooks/script-loader.js +2 -0
- package/dist/module-hooks/shared.js +2 -0
- package/dist/module-hooks.js +2 -0
- package/dist/panel-link.js +2 -0
- package/dist/panel-trigger.js +2 -0
- package/dist/panel.js +2 -0
- package/dist/preferences.js +2 -0
- package/dist/primitives.js +1 -1
- package/dist/prompt.js +2 -0
- package/dist/provider.js +2 -0
- package/dist/server/fetch-ssr-data.js +1 -1
- package/dist/server/headers.js +1 -1
- package/dist/server/init-cache-key.js +1 -1
- package/dist/server/normalize-url.js +1 -1
- package/dist/styles.css +1 -1
- package/dist/styles.tw3.css +67 -29
- package/dist/theme-provider.js +2 -0
- package/dist/transports/offline.js +1 -0
- package/dist/types/index.js +1 -0
- package/dist/types/theme/index.js +1 -1
- package/dist/types/theme/style-types.js +1 -1
- package/dist/ui-config-context.js +2 -0
- package/dist/ui-save.js +1 -0
- package/dist/utils/cn.js +1 -1
- package/dist/utils/default-translation-config.js +1 -0
- package/dist/utils/index.js +1 -0
- package/dist/utils/merge-slot-props.js +1 -0
- package/dist/utils/merge-styles.js +1 -1
- package/dist/utils/theme-utils.js +1 -1
- package/dist/version.js +1 -1
- package/dist-types/aggregate-components.d.ts +4 -0
- package/dist-types/chunk-warming.d.ts +19 -0
- package/dist-types/component-hooks/use-headless-consent-ui.d.ts +68 -0
- package/dist-types/component-hooks/use-headless-iab-consent-ui.d.ts +22 -0
- package/dist-types/component-hooks/use-manager.d.ts +40 -0
- package/dist-types/component-hooks/use-panel-trigger.d.ts +20 -0
- package/dist-types/component-hooks/use-translations.d.ts +2 -0
- package/dist-types/components/consent-preferences-link/consent-preferences-link.d.ts +1 -1
- package/dist-types/components/frame/atoms.d.ts +5 -5
- package/dist-types/components/frame/types.d.ts +3 -2
- package/dist-types/components/{iab-consent-dialog → iab-panel}/atoms/card.d.ts +2 -1
- package/dist-types/components/{iab-consent-dialog → iab-panel}/atoms/content.d.ts +1 -1
- package/dist-types/components/{iab-consent-dialog → iab-panel}/atoms/footer.d.ts +1 -1
- package/dist-types/components/{iab-consent-dialog → iab-panel}/atoms/header.d.ts +1 -1
- package/dist-types/components/{iab-consent-dialog → iab-panel}/atoms/overlay.d.ts +1 -1
- package/dist-types/components/{iab-consent-dialog → iab-panel}/atoms/purpose-item.d.ts +7 -1
- package/dist-types/components/{iab-consent-dialog → iab-panel}/atoms/root.d.ts +3 -2
- package/dist-types/components/{iab-consent-dialog → iab-panel}/atoms/stack-item.d.ts +1 -1
- package/dist-types/components/{iab-consent-dialog → iab-panel}/atoms/tabs.d.ts +1 -1
- package/dist-types/components/{iab-consent-dialog → iab-panel}/atoms/vendor-list.d.ts +2 -3
- package/dist-types/components/iab-panel/hooks/use-display-model.d.ts +18 -0
- package/dist-types/components/iab-panel/hooks/use-gvl-data.d.ts +17 -0
- package/dist-types/components/{iab-consent-dialog/iab-consent-dialog.d.ts → iab-panel/iab-panel.d.ts} +10 -3
- package/dist-types/components/{iab-consent-dialog → iab-panel}/index.d.ts +3 -2
- package/dist-types/components/iab-panel/types.d.ts +1 -0
- package/dist-types/components/{iab-consent-dialog → iab-panel}/use-iab-translations.d.ts +3 -1
- package/dist-types/components/{iab-consent-banner → iab-prompt}/atoms/button-group.d.ts +1 -1
- package/dist-types/components/{iab-consent-banner → iab-prompt}/atoms/card.d.ts +2 -1
- package/dist-types/components/{iab-consent-banner → iab-prompt}/atoms/description.d.ts +1 -1
- package/dist-types/components/{iab-consent-banner → iab-prompt}/atoms/footer.d.ts +2 -1
- package/dist-types/components/{iab-consent-banner → iab-prompt}/atoms/header.d.ts +2 -1
- package/dist-types/components/{iab-consent-banner → iab-prompt}/atoms/overlay.d.ts +1 -1
- package/dist-types/components/{iab-consent-banner → iab-prompt}/atoms/root.d.ts +3 -2
- package/dist-types/components/{iab-consent-banner → iab-prompt}/atoms/title.d.ts +1 -1
- package/dist-types/components/{iab-consent-banner/iab-consent-banner.d.ts → iab-prompt/iab-prompt.d.ts} +10 -4
- package/dist-types/components/{iab-consent-banner → iab-prompt}/index.d.ts +1 -1
- package/dist-types/components/{consent-dialog → panel}/atoms/card.d.ts +15 -15
- package/dist-types/components/{consent-dialog → panel}/atoms/overlay.d.ts +24 -8
- package/dist-types/components/{consent-dialog → panel}/atoms/root.d.ts +4 -3
- package/dist-types/components/{consent-dialog → panel}/index.d.ts +13 -8
- package/dist-types/components/{consent-dialog/consent-dialog.d.ts → panel/panel.d.ts} +6 -5
- package/dist-types/components/{consent-dialog-trigger → panel-trigger}/atoms/button.d.ts +2 -1
- package/dist-types/components/{consent-dialog-trigger → panel-trigger}/atoms/icon.d.ts +1 -16
- package/dist-types/components/{consent-dialog-trigger → panel-trigger}/atoms/root.d.ts +11 -23
- package/dist-types/components/{consent-dialog-trigger → panel-trigger}/atoms/text.d.ts +0 -11
- package/dist-types/components/{consent-dialog-trigger → panel-trigger}/atoms/toolbar.d.ts +15 -4
- package/dist-types/components/{consent-dialog-trigger → panel-trigger}/index.d.ts +2 -2
- package/dist-types/components/{consent-dialog-trigger/consent-dialog-trigger-toolbar.d.ts → panel-trigger/panel-trigger-toolbar.d.ts} +0 -23
- package/dist-types/components/{consent-dialog-trigger/consent-dialog-trigger.d.ts → panel-trigger/panel-trigger.d.ts} +8 -4
- package/dist-types/components/{consent-dialog-trigger → panel-trigger}/types.d.ts +16 -7
- package/dist-types/components/{consent-dialog-trigger → panel-trigger}/use-draggable.d.ts +2 -9
- package/dist-types/components/{consent-widget → preferences}/atoms/accordion.d.ts +5 -5
- package/dist-types/components/{consent-widget → preferences}/atoms/footer.d.ts +3 -3
- package/dist-types/components/{consent-widget → preferences}/atoms/root.d.ts +1 -1
- package/dist-types/components/{consent-widget → preferences}/index.d.ts +11 -9
- package/dist-types/components/preferences/policy-actions.d.ts +10 -0
- package/dist-types/components/{consent-banner → prompt}/atoms/overlay.d.ts +1 -1
- package/dist-types/components/prompt/atoms/root.d.ts +78 -0
- package/dist-types/components/{consent-banner → prompt}/components.d.ts +99 -14
- package/dist-types/components/{consent-banner → prompt}/error-boundary.d.ts +3 -1
- package/dist-types/components/{consent-banner → prompt}/index.d.ts +18 -10
- package/dist-types/components/prompt/policy-actions.d.ts +12 -0
- package/dist-types/components/{consent-banner/consent-banner.d.ts → prompt/prompt.d.ts} +36 -10
- package/dist-types/components/prompt/resolve-banner-primary-actions.d.ts +14 -0
- package/dist-types/components/prompt/surface-context.d.ts +45 -0
- package/dist-types/components/prompt/use-banner-copy.d.ts +16 -0
- package/dist-types/components/shared/libs/polymorphic.d.ts +2 -2
- package/dist-types/components/shared/libs/recursive-clone-children.d.ts +2 -2
- package/dist-types/components/shared/libs/slot.d.ts +1 -1
- package/dist-types/components/shared/libs/use-controllable-state.d.ts +1 -1
- package/dist-types/components/shared/policy-actions.d.ts +8 -3
- package/dist-types/components/shared/primitives/box.d.ts +3 -1
- package/dist-types/components/shared/primitives/button.d.ts +4 -37
- package/dist-types/components/shared/primitives/button.types.d.ts +3 -1
- package/dist-types/components/shared/primitives/legal-links/index.d.ts +7 -11
- package/dist-types/components/shared/ui/accordion/accordion.d.ts +45 -12
- package/dist-types/components/shared/ui/accordion/accordion.types.d.ts +1 -1
- package/dist-types/components/shared/ui/animated-collapse/animated-collapse.d.ts +1 -1
- package/dist-types/components/shared/ui/branding.d.ts +12 -12
- package/dist-types/components/shared/ui/button/button.d.ts +19 -25
- package/dist-types/components/shared/ui/button/button.types.d.ts +2 -2
- package/dist-types/components/shared/ui/collapsible/collapsible.d.ts +18 -1
- package/dist-types/components/shared/ui/dialog/dialog.d.ts +6 -6
- package/dist-types/components/shared/ui/icon.d.ts +1 -1
- package/dist-types/components/shared/ui/logo.d.ts +0 -21
- package/dist-types/components/shared/ui/preference-item/preference-item.d.ts +46 -2
- package/dist-types/components/shared/ui/switch/switch.d.ts +19 -8
- package/dist-types/components/shared/ui/tabs/tabs.d.ts +19 -2
- package/dist-types/context/iab-context-value.d.ts +37 -0
- package/dist-types/context/index.d.ts +3 -0
- package/dist-types/context/theme-context.d.ts +2 -2
- package/dist-types/context.d.ts +17 -0
- package/dist-types/devtools.d.ts +54 -0
- package/dist-types/draft.d.ts +31 -0
- package/dist-types/external-iab-context.d.ts +29 -0
- package/dist-types/frame.d.ts +1 -0
- package/dist-types/headless.d.ts +12 -8
- package/dist-types/hooks/use-color-scheme.d.ts +1 -1
- package/dist-types/hooks/use-component-config.d.ts +2 -2
- package/dist-types/hooks/use-focus-trap.d.ts +2 -2
- package/dist-types/hooks/use-headless-iab-consent-ui.d.ts +7 -8
- package/dist-types/hooks/use-iab-manager.d.ts +52 -0
- package/dist-types/hooks/use-is-hydrated.d.ts +8 -0
- package/dist-types/hooks/use-reduced-motion.d.ts +1 -1
- package/dist-types/hooks/use-scroll-lock.d.ts +1 -1
- package/dist-types/hooks/use-text-direction.d.ts +1 -1
- package/dist-types/hooks/use-theme.d.ts +2 -1
- package/dist-types/hooks.d.ts +148 -0
- package/dist-types/iab-context.d.ts +28 -0
- package/dist-types/iab.d.ts +14 -8
- package/dist-types/index.d.ts +61 -22
- package/dist-types/module-hooks/iframe-blocker.d.ts +6 -0
- package/dist-types/module-hooks/network-blocker.d.ts +9 -0
- package/dist-types/module-hooks/persistence.d.ts +4 -0
- package/dist-types/module-hooks/script-loader.d.ts +6 -0
- package/dist-types/module-hooks/shared.d.ts +2 -0
- package/dist-types/module-hooks.d.ts +4 -0
- package/dist-types/panel-link.d.ts +1 -0
- package/dist-types/panel-trigger.d.ts +1 -0
- package/dist-types/panel.d.ts +1 -0
- package/dist-types/preferences.d.ts +1 -0
- package/dist-types/prompt.d.ts +1 -0
- package/dist-types/provider.d.ts +149 -0
- package/dist-types/server/fetch-ssr-data.d.ts +2 -2
- package/dist-types/server/headers.d.ts +3 -3
- package/dist-types/server/init-cache-key.d.ts +3 -3
- package/dist-types/server/normalize-url.d.ts +2 -2
- package/dist-types/server/types.d.ts +1 -1
- package/dist-types/theme-provider.d.ts +10 -0
- package/dist-types/transports/offline.d.ts +18 -0
- package/dist-types/types/index.d.ts +3 -0
- package/dist-types/types/manager.d.ts +15 -0
- package/dist-types/types/slots.d.ts +5 -0
- package/dist-types/types/theme/index.d.ts +0 -1
- package/dist-types/types/theme/style-types.d.ts +3 -9
- package/dist-types/ui-config-context.d.ts +9 -0
- package/dist-types/ui-save.d.ts +5 -0
- package/dist-types/utils/cn.d.ts +1 -1
- package/dist-types/utils/default-translation-config.d.ts +6 -0
- package/dist-types/utils/index.d.ts +4 -0
- package/dist-types/utils/merge-slot-props.d.ts +14 -0
- package/dist-types/utils/merge-styles.d.ts +1 -1
- package/dist-types/utils/theme-utils.d.ts +2 -2
- package/dist-types/version.d.ts +1 -1
- package/docs/README.md +89 -141
- package/docs/assets/v3/brand-bar.png +0 -0
- package/docs/assets/v3/brand-card.png +0 -0
- package/docs/assets/v3/choice-wall.png +0 -0
- package/docs/assets/v3/mobile-card.png +0 -0
- package/docs/assets/v3/preferences.png +0 -0
- package/docs/customization/overview.md +45 -0
- package/docs/customization/recipes.md +79 -0
- package/docs/customization/slots.md +55 -0
- package/docs/customization/tokens.md +76 -0
- package/docs/customization/translations.md +49 -0
- package/docs/frameworks/react/components/consent-banner.md +219 -202
- package/docs/frameworks/react/components/consent-dialog-link.md +88 -35
- package/docs/frameworks/react/components/consent-dialog-trigger.md +74 -134
- package/docs/frameworks/react/components/consent-dialog.md +170 -135
- package/docs/frameworks/react/components/consent-manager-provider.md +57 -256
- package/docs/frameworks/react/components/consent-widget.md +154 -118
- package/docs/frameworks/react/components/dev-tools.md +198 -33
- package/docs/frameworks/react/components/frame.md +120 -42
- package/docs/frameworks/react/concepts/consent-categories.md +24 -89
- package/docs/frameworks/react/concepts/policy-presets.md +123 -0
- package/docs/frameworks/react/headless.md +91 -185
- package/docs/frameworks/react/hooks/use-consent-manager/overview.md +39 -153
- package/docs/frameworks/react/iab/overview.md +33 -108
- package/docs/frameworks/react/quickstart.md +116 -112
- package/docs/frameworks/react/script-loader.md +41 -533
- package/docs/frameworks/react/styling/overview.md +168 -253
- package/docs/frameworks/react/troubleshooting.md +47 -119
- package/docs/guides/consent-state.md +60 -0
- package/docs/guides/data-fetching.md +163 -0
- package/docs/guides/deployment-modes.md +63 -0
- package/docs/guides/troubleshooting.md +68 -0
- package/docs/guides/verify-consent.md +62 -0
- package/docs/integrations/adobe-analytics.md +239 -105
- package/docs/integrations/ahrefs-analytics.md +238 -104
- package/docs/integrations/amplitude.md +219 -157
- package/docs/integrations/building-integrations.md +32 -224
- package/docs/integrations/clear-on-revocation.md +167 -0
- package/docs/integrations/clearbit.md +247 -86
- package/docs/integrations/cloudflare-web-analytics.md +250 -84
- package/docs/integrations/crisp.md +251 -97
- package/docs/integrations/databuddy.md +259 -153
- package/docs/integrations/fathom-analytics.md +239 -96
- package/docs/integrations/google-maps.md +328 -207
- package/docs/integrations/google-tag-manager.md +248 -96
- package/docs/integrations/google-tag.md +261 -90
- package/docs/integrations/heap.md +222 -149
- package/docs/integrations/hightouch.md +225 -131
- package/docs/integrations/hotjar.md +239 -90
- package/docs/integrations/intercom.md +239 -98
- package/docs/integrations/linkedin-insights.md +243 -113
- package/docs/integrations/logrocket.md +241 -123
- package/docs/integrations/matomo-analytics.md +256 -111
- package/docs/integrations/meta-pixel.md +197 -324
- package/docs/integrations/microsoft-clarity.md +233 -114
- package/docs/integrations/microsoft-uet.md +245 -110
- package/docs/integrations/mixpanel-analytics.md +252 -87
- package/docs/integrations/openai-pixel.md +441 -0
- package/docs/integrations/overview.md +95 -133
- package/docs/integrations/pirsch.md +249 -96
- package/docs/integrations/plausible-analytics.md +241 -100
- package/docs/integrations/posthog.md +353 -214
- package/docs/integrations/promptwatch.md +251 -81
- package/docs/integrations/reddit-pixel.md +226 -173
- package/docs/integrations/rudderstack.md +244 -187
- package/docs/integrations/rybbit-analytics.md +244 -91
- package/docs/integrations/segment.md +238 -92
- package/docs/integrations/snapchat-pixel.md +240 -110
- package/docs/integrations/tiktok-pixel.md +249 -81
- package/docs/integrations/umami-analytics.md +242 -95
- package/docs/integrations/vercel-analytics.md +242 -90
- package/docs/integrations/x-pixel.md +238 -104
- package/docs/integrations/youtube.md +354 -142
- package/docs/upgrade-v3.md +334 -0
- package/iab/styles.css +1 -1
- package/iab/styles.tw3.css +1 -1
- package/package.json +187 -102
- package/readme.json +1 -1
- package/src/iab/styles.css +1 -1
- package/src/iab/styles.tw3.css +1 -1
- package/src/styles.css +1 -1
- package/src/styles.tw3.css +1 -1
- package/styles.css +1 -1
- package/styles.tw3.css +1 -1
- package/client/components/consent-banner.js +0 -4
- package/client/components/consent-dialog-link.js +0 -3
- package/client/components/consent-dialog-trigger.js +0 -3
- package/client/components/consent-dialog.js +0 -4
- package/client/components/consent-widget.js +0 -4
- package/client/components/frame.js +0 -3
- package/client/components/integrations.js +0 -3
- package/dist/components/consent-banner/atoms/overlay.cjs +0 -1
- package/dist/components/consent-banner/atoms/overlay.js +0 -1
- package/dist/components/consent-banner/atoms/root.cjs +0 -1
- package/dist/components/consent-banner/atoms/root.js +0 -1
- package/dist/components/consent-banner/components.cjs +0 -1
- package/dist/components/consent-banner/components.js +0 -1
- package/dist/components/consent-banner/consent-banner.cjs +0 -1
- package/dist/components/consent-banner/consent-banner.js +0 -1
- package/dist/components/consent-banner/error-boundary.cjs +0 -1
- package/dist/components/consent-banner/error-boundary.js +0 -1
- package/dist/components/consent-banner/index.cjs +0 -1
- package/dist/components/consent-banner/index.js +0 -1
- package/dist/components/consent-banner/policy-actions.cjs +0 -1
- package/dist/components/consent-banner/policy-actions.js +0 -1
- package/dist/components/consent-dialog/atoms/card.cjs +0 -1
- package/dist/components/consent-dialog/atoms/card.js +0 -1
- package/dist/components/consent-dialog/atoms/overlay.cjs +0 -1
- package/dist/components/consent-dialog/atoms/overlay.js +0 -1
- package/dist/components/consent-dialog/atoms/root.cjs +0 -1
- package/dist/components/consent-dialog/atoms/root.js +0 -1
- package/dist/components/consent-dialog/consent-dialog.cjs +0 -1
- package/dist/components/consent-dialog/consent-dialog.js +0 -1
- package/dist/components/consent-dialog/index.cjs +0 -1
- package/dist/components/consent-dialog/index.js +0 -1
- package/dist/components/consent-dialog-link/index.cjs +0 -1
- package/dist/components/consent-dialog-trigger/atoms/button.cjs +0 -1
- package/dist/components/consent-dialog-trigger/atoms/button.js +0 -1
- package/dist/components/consent-dialog-trigger/atoms/icon.cjs +0 -1
- package/dist/components/consent-dialog-trigger/atoms/icon.js +0 -1
- package/dist/components/consent-dialog-trigger/atoms/root.cjs +0 -1
- package/dist/components/consent-dialog-trigger/atoms/root.js +0 -1
- package/dist/components/consent-dialog-trigger/atoms/text.cjs +0 -1
- package/dist/components/consent-dialog-trigger/atoms/text.js +0 -1
- package/dist/components/consent-dialog-trigger/atoms/toolbar.cjs +0 -1
- package/dist/components/consent-dialog-trigger/atoms/toolbar.js +0 -1
- package/dist/components/consent-dialog-trigger/consent-dialog-trigger-toolbar.cjs +0 -1
- package/dist/components/consent-dialog-trigger/consent-dialog-trigger-toolbar.js +0 -1
- package/dist/components/consent-dialog-trigger/consent-dialog-trigger.cjs +0 -1
- package/dist/components/consent-dialog-trigger/consent-dialog-trigger.js +0 -1
- package/dist/components/consent-dialog-trigger/index.cjs +0 -1
- package/dist/components/consent-dialog-trigger/index.js +0 -1
- package/dist/components/consent-dialog-trigger/types.cjs +0 -1
- package/dist/components/consent-dialog-trigger/use-draggable.cjs +0 -1
- package/dist/components/consent-dialog-trigger/use-draggable.js +0 -1
- package/dist/components/consent-preferences-link/consent-preferences-link.cjs +0 -1
- package/dist/components/consent-preferences-link/index.cjs +0 -1
- package/dist/components/consent-widget/atoms/accordion.cjs +0 -1
- package/dist/components/consent-widget/atoms/accordion.js +0 -1
- package/dist/components/consent-widget/atoms/button.cjs +0 -1
- package/dist/components/consent-widget/atoms/button.js +0 -1
- package/dist/components/consent-widget/atoms/footer.cjs +0 -1
- package/dist/components/consent-widget/atoms/footer.js +0 -1
- package/dist/components/consent-widget/atoms/root.cjs +0 -1
- package/dist/components/consent-widget/atoms/root.js +0 -1
- package/dist/components/consent-widget/consent-widget.cjs +0 -1
- package/dist/components/consent-widget/consent-widget.js +0 -1
- package/dist/components/consent-widget/index.cjs +0 -1
- package/dist/components/consent-widget/index.js +0 -1
- package/dist/components/consent-widget/policy-actions.cjs +0 -1
- package/dist/components/consent-widget/policy-actions.js +0 -1
- package/dist/components/consent-widget/types.cjs +0 -1
- package/dist/components/frame/atoms.cjs +0 -1
- package/dist/components/frame/frame.cjs +0 -1
- package/dist/components/frame/index.cjs +0 -1
- package/dist/components/frame/types.cjs +0 -1
- package/dist/components/iab-consent-banner/atoms/button-group.cjs +0 -1
- package/dist/components/iab-consent-banner/atoms/button-group.js +0 -1
- package/dist/components/iab-consent-banner/atoms/card.cjs +0 -1
- package/dist/components/iab-consent-banner/atoms/card.js +0 -1
- package/dist/components/iab-consent-banner/atoms/description.cjs +0 -1
- package/dist/components/iab-consent-banner/atoms/description.js +0 -1
- package/dist/components/iab-consent-banner/atoms/footer.cjs +0 -1
- package/dist/components/iab-consent-banner/atoms/footer.js +0 -1
- package/dist/components/iab-consent-banner/atoms/header.cjs +0 -1
- package/dist/components/iab-consent-banner/atoms/header.js +0 -1
- package/dist/components/iab-consent-banner/atoms/overlay.cjs +0 -1
- package/dist/components/iab-consent-banner/atoms/overlay.js +0 -1
- package/dist/components/iab-consent-banner/atoms/root.cjs +0 -1
- package/dist/components/iab-consent-banner/atoms/root.js +0 -1
- package/dist/components/iab-consent-banner/atoms/title.cjs +0 -1
- package/dist/components/iab-consent-banner/atoms/title.js +0 -1
- package/dist/components/iab-consent-banner/iab-consent-banner.cjs +0 -1
- package/dist/components/iab-consent-banner/iab-consent-banner.js +0 -1
- package/dist/components/iab-consent-banner/index.cjs +0 -1
- package/dist/components/iab-consent-banner/index.js +0 -1
- package/dist/components/iab-consent-dialog/atoms/card.cjs +0 -1
- package/dist/components/iab-consent-dialog/atoms/card.js +0 -1
- package/dist/components/iab-consent-dialog/atoms/content.cjs +0 -1
- package/dist/components/iab-consent-dialog/atoms/content.js +0 -1
- package/dist/components/iab-consent-dialog/atoms/footer.cjs +0 -1
- package/dist/components/iab-consent-dialog/atoms/footer.js +0 -1
- package/dist/components/iab-consent-dialog/atoms/header.cjs +0 -1
- package/dist/components/iab-consent-dialog/atoms/header.js +0 -1
- package/dist/components/iab-consent-dialog/atoms/overlay.cjs +0 -1
- package/dist/components/iab-consent-dialog/atoms/overlay.js +0 -1
- package/dist/components/iab-consent-dialog/atoms/purpose-item.cjs +0 -1
- package/dist/components/iab-consent-dialog/atoms/purpose-item.js +0 -1
- package/dist/components/iab-consent-dialog/atoms/root.cjs +0 -1
- package/dist/components/iab-consent-dialog/atoms/root.js +0 -1
- package/dist/components/iab-consent-dialog/atoms/stack-item.cjs +0 -1
- package/dist/components/iab-consent-dialog/atoms/stack-item.js +0 -1
- package/dist/components/iab-consent-dialog/atoms/tabs.cjs +0 -1
- package/dist/components/iab-consent-dialog/atoms/tabs.js +0 -1
- package/dist/components/iab-consent-dialog/atoms/vendor-list.cjs +0 -1
- package/dist/components/iab-consent-dialog/atoms/vendor-list.js +0 -1
- package/dist/components/iab-consent-dialog/hooks/use-gvl-data.cjs +0 -1
- package/dist/components/iab-consent-dialog/hooks/use-gvl-data.js +0 -1
- package/dist/components/iab-consent-dialog/iab-consent-dialog.cjs +0 -1
- package/dist/components/iab-consent-dialog/iab-consent-dialog.js +0 -1
- package/dist/components/iab-consent-dialog/index.cjs +0 -1
- package/dist/components/iab-consent-dialog/index.js +0 -1
- package/dist/components/iab-consent-dialog/types.cjs +0 -1
- package/dist/components/iab-consent-dialog/use-iab-translations.cjs +0 -1
- package/dist/components/iab-consent-dialog/use-iab-translations.js +0 -1
- package/dist/components/integrations/google-map.cjs +0 -1
- package/dist/components/integrations/google-map.js +0 -1
- package/dist/components/integrations/index.cjs +0 -1
- package/dist/components/integrations/index.js +0 -1
- package/dist/components/integrations/shared.cjs +0 -1
- package/dist/components/integrations/shared.js +0 -1
- package/dist/components/integrations/youtube-embed.cjs +0 -1
- package/dist/components/integrations/youtube-embed.js +0 -1
- package/dist/components/shared/libs/polymorphic.cjs +0 -1
- package/dist/components/shared/libs/recursive-clone-children.cjs +0 -1
- package/dist/components/shared/libs/slot.cjs +0 -1
- package/dist/components/shared/libs/use-controllable-state.cjs +0 -1
- package/dist/components/shared/policy-actions.cjs +0 -1
- package/dist/components/shared/primitives/box.cjs +0 -1
- package/dist/components/shared/primitives/button.cjs +0 -1
- package/dist/components/shared/primitives/button.types.cjs +0 -1
- package/dist/components/shared/primitives/legal-links/index.cjs +0 -1
- package/dist/components/shared/ui/accordion/accordion.cjs +0 -1
- package/dist/components/shared/ui/accordion/accordion.types.cjs +0 -1
- package/dist/components/shared/ui/accordion/index.cjs +0 -1
- package/dist/components/shared/ui/animated-collapse/animated-collapse.cjs +0 -1
- package/dist/components/shared/ui/animated-collapse/index.cjs +0 -1
- package/dist/components/shared/ui/branding.cjs +0 -1
- package/dist/components/shared/ui/button/button.cjs +0 -1
- package/dist/components/shared/ui/button/button.types.cjs +0 -1
- package/dist/components/shared/ui/button/index.cjs +0 -1
- package/dist/components/shared/ui/collapsible/collapsible.cjs +0 -1
- package/dist/components/shared/ui/collapsible/index.cjs +0 -1
- package/dist/components/shared/ui/dialog/dialog.cjs +0 -1
- package/dist/components/shared/ui/dialog/index.cjs +0 -1
- package/dist/components/shared/ui/icon.cjs +0 -1
- package/dist/components/shared/ui/logo.cjs +0 -1
- package/dist/components/shared/ui/preference-item/index.cjs +0 -1
- package/dist/components/shared/ui/preference-item/preference-item.cjs +0 -1
- package/dist/components/shared/ui/switch/index.cjs +0 -1
- package/dist/components/shared/ui/switch/switch.cjs +0 -1
- package/dist/components/shared/ui/switch/switch.types.cjs +0 -1
- package/dist/components/shared/ui/tabs/index.cjs +0 -1
- package/dist/components/shared/ui/tabs/tabs.cjs +0 -1
- package/dist/context/consent-manager-context.cjs +0 -1
- package/dist/context/consent-manager-context.js +0 -1
- package/dist/context/consent-tracking-context.cjs +0 -1
- package/dist/context/theme-context.cjs +0 -1
- package/dist/headless.cjs +0 -1
- package/dist/hooks/index.cjs +0 -1
- package/dist/hooks/index.js +0 -1
- package/dist/hooks/use-color-scheme.cjs +0 -1
- package/dist/hooks/use-component-config.cjs +0 -1
- package/dist/hooks/use-consent-dialog-trigger.cjs +0 -1
- package/dist/hooks/use-consent-dialog-trigger.js +0 -1
- package/dist/hooks/use-consent-manager.cjs +0 -1
- package/dist/hooks/use-consent-manager.js +0 -1
- package/dist/hooks/use-consent-script.cjs +0 -1
- package/dist/hooks/use-consent-script.js +0 -1
- package/dist/hooks/use-focus-trap.cjs +0 -1
- package/dist/hooks/use-headless-consent-ui.cjs +0 -1
- package/dist/hooks/use-headless-consent-ui.js +0 -1
- package/dist/hooks/use-headless-iab-consent-ui.cjs +0 -1
- package/dist/hooks/use-reduced-motion.cjs +0 -1
- package/dist/hooks/use-scroll-lock.cjs +0 -1
- package/dist/hooks/use-ssr-status.cjs +0 -1
- package/dist/hooks/use-ssr-status.js +0 -1
- package/dist/hooks/use-styles.cjs +0 -1
- package/dist/hooks/use-styles.js +0 -1
- package/dist/hooks/use-text-direction.cjs +0 -1
- package/dist/hooks/use-theme.cjs +0 -1
- package/dist/hooks/use-translations.cjs +0 -1
- package/dist/hooks/use-translations.js +0 -1
- package/dist/iab.cjs +0 -1
- package/dist/index.cjs +0 -1
- package/dist/primitives/accordion.cjs +0 -1
- package/dist/primitives/button.cjs +0 -1
- package/dist/primitives/collapsible.cjs +0 -1
- package/dist/primitives/dialog.cjs +0 -1
- package/dist/primitives/preference-item.cjs +0 -1
- package/dist/primitives/switch.cjs +0 -1
- package/dist/primitives/tabs.cjs +0 -1
- package/dist/primitives.cjs +0 -1
- package/dist/providers/consent-manager-provider.cjs +0 -1
- package/dist/providers/consent-manager-provider.js +0 -1
- package/dist/server/fetch-ssr-data.cjs +0 -1
- package/dist/server/headers.cjs +0 -1
- package/dist/server/index.cjs +0 -1
- package/dist/server/init-cache-key.cjs +0 -1
- package/dist/server/normalize-url.cjs +0 -1
- package/dist/server/types.cjs +0 -1
- package/dist/types/consent-manager.cjs +0 -1
- package/dist/types/theme/index.cjs +0 -1
- package/dist/types/theme/style-keys.cjs +0 -1
- package/dist/types/theme/style-types.cjs +0 -1
- package/dist/utils/cn.cjs +0 -1
- package/dist/utils/merge-styles.cjs +0 -1
- package/dist/utils/test-helpers.cjs +0 -1
- package/dist/utils/test-helpers.js +0 -1
- package/dist/utils/theme-utils.cjs +0 -1
- package/dist/version.cjs +0 -1
- package/dist-types/components/consent-banner/atoms/root.d.ts +0 -126
- package/dist-types/components/consent-banner/policy-actions.d.ts +0 -11
- package/dist-types/components/consent-widget/policy-actions.d.ts +0 -11
- package/dist-types/components/iab-consent-dialog/hooks/use-gvl-data.d.ts +0 -27
- package/dist-types/components/iab-consent-dialog/types.d.ts +0 -72
- package/dist-types/components/integrations/google-map.d.ts +0 -82
- package/dist-types/components/integrations/index.d.ts +0 -2
- package/dist-types/components/integrations/shared.d.ts +0 -12
- package/dist-types/components/integrations/youtube-embed.d.ts +0 -95
- package/dist-types/context/consent-manager-context.d.ts +0 -31
- package/dist-types/hooks/index.d.ts +0 -12
- package/dist-types/hooks/use-consent-dialog-trigger.d.ts +0 -10
- package/dist-types/hooks/use-consent-manager.d.ts +0 -27
- package/dist-types/hooks/use-consent-script.d.ts +0 -80
- package/dist-types/hooks/use-headless-consent-ui.d.ts +0 -46
- package/dist-types/hooks/use-ssr-status.d.ts +0 -57
- package/dist-types/hooks/use-styles.d.ts +0 -21
- package/dist-types/hooks/use-translations.d.ts +0 -28
- package/dist-types/providers/consent-manager-provider.d.ts +0 -40
- package/dist-types/types/consent-manager.d.ts +0 -39
- package/dist-types/types/theme/style-keys.d.ts +0 -1
- package/dist-types/utils/test-helpers.d.ts +0 -31
- package/docs/frameworks/react/building-headless-components.md +0 -370
- package/docs/frameworks/react/callbacks.md +0 -186
- package/docs/frameworks/react/concepts/client-modes.md +0 -177
- package/docs/frameworks/react/concepts/consent-models.md +0 -113
- package/docs/frameworks/react/concepts/cookie-management.md +0 -122
- package/docs/frameworks/react/concepts/glossary.md +0 -24
- package/docs/frameworks/react/concepts/initialization-flow.md +0 -149
- package/docs/frameworks/react/concepts/policy-packs.md +0 -228
- package/docs/frameworks/react/hooks/use-color-scheme.md +0 -41
- package/docs/frameworks/react/hooks/use-consent-manager/checking-consent.md +0 -96
- package/docs/frameworks/react/hooks/use-consent-manager/location-info.md +0 -97
- package/docs/frameworks/react/hooks/use-consent-manager/setting-consent.md +0 -94
- package/docs/frameworks/react/hooks/use-draggable.md +0 -59
- package/docs/frameworks/react/hooks/use-focus-trap.md +0 -42
- package/docs/frameworks/react/hooks/use-reduced-motion.md +0 -37
- package/docs/frameworks/react/hooks/use-ssr-status.md +0 -32
- package/docs/frameworks/react/hooks/use-text-direction.md +0 -50
- package/docs/frameworks/react/hooks/use-translations.md +0 -55
- package/docs/frameworks/react/iab/consent-banner.md +0 -91
- package/docs/frameworks/react/iab/consent-dialog.md +0 -129
- package/docs/frameworks/react/iab/use-gvl-data.md +0 -21
- package/docs/frameworks/react/iframe-blocking.md +0 -106
- package/docs/frameworks/react/internationalization.md +0 -207
- package/docs/frameworks/react/network-blocker.md +0 -140
- package/docs/frameworks/react/optimization.md +0 -148
- package/docs/frameworks/react/policy-packs.md +0 -242
- package/docs/frameworks/react/server-side.md +0 -158
- package/docs/frameworks/react/styling/classnames.md +0 -94
- package/docs/frameworks/react/styling/color-scheme.md +0 -84
- package/docs/frameworks/react/styling/css-variables.md +0 -53
- package/docs/frameworks/react/styling/slots.md +0 -94
- package/docs/frameworks/react/styling/tailwind.md +0 -119
- package/docs/frameworks/react/styling/tokens.md +0 -156
- package/docs/shared/concepts/client-modes.md +0 -103
- package/docs/shared/concepts/consent-categories.md +0 -41
- package/docs/shared/concepts/consent-models.md +0 -72
- package/docs/shared/concepts/cookie-management.md +0 -88
- package/docs/shared/concepts/glossary.md +0 -24
- package/docs/shared/concepts/initialization-flow.md +0 -105
- package/docs/shared/concepts/policy-packs.md +0 -225
- package/docs/shared/react/components/consent-banner.md +0 -242
- package/docs/shared/react/components/consent-dialog-link.md +0 -45
- package/docs/shared/react/components/consent-dialog-trigger.md +0 -185
- package/docs/shared/react/components/consent-dialog.md +0 -119
- package/docs/shared/react/components/consent-manager-provider.md +0 -225
- package/docs/shared/react/components/consent-widget.md +0 -121
- package/docs/shared/react/components/dev-tools.md +0 -81
- package/docs/shared/react/components/frame.md +0 -52
- package/docs/shared/react/guides/building-headless-components.md +0 -110
- package/docs/shared/react/guides/callbacks.md +0 -89
- package/docs/shared/react/guides/headless.md +0 -31
- package/docs/shared/react/guides/iframe-blocking.md +0 -65
- package/docs/shared/react/guides/internationalization.md +0 -123
- package/docs/shared/react/guides/network-blocker.md +0 -72
- package/docs/shared/react/guides/optimization.md +0 -44
- package/docs/shared/react/guides/policy-packs.md +0 -173
- package/docs/shared/react/guides/script-loader.md +0 -311
- package/docs/shared/react/hooks/use-color-scheme.md +0 -31
- package/docs/shared/react/hooks/use-consent-manager/checking-consent.md +0 -95
- package/docs/shared/react/hooks/use-consent-manager/location-info.md +0 -96
- package/docs/shared/react/hooks/use-consent-manager/overview.md +0 -74
- package/docs/shared/react/hooks/use-consent-manager/setting-consent.md +0 -93
- package/docs/shared/react/hooks/use-draggable.md +0 -30
- package/docs/shared/react/hooks/use-focus-trap.md +0 -20
- package/docs/shared/react/hooks/use-reduced-motion.md +0 -33
- package/docs/shared/react/hooks/use-ssr-status.md +0 -16
- package/docs/shared/react/hooks/use-text-direction.md +0 -38
- package/docs/shared/react/hooks/use-translations.md +0 -15
- package/docs/shared/react/iab/consent-banner.md +0 -60
- package/docs/shared/react/iab/consent-dialog.md +0 -76
- package/docs/shared/react/iab/overview.md +0 -80
- package/docs/shared/react/iab/use-gvl-data.md +0 -21
- package/docs/shared/react/styling/classnames.md +0 -93
- package/docs/shared/react/styling/color-scheme.md +0 -35
- package/docs/shared/react/styling/css-variables.md +0 -53
- package/docs/shared/react/styling/overview.md +0 -261
- package/docs/shared/react/styling/slots.md +0 -93
- package/docs/shared/react/styling/stylesheet-entrypoint.md +0 -8
- package/docs/shared/react/styling/tailwind.md +0 -88
- package/docs/shared/react/styling/tokens.md +0 -155
- package/docs/shared/troubleshooting.md +0 -82
- /package/dist/components/{consent-dialog-trigger → iab-panel}/types.js +0 -0
- /package/dist/components/{consent-widget → panel-trigger}/types.js +0 -0
- /package/dist/components/{iab-consent-dialog → preferences}/types.js +0 -0
- /package/dist/types/{consent-manager.js → manager.js} +0 -0
- /package/dist/types/{theme/style-keys.js → slots.js} +0 -0
- /package/dist-types/components/{consent-dialog-link → panel-link}/index.d.ts +0 -0
- /package/dist-types/components/{consent-widget → preferences}/atoms/button.d.ts +0 -0
- /package/dist-types/components/{consent-widget/consent-widget.d.ts → preferences/preferences.d.ts} +0 -0
- /package/dist-types/components/{consent-widget → preferences}/types.d.ts +0 -0
|
@@ -1,302 +1,217 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: Styling
|
|
3
|
-
description:
|
|
4
|
-
|
|
2
|
+
title: Styling
|
|
3
|
+
description: Import the React stylesheet and theme c15t components with tokens,
|
|
4
|
+
slots, and class names on ConsentProvider.
|
|
5
5
|
group: frameworks
|
|
6
6
|
---
|
|
7
|
-
c15t's theming system gives you multiple levels of control, but most customization should stay inside the pre-built components.
|
|
8
7
|
|
|
9
|
-
|
|
8
|
+
## Stylesheet
|
|
10
9
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
3. **Slots** — targeted styling for specific parts such as the banner card, footer, or title
|
|
14
|
-
4. **CSS variables or className-level overrides** — when you need to integrate with external CSS systems
|
|
15
|
-
5. **Compound components** — when you must rearrange markup while still using c15t primitives
|
|
16
|
-
6. **`noStyle`** — when you want c15t structure but you need to own all visual styling
|
|
17
|
-
7. **Headless** — when you want fully custom markup and behavior
|
|
18
|
-
|
|
19
|
-
Keep styling and escalation as separate decisions:
|
|
20
|
-
|
|
21
|
-
* If you are still using the stock banner, dialog, or widget, stay with props, tokens, and slots.
|
|
22
|
-
* Escalate to compound components, `noStyle`, or headless only when the structure or behavior itself must change.
|
|
23
|
-
|
|
24
|
-
## Styling Approaches
|
|
25
|
-
|
|
26
|
-
|Approach|Control|Use When|
|
|
27
|
-
|--|--|--|
|
|
28
|
-
|**Component and provider APIs**|High|Reordering actions, changing button emphasis, configuring links, hiding branding, changing copy via `i18n`|
|
|
29
|
-
|**Tokens**|High|Changing global colors, typography, spacing, radius, shadows, or motion|
|
|
30
|
-
|**Slots**|Medium|Targeting specific component parts (for example `consentBannerFooter` or `consentDialogCard`)|
|
|
31
|
-
|**CSS variables / className**|Medium|Integrating with an existing stylesheet or utility classes after tokens and slots|
|
|
32
|
-
|**Compound components**|Structure|Rearranging existing c15t primitives without going fully custom|
|
|
33
|
-
|**noStyle**|Full visuals|Keeping c15t structure but replacing all visual defaults|
|
|
34
|
-
|**Headless**|Full|Replacing both markup and behavior|
|
|
35
|
-
|
|
36
|
-
## Quick Start
|
|
37
|
-
|
|
38
|
-
Use the `Theme` type for TypeScript autocomplete and validation:
|
|
10
|
+
Import the stylesheet once, next to your global CSS, in the entry module that
|
|
11
|
+
renders `ConsentProvider`:
|
|
39
12
|
|
|
40
13
|
```tsx
|
|
41
|
-
import
|
|
42
|
-
import { type Theme, ConsentManagerProvider } from '@c15t/react';
|
|
43
|
-
|
|
44
|
-
const theme = {
|
|
45
|
-
colors: {
|
|
46
|
-
primary: '#6366f1',
|
|
47
|
-
primaryHover: '#4f46e5',
|
|
48
|
-
surface: '#ffffff',
|
|
49
|
-
text: '#1f2937',
|
|
50
|
-
textMuted: '#6b7280',
|
|
51
|
-
},
|
|
52
|
-
radius: {
|
|
53
|
-
md: '0.75rem',
|
|
54
|
-
lg: '1rem',
|
|
55
|
-
},
|
|
56
|
-
spacing: {
|
|
57
|
-
md: '1.25rem',
|
|
58
|
-
},
|
|
59
|
-
} satisfies Theme;
|
|
60
|
-
|
|
61
|
-
export function ConsentManager({ children }: { children: ReactNode }) {
|
|
62
|
-
return (
|
|
63
|
-
<ConsentManagerProvider
|
|
64
|
-
options={{
|
|
65
|
-
mode: 'hosted',
|
|
66
|
-
backendURL: 'https://your-instance.c15t.dev',
|
|
67
|
-
theme,
|
|
68
|
-
}}
|
|
69
|
-
>
|
|
70
|
-
{children}
|
|
71
|
-
</ConsentManagerProvider>
|
|
72
|
-
);
|
|
73
|
-
}
|
|
14
|
+
import 'c15t/react/styles.css';
|
|
74
15
|
```
|
|
75
16
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
* `theme.consentActions` for stock banner and dialog button treatment
|
|
88
|
-
* `i18n` on `ConsentManagerProvider` for copy changes
|
|
89
|
-
|
|
90
|
-
```tsx
|
|
91
|
-
<ConsentBanner layout={['customize', ['reject', 'accept']]} primaryButton="accept" />
|
|
17
|
+
Every rule lives in `@layer components`, so unlayered utilities from Tailwind
|
|
18
|
+
v4 and atomic classes from StyleX override it without specificity tricks.
|
|
19
|
+
Tailwind v3 treats `@layer components` as its own directive, so import the
|
|
20
|
+
Tailwind 3 build from your Tailwind entry instead, between the `components`
|
|
21
|
+
and `utilities` directives:
|
|
22
|
+
|
|
23
|
+
```css
|
|
24
|
+
@tailwind base;
|
|
25
|
+
@tailwind components;
|
|
26
|
+
@import 'c15t/react/styles.tw3.css';
|
|
27
|
+
@tailwind utilities;
|
|
92
28
|
```
|
|
93
29
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
Set global values for colors, typography, spacing, radius, shadows, and motion:
|
|
97
|
-
|
|
98
|
-
```tsx
|
|
99
|
-
options={{ theme: { colors: { primary: '#6366f1' } } }}
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
Use tokens first when the change is semantic:
|
|
103
|
-
|
|
104
|
-
* Banner card background -> `theme.colors.surface`
|
|
105
|
-
* Banner footer background -> `theme.colors.surfaceHover`
|
|
106
|
-
* Shared copy color -> `theme.colors.text` and `theme.colors.textMuted`
|
|
107
|
-
* Primary-filled surfaces such as stock branding tags and filled actions -> `theme.colors.primary` with `theme.colors.textOnPrimary` as the matching foreground override
|
|
30
|
+
## Tokens
|
|
108
31
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
colors: {
|
|
113
|
-
surface: '#ffffff',
|
|
114
|
-
surfaceHover: '#f6f3ee',
|
|
115
|
-
},
|
|
116
|
-
},
|
|
117
|
-
}}
|
|
118
|
-
```
|
|
32
|
+
The provider snippets below are partial configuration examples. Apply them to
|
|
33
|
+
your existing `ConsentProvider` from `c15t/react`, keeping its `mode`, children
|
|
34
|
+
and other options.
|
|
119
35
|
|
|
120
|
-
|
|
36
|
+
Colors, radii, shadows, typography, and motion come from `--c15t-*` custom
|
|
37
|
+
properties. Set them on the provider through `theme`, or override the
|
|
38
|
+
variables directly in your CSS.
|
|
121
39
|
|
|
122
|
-
|
|
40
|
+
React and Next.js render the theme stylesheet in the server HTML before
|
|
41
|
+
the banner. Pass the same theme on the server and the first client render
|
|
42
|
+
so your custom tokens apply before hydration. The provider's `nonce`
|
|
43
|
+
option also applies to this stylesheet for Content Security Policy.
|
|
123
44
|
|
|
124
|
-
|
|
45
|
+
`colorScheme: 'dark'` applies dark tokens in the server HTML.
|
|
46
|
+
`colorScheme: 'system'` uses a CSS media query to follow the visitor's
|
|
47
|
+
preference before hydration. If your app manages dark mode through a
|
|
48
|
+
root class instead, include that class in the server HTML too.
|
|
125
49
|
|
|
126
50
|
```tsx
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
}
|
|
51
|
+
import { ConsentProvider, defineTheme } from 'c15t/react';
|
|
52
|
+
|
|
53
|
+
const theme = defineTheme({
|
|
54
|
+
colors: { primary: '#2f6f4e' },
|
|
55
|
+
radius: { lg: '4px' },
|
|
56
|
+
consentActions: {
|
|
57
|
+
primary: { variant: 'primary', mode: 'filled' },
|
|
58
|
+
dismiss: { variant: 'neutral', mode: 'stroke' },
|
|
59
|
+
},
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
<ConsentProvider options={{ mode, theme }} />;
|
|
136
63
|
```
|
|
137
64
|
|
|
138
|
-
|
|
65
|
+
`consentActions` decides how each action role looks: `default` applies to
|
|
66
|
+
every button, `primary` to whichever actions the policy or your props mark
|
|
67
|
+
primary, and `accept`, `reject`, `customize`, and `dismiss` to one role each.
|
|
68
|
+
Per-action keys win over `primary`, which wins over `default`.
|
|
139
69
|
|
|
140
|
-
|
|
70
|
+
Banner sizing has its own variables. Override them in CSS when a variant
|
|
71
|
+
needs a different footprint:
|
|
141
72
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
options={{
|
|
148
|
-
theme: {
|
|
149
|
-
slots: {
|
|
150
|
-
consentBannerFooter: 'bg-[var(--banner-footer)]',
|
|
151
|
-
},
|
|
152
|
-
},
|
|
153
|
-
}}
|
|
154
|
-
```
|
|
73
|
+
| Variable | Default | Applies to |
|
|
74
|
+
| ----------------------------------- | ------- | ---------------- |
|
|
75
|
+
| `--consent-banner-max-width` | `440px` | `floating` cards |
|
|
76
|
+
| `--consent-banner-widget-max-width` | `20rem` | `widget` chips |
|
|
77
|
+
| `--consent-banner-wall-max-width` | `30rem` | `wall` cards |
|
|
155
78
|
|
|
156
|
-
##
|
|
79
|
+
## Colors by consent model
|
|
157
80
|
|
|
158
|
-
|
|
81
|
+
The primary action can change while the brand color stays the same. Set
|
|
82
|
+
`consentActions.primary` once, then select `primaryButton` per policy as
|
|
83
|
+
shown in [ConsentBanner](../components/consent-banner.md#per-policy-buttons).
|
|
159
84
|
|
|
160
|
-
|
|
85
|
+
To give opt-in and opt-out banners different colors, scope the tokens to
|
|
86
|
+
the root's attributes. Include hover and foreground colors when overriding
|
|
87
|
+
CSS tokens directly:
|
|
161
88
|
|
|
162
|
-
|
|
89
|
+
```css
|
|
90
|
+
[data-prompt][data-model='opt-in'] {
|
|
91
|
+
--c15t-primary: #2f6f4e;
|
|
92
|
+
--c15t-primary-hover: #24563c;
|
|
93
|
+
--c15t-text-on-primary: #fff;
|
|
94
|
+
}
|
|
163
95
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
<ConsentBanner.Description />
|
|
170
|
-
</ConsentBanner.Header>
|
|
171
|
-
<ConsentBanner.Footer>
|
|
172
|
-
<ConsentBanner.CustomizeButton />
|
|
173
|
-
<ConsentBanner.FooterSubGroup>
|
|
174
|
-
<ConsentBanner.RejectButton />
|
|
175
|
-
<ConsentBanner.AcceptButton />
|
|
176
|
-
</ConsentBanner.FooterSubGroup>
|
|
177
|
-
</ConsentBanner.Footer>
|
|
178
|
-
</ConsentBanner.Card>
|
|
179
|
-
</ConsentBanner.Root>
|
|
96
|
+
[data-prompt][data-model='opt-out'] {
|
|
97
|
+
--c15t-primary: #6b3fa0;
|
|
98
|
+
--c15t-primary-hover: #55327f;
|
|
99
|
+
--c15t-text-on-primary: #fff;
|
|
100
|
+
}
|
|
180
101
|
```
|
|
181
102
|
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
Use `noStyle` only when the c15t structure is still correct but you want to replace all visual defaults:
|
|
103
|
+
These colors apply to the action marked primary. Button layout and color
|
|
104
|
+
changes do not change the policy or expire a saved choice.
|
|
185
105
|
|
|
186
|
-
|
|
187
|
-
<ConsentBanner noStyle />
|
|
188
|
-
```
|
|
106
|
+
## Slots
|
|
189
107
|
|
|
190
|
-
|
|
108
|
+
Each component part is a slot. A slot accepts any attributes the element
|
|
109
|
+
takes, so the contract is the same whether you write class strings or pass an
|
|
110
|
+
object with `className` and `style`. Set slots on the provider under
|
|
111
|
+
`components`, keyed by component and part.
|
|
191
112
|
|
|
192
|
-
|
|
113
|
+
For a full-width notice, use the supported `bar` variant. Inside your existing
|
|
114
|
+
provider, replace the stock banner with:
|
|
193
115
|
|
|
194
|
-
|
|
116
|
+
```tsx title="src/regional-banner.tsx"
|
|
117
|
+
import { ConsentBanner, usePolicyRule } from 'c15t/react';
|
|
195
118
|
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
theme: {
|
|
201
|
-
colors: {
|
|
202
|
-
surfaceHover: '#f6f3ee',
|
|
203
|
-
},
|
|
204
|
-
},
|
|
205
|
-
}}
|
|
119
|
+
export function RegionalBanner() {
|
|
120
|
+
const policy = usePolicyRule();
|
|
121
|
+
return <ConsentBanner variant={policy?.prompt === 'notice' ? 'bar' : 'floating'} />;
|
|
122
|
+
}
|
|
206
123
|
```
|
|
207
124
|
|
|
208
|
-
|
|
125
|
+
To remove the notice card's radius, add these values to the existing
|
|
126
|
+
`options.components.banner` slots. The root owns `data-prompt`, so the card
|
|
127
|
+
uses Tailwind's `group` selector to read it:
|
|
209
128
|
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
surface: '#fffdf8',
|
|
217
|
-
},
|
|
129
|
+
```ts
|
|
130
|
+
const bannerSlots = {
|
|
131
|
+
root: { className: 'group' },
|
|
132
|
+
card: { className: 'group-data-[prompt=notice]:rounded-none' },
|
|
133
|
+
rightLink: {
|
|
134
|
+
className: 'underline-offset-4 data-[right=opt-out]:text-red-700',
|
|
218
135
|
},
|
|
219
|
-
}
|
|
220
|
-
```
|
|
136
|
+
};
|
|
221
137
|
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
### Tweak the banner card, footer, or title styling without changing markup
|
|
225
|
-
|
|
226
|
-
```tsx
|
|
227
|
-
options={{
|
|
228
|
-
theme: {
|
|
229
|
-
slots: {
|
|
230
|
-
consentBannerCard: 'rounded-[28px] shadow-xl',
|
|
231
|
-
consentBannerFooter: 'border-t border-black/10 px-6',
|
|
232
|
-
consentBannerTitle: 'text-xl tracking-tight',
|
|
233
|
-
},
|
|
234
|
-
},
|
|
235
|
-
}}
|
|
138
|
+
// In the existing options.components object:
|
|
139
|
+
// banner: bannerSlots
|
|
236
140
|
```
|
|
237
141
|
|
|
238
|
-
|
|
142
|
+
The root also carries `data-variant`, so you can restyle one shape without
|
|
143
|
+
touching the others. Tailwind, giving a `bar` a brand-colored top edge and
|
|
144
|
+
tighter text:
|
|
239
145
|
|
|
240
146
|
```tsx
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
147
|
+
<ConsentProvider
|
|
148
|
+
options={{
|
|
149
|
+
mode,
|
|
150
|
+
presentation: { prompt: { variant: 'bar' } },
|
|
151
|
+
components: {
|
|
152
|
+
banner: {
|
|
153
|
+
root: { className: 'group' },
|
|
154
|
+
card: {
|
|
155
|
+
className:
|
|
156
|
+
'group-data-[variant=bar]:border-t-4 group-data-[variant=bar]:border-t-emerald-600',
|
|
157
|
+
},
|
|
158
|
+
},
|
|
159
|
+
description: {
|
|
160
|
+
banner: { className: 'group-data-[variant=bar]:text-xs' },
|
|
161
|
+
},
|
|
162
|
+
},
|
|
163
|
+
}}
|
|
164
|
+
/>
|
|
250
165
|
```
|
|
251
166
|
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
### Change banner copy without replacing the component
|
|
255
|
-
|
|
256
|
-
```tsx
|
|
257
|
-
options={{
|
|
258
|
-
i18n: {
|
|
259
|
-
locale: 'en',
|
|
260
|
-
messages: {
|
|
261
|
-
en: {
|
|
262
|
-
cookieBanner: {
|
|
263
|
-
title: 'We value your privacy',
|
|
264
|
-
description: 'We use cookies to improve the site and measure performance.',
|
|
265
|
-
},
|
|
266
|
-
common: {
|
|
267
|
-
acceptAll: 'Accept all',
|
|
268
|
-
rejectAll: 'Reject all',
|
|
269
|
-
customize: 'Manage preferences',
|
|
270
|
-
},
|
|
271
|
-
},
|
|
272
|
-
},
|
|
273
|
-
},
|
|
274
|
-
}}
|
|
275
|
-
```
|
|
167
|
+
`data-variant` sits on the root, so child slots use Tailwind's `group`
|
|
168
|
+
prefix to read it.
|
|
276
169
|
|
|
277
|
-
|
|
170
|
+
StyleX, spreading the result of `stylex.props()` into a slot:
|
|
278
171
|
|
|
279
172
|
```tsx
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
173
|
+
import * as stylex from '@stylexjs/stylex';
|
|
174
|
+
|
|
175
|
+
const styles = stylex.create({
|
|
176
|
+
card: { borderRadius: 0, boxShadow: 'none' },
|
|
177
|
+
rightLink: { textUnderlineOffset: 4, color: 'rgb(185 28 28)' },
|
|
178
|
+
});
|
|
179
|
+
|
|
180
|
+
<ConsentProvider
|
|
181
|
+
options={{
|
|
182
|
+
mode,
|
|
183
|
+
components: {
|
|
184
|
+
banner: {
|
|
185
|
+
card: stylex.props(styles.card),
|
|
186
|
+
rightLink: stylex.props(styles.rightLink),
|
|
187
|
+
},
|
|
188
|
+
},
|
|
189
|
+
}}
|
|
190
|
+
/>;
|
|
287
191
|
```
|
|
288
192
|
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
|
298
|
-
|
|
299
|
-
|
|
|
300
|
-
|
|
|
301
|
-
|
|
302
|
-
|
|
193
|
+
Set `noStyle` on a component to drop the built-in classes from every part and
|
|
194
|
+
keep only what your slots pass. Set `noStyle` in the provider options to do it
|
|
195
|
+
for every component.
|
|
196
|
+
|
|
197
|
+
Banner slot keys under `components.banner`:
|
|
198
|
+
|
|
199
|
+
| Key | Element |
|
|
200
|
+
| ------------- | ----------------------------------------------------------------------------------------------------------------- |
|
|
201
|
+
| `root` | Fixed-position wrapper carrying `data-prompt`, `data-model`, `data-variant`, `data-position`, and `data-blocking` |
|
|
202
|
+
| `cardShell` | Sizes the card and holds the branding tag |
|
|
203
|
+
| `card` | The visible card, carrying `data-state` |
|
|
204
|
+
| `header` | Title and description container |
|
|
205
|
+
| `title` | Heading |
|
|
206
|
+
| `footer` | Action area |
|
|
207
|
+
| `actions` | Group of action groups |
|
|
208
|
+
| `actionGroup` | One group of equally prominent actions |
|
|
209
|
+
| `rights` | Group of right links, rendered before the actions |
|
|
210
|
+
| `rightLink` | One right link, carrying `data-action="right"` and `data-right` |
|
|
211
|
+
| `overlay` | Backdrop shown when the banner blocks the page |
|
|
212
|
+
|
|
213
|
+
Action buttons carry `data-action` and `data-variant`, and right links carry
|
|
214
|
+
`data-action="right"`, so a single rule such as `[data-action='dismiss']` or
|
|
215
|
+
`[data-action='right']` styles one role across every surface. Right links are
|
|
216
|
+
underlined text by default, so the only button on a notice is the primary
|
|
217
|
+
action.
|
|
@@ -1,139 +1,67 @@
|
|
|
1
1
|
---
|
|
2
|
-
title:
|
|
3
|
-
description:
|
|
4
|
-
missing banners, consent persistence, and more.
|
|
2
|
+
title: Troubleshoot React consent
|
|
3
|
+
description: Diagnose policy resolution, early scripts, storage and rendering problems.
|
|
5
4
|
group: frameworks
|
|
6
5
|
---
|
|
7
|
-
## "Provider not found" Error
|
|
8
6
|
|
|
9
|
-
|
|
7
|
+
## Why is there no banner?
|
|
10
8
|
|
|
11
|
-
|
|
9
|
+
Inspect `resolution` and `promptRequirement` before changing styles. Pending or
|
|
10
|
+
failed initialization, no matching rule, a valid stored choice and a rule that
|
|
11
|
+
requires no prompt can all produce no banner for different reasons. A missing
|
|
12
|
+
stylesheet can also make rendered controls appear incorrectly.
|
|
12
13
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
const { consents } = useConsentManager(); // throws
|
|
17
|
-
return <ConsentManagerProvider options={...}>...</ConsentManagerProvider>;
|
|
18
|
-
}
|
|
14
|
+
Check the backend URL and Network response, then confirm the active policy for
|
|
15
|
+
the visitor's location. Do not solve missing UI by granting every category or
|
|
16
|
+
setting `enabled: false`: disabling the runtime permits optional loading.
|
|
19
17
|
|
|
20
|
-
|
|
21
|
-
function App() {
|
|
22
|
-
return (
|
|
23
|
-
<ConsentManagerProvider options={...}>
|
|
24
|
-
<MyComponent /> {/* useConsentManager works here */}
|
|
25
|
-
</ConsentManagerProvider>
|
|
26
|
-
);
|
|
27
|
-
}
|
|
28
|
-
```
|
|
18
|
+
## Why does the UI disappear with a content blocker?
|
|
29
19
|
|
|
30
|
-
|
|
20
|
+
Check the browser Network panel for `ERR_BLOCKED_BY_CLIENT` or a failed dynamic
|
|
21
|
+
import. Older c15t builds used component filenames such as
|
|
22
|
+
`consent-dialog-*.js`, which some cookie-annoyance lists block. Update the c15t
|
|
23
|
+
packages and rebuild the app. Current component modules use neutral filenames;
|
|
24
|
+
public component imports stay the same. This also covers Vite development
|
|
25
|
+
requests used by TanStack Start and other Vite integrations.
|
|
31
26
|
|
|
32
|
-
|
|
27
|
+
Extensions can separately hide elements with cosmetic filters or block a
|
|
28
|
+
configured backend URL. Check the failed request or hidden element to distinguish
|
|
29
|
+
those cases from a missing component module.
|
|
33
30
|
|
|
34
|
-
|
|
31
|
+
## Why does analytics run before a choice?
|
|
35
32
|
|
|
36
|
-
|
|
33
|
+
Check effective permission under the selected policy, then find every loader
|
|
34
|
+
for that vendor. Remove unconditional script tags, framework analytics plugins
|
|
35
|
+
and duplicate tag-manager entries. c15t's script registration only controls the
|
|
36
|
+
scripts registered with it.
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
Google helpers intentionally load with Consent Mode defaults. A Google request
|
|
39
|
+
is not by itself proof that its storage consent was granted. If your requirement
|
|
40
|
+
is no request at all, do not use an always-loaded helper unchanged.
|
|
39
41
|
|
|
40
|
-
|
|
42
|
+
## Why does a choice disappear on reload?
|
|
41
43
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
```
|
|
44
|
+
Check whether persistence is disabled, browser storage is blocked, the origin
|
|
45
|
+
changed, or the receipt expired or no longer matches the current policy.
|
|
46
|
+
A development example with `persistence: false` deliberately resets on reload.
|
|
47
|
+
Do not "repair" persistence by saving permissions automatically on mount.
|
|
47
48
|
|
|
48
|
-
##
|
|
49
|
+
## Why does hydration differ from server HTML?
|
|
49
50
|
|
|
50
|
-
|
|
51
|
+
Use the adapter's request helper and pass the returned configuration unchanged
|
|
52
|
+
to its boundary. Check that server and browser use the same backend and policy
|
|
53
|
+
inputs. A module-level mutable runtime on a server can share one visitor's state
|
|
54
|
+
with another request; create request-owned state instead.
|
|
51
55
|
|
|
52
|
-
|
|
56
|
+
## Why does static hosting fail when development works?
|
|
53
57
|
|
|
54
|
-
|
|
58
|
+
A static host has no app server for init routes, proxies or server functions.
|
|
59
|
+
Use absolute external consent URLs or an explicitly local policy. Test the
|
|
60
|
+
production output with a static file server, not the framework dev server.
|
|
55
61
|
|
|
56
|
-
|
|
62
|
+
## Why does customization do nothing?
|
|
57
63
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
## Scripts Not Loading
|
|
63
|
-
|
|
64
|
-
**Symptom:** Third-party scripts configured in the `scripts` option don't load after consent is granted.
|
|
65
|
-
|
|
66
|
-
**Checklist:**
|
|
67
|
-
|
|
68
|
-
1. **Wrong category name** — The `category` on the script must match one of the `consentCategories` names. For example, `'measurement'` not `'analytics'`.
|
|
69
|
-
|
|
70
|
-
2. **Consent condition not met** — Use `has('measurement')` to verify the category is actually consented.
|
|
71
|
-
|
|
72
|
-
3. **Script error** — Check the browser DevTools Console for script loading errors. The `onError` callback can help debug:
|
|
73
|
-
|
|
74
|
-
```tsx
|
|
75
|
-
{
|
|
76
|
-
id: 'analytics',
|
|
77
|
-
src: 'https://...',
|
|
78
|
-
category: 'measurement',
|
|
79
|
-
onError: ({ error }) => console.error('Script failed:', error),
|
|
80
|
-
}
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
4. **Ad blocker** — Browser extensions may block the script regardless of consent. The `anonymizeId` option (default: `true`) helps avoid pattern-based blocking.
|
|
84
|
-
|
|
85
|
-
## SSR Hydration Mismatch
|
|
86
|
-
|
|
87
|
-
**Symptom:** React hydration warnings, consent banner flashes briefly, or consent state differs between server and client.
|
|
88
|
-
|
|
89
|
-
**Fixes:**
|
|
90
|
-
|
|
91
|
-
1. **Missing `ssrData`** — Ensure you're passing the SSR data Promise to the provider:
|
|
92
|
-
|
|
93
|
-
```tsx
|
|
94
|
-
<ConsentManagerProvider
|
|
95
|
-
options={{
|
|
96
|
-
mode: 'hosted',
|
|
97
|
-
backendURL: '...',
|
|
98
|
-
ssrData: fetchSSRData({ backendURL: '...', headers }),
|
|
99
|
-
}}
|
|
100
|
-
>
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
2. **Stale cache** — If using a CDN or caching layer, ensure the SSR data is fresh per-request and not shared across users.
|
|
104
|
-
|
|
105
|
-
3. **Debug with `useSSRStatus`** — Check if SSR data was actually consumed:
|
|
106
|
-
|
|
107
|
-
```tsx
|
|
108
|
-
const { ssrDataUsed, ssrSkippedReason } = useSSRStatus();
|
|
109
|
-
```
|
|
110
|
-
|
|
111
|
-
See [Server-Side Utilities](/docs/frameworks/react/server-side) for full SSR setup.
|
|
112
|
-
|
|
113
|
-
## TypeScript Errors
|
|
114
|
-
|
|
115
|
-
**Common import issues:**
|
|
116
|
-
|
|
117
|
-
```tsx
|
|
118
|
-
// Components and hooks — main entry point
|
|
119
|
-
import { ConsentManagerProvider, useConsentManager } from '@c15t/react';
|
|
120
|
-
|
|
121
|
-
// Server utilities — separate entry point
|
|
122
|
-
import { fetchSSRData } from '@c15t/react/server';
|
|
123
|
-
|
|
124
|
-
// Headless (hooks only, no components)
|
|
125
|
-
import { useConsentManager } from '@c15t/react/headless';
|
|
126
|
-
```
|
|
127
|
-
|
|
128
|
-
If you see type errors after updating, try:
|
|
129
|
-
|
|
130
|
-
```sh
|
|
131
|
-
rm -rf node_modules/.cache
|
|
132
|
-
bun install
|
|
133
|
-
```
|
|
134
|
-
|
|
135
|
-
## Still Stuck?
|
|
136
|
-
|
|
137
|
-
* Enable `debug: true` in provider options for verbose console logging
|
|
138
|
-
* Use the [DevTools](/docs/frameworks/react/components/dev-tools) panel to inspect live consent state
|
|
139
|
-
* Check the [GitHub issues](https://github.com/c15t/c15t/issues) for known bugs
|
|
64
|
+
Check the imported stylesheet, the correct token or slot, and which element
|
|
65
|
+
carries the state attribute. `data-variant` on a banner root is not a matching
|
|
66
|
+
attribute on its child card. Check cascade layers and the Tailwind version
|
|
67
|
+
before adding specificity. See [customization](../../customization/overview.md).
|