@c15t/react 2.2.0 → 3.0.0-alpha.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/AGENTS.md +88 -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 +133 -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 +173 -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 +144 -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 +88 -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 +41 -249
- 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 +35 -535
- package/docs/frameworks/react/styling/overview.md +160 -255
- 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/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
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { HeadlessConsentDialogAction } from '../../component-hooks/use-headless-consent-ui';
|
|
3
|
+
import type { PolicyActionRenderProps } from '../shared/policy-actions';
|
|
4
|
+
export type ConsentWidgetPolicyActionRenderProps = PolicyActionRenderProps<HeadlessConsentDialogAction>;
|
|
5
|
+
export interface ConsentWidgetPolicyActionsProps {
|
|
6
|
+
renderAction?: (action: HeadlessConsentDialogAction, props: ConsentWidgetPolicyActionRenderProps) => ReactNode;
|
|
7
|
+
}
|
|
8
|
+
export declare const ConsentWidgetPolicyActions: ({ renderAction, }: ConsentWidgetPolicyActionsProps) => import("react").JSX.Element;
|
|
9
|
+
declare const PolicyActions: typeof ConsentWidgetPolicyActions;
|
|
10
|
+
export { PolicyActions };
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import type * as C15tCoreTypes from '@c15t/core';
|
|
2
|
+
import type { PromptPosition, PromptVariant } from '@c15t/core';
|
|
3
|
+
import type { FC, HTMLAttributes, ReactNode } from 'react';
|
|
4
|
+
/**
|
|
5
|
+
* Props for the root component of the ConsentBanner.
|
|
6
|
+
*
|
|
7
|
+
* @remarks
|
|
8
|
+
* The root component serves as the top-level container and context provider
|
|
9
|
+
* for the consent banner. It manages the consent state and styling configuration
|
|
10
|
+
* for all child components.
|
|
11
|
+
*
|
|
12
|
+
* @public
|
|
13
|
+
*/
|
|
14
|
+
interface ConsentBannerRootProps extends HTMLAttributes<HTMLDivElement> {
|
|
15
|
+
/**
|
|
16
|
+
* @remarks
|
|
17
|
+
* React elements to be rendered within the consent banner.
|
|
18
|
+
* Typically includes Content, Title, Description, and Actions components.
|
|
19
|
+
*/
|
|
20
|
+
children: ReactNode;
|
|
21
|
+
/**
|
|
22
|
+
* @remarks
|
|
23
|
+
* When true, removes all default styling from the banner and its children.
|
|
24
|
+
* Useful when implementing completely custom styles.
|
|
25
|
+
*/
|
|
26
|
+
noStyle?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* @remarks
|
|
29
|
+
* When true, disables the entrance/exit animations.
|
|
30
|
+
* Useful for environments where animations are not desired.
|
|
31
|
+
*/
|
|
32
|
+
disableAnimation?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* @remarks
|
|
35
|
+
* When true, the consent banner will lock the scroll of the page.
|
|
36
|
+
* Useful for implementing a consent banner that locks the scroll of the page.
|
|
37
|
+
* @default false
|
|
38
|
+
*/
|
|
39
|
+
scrollLock?: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* @remarks
|
|
42
|
+
* When true, the consent banner will trap focus.
|
|
43
|
+
* Useful for implementing a consent banner that traps focus.
|
|
44
|
+
* @default true
|
|
45
|
+
*/
|
|
46
|
+
trapFocus?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Which consent models this banner responds to.
|
|
49
|
+
* @default ['opt-in', 'opt-out']
|
|
50
|
+
*/
|
|
51
|
+
models?: C15tCoreTypes.Model[];
|
|
52
|
+
/**
|
|
53
|
+
* Override the UI source identifier sent with consent API calls.
|
|
54
|
+
* @default 'banner'
|
|
55
|
+
*/
|
|
56
|
+
uiSource?: string;
|
|
57
|
+
/**
|
|
58
|
+
* Shape of the prompt. Overrides `presentation.prompt.variant`.
|
|
59
|
+
* @remarks A notice defaults to `bar`; a choice prompt defaults to `floating`.
|
|
60
|
+
*/
|
|
61
|
+
variant?: PromptVariant;
|
|
62
|
+
/**
|
|
63
|
+
* Placement of the prompt. Overrides `presentation.prompt.position`.
|
|
64
|
+
* @remarks Must be valid for the resolved variant; otherwise the variant
|
|
65
|
+
* default is used and a development diagnostic is logged. Host-chosen
|
|
66
|
+
* positions are never mirrored for right-to-left text.
|
|
67
|
+
*/
|
|
68
|
+
position?: PromptPosition;
|
|
69
|
+
/**
|
|
70
|
+
* Backdrop, scroll lock, focus trap and no outside dismissal, as one value.
|
|
71
|
+
* Overrides `presentation.prompt.blocking`.
|
|
72
|
+
* @remarks `wall` is always blocking; a notice never is.
|
|
73
|
+
*/
|
|
74
|
+
blocking?: boolean;
|
|
75
|
+
}
|
|
76
|
+
declare const ConsentBannerRoot: FC<ConsentBannerRootProps>;
|
|
77
|
+
declare const Root: FC<ConsentBannerRootProps>;
|
|
78
|
+
export { ConsentBannerRoot, Root };
|
|
@@ -3,9 +3,13 @@
|
|
|
3
3
|
* Provides the core components for building consent banners.
|
|
4
4
|
* Implements accessible, customizable components following GDPR requirements.
|
|
5
5
|
*/
|
|
6
|
-
import {
|
|
6
|
+
import type { PolicyRight } from '@c15t/schema/types';
|
|
7
|
+
import type { ButtonHTMLAttributes, ReactNode } from 'react';
|
|
8
|
+
import type { BoxProps } from '../shared/primitives/box';
|
|
7
9
|
import type { ConsentButtonProps } from '../shared/primitives/button.types';
|
|
8
10
|
import type { InlineLegalLinksProps } from '../shared/primitives/legal-links';
|
|
11
|
+
/** Rights the banner can expose as links. `disclosure` is carried by legal links. */
|
|
12
|
+
export type ConsentBannerRight = Exclude<PolicyRight, 'disclosure'>;
|
|
9
13
|
/**
|
|
10
14
|
* Title component for the consent banner.
|
|
11
15
|
*
|
|
@@ -20,7 +24,7 @@ import type { InlineLegalLinksProps } from '../shared/primitives/legal-links';
|
|
|
20
24
|
* </ConsentBannerTitle>
|
|
21
25
|
* ```
|
|
22
26
|
*/
|
|
23
|
-
declare const ConsentBannerTitle: import("react").ForwardRefExoticComponent<Omit<BoxProps, "
|
|
27
|
+
declare const ConsentBannerTitle: import("react").ForwardRefExoticComponent<Omit<BoxProps, "slotKey"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
24
28
|
/**
|
|
25
29
|
* Description component for the consent banner.
|
|
26
30
|
*
|
|
@@ -36,7 +40,7 @@ declare const ConsentBannerTitle: import("react").ForwardRefExoticComponent<Omit
|
|
|
36
40
|
* </ConsentBannerDescription>
|
|
37
41
|
* ```
|
|
38
42
|
*/
|
|
39
|
-
declare const ConsentBannerDescription: import("react").ForwardRefExoticComponent<Omit<BoxProps, "
|
|
43
|
+
declare const ConsentBannerDescription: import("react").ForwardRefExoticComponent<Omit<BoxProps, "slotKey"> & {
|
|
40
44
|
legalLinks?: InlineLegalLinksProps['links'];
|
|
41
45
|
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
42
46
|
/**
|
|
@@ -54,7 +58,7 @@ declare const ConsentBannerDescription: import("react").ForwardRefExoticComponen
|
|
|
54
58
|
* </ConsentBannerFooter>
|
|
55
59
|
* ```
|
|
56
60
|
*/
|
|
57
|
-
declare const ConsentBannerFooter: import("react").ForwardRefExoticComponent<Omit<BoxProps, "
|
|
61
|
+
declare const ConsentBannerFooter: import("react").ForwardRefExoticComponent<Omit<BoxProps, "slotKey"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
58
62
|
/**
|
|
59
63
|
* Card component for the consent banner.
|
|
60
64
|
*
|
|
@@ -71,7 +75,7 @@ declare const ConsentBannerFooter: import("react").ForwardRefExoticComponent<Omi
|
|
|
71
75
|
* </ConsentBannerCard>
|
|
72
76
|
* ```
|
|
73
77
|
*/
|
|
74
|
-
declare const ConsentBannerCard: import("react").ForwardRefExoticComponent<Omit<BoxProps, "
|
|
78
|
+
declare const ConsentBannerCard: import("react").ForwardRefExoticComponent<Omit<BoxProps, "slotKey"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
75
79
|
/**
|
|
76
80
|
* Header component for the consent banner.
|
|
77
81
|
*
|
|
@@ -79,7 +83,7 @@ declare const ConsentBannerCard: import("react").ForwardRefExoticComponent<Omit<
|
|
|
79
83
|
* Contains the title and description sections.
|
|
80
84
|
* Implements proper spacing and layout for header content.
|
|
81
85
|
*/
|
|
82
|
-
declare const ConsentBannerHeader: import("react").ForwardRefExoticComponent<Omit<BoxProps, "
|
|
86
|
+
declare const ConsentBannerHeader: import("react").ForwardRefExoticComponent<Omit<BoxProps, "slotKey"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
83
87
|
/**
|
|
84
88
|
* Footer sub-group component for organizing related actions.
|
|
85
89
|
*
|
|
@@ -87,7 +91,7 @@ declare const ConsentBannerHeader: import("react").ForwardRefExoticComponent<Omi
|
|
|
87
91
|
* Groups related buttons or controls in the footer.
|
|
88
92
|
* Implements proper spacing and alignment for button groups.
|
|
89
93
|
*/
|
|
90
|
-
declare const ConsentBannerFooterSubGroup: import("react").ForwardRefExoticComponent<Omit<BoxProps, "
|
|
94
|
+
declare const ConsentBannerFooterSubGroup: import("react").ForwardRefExoticComponent<Omit<BoxProps, "slotKey"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
91
95
|
/**
|
|
92
96
|
* Button to reject all non-essential cookies.
|
|
93
97
|
*
|
|
@@ -127,15 +131,96 @@ declare const ConsentBannerCustomizeButton: import("react").ForwardRefExoticComp
|
|
|
127
131
|
* ```
|
|
128
132
|
*/
|
|
129
133
|
declare const ConsentBannerAcceptButton: import("react").ForwardRefExoticComponent<ConsentButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
130
|
-
|
|
131
|
-
|
|
134
|
+
/**
|
|
135
|
+
* Button that acknowledges a notice prompt.
|
|
136
|
+
*
|
|
137
|
+
* @remarks
|
|
138
|
+
* Records a notice dismissal without recording a category choice, so no
|
|
139
|
+
* choice callbacks fire. Only rendered when the active policy requires a
|
|
140
|
+
* notice. Uses `common.acknowledge`, with `common.dismiss` as a fallback.
|
|
141
|
+
* Children or `dismissButtonText` override the label.
|
|
142
|
+
* Themed through `theme.consentActions.dismiss`.
|
|
143
|
+
*
|
|
144
|
+
* @example
|
|
145
|
+
* ```tsx
|
|
146
|
+
* <ConsentBannerDismissButton>
|
|
147
|
+
* Got it
|
|
148
|
+
* </ConsentBannerDismissButton>
|
|
149
|
+
* ```
|
|
150
|
+
*/
|
|
151
|
+
declare const ConsentBannerDismissButton: import("react").ForwardRefExoticComponent<ConsentButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
152
|
+
/**
|
|
153
|
+
* Props for {@link ConsentBannerRightLink}.
|
|
154
|
+
* @public
|
|
155
|
+
*/
|
|
156
|
+
export interface ConsentBannerRightLinkProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'children' | 'type'> {
|
|
157
|
+
/** Which persistent right the control keeps reachable. */
|
|
158
|
+
right: ConsentBannerRight;
|
|
159
|
+
/** Custom label. Defaults to the `rights` translation for `right`. */
|
|
160
|
+
children?: ReactNode;
|
|
161
|
+
/** Render the child element instead of a button, keeping the behavior. */
|
|
162
|
+
asChild?: boolean;
|
|
163
|
+
/** Skip the banner stylesheet for this control. */
|
|
164
|
+
noStyle?: boolean;
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Underlined text control that keeps a persistent right reachable from the
|
|
168
|
+
* banner.
|
|
169
|
+
*
|
|
170
|
+
* @remarks
|
|
171
|
+
* Opens the preference center, where the subject can opt out or change
|
|
172
|
+
* category preferences. Renders as plain underlined text through the
|
|
173
|
+
* `rightLink` class and the `banner.rightLink` slot so the primary action
|
|
174
|
+
* beside it keeps the emphasis. The label comes from the `rights`
|
|
175
|
+
* translations and children override it. Carries `data-action="right"`,
|
|
176
|
+
* `data-right`, and `data-c15t-rights` for styling hooks. With `asChild`
|
|
177
|
+
* the child element, such as a link to a dedicated opt-out page, receives
|
|
178
|
+
* the same class, attributes, and click handling.
|
|
179
|
+
*
|
|
180
|
+
* @example
|
|
181
|
+
* ```tsx
|
|
182
|
+
* <ConsentBannerRightLink right="opt-out" />
|
|
183
|
+
* ```
|
|
184
|
+
*/
|
|
185
|
+
declare const ConsentBannerRightLink: import("react").ForwardRefExoticComponent<ConsentBannerRightLinkProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
186
|
+
/**
|
|
187
|
+
* Props for {@link ConsentBannerRights}.
|
|
188
|
+
* @public
|
|
189
|
+
*/
|
|
190
|
+
export interface ConsentBannerRightsProps extends Omit<BoxProps, 'slotKey'> {
|
|
191
|
+
/**
|
|
192
|
+
* Additional preferences buttons to render. Defaults to the resolved
|
|
193
|
+
* presentation recommendation: a notice under an opt-out rule shows the
|
|
194
|
+
* opt-out control (which also keeps preferences reachable), and a choice
|
|
195
|
+
* prompt with customize shows nothing.
|
|
196
|
+
*/
|
|
197
|
+
rights?: readonly PolicyRight[];
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Group of additional buttons that open preferences.
|
|
201
|
+
*
|
|
202
|
+
* @remarks
|
|
203
|
+
* Renders nothing when no additional preferences button is recommended. Children replace the default
|
|
204
|
+
* controls; use {@link ConsentBannerRightLink} to keep the behavior.
|
|
205
|
+
*
|
|
206
|
+
* @example
|
|
207
|
+
* ```tsx
|
|
208
|
+
* <ConsentBannerRights />
|
|
209
|
+
* ```
|
|
210
|
+
*/
|
|
211
|
+
declare const ConsentBannerRights: import("react").ForwardRefExoticComponent<ConsentBannerRightsProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
212
|
+
declare const Title: import("react").ForwardRefExoticComponent<Omit<BoxProps, "slotKey"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
213
|
+
declare const Description: import("react").ForwardRefExoticComponent<Omit<BoxProps, "slotKey"> & {
|
|
132
214
|
legalLinks?: InlineLegalLinksProps['links'];
|
|
133
215
|
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
134
|
-
declare const Footer: import("react").ForwardRefExoticComponent<Omit<BoxProps, "
|
|
135
|
-
declare const FooterSubGroup: import("react").ForwardRefExoticComponent<Omit<BoxProps, "
|
|
136
|
-
declare const Card: import("react").ForwardRefExoticComponent<Omit<BoxProps, "
|
|
137
|
-
declare const Header: import("react").ForwardRefExoticComponent<Omit<BoxProps, "
|
|
216
|
+
declare const Footer: import("react").ForwardRefExoticComponent<Omit<BoxProps, "slotKey"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
217
|
+
declare const FooterSubGroup: import("react").ForwardRefExoticComponent<Omit<BoxProps, "slotKey"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
218
|
+
declare const Card: import("react").ForwardRefExoticComponent<Omit<BoxProps, "slotKey"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
219
|
+
declare const Header: import("react").ForwardRefExoticComponent<Omit<BoxProps, "slotKey"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
138
220
|
declare const RejectButton: import("react").ForwardRefExoticComponent<ConsentButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
139
221
|
declare const CustomizeButton: import("react").ForwardRefExoticComponent<ConsentButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
140
222
|
declare const AcceptButton: import("react").ForwardRefExoticComponent<ConsentButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
141
|
-
|
|
223
|
+
declare const DismissButton: import("react").ForwardRefExoticComponent<ConsentButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
224
|
+
declare const Rights: import("react").ForwardRefExoticComponent<ConsentBannerRightsProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
225
|
+
declare const RightLink: import("react").ForwardRefExoticComponent<ConsentBannerRightLinkProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
226
|
+
export { AcceptButton, Card, ConsentBannerAcceptButton, ConsentBannerCard, ConsentBannerCustomizeButton, ConsentBannerDescription, ConsentBannerDismissButton, ConsentBannerFooter, ConsentBannerFooterSubGroup, ConsentBannerHeader, ConsentBannerRejectButton, ConsentBannerRightLink, ConsentBannerRights, ConsentBannerTitle, CustomizeButton, Description, DismissButton, Footer, FooterSubGroup, Header, RejectButton, RightLink, Rights, Title, };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { Component
|
|
1
|
+
import { Component } from 'react';
|
|
2
|
+
import type { ErrorInfo, ReactNode } from 'react';
|
|
2
3
|
/**
|
|
3
4
|
* Props for the ErrorBoundary component.
|
|
4
5
|
*
|
|
@@ -47,6 +48,7 @@ interface ErrorBoundaryState {
|
|
|
47
48
|
* @public
|
|
48
49
|
*/
|
|
49
50
|
export declare class ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundaryState> {
|
|
51
|
+
private errorInfo;
|
|
50
52
|
constructor(props: ErrorBoundaryProps);
|
|
51
53
|
static getDerivedStateFromError(error: Error): ErrorBoundaryState;
|
|
52
54
|
componentDidCatch(error: Error, errorInfo: ErrorInfo): void;
|
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
import type { FC } from 'react';
|
|
11
11
|
import { Overlay } from './atoms/overlay';
|
|
12
12
|
import { Root } from './atoms/root';
|
|
13
|
-
import { AcceptButton, Card, CustomizeButton, Description, Footer, FooterSubGroup, Header, RejectButton, Title } from './components';
|
|
14
|
-
import { type ConsentBannerButton, type ConsentBannerLayout, type ConsentBannerProps } from './consent-banner';
|
|
13
|
+
import { AcceptButton, Card, CustomizeButton, Description, DismissButton, Footer, FooterSubGroup, Header, RejectButton, RightLink, Rights, Title } from './components';
|
|
15
14
|
import { PolicyActions } from './policy-actions';
|
|
15
|
+
import type { ConsentBannerButton, ConsentBannerLayout, ConsentBannerProps } from './prompt';
|
|
16
16
|
/**
|
|
17
17
|
* This interface extends the base ConsentBanner component with additional sub-components
|
|
18
18
|
* that can be used to compose the banner's structure.
|
|
@@ -29,6 +29,9 @@ export interface ConsentBannerCompoundComponent extends FC<ConsentBannerProps> {
|
|
|
29
29
|
RejectButton: typeof RejectButton;
|
|
30
30
|
CustomizeButton: typeof CustomizeButton;
|
|
31
31
|
AcceptButton: typeof AcceptButton;
|
|
32
|
+
DismissButton: typeof DismissButton;
|
|
33
|
+
Rights: typeof Rights;
|
|
34
|
+
RightLink: typeof RightLink;
|
|
32
35
|
Overlay: typeof Overlay;
|
|
33
36
|
}
|
|
34
37
|
/**
|
|
@@ -37,7 +40,7 @@ export interface ConsentBannerCompoundComponent extends FC<ConsentBannerProps> {
|
|
|
37
40
|
* @remarks
|
|
38
41
|
* This component serves as the main entry point for rendering a consent banner.
|
|
39
42
|
* Start with the pre-built component and its existing configuration surface.
|
|
40
|
-
* For most customization, use `
|
|
43
|
+
* For most customization, use `ConsentProvider` options, theme tokens,
|
|
41
44
|
* slots, and `theme.consentActions` before reaching for compound composition.
|
|
42
45
|
*
|
|
43
46
|
* Key features:
|
|
@@ -55,10 +58,11 @@ export interface ConsentBannerCompoundComponent extends FC<ConsentBannerProps> {
|
|
|
55
58
|
* ```
|
|
56
59
|
*
|
|
57
60
|
* @example
|
|
58
|
-
* Preferred customization via provider `i18n`, theme tokens, and
|
|
61
|
+
* Preferred customization via provider `i18n`, theme tokens, and components:
|
|
59
62
|
* ```tsx
|
|
60
|
-
* <
|
|
63
|
+
* <ConsentProvider
|
|
61
64
|
* options={{
|
|
65
|
+
* mode: hosted({ url: '/api/c15t' }),
|
|
62
66
|
* i18n: {
|
|
63
67
|
* locale: 'en',
|
|
64
68
|
* messages: {
|
|
@@ -72,15 +76,17 @@ export interface ConsentBannerCompoundComponent extends FC<ConsentBannerProps> {
|
|
|
72
76
|
* surface: '#fffdf8',
|
|
73
77
|
* surfaceHover: '#f6f3ee',
|
|
74
78
|
* },
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
-
*
|
|
79
|
+
* },
|
|
80
|
+
* components: {
|
|
81
|
+
* banner: {
|
|
82
|
+
* card: { className: 'rounded-3xl' },
|
|
83
|
+
* footer: { className: 'border-t border-black/10' },
|
|
78
84
|
* },
|
|
79
85
|
* },
|
|
80
86
|
* }}
|
|
81
87
|
* >
|
|
82
88
|
* <ConsentBanner primaryButton="accept" />
|
|
83
|
-
* </
|
|
89
|
+
* </ConsentProvider>
|
|
84
90
|
* ```
|
|
85
91
|
*
|
|
86
92
|
* @example
|
|
@@ -110,6 +116,8 @@ declare const ConsentBanner: ConsentBannerCompoundComponent;
|
|
|
110
116
|
export default ConsentBanner;
|
|
111
117
|
export { ConsentBannerOverlay, Overlay } from './atoms/overlay';
|
|
112
118
|
export { ConsentBannerRoot, Root } from './atoms/root';
|
|
113
|
-
export { AcceptButton, Card, ConsentBannerAcceptButton, ConsentBannerCard, ConsentBannerCustomizeButton, ConsentBannerDescription, ConsentBannerFooter, ConsentBannerFooterSubGroup, ConsentBannerHeader, ConsentBannerRejectButton, ConsentBannerTitle, CustomizeButton, Description, Footer, FooterSubGroup, Header, RejectButton, Title, } from './components';
|
|
119
|
+
export { AcceptButton, Card, ConsentBannerAcceptButton, ConsentBannerCard, ConsentBannerCustomizeButton, ConsentBannerDescription, ConsentBannerDismissButton, ConsentBannerFooter, ConsentBannerFooterSubGroup, ConsentBannerHeader, ConsentBannerRejectButton, type ConsentBannerRight, ConsentBannerRightLink, type ConsentBannerRightLinkProps, ConsentBannerRights, type ConsentBannerRightsProps, ConsentBannerTitle, CustomizeButton, Description, DismissButton, Footer, FooterSubGroup, Header, RejectButton, RightLink, Rights, Title, } from './components';
|
|
120
|
+
export { type ConsentBannerSurface, useConsentBannerSurface, } from './surface-context';
|
|
121
|
+
export { useBannerCopy } from './use-banner-copy';
|
|
114
122
|
export { type ConsentBannerPolicyActionRenderProps, ConsentBannerPolicyActions, type ConsentBannerPolicyActionsProps, PolicyActions, } from './policy-actions';
|
|
115
123
|
export { ConsentBanner, type ConsentBannerButton, type ConsentBannerLayout, type ConsentBannerProps, };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { HeadlessConsentBannerAction } from '../../component-hooks/use-headless-consent-ui';
|
|
3
|
+
import type { PolicyActionRenderProps } from '../shared/policy-actions';
|
|
4
|
+
export type ConsentBannerPolicyActionRenderProps = PolicyActionRenderProps<HeadlessConsentBannerAction>;
|
|
5
|
+
export interface ConsentBannerPolicyActionsProps {
|
|
6
|
+
/** Replaces the default preferences buttons before the policy actions. */
|
|
7
|
+
children?: ReactNode;
|
|
8
|
+
renderAction?: (action: HeadlessConsentBannerAction, props: ConsentBannerPolicyActionRenderProps) => ReactNode;
|
|
9
|
+
}
|
|
10
|
+
export declare const ConsentBannerPolicyActions: ({ children, renderAction, }: ConsentBannerPolicyActionsProps) => import("react").JSX.Element;
|
|
11
|
+
declare const PolicyActions: typeof ConsentBannerPolicyActions;
|
|
12
|
+
export { PolicyActions };
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import type * as C15tCoreTypes from '@c15t/core';
|
|
2
|
+
import type { PromptPosition, PromptVariant } from '@c15t/core';
|
|
3
|
+
import type { SurfacePresentation } from '@c15t/ui/utils';
|
|
4
|
+
import type { FC, ReactNode } from 'react';
|
|
3
5
|
import type { InlineLegalLinksProps } from '../shared/primitives/legal-links';
|
|
4
6
|
/**
|
|
5
7
|
* Identifiers for the available buttons in the consent banner.
|
|
6
8
|
* @public
|
|
7
9
|
*/
|
|
8
|
-
export type ConsentBannerButton = 'reject' | 'accept' | 'customize';
|
|
10
|
+
export type ConsentBannerButton = 'reject' | 'accept' | 'customize' | 'dismiss' | 'save';
|
|
9
11
|
/**
|
|
10
12
|
* Structure for defining the layout of buttons in the consent banner.
|
|
11
13
|
* Supports nesting for grouping buttons.
|
|
@@ -59,15 +61,20 @@ export interface ConsentBannerProps {
|
|
|
59
61
|
*/
|
|
60
62
|
acceptButtonText?: ReactNode;
|
|
61
63
|
/**
|
|
62
|
-
*
|
|
63
|
-
* @remarks
|
|
64
|
-
* @default
|
|
64
|
+
* Content to display on the dismiss button
|
|
65
|
+
* @remarks Only rendered when the active policy requires a notice prompt
|
|
66
|
+
* @default undefined
|
|
67
|
+
*/
|
|
68
|
+
dismissButtonText?: ReactNode;
|
|
69
|
+
/**
|
|
70
|
+
* Legacy setting for a blocking banner.
|
|
71
|
+
* @deprecated Use `blocking` to control focus, scroll and backdrop together.
|
|
65
72
|
*/
|
|
66
73
|
scrollLock?: boolean;
|
|
67
74
|
/**
|
|
68
75
|
* When true, the consent banner will trap focus
|
|
69
76
|
* @remarks Useful for implementing a consent banner that traps focus
|
|
70
|
-
* @
|
|
77
|
+
* @deprecated Use `blocking` to control focus, scroll and backdrop together.
|
|
71
78
|
*/
|
|
72
79
|
trapFocus?: boolean;
|
|
73
80
|
/**
|
|
@@ -98,7 +105,7 @@ export interface ConsentBannerProps {
|
|
|
98
105
|
* ```
|
|
99
106
|
*
|
|
100
107
|
* @remarks
|
|
101
|
-
* You must set the legal links in the
|
|
108
|
+
* You must set the legal links in the ConsentProvider options.
|
|
102
109
|
*/
|
|
103
110
|
legalLinks?: InlineLegalLinksProps['links'];
|
|
104
111
|
/**
|
|
@@ -118,7 +125,7 @@ export interface ConsentBannerProps {
|
|
|
118
125
|
*
|
|
119
126
|
* @defaultValue 'row'
|
|
120
127
|
*/
|
|
121
|
-
direction?:
|
|
128
|
+
direction?: SurfacePresentation['direction'];
|
|
122
129
|
/**
|
|
123
130
|
* Specifies which button(s) should be highlighted as the primary action.
|
|
124
131
|
*
|
|
@@ -129,12 +136,31 @@ export interface ConsentBannerProps {
|
|
|
129
136
|
* Which consent models this banner responds to.
|
|
130
137
|
* @default ['opt-in']
|
|
131
138
|
*/
|
|
132
|
-
models?:
|
|
139
|
+
models?: C15tCoreTypes.Model[];
|
|
133
140
|
/**
|
|
134
141
|
* Override the UI source identifier sent with consent API calls.
|
|
135
142
|
* @default 'banner'
|
|
136
143
|
*/
|
|
137
144
|
uiSource?: string;
|
|
145
|
+
/**
|
|
146
|
+
* Shape of the prompt: `floating` card, full-width `bar`, compact
|
|
147
|
+
* `widget`, or centered `wall`. Overrides `presentation.prompt.variant`.
|
|
148
|
+
* @remarks Every prompt defaults to `floating`. Notices cannot use `wall`.
|
|
149
|
+
*/
|
|
150
|
+
variant?: PromptVariant;
|
|
151
|
+
/**
|
|
152
|
+
* Placement of the prompt. Overrides `presentation.prompt.position`.
|
|
153
|
+
* @remarks Must be valid for the resolved variant; otherwise the variant
|
|
154
|
+
* default is used and a development diagnostic is logged. Host-chosen
|
|
155
|
+
* positions are never mirrored for right-to-left text.
|
|
156
|
+
*/
|
|
157
|
+
position?: PromptPosition;
|
|
158
|
+
/**
|
|
159
|
+
* Backdrop, scroll lock, focus trap and no outside dismissal, as one
|
|
160
|
+
* value. Overrides `presentation.prompt.blocking`.
|
|
161
|
+
* @remarks `wall` is always blocking; a notice never is.
|
|
162
|
+
*/
|
|
163
|
+
blocking?: boolean;
|
|
138
164
|
}
|
|
139
165
|
export declare const ConsentBanner: FC<ConsentBannerProps>;
|
|
140
166
|
/**
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Primary actions for the banner, with dismiss promoted on a bare notice.
|
|
3
|
+
*
|
|
4
|
+
* @remarks
|
|
5
|
+
* The resolver's default primary is `customize`, which a notice never
|
|
6
|
+
* offers, so a notice resolves with no primary action. When dismiss is the
|
|
7
|
+
* only control on the surface it is the primary one.
|
|
8
|
+
*
|
|
9
|
+
* @param primaryActions - Primary actions from the resolved presentation.
|
|
10
|
+
* @param orderedActions - Every action the surface renders, in order.
|
|
11
|
+
* @returns The primary actions the banner should style.
|
|
12
|
+
* @internal
|
|
13
|
+
*/
|
|
14
|
+
export declare const resolveBannerPrimaryActions: <Action extends string>(primaryActions: readonly Action[], orderedActions: readonly Action[]) => readonly Action[];
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { PromptPosition, PromptVariant } from '@c15t/core';
|
|
2
|
+
/**
|
|
3
|
+
* Geometry the banner root resolved for the active prompt: the shape it
|
|
4
|
+
* takes, where it sits, whether that position came from the host, and
|
|
5
|
+
* whether it blocks the page.
|
|
6
|
+
*
|
|
7
|
+
* @public
|
|
8
|
+
*/
|
|
9
|
+
export interface ConsentBannerSurface {
|
|
10
|
+
/** Shape of the first-layer prompt. */
|
|
11
|
+
variant: PromptVariant;
|
|
12
|
+
/** Placement, already mirrored for right-to-left text when defaulted. */
|
|
13
|
+
position: PromptPosition;
|
|
14
|
+
/** Whether the host chose the position or the resolver defaulted it. */
|
|
15
|
+
positionSource: 'host' | 'default';
|
|
16
|
+
/** Backdrop, scroll lock, focus trap and no outside dismissal. */
|
|
17
|
+
blocking: boolean;
|
|
18
|
+
}
|
|
19
|
+
/** Shape a compound banner takes before `ConsentBanner.Root` resolves one. */
|
|
20
|
+
export declare const DEFAULT_CONSENT_BANNER_SURFACE: ConsentBannerSurface;
|
|
21
|
+
export declare const ConsentBannerSurfaceContext: import("react").Context<ConsentBannerSurface>;
|
|
22
|
+
/**
|
|
23
|
+
* Read the geometry `ConsentBanner.Root` resolved for the active prompt.
|
|
24
|
+
*
|
|
25
|
+
* @remarks
|
|
26
|
+
* Outside a root this returns the floating bottom-left default so compound
|
|
27
|
+
* parts still render.
|
|
28
|
+
*
|
|
29
|
+
* @returns The resolved variant, position, its source and blocking state.
|
|
30
|
+
* @public
|
|
31
|
+
*/
|
|
32
|
+
export declare const useConsentBannerSurface: () => ConsentBannerSurface;
|
|
33
|
+
/**
|
|
34
|
+
* Mirror a defaulted corner for right-to-left text so the banner keeps
|
|
35
|
+
* hugging the reading start. Host-chosen positions and edge or center
|
|
36
|
+
* placements are returned unchanged.
|
|
37
|
+
*
|
|
38
|
+
* @param position - The resolved position.
|
|
39
|
+
* @param positionSource - Whether the host chose it.
|
|
40
|
+
* @param variant - The resolved variant; only corners of floating and widget mirror.
|
|
41
|
+
* @param textDirection - Document text direction.
|
|
42
|
+
* @returns The position to render.
|
|
43
|
+
* @internal
|
|
44
|
+
*/
|
|
45
|
+
export declare const mirrorDefaultPosition: (position: PromptPosition, positionSource: 'host' | 'default', variant: PromptVariant, textDirection: 'ltr' | 'rtl') => PromptPosition;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Title and description for the banner under the active policy prompt.
|
|
3
|
+
*
|
|
4
|
+
* @remarks
|
|
5
|
+
* A notice prompt reads the `noticeTitle` and `noticeDescription` copy so
|
|
6
|
+
* it informs rather than asks. Languages that have not translated the notice
|
|
7
|
+
* copy fall back to the choice copy rather than to English.
|
|
8
|
+
*
|
|
9
|
+
* @returns The copy the banner should render when no props override it.
|
|
10
|
+
* @public
|
|
11
|
+
*/
|
|
12
|
+
export declare const useBannerCopy: () => {
|
|
13
|
+
title: string | undefined;
|
|
14
|
+
description: string | undefined;
|
|
15
|
+
prompt: 'choice' | 'notice' | 'none';
|
|
16
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ComponentPropsWithoutRef, ElementType, PropsWithChildren } from 'react';
|
|
2
|
-
|
|
2
|
+
interface AsProp<T extends ElementType> {
|
|
3
3
|
as?: T;
|
|
4
|
-
}
|
|
4
|
+
}
|
|
5
5
|
type PropsToOmit<T extends ElementType, P> = keyof (AsProp<T> & P);
|
|
6
6
|
type PolymorphicComponentProp<T extends ElementType, Props extends Record<string, unknown> = Record<string, unknown>> = PropsWithChildren<Props & AsProp<T>> & Omit<ComponentPropsWithoutRef<T>, PropsToOmit<T, Props>>;
|
|
7
7
|
export type PolymorphicComponentProps<T extends ElementType, P extends Record<string, unknown> = Record<string, unknown>> = PolymorphicComponentProp<T, P>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
2
|
/**
|
|
3
3
|
* Recursively clones React children, adding additional props to components with matched display names.
|
|
4
4
|
*
|
|
@@ -10,4 +10,4 @@ import { type ReactNode } from 'react';
|
|
|
10
10
|
*
|
|
11
11
|
* @returns The cloned node(s) with the additional props applied to the matched components.
|
|
12
12
|
*/
|
|
13
|
-
export declare
|
|
13
|
+
export declare const recursiveCloneChildren: (children: ReactNode, additionalProps: Record<string, unknown>, displayNames: string[], uniqueId: string, asChild?: boolean) => ReactNode | ReactNode[];
|
|
@@ -3,5 +3,5 @@ interface UseControllableStateOptions<T> {
|
|
|
3
3
|
onChange?: (value: T) => void;
|
|
4
4
|
value?: T;
|
|
5
5
|
}
|
|
6
|
-
export declare
|
|
6
|
+
export declare const useControllableState: <T>({ defaultValue, onChange, value, }: UseControllableStateOptions<T>) => readonly [T, (nextValue: T) => void];
|
|
7
7
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type { HeadlessConsentSurfaceState } from '../../hooks/use-headless-consent-ui';
|
|
1
|
+
import type { ComponentType, ReactNode } from 'react';
|
|
2
|
+
import type { HeadlessConsentSurfaceState } from '../../component-hooks/use-headless-consent-ui';
|
|
3
3
|
import type { CSSPropertiesWithVars, CSSVariables } from '../../types/theme';
|
|
4
4
|
export interface PolicyActionRenderProps<TAction extends string> {
|
|
5
5
|
key: string;
|
|
@@ -10,6 +10,9 @@ export interface PolicyActionRenderProps<TAction extends string> {
|
|
|
10
10
|
interface PolicyActionsLayoutProps {
|
|
11
11
|
children?: ReactNode;
|
|
12
12
|
className?: string;
|
|
13
|
+
'data-direction'?: string;
|
|
14
|
+
'data-fill'?: true | undefined;
|
|
15
|
+
'data-split'?: true | undefined;
|
|
13
16
|
}
|
|
14
17
|
interface PolicyActionsClassNames {
|
|
15
18
|
footerFill?: string;
|
|
@@ -24,6 +27,8 @@ interface PolicyActionsRendererProps<TAction extends string> {
|
|
|
24
27
|
classNames: PolicyActionsClassNames;
|
|
25
28
|
renderDefaultAction: (action: TAction, props: PolicyActionRenderProps<TAction>) => ReactNode;
|
|
26
29
|
renderAction?: (action: TAction, props: PolicyActionRenderProps<TAction>) => ReactNode;
|
|
30
|
+
/** Rendered inside the footer before the action groups, such as right links. */
|
|
31
|
+
leading?: ReactNode;
|
|
27
32
|
}
|
|
28
|
-
export declare
|
|
33
|
+
export declare const PolicyActionsRenderer: <TAction extends string>({ state, Footer, FooterSubGroup, classNames, renderDefaultAction, renderAction, leading, }: PolicyActionsRendererProps<TAction>) => import("react").JSX.Element;
|
|
29
34
|
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { ConsentComponentSlotKey } from '@c15t/schema/config';
|
|
2
|
+
import type { HTMLAttributes } from 'react';
|
|
2
3
|
import type { ExtendThemeKeys } from '../../../types/theme';
|
|
3
4
|
/**
|
|
4
5
|
* Props for the description text component of the CookieBanner.
|
|
@@ -8,6 +9,7 @@ import type { ExtendThemeKeys } from '../../../types/theme';
|
|
|
8
9
|
*/
|
|
9
10
|
export interface BoxProps extends Omit<HTMLAttributes<HTMLDivElement>, 'style'>, ExtendThemeKeys {
|
|
10
11
|
asChild?: boolean;
|
|
12
|
+
slotKey?: ConsentComponentSlotKey;
|
|
11
13
|
}
|
|
12
14
|
/**
|
|
13
15
|
* Renders the descriptive text content within a CookieBanner.
|