@c15t/react 2.2.1 → 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
package/AGENTS.md
CHANGED
|
@@ -1,155 +1,102 @@
|
|
|
1
1
|
# @c15t/react
|
|
2
2
|
|
|
3
|
-
> React
|
|
3
|
+
> React v3 consent components, hooks, Inth setup and customization.
|
|
4
4
|
|
|
5
5
|
These docs ship inside the package so coding agents can read them offline. Open the topic file you need from the list below — paths are relative to this file.
|
|
6
6
|
|
|
7
|
-
##
|
|
7
|
+
## Using these docs
|
|
8
|
+
|
|
9
|
+
These docs describe v3. Start with Inth hosted setup, identify the framework, router and deployment, then read its quickstart. Static sites can use Inth directly. Use page Markdown and package-bundled docs for targeted context. Verify scripts, rejection, reload and preferences; banner visibility alone is insufficient.
|
|
10
|
+
|
|
11
|
+
## Start here
|
|
8
12
|
|
|
9
|
-
|
|
13
|
+
- [React quickstart](./docs/frameworks/react/quickstart.md)
|
|
14
|
+
- [Customize your consent interface](./docs/customization/overview.md): Choose presentation, theme tokens, slots or custom markup for the change you need.
|
|
15
|
+
- [Verify consent before shipping](./docs/guides/verify-consent.md): Test requests, policy resolution, persistence, navigation and preference changes in a production build.
|
|
16
|
+
- [Upgrade to v3 policies](./docs/upgrade-v3.md): Migrate policy configuration, consent records, callbacks, and custom transports to the v3 policy system.
|
|
10
17
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
- [
|
|
18
|
-
- [
|
|
18
|
+
## More documentation
|
|
19
|
+
|
|
20
|
+
[Documentation index](https://c15t.com/docs/llms.txt) · [Full Markdown context](https://c15t.com/llms-full.txt). Prefer the index and individual pages for focused tasks.
|
|
21
|
+
|
|
22
|
+
## Frameworks
|
|
23
|
+
|
|
24
|
+
- [ConsentBanner](./docs/frameworks/react/components/consent-banner.md): Pre-built consent banner shown when consent is required.
|
|
25
|
+
- [ConsentDialog](./docs/frameworks/react/components/consent-dialog.md): Open the c15t preference center as a modal ConsentDialog in a React app, wire its triggers and control blocking, focus and policy gating.
|
|
26
|
+
- [ConsentDialogLink](./docs/frameworks/react/components/consent-dialog-link.md): Add a ConsentDialogLink to a React footer so visitors reopen the c15t preference center from your own text link, with asChild and rights data.
|
|
27
|
+
- [ConsentDialogTrigger](./docs/frameworks/react/components/consent-dialog-trigger.md): Floating button and toolbar that reopen the preference center after the first prompt.
|
|
28
|
+
- [ConsentProvider](./docs/frameworks/react/components/consent-manager-provider.md): Configure the v3 consent runtime and share its state with child components.
|
|
29
|
+
- [ConsentWidget](./docs/frameworks/react/components/consent-widget.md): Embed the c15t preference center inline with ConsentWidget on a React privacy page, with draft toggles that record a choice only on Save.
|
|
19
30
|
- [DevTools](./docs/frameworks/react/components/dev-tools.md): A development tool for inspecting consent state, geolocation, loaded scripts, and consent events in real time.
|
|
20
|
-
- [Frame](./docs/frameworks/react/components/frame.md):
|
|
21
|
-
- [
|
|
22
|
-
- [
|
|
23
|
-
- [
|
|
24
|
-
- [
|
|
25
|
-
- [
|
|
26
|
-
- [
|
|
27
|
-
- [
|
|
28
|
-
- [
|
|
29
|
-
- [
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
- [
|
|
34
|
-
- [
|
|
35
|
-
- [
|
|
36
|
-
- [
|
|
37
|
-
- [
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
- [
|
|
42
|
-
- [
|
|
43
|
-
- [
|
|
44
|
-
- [
|
|
45
|
-
- [
|
|
46
|
-
- [Network Blocker](./docs/frameworks/react/network-blocker.md): Block outgoing network requests to third-party domains until the user grants consent for the appropriate category.
|
|
47
|
-
- [Optimization](./docs/frameworks/react/optimization.md): Improve c15t startup performance in React with prefetching, proxy rewrites, and rendering tradeoffs.
|
|
48
|
-
- [Policy Packs](./docs/frameworks/react/policy-packs.md): Configure regional consent policies in React — hosted mode, presets, and offline fallback.
|
|
49
|
-
- [Quickstart](./docs/frameworks/react/quickstart.md): Add consent management to your React app in under 5 minutes.
|
|
50
|
-
- [Script Loader](./docs/frameworks/react/script-loader.md): Gate third-party scripts behind consent in React — load Google Analytics, Meta Pixel, and other tracking scripts only when users grant permission.
|
|
51
|
-
- [Server-Side Utilities](./docs/frameworks/react/server-side.md): Fetch consent data on the server for SSR hydration — eliminate the loading flash and improve performance.
|
|
52
|
-
- [Class Names](./docs/frameworks/react/styling/classnames.md): Style consent components using className props and per-slot className targeting via the theme.
|
|
53
|
-
- [Color Scheme](./docs/frameworks/react/styling/color-scheme.md): Support light mode, dark mode, and system preference detection in consent components.
|
|
54
|
-
- [CSS Variables](./docs/frameworks/react/styling/css-variables.md): Reference for all --c15t-* CSS custom properties generated by the theme system.
|
|
55
|
-
- [Styling Overview](./docs/frameworks/react/styling/overview.md): Customize every aspect of c15t's consent components using design tokens, component slots, and CSS variables.
|
|
56
|
-
- [Component Slots](./docs/frameworks/react/styling/slots.md): Target individual component parts with styles using the slot system - className strings or inline style objects.
|
|
57
|
-
- [Tailwind CSS](./docs/frameworks/react/styling/tailwind.md): Use Tailwind CSS utility classes to style consent components via the slot system.
|
|
58
|
-
- [Design Tokens](./docs/frameworks/react/styling/tokens.md): The six base token categories that control colors, typography, spacing, radius, shadows, and motion, plus optional dark-mode overrides.
|
|
59
|
-
- [Troubleshooting](./docs/frameworks/react/troubleshooting.md): Solutions for common issues with @c15t/react — provider errors, missing banners, consent persistence, and more.
|
|
31
|
+
- [Frame](./docs/frameworks/react/components/frame.md): Gate a YouTube or map iframe behind consent with Frame in React, showing a placeholder that opens the preference center until the category is allowed.
|
|
32
|
+
- [Consent categories](./docs/frameworks/react/concepts/consent-categories.md): Assign optional features to categories and understand how policy scope affects permission.
|
|
33
|
+
- [Policy presets](./docs/frameworks/react/concepts/policy-presets.md): Understand how policy rules affect React prompts, permissions and persistent privacy controls.
|
|
34
|
+
- [Headless](./docs/frameworks/react/headless.md): Build a custom consent banner in React with the c15t/react/headless hooks inside your ConsentProvider.
|
|
35
|
+
- [Hooks](./docs/frameworks/react/hooks/use-consent-manager/overview.md): Gate features and save consent choices in React components with the focused hooks exported from c15t/react.
|
|
36
|
+
- [IAB TCF](./docs/frameworks/react/iab/overview.md): Mount the IAB TCF banner and dialog inside a React ConsentProvider and configure the CMP ID, policy and vendor data.
|
|
37
|
+
- [Quickstart](./docs/frameworks/react/quickstart.md): Connect a React application to Inth and add consent UI, persistence and a preferences link.
|
|
38
|
+
- [Load scripts with consent](./docs/frameworks/react/script-loader.md): Register vendor scripts once and let effective permissions control loading.
|
|
39
|
+
- [Styling](./docs/frameworks/react/styling/overview.md): Import the React stylesheet and theme c15t components with tokens, slots, and class names on ConsentProvider.
|
|
40
|
+
- [Troubleshoot React consent](./docs/frameworks/react/troubleshooting.md): Diagnose policy resolution, early scripts, storage and rendering problems.
|
|
41
|
+
|
|
42
|
+
## Guides
|
|
43
|
+
|
|
44
|
+
- [Understand consent state](./docs/guides/consent-state.md): Distinguish policy resolution, effective permissions, explicit choices, notices and privacy signals.
|
|
45
|
+
- [Data fetching and transports](./docs/guides/data-fetching.md): Choose cached manifests, backend init or offline policy resolution, and understand where consent records are saved.
|
|
46
|
+
- [Choose a deployment mode](./docs/guides/deployment-modes.md): Choose who runs your consent backend, then select manifest, init or offline resolution for your deployment.
|
|
47
|
+
- [Troubleshoot consent](./docs/guides/troubleshooting.md): Diagnose missing banners, early vendor requests, lost choices and hydration differences.
|
|
48
|
+
- [Verify consent before shipping](./docs/guides/verify-consent.md): Test requests, policy resolution, persistence, navigation and preference changes in a production build.
|
|
49
|
+
|
|
50
|
+
## Customization
|
|
51
|
+
|
|
52
|
+
- [Customize your consent interface](./docs/customization/overview.md): Choose presentation, theme tokens, slots or custom markup for the change you need.
|
|
53
|
+
- [Banner styling recipes](./docs/customization/recipes.md): See real v3 components and reuse the exact theme configuration behind the examples.
|
|
54
|
+
- [Style component slots](./docs/customization/slots.md): Target a specific c15t component part without replacing its markup or behavior.
|
|
55
|
+
- [Theme tokens and CSS](./docs/customization/tokens.md): Style c15t with semantic tokens and use the stylesheet that matches your CSS tooling.
|
|
56
|
+
- [Copy and translations](./docs/customization/translations.md): Change consent wording through i18n and test the complete prompt and preferences flow.
|
|
60
57
|
|
|
61
58
|
## Integrations
|
|
62
59
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
- [
|
|
66
|
-
- [
|
|
67
|
-
- [
|
|
68
|
-
- [
|
|
69
|
-
- [
|
|
70
|
-
- [
|
|
71
|
-
- [
|
|
72
|
-
- [
|
|
73
|
-
- [
|
|
74
|
-
- [Google
|
|
75
|
-
- [
|
|
76
|
-
- [
|
|
77
|
-
- [
|
|
78
|
-
- [
|
|
79
|
-
- [
|
|
80
|
-
- [
|
|
81
|
-
- [
|
|
82
|
-
- [
|
|
83
|
-
- [
|
|
84
|
-
- [
|
|
85
|
-
- [
|
|
86
|
-
- [
|
|
87
|
-
- [
|
|
88
|
-
- [
|
|
89
|
-
- [
|
|
90
|
-
- [
|
|
91
|
-
- [
|
|
92
|
-
- [
|
|
93
|
-
- [
|
|
94
|
-
- [
|
|
95
|
-
- [
|
|
96
|
-
- [
|
|
97
|
-
- [
|
|
98
|
-
- [
|
|
99
|
-
- [
|
|
100
|
-
- [
|
|
101
|
-
- [
|
|
102
|
-
- [YouTube](./docs/integrations/youtube.md): Keep YouTube iframes unmounted until consent with a privacy-enhanced, lazy-loaded React or Next.js embed.
|
|
60
|
+
- [Adobe Analytics](./docs/integrations/adobe-analytics.md): Configure Adobe Analytics with c15t v3, understand measurement permission and verify loading and revocation.
|
|
61
|
+
- [Ahrefs Analytics](./docs/integrations/ahrefs-analytics.md): Configure Ahrefs Analytics with c15t v3, understand measurement permission and verify loading and revocation.
|
|
62
|
+
- [Amplitude](./docs/integrations/amplitude.md): Configure Amplitude with c15t v3, understand measurement permission and verify loading and revocation.
|
|
63
|
+
- [Custom integrations](./docs/integrations/building-integrations.md): Define loading, initialization and consent-change behavior for a vendor without a helper.
|
|
64
|
+
- [Clearbit](./docs/integrations/clearbit.md): Configure Clearbit with c15t v3, understand marketing permission and verify loading and revocation.
|
|
65
|
+
- [Cloudflare Web Analytics](./docs/integrations/cloudflare-web-analytics.md): Configure Cloudflare Web Analytics with c15t v3, understand measurement permission and verify loading and revocation.
|
|
66
|
+
- [Crisp](./docs/integrations/crisp.md): Configure Crisp with c15t v3, understand functionality permission and verify loading and revocation.
|
|
67
|
+
- [Databuddy](./docs/integrations/databuddy.md): Configure Databuddy's initial and updated consent state with c15t v3.
|
|
68
|
+
- [Fathom Analytics](./docs/integrations/fathom-analytics.md): Configure Fathom Analytics with c15t v3, understand measurement permission and verify loading and revocation.
|
|
69
|
+
- [Google Maps](./docs/integrations/google-maps.md): Prevent a map iframe from mounting before the required permission.
|
|
70
|
+
- [Google Tag](./docs/integrations/google-tag.md): Configure gtag with c15t Consent Mode signals and understand its loading behavior.
|
|
71
|
+
- [Google Tag Manager](./docs/integrations/google-tag-manager.md): Load GTM with c15t consent signals and verify the tags inside your container.
|
|
72
|
+
- [Heap](./docs/integrations/heap.md): Configure Heap with c15t v3, understand measurement permission and verify loading and revocation.
|
|
73
|
+
- [Hightouch](./docs/integrations/hightouch.md): Configure Hightouch with c15t v3, understand measurement permission and verify loading and revocation.
|
|
74
|
+
- [Hotjar](./docs/integrations/hotjar.md): Configure Hotjar with c15t v3, understand measurement permission and verify loading and revocation.
|
|
75
|
+
- [Intercom](./docs/integrations/intercom.md): Load the Intercom messenger with functionality permission and configure its region.
|
|
76
|
+
- [LinkedIn Insight Tag](./docs/integrations/linkedin-insights.md): Configure LinkedIn Insight Tag with c15t v3, understand marketing permission and verify loading and revocation.
|
|
77
|
+
- [LogRocket](./docs/integrations/logrocket.md): Configure LogRocket with c15t v3, understand measurement permission and verify loading and revocation.
|
|
78
|
+
- [Matomo Analytics](./docs/integrations/matomo-analytics.md): Choose gated loading or Matomo consent signaling and configure the correct tracker endpoints.
|
|
79
|
+
- [Meta Pixel](./docs/integrations/meta-pixel.md): Register the Meta Pixel under marketing permission and verify event calls after revocation.
|
|
80
|
+
- [Microsoft Clarity](./docs/integrations/microsoft-clarity.md): Configure Microsoft Clarity with c15t v3, understand measurement permission and verify loading and revocation.
|
|
81
|
+
- [Microsoft UET](./docs/integrations/microsoft-uet.md): Configure Microsoft UET with c15t v3, understand marketing permission and verify loading and revocation.
|
|
82
|
+
- [Mixpanel](./docs/integrations/mixpanel-analytics.md): Configure Mixpanel with c15t v3, understand measurement permission and verify loading and revocation.
|
|
83
|
+
- [OpenAI Pixel](./docs/integrations/openai-pixel.md): Configure the OpenAI Measurement Pixel for ChatGPT Ads with c15t v3, manage marketing permission and verify conversion delivery.
|
|
84
|
+
- [Overview](./docs/integrations/overview.md): Find all c15t integrations for analytics, tag managers, advertising, chat and embedded content.
|
|
85
|
+
- [Pirsch](./docs/integrations/pirsch.md): Configure Pirsch with c15t v3, understand measurement permission and verify loading and revocation.
|
|
86
|
+
- [Plausible Analytics](./docs/integrations/plausible-analytics.md): Configure Plausible Analytics with c15t v3, understand measurement permission and verify loading and revocation.
|
|
87
|
+
- [PostHog](./docs/integrations/posthog.md): Choose PostHog loading and cookieless behavior, configure the region, and synchronize v3 permissions.
|
|
88
|
+
- [Promptwatch](./docs/integrations/promptwatch.md): Configure Promptwatch with c15t v3, understand measurement permission and verify loading and revocation.
|
|
89
|
+
- [Reddit Pixel](./docs/integrations/reddit-pixel.md): Configure Reddit Pixel with c15t v3, understand marketing permission and verify loading and revocation.
|
|
90
|
+
- [RudderStack](./docs/integrations/rudderstack.md): Gate the RudderStack browser SDK or map c15t categories to destination consent IDs.
|
|
91
|
+
- [Rybbit Analytics](./docs/integrations/rybbit-analytics.md): Configure Rybbit Analytics with c15t v3, understand measurement permission and verify loading and revocation.
|
|
92
|
+
- [Segment](./docs/integrations/segment.md): Configure Segment with c15t v3, understand measurement permission and verify loading and revocation.
|
|
93
|
+
- [Snapchat Pixel](./docs/integrations/snapchat-pixel.md): Configure Snapchat Pixel with c15t v3, understand marketing permission and verify loading and revocation.
|
|
94
|
+
- [TikTok Pixel](./docs/integrations/tiktok-pixel.md): Configure TikTok Pixel with c15t v3, understand marketing permission and verify loading and revocation.
|
|
95
|
+
- [Umami Analytics](./docs/integrations/umami-analytics.md): Configure Umami Analytics with c15t v3, understand measurement permission and verify loading and revocation.
|
|
96
|
+
- [Vercel Analytics](./docs/integrations/vercel-analytics.md): Configure Vercel Analytics with c15t v3, understand measurement permission and verify loading and revocation.
|
|
97
|
+
- [X Pixel](./docs/integrations/x-pixel.md): Configure X Pixel with c15t v3, understand marketing permission and verify loading and revocation.
|
|
98
|
+
- [YouTube](./docs/integrations/youtube.md): Gate YouTube embeds with c15t v3 in Next.js, TanStack Start, React, Nuxt, Vue, Astro, Svelte, SvelteKit or JavaScript.
|
|
103
99
|
|
|
104
100
|
## Reference
|
|
105
101
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
- [Client Modes](./docs/shared/concepts/client-modes.md): Reference page for client modes.
|
|
109
|
-
- [Consent Categories](./docs/shared/concepts/consent-categories.md): Reference page for consent categories.
|
|
110
|
-
- [Consent Models](./docs/shared/concepts/consent-models.md): Reference page for consent models.
|
|
111
|
-
- [Cookie Management](./docs/shared/concepts/cookie-management.md): Reference page for cookie management.
|
|
112
|
-
- [Glossary](./docs/shared/concepts/glossary.md): Reference page for glossary.
|
|
113
|
-
- [Initialization Flow](./docs/shared/concepts/initialization-flow.md): Reference page for initialization flow.
|
|
114
|
-
- [Policy Packs](./docs/shared/concepts/policy-packs.md): Reference page for policy packs.
|
|
115
|
-
- [Consent Banner](./docs/shared/react/components/consent-banner.md): Reference page for consent banner.
|
|
116
|
-
- [Consent Dialog](./docs/shared/react/components/consent-dialog.md): Reference page for consent dialog.
|
|
117
|
-
- [Consent Dialog Link](./docs/shared/react/components/consent-dialog-link.md): Reference page for consent dialog link.
|
|
118
|
-
- [Consent Dialog Trigger](./docs/shared/react/components/consent-dialog-trigger.md): Reference page for consent dialog trigger.
|
|
119
|
-
- [Consent Manager Provider](./docs/shared/react/components/consent-manager-provider.md): Reference page for consent manager provider.
|
|
120
|
-
- [Consent Widget](./docs/shared/react/components/consent-widget.md): Reference page for consent widget.
|
|
121
|
-
- [Dev Tools](./docs/shared/react/components/dev-tools.md): Reference page for dev tools.
|
|
122
|
-
- [Frame](./docs/shared/react/components/frame.md): Reference page for frame.
|
|
123
|
-
- [Building Headless Components](./docs/shared/react/guides/building-headless-components.md): Reference page for building headless components.
|
|
124
|
-
- [Callbacks](./docs/shared/react/guides/callbacks.md): Reference page for callbacks.
|
|
125
|
-
- [Headless](./docs/shared/react/guides/headless.md): Reference page for headless.
|
|
126
|
-
- [Iframe Blocking](./docs/shared/react/guides/iframe-blocking.md): Reference page for iframe blocking.
|
|
127
|
-
- [Internationalization](./docs/shared/react/guides/internationalization.md): Reference page for internationalization.
|
|
128
|
-
- [Network Blocker](./docs/shared/react/guides/network-blocker.md): Reference page for network blocker.
|
|
129
|
-
- [Optimization](./docs/shared/react/guides/optimization.md): Reference page for optimization.
|
|
130
|
-
- [Policy Packs](./docs/shared/react/guides/policy-packs.md): Reference page for policy packs.
|
|
131
|
-
- [Script Loader](./docs/shared/react/guides/script-loader.md): Reference page for script loader.
|
|
132
|
-
- [Use Color Scheme](./docs/shared/react/hooks/use-color-scheme.md): Reference page for use color scheme.
|
|
133
|
-
- [Checking Consent](./docs/shared/react/hooks/use-consent-manager/checking-consent.md): Reference page for checking consent.
|
|
134
|
-
- [Location Info](./docs/shared/react/hooks/use-consent-manager/location-info.md): Reference page for location info.
|
|
135
|
-
- [Overview](./docs/shared/react/hooks/use-consent-manager/overview.md): Reference page for overview.
|
|
136
|
-
- [Setting Consent](./docs/shared/react/hooks/use-consent-manager/setting-consent.md): Reference page for setting consent.
|
|
137
|
-
- [Use Draggable](./docs/shared/react/hooks/use-draggable.md): Reference page for use draggable.
|
|
138
|
-
- [Use Focus Trap](./docs/shared/react/hooks/use-focus-trap.md): Reference page for use focus trap.
|
|
139
|
-
- [Use Reduced Motion](./docs/shared/react/hooks/use-reduced-motion.md): Reference page for use reduced motion.
|
|
140
|
-
- [Use SSR Status](./docs/shared/react/hooks/use-ssr-status.md): Reference page for use ssr status.
|
|
141
|
-
- [Use Text Direction](./docs/shared/react/hooks/use-text-direction.md): Reference page for use text direction.
|
|
142
|
-
- [Use Translations](./docs/shared/react/hooks/use-translations.md): Reference page for use translations.
|
|
143
|
-
- [Consent Banner](./docs/shared/react/iab/consent-banner.md): Reference page for consent banner.
|
|
144
|
-
- [Consent Dialog](./docs/shared/react/iab/consent-dialog.md): Reference page for consent dialog.
|
|
145
|
-
- [Overview](./docs/shared/react/iab/overview.md): Reference page for overview.
|
|
146
|
-
- [Use GVL Data](./docs/shared/react/iab/use-gvl-data.md): Reference page for use gvl data.
|
|
147
|
-
- [Classnames](./docs/shared/react/styling/classnames.md): Reference page for classnames.
|
|
148
|
-
- [Color Scheme](./docs/shared/react/styling/color-scheme.md): Reference page for color scheme.
|
|
149
|
-
- [CSS Variables](./docs/shared/react/styling/css-variables.md): Reference page for css variables.
|
|
150
|
-
- [Overview](./docs/shared/react/styling/overview.md): Reference page for overview.
|
|
151
|
-
- [Slots](./docs/shared/react/styling/slots.md): Reference page for slots.
|
|
152
|
-
- [Stylesheet Entrypoint](./docs/shared/react/styling/stylesheet-entrypoint.md): Reference page for stylesheet entrypoint.
|
|
153
|
-
- [Tailwind](./docs/shared/react/styling/tailwind.md): Reference page for tailwind.
|
|
154
|
-
- [Tokens](./docs/shared/react/styling/tokens.md): Reference page for tokens.
|
|
155
|
-
- [Troubleshooting](./docs/shared/troubleshooting.md): Reference page for troubleshooting.
|
|
102
|
+
- [Upgrade to v3 policies](./docs/upgrade-v3.md): Migrate policy configuration, consent records, callbacks, and custom transports to the v3 policy system.
|
package/README.md
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
<a href="https://github.com/c15t/c15t/blob/main/LICENSE.md"><picture><source media="(prefers-color-scheme: dark)" srcset="https://shieldcn.dev/github/c15t/c15t/license.svg?variant=outline&mode=dark"><img src="https://shieldcn.dev/github/c15t/c15t/license.svg?variant=outline&mode=light" alt="License"></picture></a>
|
|
16
16
|
<a href="https://c15t.link/discord"><picture><source media="(prefers-color-scheme: dark)" srcset="https://shieldcn.dev/discord/1312171102268690493.svg?variant=outline&mode=dark"><img src="https://shieldcn.dev/discord/1312171102268690493.svg?variant=outline&mode=light" alt="Discord"></picture></a>
|
|
17
17
|
<a href="https://skills.sh/c15t/skills/c15t"><picture><source media="(prefers-color-scheme: dark)" srcset="https://shieldcn.dev/skills/c15t/skills/c15t.svg?variant=outline&mode=dark"><img src="https://shieldcn.dev/skills/c15t/skills/c15t.svg?variant=outline&mode=light" alt="Skills"></picture></a>
|
|
18
|
-
<a href="https://inth.com?utm_source=npm&utm_medium=readme&utm_campaign=oss_readme&utm_content=%40c15t%2Freact"><picture><source media="(prefers-color-scheme: dark)" srcset="https://shieldcn.dev/badge/Made%20By-Inth-ffc803.svg?logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCAzOTMgNDAwIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJNMTgyLjY2MiAwdjM2Ljg5NWgtNTkuMDMxdjgyLjczM2g1OS4wMzF2MzYuODkzSDI3LjQ4MnYtMzYuODkzaDU5LjAzVjM2Ljg5NWgtNTkuMDNWMHpNMzIxLjk0MSA4OS44NVYwaDM1LjM1NXYxNTYuNTIxaC0yNS43MTNsLTg2LjEzNy05MC4zNjR2OTAuMzY0aC0zNS4zNTVWMGgyNi4zNTV6Ii8%2BPHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMzE4LjU3MSAxODUuNzE0aDc0LjI4NlY0MDBIMFYxODUuNzE0aDI3Mi44NTd2LTQ3LjE0M3ptLTI5MS4wOSAyOC45Njl2MzcuMTE4aDU4LjEzN3YxMTkuNjI4aDM2Ljg5NVYyNTEuODAxaDU4LjU4NHYtMzcuMTE4em0xODIuNjEuMjI0djE1Ni41MjJoMzYuODk0VjMxMy41OWg3My4zNDF2NTcuODM5aDM3LjExOFYyMTQuOTA3aC0zNy4xMTh2NjEuNzg4aC03My4zNDF2LTYxLjc4OHoiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg%3D%3D&
|
|
18
|
+
<a href="https://inth.com?utm_source=npm&utm_medium=readme&utm_campaign=oss_readme&utm_content=%40c15t%2Freact"><picture><source media="(prefers-color-scheme: dark)" srcset="https://shieldcn.dev/badge/Made%20By-Inth-ffc803.svg?color=ffc803&labelTextColor=000000&logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCAzOTMgNDAwIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJNMTgyLjY2MiAwdjM2Ljg5NWgtNTkuMDMxdjgyLjczM2g1OS4wMzF2MzYuODkzSDI3LjQ4MnYtMzYuODkzaDU5LjAzVjM2Ljg5NWgtNTkuMDNWMHpNMzIxLjk0MSA4OS44NVYwaDM1LjM1NXYxNTYuNTIxaC0yNS43MTNsLTg2LjEzNy05MC4zNjR2OTAuMzY0aC0zNS4zNTVWMGgyNi4zNTV6Ii8%2BPHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMzE4LjU3MSAxODUuNzE0aDc0LjI4NlY0MDBIMFYxODUuNzE0aDI3Mi44NTd2LTQ3LjE0M3ptLTI5MS4wOSAyOC45Njl2MzcuMTE4aDU4LjEzN3YxMTkuNjI4aDM2Ljg5NVYyNTEuODAxaDU4LjU4NHYtMzcuMTE4em0xODIuNjEuMjI0djE1Ni41MjJoMzYuODk0VjMxMy41OWg3My4zNDF2NTcuODM5aDM3LjExOFYyMTQuOTA3aC0zNy4xMTh2NjEuNzg4aC03My4zNDF2LTYxLjc4OHoiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg%3D%3D&valueColor=000000&mode=dark"><img src="https://shieldcn.dev/badge/Made%20By-Inth-ffc803.svg?color=ffc803&labelTextColor=000000&logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCAzOTMgNDAwIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJNMTgyLjY2MiAwdjM2Ljg5NWgtNTkuMDMxdjgyLjczM2g1OS4wMzF2MzYuODkzSDI3LjQ4MnYtMzYuODkzaDU5LjAzVjM2Ljg5NWgtNTkuMDNWMHpNMzIxLjk0MSA4OS44NVYwaDM1LjM1NXYxNTYuNTIxaC0yNS43MTNsLTg2LjEzNy05MC4zNjR2OTAuMzY0aC0zNS4zNTVWMGgyNi4zNTV6Ii8%2BPHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMzE4LjU3MSAxODUuNzE0aDc0LjI4NlY0MDBIMFYxODUuNzE0aDI3Mi44NTd2LTQ3LjE0M3ptLTI5MS4wOSAyOC45Njl2MzcuMTE4aDU4LjEzN3YxMTkuNjI4aDM2Ljg5NVYyNTEuODAxaDU4LjU4NHYtMzcuMTE4em0xODIuNjEuMjI0djE1Ni41MjJoMzYuODk0VjMxMy41OWg3My4zNDF2NTcuODM5aDM3LjExOFYyMTQuOTA3aC0zNy4xMTh2NjEuNzg4aC03My4zNDF2LTYxLjc4OHoiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg%3D%3D&valueColor=000000&mode=light" alt="Made by Inth"></picture></a>
|
|
19
19
|
</p>
|
|
20
20
|
|
|
21
21
|
React cookie banner, consent manager, preference center, and headless CMP components for modern React apps.
|
|
@@ -36,7 +36,7 @@ React cookie banner, consent manager, preference center, and headless CMP compon
|
|
|
36
36
|
## Prerequisites
|
|
37
37
|
|
|
38
38
|
- React 16.8 or later
|
|
39
|
-
- Node.js
|
|
39
|
+
- Node.js 20.19 or later
|
|
40
40
|
- A hosted [c15t instance](https://inth.com) (free sign-up), [self-hosted deployment](https://c15t.com/docs/self-host/quickstart), or offline mode for local-only storage
|
|
41
41
|
|
|
42
42
|
## Quick Start
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import{jsx as o}from"react/jsx-runtime";import{Suspense as e,lazy as n}from"react";import{registerDialogChunkWarmer as t}from"./chunk-warming.js";import{useActiveUI as r}from"./hooks.js";let i=function(n){return t=>o(e,{fallback:null,children:o(n,{...t})})},c=function(o){return i(n(async()=>({default:(await import("./components/panel/index.js"))[o]})))};t(()=>{import("./components/panel/index.js")});let a=function(o){return i(n(async()=>({default:(await import("./components/preferences/index.js"))[o]})))},l=c("ConsentDialog"),s=a("ConsentWidget"),d=function(o,e,n){let t={};for(let r of e)Object.defineProperty(o,r,{configurable:!0,enumerable:!0,get:()=>(t[r]??=n(r),t[r])});return o},u=d(e=>{let n=r();return!0===e.open||"dialog"===n||e.showTrigger?o(l,{...e}):null},["Card","Header","HeaderTitle","HeaderDescription","Content","Footer","ConsentCustomizationCard","ConsentDialogFooter","ConsentDialogHeader","ConsentDialogHeaderTitle","ConsentDialogHeaderDescription","ConsentDialogContent","Overlay","Root"],c),m=d(e=>o(s,{...e}),["AccordionTrigger","AccordionTriggerInner","AccordionContent","AccordionArrow","Accordion","Switch","AccordionItems","AccordionItem","Root","AcceptAllButton","CustomizeButton","SaveButton","RejectButton","PolicyActions","Footer","FooterSubGroup"],a);export{u as ConsentDialog,m as ConsentWidget};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
let r=new Set,e=!1,n=function(n){return r.add(n),e&&n(),()=>{r.delete(n)}},a=function(){if(!e)for(let n of(e=!0,r))n()};export{n as registerDialogChunkWarmer,a as warmDialogChunk};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import{resolveConsentPresentation as e}from"@c15t/core";import{useCallback as s,useContext as r,useEffect as o,useMemo as t}from"react";import{GlobalThemeContext as c}from"../context/theme-context.js";import{useConsentSaveAction as n}from"../draft.js";import{useActiveUI as i,useDismissNotice as a,usePolicyRule as p,useSetActiveUI as l}from"../hooks.js";import{useTheme as m}from"../hooks/use-theme.js";import{useUIConfig as u}from"../ui-config-context.js";let f=function(f){let d=i(),g=p(),{presentation:j}=u(),h=r(c),k=t(()=>({preferences:{scrollLock:h.scrollLock,trapFocus:h.trapFocus,...j?.preferences},prompt:{scrollLock:h.scrollLock,trapFocus:h.trapFocus,...j?.prompt}}),[j,h.scrollLock,h.trapFocus]),{theme:b}=m(),v=t(()=>{let e=b?.consentActions;if(e?.accept||e?.reject||e?.customize||e?.dismiss)return{accept:{...e.default,...e.accept},customize:{...e.default,...e.customize},dismiss:{...e.default,...e.dismiss},reject:{...e.default,...e.reject}}},[b]),A=n(),F=a(),L=l(),_=t(()=>({...e({actionAppearance:v,override:f?.prompt,policy:g,presentation:k,surface:"prompt"}),isVisible:"banner"===d}),[g,k,f?.prompt,d,v]),x=t(()=>({...e({actionAppearance:v,override:f?.preferences,policy:g,presentation:k,surface:"preferences"}),isVisible:"dialog"===d}),[g,k,f?.preferences,d,v]);o(()=>{if(globalThis.process?.env?.NODE_ENV!=="production")for(let e of[..._.diagnostics,...x.diagnostics])console.warn(`c15t presentation: ${e.message}`,e.actions)},[_.diagnostics,x.diagnostics]);let z=s(()=>L("banner"),[L]),C=s(()=>L("dialog"),[L]),V=s(()=>L("none"),[L]),w=s(e=>{switch(e){case"accept":return A("all");case"reject":return A("none");case"save":return A();case"dismiss":return F();case"customize":return L("dialog");default:return}},[A,F,L]);return{activeUI:d,banner:_,closeUI:V,dialog:x,openBanner:z,openDialog:C,performAction:w,performBannerAction:w,performDialogAction:w,saveCustomPreferences:A}};export{f as useHeadlessConsentUI};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import{resolveIABBannerSummary as e}from"@c15t/iab/headless";import{useCallback as a,useMemo as t}from"react";import{useIAB as r}from"../iab-context.js";import{useConsentManager as s}from"./use-manager.js";let c=function(){let c=r(),{activeUI:l,policyBanner:n,policyDialog:o,setActiveUI:i}=s(),f=t(()=>e(c),[c]),u=a(()=>{c?.setPreferenceCenterTab("vendors"),i("dialog")},[c,i]),d=a(()=>i("none"),[i]),m=a(e=>{e?.tab&&c?.setPreferenceCenterTab(e.tab),i("dialog")},[c,i]),p=a(async e=>{if("accept"===e){c?.acceptAll(),await c?.save();return}if("reject"===e){c?.rejectAll(),await c?.save();return}m()},[c,m]),b=a(async e=>{if("accept"===e){c?.acceptAll(),await c?.save();return}if("reject"===e){c?.rejectAll(),await c?.save();return}await c?.save()},[c]);return{activeUI:l,banner:{...f,scrollLock:n.scrollLock},closeUI:d,dialog:{isReady:!!(c?.gvl||c?.gvlReference),scrollLock:o.scrollLock},iab:c,openDialog:m,openVendorsDialog:u,performBannerAction:p,performDialogAction:b}};export{c as useHeadlessIABConsentUI};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import{evaluateConsent as e}from"@c15t/core";import{useCallback as t,useContext as a,useMemo as i}from"react";import{ProviderServicesContext as n}from"../context.js";import{useConsentManagerDraft as s}from"../draft.js";import{useActiveUI as r,useBranding as o,useConsents as l,useModel as p,usePolicyCategories as c,usePolicyScopeMode as u,usePreferencesPresentation as m,usePromptPresentation as d,useSetActiveUI as f,useSnapshot as y,useSubscribeToConsentChanges as g,useTranslations as v}from"../hooks.js";import{defaultTranslationConfig as C}from"../utils/default-translation-config.js";let T={},b=[{defaultValue:!0,description:"Required for basic site functionality",disabled:!0,display:!0,gdprType:1,name:"necessary"},{defaultValue:!1,description:"Enables enhanced features",display:!0,gdprType:2,name:"functionality"},{defaultValue:!1,description:"Analytics and performance measurement",display:!0,gdprType:4,name:"measurement"},{defaultValue:!1,description:"Improves your experience",display:!0,gdprType:3,name:"experience"},{defaultValue:!1,description:"Advertising and marketing",display:!0,gdprType:5,name:"marketing"}],x=function(){let x=y(),D=a(n),h=l(),R=r(),S=o(),V=p(),j=d(),k=c(),q=m(),w=u(),{draft:I,save:A}=s(),M=f(),O=g(),P=v(),_=i(()=>P?{...C,defaultLanguage:P.language,translations:{...C.translations,[P.language]:P.translations}}:C,[P]),B=i(()=>["necessary",...k],[k]),E=i(()=>[...D?.getConsentCategories()??B],[D,B]),L=t(()=>{let e=new Set(E);return b.filter(t=>e.has(t.name)).map(e=>({...e,display:!0}))},[E]),U=t(t=>e({category:t},x),[x]),z=t(e=>{M(e)},[M]),F=t(async(e,t)=>{"custom"===e?await A():await A("all"===e?"all":"none")},[A]),G=t((e,t)=>{E.includes(e)&&I.set(e,t)},[I,E]),H=t(e=>{},[]),J=t(e=>O(e),[O]);return{activeUI:R??"none",branding:S??"c15t",consentCategories:E,consentTypes:L(),consents:h,draftIsStale:I.isStale,effectivePermissions:x.effectivePermissions,explicitChoice:x.explicitChoice,getDisplayedConsents:L,has:U,iab:x.iab,manager:null,model:V??"opt-in",noticeDismissal:x.noticeDismissal,optOutDirectives:x.optOutDirectives,policyBanner:j??T,policyCategories:B,policyDialog:q??T,policyRule:x.policyRule,policyScopeMode:w,privacySignals:x.privacySignals,promptRequirement:x.promptRequirement,resetDraft:I.reset,resolution:x.resolution,restrictions:x.restrictions,saveConsents:F,selectedConsentTypes:I.values,selectedConsents:I.values,setActiveUI:z,setSelectedConsent:G,subscribeToConsentChanges:J,translationConfig:_,updateConsentCategories:H}};export{x as useConsentManager};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import{useCallback as e}from"react";import{useActiveUI as r,useHasConsentUI as o,usePromptRequirement as i,useSetActiveUI as t}from"../hooks.js";let n=function(n={}){let{showWhen:s="always",onClick:a}=n,g=t(),l=r(),p=i(),m=o(),u=e(()=>{a?.(),g("dialog")},[a,g]),f="after-prompt"!==s||"none"===p.kind;return{isVisible:m&&"never"!==s&&"dialog"!==l&&f,openDialog:u}};export{n as useConsentDialogTrigger};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import{useMemo as s}from"react";import{useTranslations as t}from"../hooks.js";import{defaultTranslationConfig as n}from"../utils/default-translation-config.js";let a=function(){let a=t();return s(()=>a?.translations??n.translations.en,[a])};export{a as useTranslations};
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import{jsx as t}from"react/jsx-runtime";import{forwardRef as o}from"react";import{ConsentButton as i}from"../shared/primitives/button.js";import{useHasConsentUI as n,usePolicyRule as r}from"../../hooks.js";let e=o(({children:o,noStyle:e=!0,...a},s)=>{let l=r();return n()?t(i,{ref:s,action:"open-consent-dialog",noStyle:e,"data-testid":"consent-dialog-link","data-c15t-rights":l.rights.join(" "),...a,children:o}):null});e.displayName="ConsentDialogLink";export{e as ConsentDialogLink};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e}from"react/jsx-runtime";import t from"@c15t/ui/styles/components/frame
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import t from"@c15t/ui/styles/components/frame";import{forwardRef as r}from"react";import{useTranslations as a}from"../../component-hooks/use-translations.js";import{Box as o}from"../shared/primitives/box.js";import{ConsentButton as i}from"../shared/primitives/button.js";let m=r(({children:r,...a},i)=>e(o,{ref:i,baseClassName:t.placeholder,"data-testid":"frame-placeholder",...a,children:r})),l=r(({children:r,category:i,...m},l)=>{let{frame:s,consentTypes:n}=a(),p=i&&s?.title?s.title.replace("{category}",n?.[i]?.title??i):void 0;return e(o,{ref:l,baseClassName:t.title,...m,children:r??p})}),s=r(({children:t,category:r,...o},m)=>{let{frame:l,consentTypes:s}=a(),n=s?.[r]?.title??r,p=l?.actionButton?.replace("{category}",n);return e(i,{mode:"stroke",size:"small",variant:"primary",...o,ref:m,action:"open-consent-dialog",category:r,"data-testid":"frame-open-dialog",children:t??p})});m.displayName="FrameRoot",l.displayName="FrameTitle",s.displayName="FrameButton";export{s as FrameButton,m as FrameRoot,l as FrameTitle};
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import{jsx as e,jsxs as o}from"react/jsx-runtime";import{forwardRef as r,useEffect as t}from"react";import{useConsentManager as i}from"../../component-hooks/use-manager.js";import{useTranslations as l}from"../../component-hooks/use-translations.js";import{FrameButton as n,FrameRoot as s,FrameTitle as c}from"./atoms.js";let a=({category:r,policyBlocked:t,policyBlockedMessage:i})=>o(s,{children:[e(c,{category:r,children:t?i??"This content is unavailable under your region's consent policy.":void 0}),t?null:e(n,{category:r})]}),m=r(({children:o,category:r,placeholder:n,noStyle:s,className:c,theme:m,...d},p)=>{let{has:y,updateConsentCategories:u,consentCategories:h,policyCategories:g,policyScopeMode:f}=i(),{frame:k}=l(),j=y(r),v=Array.isArray(g)&&g.length>0&&!g.includes("*")&&!g.includes(r);return t(()=>{h.includes(r)||u([...h,r])},[r,h,u]),e("div",{ref:p,className:c,...d,children:j?o:n||e(a,{category:r,policyBlocked:"strict"===f&&v,policyBlockedMessage:k?.policyBlocked})})});m.displayName="Frame";let d=m;export{d as Frame};
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import{Frame as t}from"./frame.js";import*as e from"./atoms.js";let r=Object.assign(t,{Button:e.FrameButton,Root:e.FrameRoot,Title:e.FrameTitle});var a=e.FrameButton,m=e.FrameRoot,o=e.FrameTitle;export{a as FrameButton,m as FrameRoot,o as FrameTitle,r as Frame};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import{jsx as t}from"react/jsx-runtime";import e from"@c15t/ui/styles/components/iab-consent-dialog";import{forwardRef as r,useCallback as o,useEffect as i,useRef as a,useState as n}from"react";import{useFocusTrap as s}from"../../../hooks/use-focus-trap.js";import{useTheme as m}from"../../../hooks/use-theme.js";import{useUIConfig as l}from"../../../ui-config-context.js";import{cnExt as c}from"../../../utils/cn.js";import{mergeSlotProps as d}from"../../../utils/merge-slot-props.js";import{useIABTranslations as u}from"../use-iab-translations.js";let p=r(({children:r,className:p,"data-testid":f,...b},g)=>{let{trapFocus:j}=m(),{components:C}=l(),h=a(null),x=o(t=>{if(h.current=t,"function"==typeof g)return g(t);g&&(g.current=t)},[g]),A=u(),[y,I]=n(!1);return s(!!j,h),i(()=>{let t=requestAnimationFrame(()=>I(!0));return()=>cancelAnimationFrame(t)},[]),t("div",{ref:x,...d(C?.["iab-dialog"]?.card,{baseClassName:c(e.card,y?e.contentVisible:e.contentHidden),className:p,"data-testid":f??"iab-consent-dialog-card",...b}),"aria-label":A.preferenceCenter.title,"aria-modal":j?"true":void 0,role:"dialog",tabIndex:-1,children:r})});p.displayName="IABConsentDialogCard";export{p as IABConsentDialogCard};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import{jsx as t}from"react/jsx-runtime";import o from"@c15t/ui/styles/components/iab-consent-dialog";import{forwardRef as e}from"react";let n=e(({children:e,className:n,...i},r)=>t("div",{ref:r,className:n?`${o.content} ${n}`:o.content,...i,children:e}));n.displayName="IABConsentDialogContent";export{n as IABConsentDialogContent};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import{Fragment as o,jsx as t,jsxs as e}from"react/jsx-runtime";import a from"@c15t/ui/styles/components/consent-actions";import i from"@c15t/ui/styles/components/iab-consent-dialog";import{forwardRef as s}from"react";import{useHeadlessIABConsentUI as r}from"../../../component-hooks/use-headless-iab-consent-ui.js";import{useTheme as c}from"../../../hooks/use-theme.js";import{useUIConfig as n}from"../../../ui-config-context.js";import{mergeSlotProps as m}from"../../../utils/merge-slot-props.js";import{useGVLData as l}from"../hooks/use-gvl-data.js";import{useIABTranslations as d}from"../use-iab-translations.js";import*as p from"../../shared/ui/button/index.js";let u=s(({children:s,className:u,...f},h)=>{let{banner:y,performDialogAction:j}=r(),{components:b}=n(),{noStyle:g}=c(),k=d(),{isLoading:v}=l(),C=async()=>{try{await j("accept")}catch{}},R=async()=>{try{await j("reject")}catch{}},z=async()=>{try{await j("customize")}catch{}};return t("div",{ref:h,...m(b?.["iab-dialog"]?.footer,{baseClassName:[i.footer,a.actionRoot],className:u,noStyle:g,...f}),children:s||e(o,{children:[e("div",{className:a.actionGroup,"data-direction":"row",children:[t(p.Root,{variant:"neutral",mode:"stroke",size:"small",onClick:R,disabled:!y.isReady,"data-action":"reject",children:k.common.rejectAll}),t(p.Root,{variant:"neutral",mode:"stroke",size:"small",onClick:C,disabled:!y.isReady,"data-action":"accept",children:k.common.acceptAll})]}),t(p.Root,{variant:"primary",mode:"filled",size:"small",onClick:z,disabled:v,"data-action":"customize",children:k.common.saveSettings})]})})});u.displayName="IABConsentDialogFooter";export{u as IABConsentDialogFooter};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import{Fragment as e,jsx as t,jsxs as o}from"react/jsx-runtime";import r from"@c15t/ui/styles/components/iab-consent-dialog";import{forwardRef as i}from"react";import{useTranslations as n}from"../../../component-hooks/use-translations.js";import{useSetActiveUI as s}from"../../../hooks.js";import{useUIConfig as l}from"../../../ui-config-context.js";import{mergeSlotProps as a}from"../../../utils/merge-slot-props.js";import{useIABTranslations as c}from"../use-iab-translations.js";let m=i(({children:i,headerTitle:m,description:d,showCloseButton:p=!0,className:h},f)=>{let u=s(),{components:g}=l(),b=c(),{common:x}=n();return t("div",{ref:f,...a(g?.["iab-dialog"]?.header,{baseClassName:r.header,className:h}),children:i||o(e,{children:[o("div",{className:r.headerContent,children:[t("h2",{className:r.title,children:m??b.preferenceCenter.title}),t("p",{className:r.description,children:d??b.preferenceCenter.description})]}),p&&t("button",{type:"button",onClick:()=>{u("none")},className:r.closeButton,"aria-label":x.close,"data-testid":"iab-consent-dialog-close",children:o("svg",{style:{height:"1rem",width:"1rem"},viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[t("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),t("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})})});m.displayName="IABConsentDialogHeader";export{m as IABConsentDialogHeader};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import{jsx as e}from"react/jsx-runtime";import t from"@c15t/ui/styles/components/iab-consent-dialog";import{forwardRef as o,useEffect as r,useState as a}from"react";import{useTheme as i}from"../../../hooks/use-theme.js";import{useUIConfig as n}from"../../../ui-config-context.js";import{cnExt as l}from"../../../utils/cn.js";import{mergeSlotProps as m}from"../../../utils/merge-slot-props.js";let s=o(({className:o,style:s,noStyle:u,isOpen:c,...d},p)=>{let y,{disableAnimation:f,noStyle:g,scrollLock:v}=i(),{components:b}=n(),[A,j]=a(!1);r(()=>{if(c){let e=requestAnimationFrame(()=>j(!0));return()=>cancelAnimationFrame(e)}if(f){let e=requestAnimationFrame(()=>j(!1));return()=>cancelAnimationFrame(e)}let e=setTimeout(()=>{j(!1)},Number.parseInt(getComputedStyle(document.documentElement).getPropertyValue("--iab-cd-animation-duration")||"150",10));return()=>clearTimeout(e)},[c,f]);let N=m(b?.["iab-dialog"]?.overlay,{baseClassName:t.overlay,className:o,noStyle:g||u,style:s,...d});g||u||f||(y=A?t.overlayVisible:t.overlayHidden);let C=l(N.className,y);return c&&v?e("div",{ref:p,...N,"aria-hidden":"true",className:C,"data-testid":"iab-consent-dialog-overlay"}):null});s.displayName="IABConsentDialogOverlay";export{s as IABConsentDialogOverlay};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import{Fragment as e,jsx as t,jsxs as r}from"react/jsx-runtime";import{iabDisplayTestId as n}from"@c15t/iab/headless";import i from"@c15t/ui/styles/components/iab-consent-dialog";import{useState as o}from"react";import{useTheme as s}from"../../../hooks/use-theme.js";import{useUIConfig as l}from"../../../ui-config-context.js";import{mergeSlotProps as a}from"../../../utils/merge-slot-props.js";import{useIABTranslations as c}from"../use-iab-translations.js";import*as d from"../../shared/ui/preference-item/index.js";import*as p from"../../shared/ui/switch/index.js";let m={},h={},g=({vendor:e,isConsented:n,onToggle:o,onClick:s,isLegitimateInterest:l=!1,isLegitimateInterestAllowed:a=!0,onLegitimateInterestToggle:d})=>{let m=c(),h=l&&d;return r("div",{className:`${i.vendorRow} ${l?i.vendorRowLi:""}`,children:[r("div",{className:i.vendorInfo,children:[r("button",{type:"button",onClick:s,className:i.vendorName,children:[t("span",{children:e.name}),e.isCustom&&r("svg",{className:i.customVendorIcon,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-label":m.common.customPartner,children:[t("circle",{cx:"12",cy:"12",r:"10"}),t("line",{x1:"2",y1:"12",x2:"22",y2:"12"}),t("path",{d:"M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"})]})]}),r("div",{className:i.vendorDetails,children:[l&&t("span",{className:`${i.vendorDetail} ${i.vendorDetailLi}`,children:m.preferenceCenter.purposeItem.legitimateInterest}),e.usesCookies&&t("span",{className:i.vendorDetail,children:m.preferenceCenter.vendorList.usesCookies}),e.usesNonCookieAccess&&t("span",{className:i.vendorDetail,children:m.preferenceCenter.vendorList.nonCookieAccess})]})]}),h?t("button",{type:"button",onClick:()=>d(!a),className:`${i.objectButton} ${a?"":i.objectButtonActive}`,"aria-pressed":!a,children:a?m.preferenceCenter.purposeItem.objectButton:m.preferenceCenter.purposeItem.objected}):t(p.Root,{"aria-label":e.name,checked:n,onCheckedChange:o,size:"small"})]})},u=({purpose:u,testId:v,isEnabled:C,onToggle:f,vendorConsents:I,onVendorToggle:N,onVendorClick:k,isLocked:y=!1,vendorLegitimateInterests:b=m,onVendorLegitimateInterestToggle:x,purposeLegitimateInterests:S=h,onPurposeLegitimateInterestToggle:M})=>{let{components:L}=l(),{noStyle:w}=s(),[T,B]=o(!1),[j,W]=o(!1),[$,A]=o(!1),R=c(),D=u.vendors.filter(e=>e.usesLegitimateInterest),O=u.vendors.filter(e=>!e.usesLegitimateInterest),P=e=>I[String(e)]??!1,H=e=>b[String(e)]??!0,U=S[u.id]??!0,V=O.filter(e=>!e.isCustom),z=O.filter(e=>e.isCustom),K=D.filter(e=>!e.isCustom),E=D.filter(e=>e.isCustom),Y=a(L?.["iab-purpose-item"]?.header,{baseClassName:i.purposeHeader,noStyle:w}),q=a(L?.["iab-purpose-item"]?.legitimateInterest,{baseClassName:i.purposeLiSection,noStyle:w}),F=a(L?.["iab-purpose-item"]?.examples,{noStyle:w}),G=a(L?.["iab-purpose-item"]?.vendors,{noStyle:w});return r(d.Root,{className:w?void 0:i.purposeItem,"data-testid":v??n("purpose",u.id),noStyle:!0,onOpenChange:B,open:T,slotKey:"iab-purpose-item.root",children:[r("div",{...Y,children:[r(d.Trigger,{className:w?void 0:i.purposeTrigger,noStyle:!0,slotKey:"iab-purpose-item.trigger",children:[t(d.Leading,{noStyle:!0,children:t("svg",{className:i.purposeArrow,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:T?t("path",{d:"M19 9l-7 7-7-7"}):t("path",{d:"M9 5l7 7-7 7"})})}),r(d.Header,{className:i.purposeInfo,noStyle:!0,children:[r(d.Title,{className:i.purposeName,noStyle:!0,children:[u.name,y&&r("svg",{className:i.lockIcon,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[t("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),t("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]})]}),t(d.Meta,{className:i.purposeMeta,noStyle:!0,children:R.preferenceCenter.purposeItem.partners.replace("{count}",String(u.vendors.length))}),D.length>0&&r(d.Auxiliary,{className:i.legitimateInterestBadge,noStyle:!0,children:[t("svg",{className:i.legitimateInterestIcon,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:t("path",{d:"M12 3v18M3 12h18M4.93 4.93l14.14 14.14M19.07 4.93L4.93 19.07"})}),R.preferenceCenter.purposeItem.vendorsUseLegitimateInterest.replace("{count}",String(D.length))]})]})]}),t(d.Control,{noStyle:!0,children:t(p.Root,{"aria-label":u.name,checked:C,onCheckedChange:e=>{for(let t of(f(e),O))N(t.id,e)},disabled:y})})]}),r(d.Content,{innerClassName:w?void 0:i.purposeContent,innerSlotKey:"iab-purpose-item.content",noStyle:w,children:[t("p",{className:i.purposeDescription,children:u.description}),D.length>0&&M&&r("div",{...q,children:[r("div",{className:i.purposeLiSectionHeader,children:[r("div",{className:i.purposeLiInfo,children:[t("svg",{className:i.legitimateInterestIcon,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:t("path",{d:"M12 3v18M3 12h18M4.93 4.93l14.14 14.14M19.07 4.93L4.93 19.07"})}),t("span",{children:R.preferenceCenter.purposeItem.vendorsUseLegitimateInterest.replace("{count}",String(D.length))})]}),t("button",{type:"button",onClick:()=>{let e=!U;if(M&&M(u.id,e),x)for(let t of D)x(t.id,e)},className:`${i.objectButton} ${U?"":i.objectButtonActive}`,"aria-pressed":!U,children:U?R.preferenceCenter.purposeItem.objectButton:R.preferenceCenter.purposeItem.objected})]}),t("p",{className:i.liExplanation,children:R.preferenceCenter.purposeItem.rightToObject})]}),D.length>0&&!M&&r("div",{className:i.legitimateInterestBadge,children:[t("svg",{className:i.legitimateInterestIcon,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:t("path",{d:"M12 3v18M3 12h18M4.93 4.93l14.14 14.14M19.07 4.93L4.93 19.07"})}),R.preferenceCenter.purposeItem.vendorsUseLegitimateInterest.replace("{count}",String(D.length))]}),u.illustrations&&u.illustrations.length>0&&t("div",{...F,children:r(d.Root,{noStyle:!0,onOpenChange:W,open:j,children:[r(d.Trigger,{className:i.examplesToggle,noStyle:!0,children:[t("svg",{style:{height:"0.75rem",width:"0.75rem"},viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:j?t("path",{d:"M19 9l-7 7-7-7"}):t("path",{d:"M9 5l7 7-7 7"})}),R.preferenceCenter.purposeItem.examples," (",u.illustrations.length,")"]}),t(d.Content,{noStyle:w,children:t("ul",{className:i.examplesList,children:u.illustrations.map((e,r)=>t("li",{children:e},r))})})]})}),t("div",{...G,children:r(d.Root,{noStyle:!0,onOpenChange:A,open:$,children:[r(d.Trigger,{className:i.vendorsToggle,noStyle:!0,children:[t("svg",{style:{height:"0.75rem",width:"0.75rem"},viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:$?t("path",{d:"M19 9l-7 7-7-7"}):t("path",{d:"M9 5l7 7-7 7"})}),R.preferenceCenter.purposeItem.partnersUsingPurpose," (",u.vendors.length,")"]}),r(d.Content,{innerClassName:i.vendorSection,noStyle:w,children:[V.length>0&&r(e,{children:[r("h5",{className:i.vendorSectionTitle,children:[R.preferenceCenter.purposeItem.withYourPermission," (",V.length,")"]}),V.map(e=>t(g,{vendor:e,isConsented:P(e.id),onToggle:t=>N(e.id,t),onClick:()=>k(e.id)},e.id))]}),K.length>0&&r(e,{children:[r("h5",{className:`${i.vendorSectionTitle} ${i.vendorSectionTitleLi}`,children:[t("svg",{className:i.legitimateInterestIcon,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:t("path",{d:"M12 3v18M3 12h18M4.93 4.93l14.14 14.14M19.07 4.93L4.93 19.07"})}),R.preferenceCenter.purposeItem.legitimateInterest," (",K.length,")"]}),t("p",{className:i.liExplanation,children:R.preferenceCenter.purposeItem.rightToObject}),K.map(e=>t(g,{vendor:e,isConsented:P(e.id),onToggle:t=>N(e.id,t),onClick:()=>k(e.id),isLegitimateInterest:!0,isLegitimateInterestAllowed:H(e.id),onLegitimateInterestToggle:x?t=>x(e.id,t):void 0},e.id))]}),(z.length>0||E.length>0)&&r("div",{className:i.customVendorPurposeSection,children:[r("h5",{className:i.vendorSectionTitleCustom,children:[r("svg",{className:i.legitimateInterestIcon,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[t("circle",{cx:"12",cy:"12",r:"10"}),t("line",{x1:"2",y1:"12",x2:"22",y2:"12"}),t("path",{d:"M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"})]}),R.preferenceCenter.vendorList.customVendorsHeading," (",z.length+E.length,")"]}),z.map(e=>t(g,{vendor:e,isConsented:P(e.id),onToggle:t=>N(e.id,t),onClick:()=>k(e.id)},e.id)),E.map(e=>t(g,{vendor:e,isConsented:P(e.id),onToggle:t=>N(e.id,t),onClick:()=>k(e.id),isLegitimateInterest:!0,isLegitimateInterestAllowed:H(e.id),onLegitimateInterestToggle:x?t=>x(e.id,t):void 0},e.id))]})]})]})})]})]})};export{u as PurposeItem};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import{jsx as o,jsxs as e}from"react/jsx-runtime";import{isDialogDismissKey as t}from"@c15t/ui/primitives/dialog";import r from"@c15t/ui/styles/components/iab-consent-dialog";import{useEffect as i,useMemo as n,useState as m}from"react";import{createPortal as a}from"react-dom";import{ConsentTrackingContext as s}from"../../../context/consent-tracking-context.js";import{LocalThemeContext as l}from"../../../context/theme-context.js";import{useSetActiveUI as c}from"../../../hooks.js";import{useIABConsentManager as d}from"../../../hooks/use-iab-manager.js";import{useIsHydrated as u}from"../../../hooks/use-is-hydrated.js";import{useScrollLock as p}from"../../../hooks/use-scroll-lock.js";import{useTextDirection as f}from"../../../hooks/use-text-direction.js";import{useUIConfig as g}from"../../../ui-config-context.js";import{cnExt as b}from"../../../utils/cn.js";import{mergeSlotProps as j}from"../../../utils/merge-slot-props.js";import{IABConsentDialogOverlay as k}from"./overlay.js";let v=["iab"],h=({children:h,open:x,models:y=v,noStyle:A,disableAnimation:F,scrollLock:L,trapFocus:C,uiSource:D})=>{let{activeUI:q,translationConfig:w,iab:B,policyDialog:E,model:I}=d({preferences:{scrollLock:L,trapFocus:C}}),N=c(),{components:P}=g(),R=f(w.defaultLanguage),T=u(),[H,O]=m(!1),S=null!==I&&y.includes(I)&&(x??"dialog"===q),V=E.blocking,_=n(()=>({disableAnimation:F,noStyle:A,scrollLock:V,trapFocus:V}),[F,A,V]);p(!!(S&&V)),i(()=>{if(!S)return;let o=o=>{t(o.key)&&(o.preventDefault(),N("none"))};return document.addEventListener("keydown",o),()=>document.removeEventListener("keydown",o)},[S,N]),i(()=>{if(S){let o=requestAnimationFrame(()=>O(!0));return()=>cancelAnimationFrame(o)}if(F){let o=requestAnimationFrame(()=>O(!1));return()=>cancelAnimationFrame(o)}let o=setTimeout(()=>{O(!1)},150);return()=>clearTimeout(o)},[S,F]);let z=j(P?.["iab-dialog"]?.root,{baseClassName:b(r.root,F?void 0:H?r.dialogVisible:r.dialogHidden)}),G=n(()=>({uiSource:D??"iab_dialog"}),[D]);return T&&B?.config.enabled&&(S||H)?a(o(s.Provider,{value:G,children:e(l.Provider,{value:_,children:[o(k,{isOpen:S}),o("div",{...z,"data-testid":"iab-consent-dialog-root",dir:R,children:h})]})}),document.body):null};h.displayName="IABConsentDialogRoot";export{h as IABConsentDialogRoot};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import{Fragment as e,jsx as t,jsxs as r}from"react/jsx-runtime";import s from"@c15t/ui/styles/components/iab-consent-dialog";import{useState as o}from"react";import{useTheme as i}from"../../../hooks/use-theme.js";import{useUIConfig as a}from"../../../ui-config-context.js";import{mergeSlotProps as n}from"../../../utils/merge-slot-props.js";import{useIABTranslations as l}from"../use-iab-translations.js";import{PurposeItem as c}from"./purpose-item.js";import*as d from"../../shared/ui/preference-item/index.js";import*as m from"../../shared/ui/switch/index.js";let p={},h={},g=({stack:g,consents:u,onToggle:f,vendorConsents:k,onVendorToggle:v,onVendorClick:y,vendorLegitimateInterests:C=p,onVendorLegitimateInterestToggle:N,purposeLegitimateInterests:b=h,onPurposeLegitimateInterestToggle:S})=>{let{components:I}=a(),{noStyle:j}=i(),L=l(),[T,x]=o(!1),M=g.purposes.every(e=>u[e.id]??!1),w=g.purposes.some(e=>u[e.id]??!1)&&!M,P=n(I?.["iab-stack-item"]?.header,{baseClassName:s.stackHeader,noStyle:j}),V=new Set(g.purposes.flatMap(e=>e.vendors.map(e=>e.id))).size;return r(d.Root,{className:j?void 0:s.stackItem,"data-testid":`stack-item-${g.id}`,noStyle:!0,onOpenChange:x,open:T,slotKey:"iab-stack-item.root",children:[r("div",{...P,children:[r(d.Trigger,{className:j?void 0:s.stackTrigger,noStyle:!0,slotKey:"iab-stack-item.trigger",children:[t(d.Leading,{noStyle:!0,children:t("svg",{className:s.purposeArrow,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:T?t("path",{d:"M19 9l-7 7-7-7"}):t("path",{d:"M9 5l7 7-7 7"})})}),r(d.Header,{className:s.stackInfo,noStyle:!0,children:[t(d.Title,{className:s.stackName,noStyle:!0,children:g.name}),r(d.Meta,{className:s.stackMeta,noStyle:!0,children:[V," ",1===V?L.preferenceCenter.vendorList.partnerSingular:L.preferenceCenter.vendorList.partnerPlural]})]})]}),r(d.Control,{className:s.stackControls,noStyle:!0,children:[w&&r(e,{children:[t("span",{className:s.srOnly,children:"Partially enabled"}),t("div",{className:s.partialIndicator})]}),t(m.Root,{"aria-label":g.name,checked:M,onCheckedChange:e=>{for(let t of g.purposes)for(let r of(f(t.id,e),t.vendors))r.usesLegitimateInterest||v(r.id,e)}})]})]}),r(d.Content,{noStyle:j,children:[t("div",{className:s.stackDescription,children:t("p",{children:g.description})}),t("div",{...n(I?.["iab-stack-item"]?.content,{baseClassName:s.stackContent,noStyle:j}),children:g.purposes.map(e=>t(c,{purpose:e,isEnabled:u[e.id]??!1,onToggle:t=>f(e.id,t),vendorConsents:k,onVendorToggle:v,onVendorClick:y,vendorLegitimateInterests:C,onVendorLegitimateInterestToggle:N,purposeLegitimateInterests:b,onPurposeLegitimateInterestToggle:S},e.id))})]})]})};export{g as StackItem};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import{jsx as e,jsxs as t}from"react/jsx-runtime";import o from"@c15t/ui/styles/components/iab-consent-dialog";import{forwardRef as a}from"react";import{useIABDisplayModel as s}from"../hooks/use-display-model.js";import{useIABTranslations as r}from"../use-iab-translations.js";import*as n from"../../shared/ui/tabs/index.js";let i=a(({children:a,defaultTab:i="purposes",className:l,...u},m)=>{let p=r(),{purposeTabCount:b,vendorTabCount:c,isLoading:d}=s();return e(n.Root,{ref:m,className:l?`${o.tabsContainer} ${l}`:o.tabsContainer,defaultValue:i,...u,children:a||t(n.List,{className:o.tabsList,noStyle:!0,children:[t(n.Trigger,{className:o.tabButton,noStyle:!0,value:"purposes",children:[p.preferenceCenter.tabs.purposes,!d&&` (${b})`]}),t(n.Trigger,{className:o.tabButton,noStyle:!0,value:"vendors",children:[p.preferenceCenter.tabs.vendors,!d&&` (${c})`]})]})})});i.displayName="IABConsentDialogTabs";let l=a(({tab:t,children:a,className:s,...r},i)=>e(n.Trigger,{ref:i,className:s?`${o.tabButton} ${s}`:o.tabButton,noStyle:!0,value:t,...r,children:a}));l.displayName="IABConsentDialogTabButton";export{l as IABConsentDialogTabButton,i as IABConsentDialogTabs};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import{jsx as e,jsxs as r}from"react/jsx-runtime";import n from"@c15t/ui/styles/components/iab-consent-dialog";import{useEffect as t,useState as s}from"react";import{useTheme as i}from"../../../hooks/use-theme.js";import{useUIConfig as o}from"../../../ui-config-context.js";import{mergeSlotProps as a}from"../../../utils/merge-slot-props.js";import{useIABTranslations as l}from"../use-iab-translations.js";import*as d from"../../shared/ui/preference-item/index.js";import*as c from"../../shared/ui/switch/index.js";let m=[],p={},h=({vendorData:h,purposes:u,vendorConsents:v,onVendorToggle:g,selectedVendorId:f,onClearSelection:N,customVendors:C=m,vendorLegitimateInterests:k=p,onVendorLegitimateInterestToggle:L})=>{let{components:y}=o(),{noStyle:S}=i(),[x,I]=s(""),[P,b]=s(new Set),M=l(),w=[...h?Object.entries(h.vendors).map(([e,r])=>({cookieMaxAgeSeconds:r.cookieMaxAgeSeconds,cookieRefresh:r.cookieRefresh,dataDeclaration:r.dataDeclaration||[],dataRetention:r.dataRetention,deviceStorageDisclosureUrl:r.deviceStorageDisclosureUrl??null,features:r.features||[],id:Number(e),isCustom:!1,legIntPurposes:r.legIntPurposes||[],legitimateInterestUrl:r.urls?.find(e=>e.legIntClaim)?.legIntClaim??null,name:r.name,policyUrl:r.policyUrl??"",purposes:r.purposes||[],specialFeatures:r.specialFeatures||[],specialPurposes:r.specialPurposes||[],usesCookies:r.usesCookies,usesNonCookieAccess:r.usesNonCookieAccess})):[],...C.map(e=>({cookieMaxAgeSeconds:e.cookieMaxAgeSeconds??null,cookieRefresh:void 0,dataDeclaration:e.dataCategories||[],dataRetention:void 0,deviceStorageDisclosureUrl:null,features:e.features||[],id:e.id,isCustom:!0,legIntPurposes:e.legIntPurposes||[],legitimateInterestUrl:null,name:e.name,policyUrl:e.privacyPolicyUrl,purposes:e.purposes||[],specialFeatures:e.specialFeatures||[],specialPurposes:[],usesCookies:e.usesCookies??!1,usesNonCookieAccess:e.usesNonCookieAccess??!1}))].sort((e,r)=>e.name.localeCompare(r.name));t(()=>{if(null!==f){let e=requestAnimationFrame(()=>{b(e=>new Set(e).add(f))}),r=setTimeout(()=>{let e=document.getElementById(`vendor-${String(f)}`);e&&e.scrollIntoView({behavior:"smooth",block:"start"})},100);return()=>{cancelAnimationFrame(e),clearTimeout(r)}}},[f]);let R=null===f?w.filter(e=>e.name.toLowerCase().includes(x.toLowerCase())):w.filter(e=>String(e.id)===String(f)),B=R.filter(e=>!e.isCustom),V=R.filter(e=>e.isCustom),A=a(y?.["iab-vendor-list"]?.root,{noStyle:S}),T=a(y?.["iab-vendor-list"]?.header,{baseClassName:n.vendorListHeader,noStyle:S}),D=a(y?.["iab-vendor-list"]?.search,{baseClassName:n.searchContainer,noStyle:S}),U=a(y?.["iab-vendor-list"]?.selectedVendor,{baseClassName:n.selectedVendorBanner,noStyle:S}),$=function(t){var s,i,o,l;let m,p,f,N,C=String(t.id),x=(s=t.id,(m=w.find(e=>String(e.id)===String(s)))?u.filter(e=>e.vendors.some(e=>String(e.id)===String(s))).map(e=>({...e,usesLegitimateInterest:m.legIntPurposes.includes(e.id)})):[]),I=(i=t.id,(p=w.find(e=>String(e.id)===String(i)))&&h?p.specialPurposes.map(e=>h.specialPurposes[e]).filter(e=>null!=e).map(e=>({description:e.description,id:e.id,name:e.name})):[]),R=(o=t.id,(f=w.find(e=>String(e.id)===String(o)))&&h?f.specialFeatures.map(e=>h.specialFeatures[e]).filter(e=>null!=e).map(e=>({description:e.description,id:e.id,name:e.name})):[]),B=(l=t.id,(N=w.find(e=>String(e.id)===String(l)))&&h?(N.features||[]).map(e=>h.features[e]).filter(e=>null!=e).map(e=>({description:e.description,id:e.id,name:e.name})):[]),V=P.has(t.id),A=x.filter(e=>e.usesLegitimateInterest).length,T=t.legIntPurposes.length>0,D=k[C]??!0,U=t.dataRetention?.stdRetention,$=null;t.cookieMaxAgeSeconds&&($=M.preferenceCenter.vendorList.maxAge.replace("{days}",String(Math.floor(t.cookieMaxAgeSeconds/86400))),t.cookieRefresh&&($=`${$} (refreshes)`));let j=a(y?.["iab-vendor-list"]?.rowHeader,{baseClassName:n.vendorListItemHeader,noStyle:S});return r(d.Root,{id:`vendor-${C}`,className:S?void 0:`${n.vendorListItem} ${t.isCustom?n.customVendorItem:""}`,noStyle:!0,onOpenChange:()=>{var e;return e=t.id,void b(r=>{let n=new Set(r);return n.has(e)?n.delete(e):n.add(e),n})},open:V,slotKey:"iab-vendor-list.row",children:[r("div",{...j,children:[r(d.Trigger,{className:n.vendorListTrigger,noStyle:!0,children:[r("div",{className:n.vendorListInfo,children:[r("h3",{className:n.vendorListName,children:[t.name,t.isCustom&&r("svg",{className:n.customVendorIcon,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-label":M.common.customPartner,children:[e("circle",{cx:"12",cy:"12",r:"10"}),e("line",{x1:"2",y1:"12",x2:"22",y2:"12"}),e("path",{d:"M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"})]})]}),r("div",{className:n.vendorListMeta,children:[r("span",{className:n.vendorListMetaText,children:[x.length," purpose",1===x.length?"":"s",I.length>0&&`, ${I.length} special`,R.length>0&&`, ${R.length} feature${1===R.length?"":"s"}`]}),A>0&&r("span",{className:n.vendorListLiBadge,children:[e("svg",{style:{height:"0.625rem",width:"0.625rem"},viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:e("path",{d:"M12 3v18M3 12h18M4.93 4.93l14.14 14.14M19.07 4.93L4.93 19.07"})}),A," ",M.preferenceCenter.vendorList.legitimateInterest]})]})]}),e("svg",{className:n.purposeArrow,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:V?e("path",{d:"M19 15l-7-7-7 7"}):e("path",{d:"M19 9l-7 7-7-7"})})]}),e("div",{className:n.vendorConsentControl,children:e(c.Root,{"aria-label":`Consent for ${t.name}`,className:n.vendorConsentSwitch,checked:v[C]??!1,onCheckedChange:e=>g(t.id,e)})})]}),r(d.Content,{innerClassName:S?void 0:n.vendorListContent,innerSlotKey:"iab-vendor-list.rowContent",noStyle:S,children:[r("div",{className:n.vendorLinks,children:[r("a",{href:t.policyUrl,target:"_blank",rel:"noopener noreferrer",className:n.vendorLink,children:[r("svg",{className:n.vendorLinkIcon,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}),e("polyline",{points:"15 3 21 3 21 9"}),e("line",{x1:"10",y1:"14",x2:"21",y2:"3"})]}),M.preferenceCenter.vendorList.privacyPolicy]}),t.legitimateInterestUrl&&r("a",{href:t.legitimateInterestUrl,target:"_blank",rel:"noopener noreferrer",className:n.vendorLink,children:[r("svg",{className:n.vendorLinkIcon,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}),e("polyline",{points:"15 3 21 3 21 9"}),e("line",{x1:"10",y1:"14",x2:"21",y2:"3"})]}),M.preferenceCenter.purposeItem.legitimateInterest]}),t.deviceStorageDisclosureUrl&&r("a",{href:t.deviceStorageDisclosureUrl,target:"_blank",rel:"noopener noreferrer",className:n.vendorLink,children:[r("svg",{className:n.vendorLinkIcon,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}),e("polyline",{points:"15 3 21 3 21 9"}),e("line",{x1:"10",y1:"14",x2:"21",y2:"3"})]}),M.preferenceCenter.vendorList.storageDisclosure]})]}),r("div",{className:n.vendorBadges,children:[t.usesCookies&&e("span",{className:n.vendorBadge,children:M.preferenceCenter.vendorList.usesCookies}),t.usesNonCookieAccess&&e("span",{className:n.vendorBadge,children:M.preferenceCenter.vendorList.nonCookieAccess}),$&&e("span",{className:n.vendorBadge,children:$}),U&&e("span",{className:n.vendorBadge,children:M.preferenceCenter.vendorList.retention.replace("{days}",String(U))})]}),x.length>0&&r("div",{className:n.vendorPurposesList,children:[r("h4",{className:n.vendorPurposesTitle,children:[M.preferenceCenter.vendorList.purposes," (",x.length,")"]}),e("ul",{className:n.vendorPurposesItems,children:x.map(s=>{let i;return t.dataRetention?.purposes?.[s.id]?i=t.dataRetention.purposes[s.id]:t.dataRetention?.stdRetention&&(i=t.dataRetention.stdRetention),r("li",{className:`${n.vendorPurposeItem} ${s.usesLegitimateInterest?n.vendorPurposeItemLi:""}`,children:[r("span",{children:[s.name,i&&r("span",{className:n.vendorRetention,children:[" ","(Retained: ",i,"d)"]})]}),s.usesLegitimateInterest&&r("span",{className:n.vendorListLiBadge,children:[e("svg",{style:{height:"0.625rem",width:"0.625rem"},viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:e("path",{d:"M12 3v18M3 12h18M4.93 4.93l14.14 14.14M19.07 4.93L4.93 19.07"})}),M.preferenceCenter.vendorList.legitimateInterest]})]},s.id)})})]}),T&&L&&r("div",{className:n.vendorLiSection,children:[r("div",{className:n.vendorLiSectionHeader,children:[r("h4",{className:n.vendorPurposesTitle,children:[e("svg",{style:{height:"0.75rem",marginRight:"0.25rem",width:"0.75rem"},viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:e("path",{d:"M12 3v18M3 12h18M4.93 4.93l14.14 14.14M19.07 4.93L4.93 19.07"})}),M.preferenceCenter.purposeItem.legitimateInterest]}),e("button",{type:"button",onClick:()=>L(t.id,!D),className:`${n.objectButton} ${D?"":n.objectButtonActive}`,"aria-pressed":!D,children:D?M.preferenceCenter.purposeItem.objectButton:M.preferenceCenter.purposeItem.objected})]}),e("p",{className:n.liExplanation,children:M.preferenceCenter.purposeItem.rightToObject})]}),t.dataDeclaration&&t.dataDeclaration.length>0&&r("div",{className:n.vendorPurposesList,children:[r("h4",{className:n.vendorPurposesTitle,children:[M.preferenceCenter.vendorList.dataCategories," (",t.dataDeclaration.length,")"]}),e("ul",{className:n.vendorPurposesItems,children:t.dataDeclaration.map(r=>{let t=h?.dataCategories?.[r];return e("li",{className:n.vendorPurposeItem,title:t?.description,children:t?.name||`Data Category ${r}`},r)})})]}),I.length>0&&r("div",{className:n.vendorPurposesList,children:[r("h4",{className:n.vendorPurposesTitle,children:[r("svg",{"aria-hidden":"true",focusable:"false",style:{height:"0.75rem",marginRight:"0.25rem",width:"0.75rem"},viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e("title",{children:M.preferenceCenter.vendorList.specialPurposes}),e("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),e("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]}),M.preferenceCenter.vendorList.specialPurposes," (",I.length,")"]}),e("ul",{className:n.vendorPurposesItems,children:I.map(s=>{let i;return t.dataRetention?.specialPurposes?.[s.id]?i=t.dataRetention.specialPurposes[s.id]:t.dataRetention?.stdRetention&&(i=t.dataRetention.stdRetention),e("li",{className:n.vendorPurposeItem,children:r("span",{children:[s.name,i&&r("span",{className:n.vendorRetention,children:[" ","(Retained: ",i,"d)"]})]})},s.id)})}),e("p",{className:n.vendorListMetaText,style:{fontStyle:"italic",marginTop:"0.25rem"},children:M.preferenceCenter.vendorList.requiredNotice})]}),R.length>0&&r("div",{className:n.vendorPurposesList,children:[r("h4",{className:n.vendorPurposesTitle,children:[M.preferenceCenter.vendorList.specialFeatures," (",R.length,")"]}),e("ul",{className:n.vendorPurposesItems,children:R.map(r=>e("li",{className:n.vendorPurposeItem,children:r.name},r.id))})]}),B.length>0&&r("div",{className:n.vendorPurposesList,children:[r("h4",{className:n.vendorPurposesTitle,children:[M.preferenceCenter.vendorList.features," (",B.length,")"]}),e("ul",{className:n.vendorPurposesItems,children:B.map(r=>e("li",{className:n.vendorPurposeItem,children:r.name},r.id))})]})]})]},t.id)};return r("div",{...A,children:[null===f?r("div",{...T,children:[r("div",{...D,children:[r("svg",{className:n.searchIcon,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e("circle",{cx:"11",cy:"11",r:"8"}),e("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]}),e("input",{type:"text",placeholder:M.preferenceCenter.vendorList.search,value:x,onChange:e=>I(e.target.value),className:n.searchInput})]}),e("p",{className:n.vendorCount,children:M.preferenceCenter.vendorList.showingCount.replace("{filtered}",String(R.length)).replace("{total}",String(w.length))})]}):r("div",{...U,children:[e("p",{className:n.selectedVendorText,children:M.common.showingSelectedVendor}),r("button",{type:"button",onClick:N,className:n.clearSelectionButton,children:[r("svg",{className:n.clearIcon,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}),M.common.clearSelection]})]}),B.length>0&&r("div",{className:n.vendorSection,children:[r("div",{className:n.iabVendorSectionHeader,children:[r("h3",{className:n.vendorSectionHeading,children:[r("svg",{className:n.vendorSectionIcon,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e("path",{d:"M12 2L2 7l10 5 10-5-10-5z"}),e("path",{d:"M2 17l10 5 10-5"}),e("path",{d:"M2 12l10 5 10-5"})]}),M.preferenceCenter.vendorList.iabVendorsHeading," (",B.length,")"]}),e("p",{className:n.iabVendorNotice,children:M.preferenceCenter.vendorList.iabVendorsNotice})]}),e("div",{children:B.map(e=>$(e))})]}),V.length>0&&r("div",{className:n.vendorSection,children:[r("div",{className:n.customVendorSectionHeader,children:[r("h3",{className:n.vendorSectionHeading,children:[r("svg",{className:n.vendorSectionIcon,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e("circle",{cx:"12",cy:"12",r:"10"}),e("line",{x1:"2",y1:"12",x2:"22",y2:"12"}),e("path",{d:"M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"})]}),M.preferenceCenter.vendorList.customVendorsHeading," (",V.length,")"]}),e("p",{className:n.customVendorNotice,children:M.preferenceCenter.vendorList.customVendorsNotice})]}),e("div",{children:V.map(e=>$(e))})]}),0===R.length&&e("div",{className:n.emptyState,children:r("p",{className:n.emptyStateText,children:['No vendors found matching "',x,'"']})})]})};export{h as VendorList};
|