@c15t/react 3.0.0-alpha.1 → 3.0.0-alpha.10

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.
Files changed (406) hide show
  1. package/AGENTS.md +96 -70
  2. package/README.md +21 -17
  3. package/SKILL.md +34 -0
  4. package/dist/aggregate-components.js +1 -1
  5. package/dist/chunk-warming.js +1 -1
  6. package/dist/component-hooks/use-headless-consent-ui.js +1 -1
  7. package/dist/component-hooks/use-headless-iab-consent-ui.js +1 -1
  8. package/dist/component-hooks/use-panel-trigger.js +1 -1
  9. package/dist/components/consent-gate/atoms.js +1 -0
  10. package/dist/components/consent-gate/consent-gate.js +2 -0
  11. package/dist/components/consent-gate/frame.js +2 -0
  12. package/dist/components/consent-gate/index.js +2 -0
  13. package/dist/components/consent-preferences-link/consent-preferences-link.js +1 -1
  14. package/dist/components/iab-panel/atoms/card.js +1 -1
  15. package/dist/components/iab-panel/atoms/feature-item.js +2 -0
  16. package/dist/components/iab-panel/atoms/header.js +1 -1
  17. package/dist/components/iab-panel/atoms/purpose-item.js +1 -1
  18. package/dist/components/iab-panel/atoms/root.js +1 -1
  19. package/dist/components/iab-panel/atoms/stack-item.js +1 -1
  20. package/dist/components/iab-panel/atoms/vendor-list.js +1 -1
  21. package/dist/components/iab-panel/hooks/use-gvl-data.js +1 -1
  22. package/dist/components/iab-panel/iab-panel.js +1 -1
  23. package/dist/components/iab-panel/index.js +1 -1
  24. package/dist/components/iab-prompt/atoms/overlay.js +1 -1
  25. package/dist/components/iab-prompt/atoms/root.js +1 -1
  26. package/dist/components/panel/atoms/card.js +1 -1
  27. package/dist/components/panel/atoms/overlay.js +1 -1
  28. package/dist/components/panel/atoms/root.js +1 -1
  29. package/dist/components/panel/panel.js +1 -1
  30. package/dist/components/panel-trigger/atoms/button.js +1 -1
  31. package/dist/components/panel-trigger/atoms/icon.js +1 -1
  32. package/dist/components/panel-trigger/atoms/root.js +1 -1
  33. package/dist/components/panel-trigger/atoms/toolbar.js +1 -1
  34. package/dist/components/panel-trigger/atoms/trigger-icons.js +1 -0
  35. package/dist/components/panel-trigger/panel-trigger-toolbar.js +1 -1
  36. package/dist/components/panel-trigger/panel-trigger.js +1 -1
  37. package/dist/components/preferences/atoms/accordion.js +1 -1
  38. package/dist/components/preferences/atoms/root.js +1 -1
  39. package/dist/components/preferences/atoms/vendor-list.js +1 -0
  40. package/dist/components/preferences/index.js +1 -1
  41. package/dist/components/prompt/atoms/early-tap-script.js +2 -0
  42. package/dist/components/prompt/atoms/overlay.js +1 -1
  43. package/dist/components/prompt/atoms/root.js +1 -1
  44. package/dist/components/prompt/components.js +1 -1
  45. package/dist/components/prompt/policy-actions.js +1 -1
  46. package/dist/components/prompt/prompt.js +1 -1
  47. package/dist/components/shared/dialog-sheets.js +1 -0
  48. package/dist/components/shared/first-paint-sheets.js +1 -0
  49. package/dist/components/shared/iab-dialog-sheets.js +1 -0
  50. package/dist/components/shared/iab-first-paint-sheets.js +1 -0
  51. package/dist/components/shared/libs/compose-refs.js +1 -0
  52. package/dist/components/shared/libs/slot.js +1 -1
  53. package/dist/components/shared/primitives/button.js +1 -1
  54. package/dist/components/shared/primitives/legal-links/index.js +1 -1
  55. package/dist/components/shared/streamed-surface.js +2 -0
  56. package/dist/components/shared/surface-styles.js +2 -0
  57. package/dist/components/shared/ui/dialog/dialog.js +1 -1
  58. package/dist/components/shared/ui/icon.js +1 -1
  59. package/dist/components/shared/ui/logo.js +1 -1
  60. package/dist/components/shared/ui/preference-item/preference-item.js +1 -1
  61. package/dist/consent-gate.js +2 -0
  62. package/dist/consent-theme.js +1 -0
  63. package/dist/context/consent-tracking-context.js +1 -1
  64. package/dist/context/index.js +1 -1
  65. package/dist/context.js +1 -1
  66. package/dist/devtools-launcher.js +2 -0
  67. package/dist/devtools.js +1 -1
  68. package/dist/draft-context.js +2 -0
  69. package/dist/draft.js +1 -1
  70. package/dist/external-iab-context.js +1 -1
  71. package/dist/gpp.js +2 -0
  72. package/dist/headless.js +1 -1
  73. package/dist/hooks/use-color-scheme.js +1 -1
  74. package/dist/hooks/use-committed-ref.js +2 -0
  75. package/dist/hooks/use-focus-trap.js +1 -1
  76. package/dist/hooks/use-headless-iab-consent-ui.js +1 -1
  77. package/dist/hooks/use-iab-policy-guard.js +1 -0
  78. package/dist/hooks/use-late-entry.js +2 -0
  79. package/dist/hooks.js +1 -1
  80. package/dist/iab/styles.tw3.css +5 -45
  81. package/dist/iab-context.js +1 -1
  82. package/dist/index-parts/consent-banner.js +1 -0
  83. package/dist/index-parts/consent-dialog-link.js +1 -0
  84. package/dist/index-parts/consent-dialog-trigger.js +1 -0
  85. package/dist/index-parts/consent-dialog.js +1 -0
  86. package/dist/index-parts/consent-gate.js +1 -0
  87. package/dist/index-parts/core.js +1 -0
  88. package/dist/index-parts/draft.js +1 -0
  89. package/dist/index-parts/frame.js +1 -0
  90. package/dist/index-parts/hooks.js +1 -0
  91. package/dist/index-parts/hosted.js +1 -0
  92. package/dist/index-parts/module-hooks.js +1 -0
  93. package/dist/index-parts/offline.js +1 -0
  94. package/dist/index-parts/presets.js +1 -0
  95. package/dist/index-parts/provider.js +1 -0
  96. package/dist/index-parts/theme.js +1 -0
  97. package/dist/index-parts/translations.js +1 -0
  98. package/dist/index.js +1 -1
  99. package/dist/kernel-selector.js +1 -0
  100. package/dist/modes.js +1 -0
  101. package/dist/module-hooks/iframe-blocker.js +1 -1
  102. package/dist/module-hooks/network-blocker.js +1 -1
  103. package/dist/module-hooks/network-hold.js +2 -0
  104. package/dist/module-hooks/persistence.js +1 -1
  105. package/dist/panel-link.js +1 -1
  106. package/dist/panel-trigger.js +1 -1
  107. package/dist/panel.js +1 -1
  108. package/dist/postcss-tailwind3.js +1 -0
  109. package/dist/preferences.js +1 -2
  110. package/dist/provider.js +1 -1
  111. package/dist/server/fetch-ssr-data.js +1 -1
  112. package/dist/server/headers.js +1 -1
  113. package/dist/server/normalize-url.js +1 -1
  114. package/dist/styles.tw3.css +33 -51
  115. package/dist/transports/hosted.js +1 -0
  116. package/dist/transports/manifest.js +1 -0
  117. package/dist/transports/offline.js +1 -1
  118. package/dist/utils/deferred-module.js +2 -0
  119. package/dist/utils/merge-slot-props.js +1 -1
  120. package/dist/utils/theme-utils.js +1 -1
  121. package/dist/version.js +1 -1
  122. package/dist-types/aggregate-components.d.ts +2 -2
  123. package/dist-types/chunk-warming.d.ts +45 -8
  124. package/dist-types/component-hooks/use-headless-consent-ui.d.ts +5 -5
  125. package/dist-types/component-hooks/use-headless-iab-consent-ui.d.ts +2 -2
  126. package/dist-types/components/consent-gate/atoms.d.ts +11 -0
  127. package/dist-types/components/consent-gate/consent-gate.d.ts +2 -0
  128. package/dist-types/components/consent-gate/frame.d.ts +19 -0
  129. package/dist-types/components/consent-gate/index.d.ts +25 -0
  130. package/dist-types/components/{frame → consent-gate}/types.d.ts +7 -7
  131. package/dist-types/components/consent-preferences-link/consent-preferences-link.d.ts +1 -1
  132. package/dist-types/components/consent-preferences-link/index.d.ts +1 -1
  133. package/dist-types/components/iab-panel/atoms/feature-item.d.ts +28 -0
  134. package/dist-types/components/iab-panel/atoms/purpose-item.d.ts +5 -2
  135. package/dist-types/components/iab-panel/atoms/stack-item.d.ts +7 -2
  136. package/dist-types/components/iab-panel/atoms/vendor-list.d.ts +1 -1
  137. package/dist-types/components/iab-panel/iab-panel.d.ts +3 -3
  138. package/dist-types/components/iab-panel/index.d.ts +29 -26
  139. package/dist-types/components/iab-panel/use-iab-translations.d.ts +4 -0
  140. package/dist-types/components/iab-prompt/iab-prompt.d.ts +3 -3
  141. package/dist-types/components/iab-prompt/index.d.ts +19 -19
  142. package/dist-types/components/panel/atoms/card.d.ts +5 -4
  143. package/dist-types/components/panel/atoms/overlay.d.ts +1 -1
  144. package/dist-types/components/panel/index.d.ts +8 -8
  145. package/dist-types/components/panel/panel.d.ts +3 -3
  146. package/dist-types/components/panel-link/index.d.ts +1 -1
  147. package/dist-types/components/panel-trigger/atoms/button.d.ts +1 -1
  148. package/dist-types/components/panel-trigger/atoms/icon.d.ts +1 -1
  149. package/dist-types/components/panel-trigger/atoms/root.d.ts +2 -2
  150. package/dist-types/components/panel-trigger/atoms/toolbar.d.ts +2 -2
  151. package/dist-types/components/panel-trigger/atoms/trigger-icons.d.ts +25 -0
  152. package/dist-types/components/panel-trigger/index.d.ts +4 -4
  153. package/dist-types/components/panel-trigger/panel-trigger-toolbar.d.ts +1 -1
  154. package/dist-types/components/panel-trigger/panel-trigger.d.ts +9 -17
  155. package/dist-types/components/panel-trigger/types.d.ts +1 -1
  156. package/dist-types/components/preferences/atoms/accordion.d.ts +6 -4
  157. package/dist-types/components/preferences/atoms/button.d.ts +1 -1
  158. package/dist-types/components/preferences/atoms/footer.d.ts +1 -1
  159. package/dist-types/components/preferences/atoms/root.d.ts +1 -1
  160. package/dist-types/components/preferences/atoms/vendor-list.d.ts +23 -0
  161. package/dist-types/components/preferences/index.d.ts +14 -12
  162. package/dist-types/components/preferences/policy-actions.d.ts +2 -2
  163. package/dist-types/components/preferences/preferences.d.ts +1 -1
  164. package/dist-types/components/preferences/types.d.ts +1 -1
  165. package/dist-types/components/prompt/atoms/early-tap-script.d.ts +17 -0
  166. package/dist-types/components/prompt/atoms/root.d.ts +4 -0
  167. package/dist-types/components/prompt/components.d.ts +9 -3
  168. package/dist-types/components/prompt/index.d.ts +12 -12
  169. package/dist-types/components/prompt/policy-actions.d.ts +2 -2
  170. package/dist-types/components/prompt/prompt.d.ts +5 -1
  171. package/dist-types/components/shared/dialog-sheets.d.ts +9 -0
  172. package/dist-types/components/shared/first-paint-sheets.d.ts +8 -0
  173. package/dist-types/components/shared/iab-dialog-sheets.d.ts +3 -0
  174. package/dist-types/components/shared/iab-first-paint-sheets.d.ts +3 -0
  175. package/dist-types/components/shared/libs/compose-refs.d.ts +20 -0
  176. package/dist-types/components/shared/policy-actions.d.ts +2 -2
  177. package/dist-types/components/shared/primitives/box.d.ts +1 -1
  178. package/dist-types/components/shared/primitives/button.d.ts +2 -2
  179. package/dist-types/components/shared/primitives/button.types.d.ts +1 -1
  180. package/dist-types/components/shared/streamed-surface.d.ts +23 -0
  181. package/dist-types/components/shared/surface-styles.d.ts +36 -0
  182. package/dist-types/components/shared/ui/accordion/accordion.d.ts +2 -2
  183. package/dist-types/components/shared/ui/accordion/index.d.ts +2 -2
  184. package/dist-types/components/shared/ui/animated-collapse/index.d.ts +2 -2
  185. package/dist-types/components/shared/ui/branding.d.ts +1 -1
  186. package/dist-types/components/shared/ui/button/button.d.ts +1 -1
  187. package/dist-types/components/shared/ui/button/index.d.ts +2 -2
  188. package/dist-types/components/shared/ui/collapsible/index.d.ts +1 -1
  189. package/dist-types/components/shared/ui/dialog/index.d.ts +1 -1
  190. package/dist-types/components/shared/ui/icon.d.ts +2 -1
  191. package/dist-types/components/shared/ui/logo.d.ts +0 -10
  192. package/dist-types/components/shared/ui/preference-item/index.d.ts +1 -1
  193. package/dist-types/components/shared/ui/preference-item/preference-item.d.ts +13 -0
  194. package/dist-types/components/shared/ui/switch/index.d.ts +2 -2
  195. package/dist-types/components/shared/ui/switch/switch.d.ts +1 -1
  196. package/dist-types/components/shared/ui/tabs/index.d.ts +1 -1
  197. package/dist-types/consent-gate.d.ts +1 -0
  198. package/dist-types/consent-theme.d.ts +38 -0
  199. package/dist-types/context/consent-tracking-context.d.ts +10 -0
  200. package/dist-types/context/index.d.ts +3 -3
  201. package/dist-types/context/theme-context.d.ts +3 -3
  202. package/dist-types/context.d.ts +25 -1
  203. package/dist-types/devtools-launcher.d.ts +29 -0
  204. package/dist-types/devtools.d.ts +13 -2
  205. package/dist-types/draft-context.d.ts +31 -0
  206. package/dist-types/draft.d.ts +81 -9
  207. package/dist-types/gpp.d.ts +27 -0
  208. package/dist-types/headless.d.ts +6 -7
  209. package/dist-types/hooks/use-committed-ref.d.ts +24 -0
  210. package/dist-types/hooks/use-focus-trap.d.ts +3 -1
  211. package/dist-types/hooks/use-headless-iab-consent-ui.d.ts +1 -1
  212. package/dist-types/hooks/use-iab-manager.d.ts +5 -5
  213. package/dist-types/hooks/use-iab-policy-guard.d.ts +35 -0
  214. package/dist-types/hooks/use-late-entry.d.ts +14 -0
  215. package/dist-types/hooks/use-theme.d.ts +1 -1
  216. package/dist-types/hooks.d.ts +106 -11
  217. package/dist-types/iab.d.ts +7 -7
  218. package/dist-types/index-parts/consent-banner.d.ts +7 -0
  219. package/dist-types/index-parts/consent-dialog-link.d.ts +7 -0
  220. package/dist-types/index-parts/consent-dialog-trigger.d.ts +7 -0
  221. package/dist-types/index-parts/consent-dialog.d.ts +7 -0
  222. package/dist-types/index-parts/consent-gate.d.ts +7 -0
  223. package/dist-types/index-parts/core.d.ts +7 -0
  224. package/dist-types/index-parts/draft.d.ts +7 -0
  225. package/dist-types/index-parts/frame.d.ts +7 -0
  226. package/dist-types/index-parts/hooks.d.ts +7 -0
  227. package/dist-types/index-parts/hosted.d.ts +7 -0
  228. package/dist-types/index-parts/module-hooks.d.ts +7 -0
  229. package/dist-types/index-parts/offline.d.ts +7 -0
  230. package/dist-types/index-parts/presets.d.ts +7 -0
  231. package/dist-types/index-parts/provider.d.ts +7 -0
  232. package/dist-types/index-parts/theme.d.ts +8 -0
  233. package/dist-types/index-parts/translations.d.ts +7 -0
  234. package/dist-types/index.d.ts +32 -28
  235. package/dist-types/kernel-selector.d.ts +68 -0
  236. package/dist-types/modes.d.ts +26 -0
  237. package/dist-types/module-hooks/iframe-blocker.d.ts +33 -1
  238. package/dist-types/module-hooks/network-blocker.d.ts +23 -0
  239. package/dist-types/module-hooks/network-hold.d.ts +47 -0
  240. package/dist-types/module-hooks.d.ts +4 -4
  241. package/dist-types/panel-link.d.ts +1 -1
  242. package/dist-types/panel-trigger.d.ts +1 -1
  243. package/dist-types/panel.d.ts +13 -1
  244. package/dist-types/postcss-tailwind3.d.ts +21 -0
  245. package/dist-types/preferences.d.ts +12 -1
  246. package/dist-types/primitives/accordion.d.ts +1 -1
  247. package/dist-types/primitives/button.d.ts +1 -1
  248. package/dist-types/primitives/collapsible.d.ts +1 -1
  249. package/dist-types/primitives/dialog.d.ts +1 -1
  250. package/dist-types/primitives/preference-item.d.ts +1 -1
  251. package/dist-types/primitives/switch.d.ts +1 -1
  252. package/dist-types/primitives/tabs.d.ts +1 -1
  253. package/dist-types/primitives.d.ts +7 -7
  254. package/dist-types/prompt.d.ts +1 -1
  255. package/dist-types/provider.d.ts +169 -28
  256. package/dist-types/server/fetch-ssr-data.d.ts +1 -1
  257. package/dist-types/server/headers.d.ts +14 -4
  258. package/dist-types/server/index.d.ts +5 -5
  259. package/dist-types/server/normalize-url.d.ts +14 -7
  260. package/dist-types/server/types.d.ts +12 -1
  261. package/dist-types/theme-provider.d.ts +2 -2
  262. package/dist-types/transports/hosted.d.ts +36 -0
  263. package/dist-types/transports/manifest.d.ts +48 -0
  264. package/dist-types/transports/offline.d.ts +7 -16
  265. package/dist-types/types/index.d.ts +3 -3
  266. package/dist-types/types/manager.d.ts +1 -1
  267. package/dist-types/types/theme/index.d.ts +1 -1
  268. package/dist-types/ui-config-context.d.ts +14 -2
  269. package/dist-types/utils/deferred-module.d.ts +13 -0
  270. package/dist-types/utils/index.d.ts +4 -4
  271. package/dist-types/utils/merge-slot-props.d.ts +17 -3
  272. package/dist-types/utils/merge-styles.d.ts +1 -1
  273. package/dist-types/utils/theme-utils.d.ts +18 -3
  274. package/dist-types/version.d.ts +1 -1
  275. package/docs/README.md +96 -70
  276. package/docs/assets/v3/bottom-bar.png +0 -0
  277. package/docs/assets/v3/brand-card.png +0 -0
  278. package/docs/assets/v3/brand-preferences.png +0 -0
  279. package/docs/assets/v3/choice-wall.png +0 -0
  280. package/docs/assets/v3/headless-bar-html.png +0 -0
  281. package/docs/assets/v3/headless-bar-mobile.png +0 -0
  282. package/docs/assets/v3/headless-bar.png +0 -0
  283. package/docs/assets/v3/slim-bar.png +0 -0
  284. package/docs/concepts/choose-your-setup.md +138 -0
  285. package/docs/concepts/consent-categories.md +84 -0
  286. package/docs/concepts/consent-state.md +421 -0
  287. package/docs/concepts/data-fetching.md +270 -0
  288. package/docs/concepts/how-consent-works.md +123 -0
  289. package/docs/concepts/modes.md +278 -0
  290. package/docs/{frameworks/react/concepts/policy-presets.md → concepts/policies.md} +8 -60
  291. package/docs/customization/class-names.md +202 -0
  292. package/docs/customization/dark-mode.md +157 -0
  293. package/docs/customization/motion.md +128 -0
  294. package/docs/customization/overview.md +68 -33
  295. package/docs/customization/recipes.md +838 -47
  296. package/docs/customization/slots.md +217 -35
  297. package/docs/customization/stylesheets.md +248 -0
  298. package/docs/customization/tailwind.md +863 -0
  299. package/docs/customization/tokens.md +167 -36
  300. package/docs/customization/translations.md +87 -3
  301. package/docs/frameworks/react/callbacks.md +118 -0
  302. package/docs/frameworks/react/clear-on-revocation.md +106 -0
  303. package/docs/frameworks/react/components/consent-banner.md +48 -27
  304. package/docs/frameworks/react/components/consent-dialog-link.md +13 -11
  305. package/docs/frameworks/react/components/consent-dialog-trigger.md +86 -76
  306. package/docs/frameworks/react/components/consent-dialog.md +111 -58
  307. package/docs/frameworks/react/components/{frame.md → consent-gate.md} +70 -49
  308. package/docs/frameworks/react/components/consent-provider.md +140 -0
  309. package/docs/frameworks/react/components/consent-widget.md +69 -24
  310. package/docs/frameworks/react/components/dev-tools.md +76 -85
  311. package/docs/frameworks/react/components.md +113 -0
  312. package/docs/frameworks/react/compose.md +354 -0
  313. package/docs/frameworks/react/content-security-policy.md +143 -0
  314. package/docs/frameworks/react/customize.md +258 -0
  315. package/docs/frameworks/react/embeds.md +89 -0
  316. package/docs/frameworks/react/gpp.md +163 -0
  317. package/docs/frameworks/react/headless.md +4 -4
  318. package/docs/frameworks/react/hooks.md +70 -0
  319. package/docs/frameworks/react/iab.md +259 -0
  320. package/docs/frameworks/react/network-blocker.md +140 -0
  321. package/docs/frameworks/react/quickstart.md +220 -102
  322. package/docs/frameworks/react/rendering.md +263 -0
  323. package/docs/frameworks/react/scripts.md +114 -0
  324. package/docs/frameworks/react/translations.md +155 -0
  325. package/docs/frameworks/react/troubleshooting.md +188 -61
  326. package/docs/frameworks/react/upgrade-v3.md +651 -0
  327. package/docs/frameworks/react/vendor-consent.md +188 -0
  328. package/docs/guides/banner-experiments.md +672 -0
  329. package/docs/guides/troubleshooting.md +192 -54
  330. package/docs/guides/verify-consent.md +96 -49
  331. package/docs/integrations/adobe-analytics.md +177 -183
  332. package/docs/integrations/ahrefs-analytics.md +162 -178
  333. package/docs/integrations/amplitude.md +172 -180
  334. package/docs/integrations/building-integrations.md +137 -33
  335. package/docs/integrations/clearbit.md +164 -178
  336. package/docs/integrations/cloudflare-web-analytics.md +166 -180
  337. package/docs/integrations/cloudflare-zaraz.md +333 -0
  338. package/docs/integrations/crisp.md +174 -182
  339. package/docs/integrations/databuddy.md +167 -197
  340. package/docs/integrations/fathom-analytics.md +168 -180
  341. package/docs/integrations/front-chat.md +308 -0
  342. package/docs/integrations/google-maps.md +142 -108
  343. package/docs/integrations/google-tag-manager.md +258 -185
  344. package/docs/integrations/google-tag.md +226 -182
  345. package/docs/integrations/heap.md +173 -179
  346. package/docs/integrations/hightouch.md +171 -181
  347. package/docs/integrations/hotjar.md +169 -179
  348. package/docs/integrations/intercom.md +193 -177
  349. package/docs/integrations/klaviyo.md +473 -0
  350. package/docs/integrations/linkedin-insights.md +184 -174
  351. package/docs/integrations/logrocket.md +170 -180
  352. package/docs/integrations/matomo-analytics.md +198 -202
  353. package/docs/integrations/meta-pixel.md +198 -174
  354. package/docs/integrations/microsoft-clarity.md +173 -179
  355. package/docs/integrations/microsoft-uet.md +158 -178
  356. package/docs/integrations/mixpanel-analytics.md +165 -184
  357. package/docs/integrations/one-dollar-stats.md +292 -0
  358. package/docs/integrations/openai-pixel.md +214 -325
  359. package/docs/integrations/overview.md +152 -83
  360. package/docs/integrations/pinterest-tag.md +315 -0
  361. package/docs/integrations/pirsch.md +179 -183
  362. package/docs/integrations/plausible-analytics.md +182 -182
  363. package/docs/integrations/posthog.md +323 -264
  364. package/docs/integrations/promptwatch.md +164 -178
  365. package/docs/integrations/reddit-pixel.md +195 -181
  366. package/docs/integrations/rudderstack.md +211 -210
  367. package/docs/integrations/rybbit-analytics.md +181 -184
  368. package/docs/integrations/segment.md +192 -178
  369. package/docs/integrations/sentry.md +402 -0
  370. package/docs/integrations/snapchat-pixel.md +196 -180
  371. package/docs/integrations/tiktok-pixel.md +181 -174
  372. package/docs/integrations/umami-analytics.md +173 -182
  373. package/docs/integrations/vercel-analytics.md +176 -181
  374. package/docs/integrations/x-pixel.md +186 -174
  375. package/docs/integrations/youtube.md +150 -111
  376. package/package.json +48 -17
  377. package/dist/component-hooks/use-manager.js +0 -2
  378. package/dist/components/frame/atoms.js +0 -1
  379. package/dist/components/frame/frame.js +0 -2
  380. package/dist/components/frame/index.js +0 -2
  381. package/dist/frame.js +0 -2
  382. package/dist/ui-save.js +0 -1
  383. package/dist-types/component-hooks/use-manager.d.ts +0 -40
  384. package/dist-types/components/frame/atoms.d.ts +0 -11
  385. package/dist-types/components/frame/frame.d.ts +0 -2
  386. package/dist-types/components/frame/index.d.ts +0 -24
  387. package/dist-types/frame.d.ts +0 -1
  388. package/dist-types/ui-save.d.ts +0 -5
  389. package/docs/assets/v3/brand-bar.png +0 -0
  390. package/docs/assets/v3/mobile-card.png +0 -0
  391. package/docs/assets/v3/preferences.png +0 -0
  392. package/docs/frameworks/react/components/consent-manager-provider.md +0 -71
  393. package/docs/frameworks/react/concepts/consent-categories.md +0 -33
  394. package/docs/frameworks/react/hooks/use-consent-manager/overview.md +0 -58
  395. package/docs/frameworks/react/iab/overview.md +0 -53
  396. package/docs/frameworks/react/script-loader.md +0 -63
  397. package/docs/frameworks/react/styling/overview.md +0 -217
  398. package/docs/guides/consent-state.md +0 -60
  399. package/docs/guides/data-fetching.md +0 -163
  400. package/docs/guides/deployment-modes.md +0 -63
  401. package/docs/integrations/clear-on-revocation.md +0 -167
  402. package/docs/upgrade-v3.md +0 -334
  403. package/readme.json +0 -48
  404. package/src/iab/styles.css +0 -11
  405. package/src/styles.css +0 -10
  406. /package/dist/components/{frame → consent-gate}/types.js +0 -0
package/AGENTS.md CHANGED
@@ -6,98 +6,124 @@ These docs ship inside the package so coding agents can read them offline. Open
6
6
 
7
7
  ## Using these docs
8
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.
9
+ These docs describe c15t v3. Find your app's row in Choose your setup, then follow that framework guide from start to finish; it names the files to create and the backend URL to use. Install c15t packages with the @alpha dist-tag, because npm latest is still v2. A visible banner does not prove anything: check that vendor requests wait for consent, that rejection survives a reload, and that preferences can be reopened.
10
10
 
11
11
  ## Start here
12
12
 
13
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.
14
+ - [Choose your setup](./docs/concepts/choose-your-setup.md): Pick the c15t setup for your framework, rendering mode and hosting, and decide who runs the consent backend.
15
+ - [How consent works](./docs/concepts/how-consent-works.md): What c15t decides on each page load, the difference between a permission and a recorded choice, and what happens when a visitor saves.
16
+ - [Customize the interface](./docs/customization/overview.md): Change c15t's consent banner and dialog one step at a time, from a prop to your own markup, and find where each step lives in your framework.
17
+ - [Verify consent](./docs/guides/verify-consent.md): Check in a production build that vendor requests wait for consent, rejection survives a reload, preferences reopen and privacy signals apply.
18
+ - [Upgrade a React app from v2](./docs/frameworks/react/upgrade-v3.md): Upgrade a React app from c15t v2 (@c15t/react) to v3. Covers packages, ConsentProvider and transports, the useConsentManager codemod, callbacks, policies, styles, IAB and stored consent.
17
19
 
18
20
  ## More documentation
19
21
 
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.
22
+ [Documentation index](https://v3.c15t.com/docs/llms.txt) · [Full Markdown context](https://v3.c15t.com/llms-full.txt). Prefer the index and individual pages for focused tasks.
21
23
 
22
24
  ## Frameworks
23
25
 
24
- - [ConsentBanner](./docs/frameworks/react/components/consent-banner.md): Pre-built consent banner shown when consent is required.
26
+ - [Callbacks](./docs/frameworks/react/callbacks.md): Run code in a React app when a visitor records a consent choice, when permissions change, when a request fails and before the revocation reload, with the ConsentProvider callbacks option.
27
+ - [Clear on revocation](./docs/frameworks/react/clear-on-revocation.md): Delete the first-party cookies and Web Storage keys a consent category owns in a React app when that category is denied, with the clearOnRevocation option on ConsentProvider.
28
+ - [Components](./docs/frameworks/react/components.md): Every c15t component a React app imports from c15t/react, what each renders, where each one mounts, and which to start with.
29
+ - [ConsentBanner](./docs/frameworks/react/components/consent-banner.md): Render the c15t consent banner in a React app, choose its variant and position, and compose its parts.
25
30
  - [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
31
  - [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.
32
+ - [ConsentDialogTrigger](./docs/frameworks/react/components/consent-dialog-trigger.md): Add the c15t ConsentDialogTrigger floating button or toolbar inside a React ConsentProvider so visitors can reopen the preference center after the first prompt.
33
+ - [ConsentGate](./docs/frameworks/react/components/consent-gate.md): Gate a YouTube or map iframe behind consent with ConsentGate in React, showing a placeholder that opens the preference center until the category is allowed.
34
+ - [ConsentProvider](./docs/frameworks/react/components/consent-provider.md): Mount ConsentProvider in a React app and configure its backend, scripts, storage, blocking and presentation options.
29
35
  - [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.
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.
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.
36
+ - [DevTools](./docs/frameworks/react/components/dev-tools.md): Inspect consent state, location, loaded scripts and consent events in a React app during development with the c15t DevTools panel.
37
+ - [Compose your own banner](./docs/frameworks/react/compose.md): Build a React consent banner from the ConsentBanner parts in c15t/react, with your own markup and buttons, while the policy still decides which actions appear.
38
+ - [Content Security Policy](./docs/frameworks/react/content-security-policy.md): Run c15t in a React app under a Content Security Policy, allow the consent backend and vendor hosts, and pass a nonce to ConsentProvider and ConsentTheme.
39
+ - [Customize](./docs/frameworks/react/customize.md): Change the colors, fonts, layout, button styles and copy of the c15t banner and dialog in a React app with theme tokens, provider options and slots, and load the stylesheet yourself when you need to.
40
+ - [Embeds](./docs/frameworks/react/embeds.md): Keep YouTube videos, maps and other iframes out of a React page until their consent category is allowed, with ConsentGate or the iframe blocker in ConsentProvider.
41
+ - [IAB GPP](./docs/frameworks/react/gpp.md): Add the IAB Global Privacy Platform API (__gpp) to a React app with ConsentGPP from @c15t/react/gpp, so ad tech can read US state opt-outs and the TCF EU consent string.
34
42
  - [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.
43
+ - [Hooks](./docs/frameworks/react/hooks.md): Gate features and save consent choices in React components with the focused hooks exported from c15t/react.
44
+ - [IAB TCF](./docs/frameworks/react/iab.md): Mount the IAB TCF banner and dialog inside a React ConsentProvider and configure the CMP ID, policy and vendor data.
45
+ - [Network blocker](./docs/frameworks/react/network-blocker.md): Hold fetch and XMLHttpRequest calls in a React app until their consent category is allowed, with networkBlocker rules in the ConsentProvider options.
46
+ - [Quickstart](./docs/frameworks/react/quickstart.md): Add a consent banner, preferences dialog and consent-gated scripts to a React single-page app built with Vite, using Inth as the consent backend.
47
+ - [Rendering and deployment](./docs/frameworks/react/rendering.md): How c15t resolves consent in client-rendered React apps, React Router framework mode, Remix and other server-rendered React apps without a c15t adapter.
48
+ - [Scripts](./docs/frameworks/react/scripts.md): Load vendor scripts by consent category in a React app with ConsentProvider, and clear stored data or reload the page when a visitor withdraws consent.
49
+ - [Translations](./docs/frameworks/react/translations.md): Where c15t banner and dialog copy comes from in a React app, how the browser picks the visitor's language, and how to override copy and switch languages with the provider's i18n option and hooks.
50
+ - [Troubleshooting](./docs/frameworks/react/troubleshooting.md): Fix a missing banner, early vendor requests, unstyled components and theme warnings in a React app that uses c15t/react.
51
+ - [Upgrade from v2](./docs/frameworks/react/upgrade-v3.md): Upgrade a React app from c15t v2 (@c15t/react) to v3. Covers packages, ConsentProvider and transports, the useConsentManager codemod, callbacks, policies, styles, IAB and stored consent.
52
+ - [Vendor consent](./docs/frameworks/react/vendor-consent.md): Let visitors allow a category such as marketing in a React app and still turn off one vendor in it, with the vendors option on ConsentProvider and useVendorAllowed.
53
+
54
+ ## Concepts
55
+
56
+ - [Choose your setup](./docs/concepts/choose-your-setup.md): Pick the c15t setup for your framework, rendering mode and hosting, and decide who runs the consent backend.
57
+ - [Consent categories](./docs/concepts/consent-categories.md): Assign scripts, embeds and features to c15t consent categories, and understand which categories the preference dialog shows.
58
+ - [Consent state reference](./docs/concepts/consent-state.md): How c15t saves choices, gates IAB vendors, hydrates server records and keeps browser tabs and storage in step.
59
+ - [Data fetching](./docs/concepts/data-fetching.md): Choose the recommended build-time policy snapshot or runtime manifest fetching, backend /init, browser resolution or offline rules, and understand where consent choices are saved.
60
+ - [How consent works](./docs/concepts/how-consent-works.md): What c15t decides on each page load, the difference between a permission and a recorded choice, and what happens when a visitor saves.
61
+ - [Consent modes](./docs/concepts/modes.md): Reference for manifest(), hosted() and offline() in every c15t framework package, where each one resolves the visitor's policy, what it adds to first-load JavaScript, the build-time manifest fetch and its failure policy, and the backend URL variable each framework reads.
62
+ - [Policies](./docs/concepts/policies.md): How policy models, prompts and scope decide what c15t asks visitors, where to change the rules, and why a banner may not appear.
41
63
 
42
64
  ## Guides
43
65
 
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.
66
+ - [Banner experiments](./docs/guides/banner-experiments.md): Run A/B tests on consent banner presentation with any feature-flag provider or built-in weighted assignment, and attribute every impression and choice to its arm.
67
+ - [Troubleshooting](./docs/guides/troubleshooting.md): Fix a missing banner, analytics that load before consent, choices lost on reload, CORS errors, hydration differences, failed manifest downloads, mode errors and failed static builds in c15t v3.
68
+ - [Verify consent](./docs/guides/verify-consent.md): Check in a production build that vendor requests wait for consent, rejection survives a reload, preferences reopen and privacy signals apply.
49
69
 
50
70
  ## Customization
51
71
 
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.
72
+ - [Class names and CSS-in-JS](./docs/customization/class-names.md): Style c15t's component parts with CSS Modules, vanilla-extract, StyleX, Emotion or plain class names, and see which approach works in each framework.
73
+ - [Dark mode](./docs/customization/dark-mode.md): Switch c15t's banner and dialog to dark colors with colorScheme, set your own dark tokens, follow your site's theme switch, and paint dark on the first frame in every framework.
74
+ - [Motion and animation](./docs/customization/motion.md): Change how fast c15t's banner and dialog animate with duration and easing tokens, turn animations off per surface with disableAnimation, and check reduced-motion behavior in each framework.
75
+ - [Customize the interface](./docs/customization/overview.md): Change c15t's consent banner and dialog one step at a time, from a prop to your own markup, and find where each step lives in your framework.
76
+ - [Banner designs](./docs/customization/recipes.md): Five consent banner designs built with c15t, from one prop to your own markup, with tested code for React, Vue, Svelte, Astro and plain HTML.
77
+ - [Component parts](./docs/customization/slots.md): Find every part of c15t's banner, dialog, widget, trigger and ConsentGate placeholder, its key in your framework's part API, and the data attributes to select on.
78
+ - [Stylesheets and CSS layers](./docs/customization/stylesheets.md): See how c15t delivers its styles in each framework without a render-blocking stylesheet, when to import styles.css yourself with styles false, which file holds the dialog's rules, and how c15t's cascade layer meets your own.
79
+ - [Tailwind CSS](./docs/customization/tailwind.md): Use c15t's styles with Tailwind CSS 4 or 3 in every framework, put utilities on c15t component parts, and use Tailwind's dark variant with c15t.
80
+ - [Theme tokens](./docs/customization/tokens.md): Change c15t's colors, type, radius, spacing, shadows and motion with theme tokens, and see every --c15t-* variable with its default.
56
81
  - [Copy and translations](./docs/customization/translations.md): Change consent wording through i18n and test the complete prompt and preferences flow.
57
82
 
58
83
  ## Integrations
59
84
 
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
- - [Clear on revocation](./docs/integrations/clear-on-revocation.md): Remove configured first-party cookies and Web Storage keys when their consent category is denied.
65
- - [Clearbit](./docs/integrations/clearbit.md): Configure Clearbit with c15t v3, understand marketing permission and verify loading and revocation.
66
- - [Cloudflare Web Analytics](./docs/integrations/cloudflare-web-analytics.md): Configure Cloudflare Web Analytics with c15t v3, understand measurement permission and verify loading and revocation.
67
- - [Crisp](./docs/integrations/crisp.md): Configure Crisp with c15t v3, understand functionality permission and verify loading and revocation.
68
- - [Databuddy](./docs/integrations/databuddy.md): Configure Databuddy's initial and updated consent state with c15t v3.
69
- - [Fathom Analytics](./docs/integrations/fathom-analytics.md): Configure Fathom Analytics with c15t v3, understand measurement permission and verify loading and revocation.
70
- - [Google Maps](./docs/integrations/google-maps.md): Prevent a map iframe from mounting before the required permission.
71
- - [Google Tag](./docs/integrations/google-tag.md): Configure gtag with c15t Consent Mode signals and understand its loading behavior.
72
- - [Google Tag Manager](./docs/integrations/google-tag-manager.md): Load GTM with c15t consent signals and verify the tags inside your container.
73
- - [Heap](./docs/integrations/heap.md): Configure Heap with c15t v3, understand measurement permission and verify loading and revocation.
74
- - [Hightouch](./docs/integrations/hightouch.md): Configure Hightouch with c15t v3, understand measurement permission and verify loading and revocation.
75
- - [Hotjar](./docs/integrations/hotjar.md): Configure Hotjar with c15t v3, understand measurement permission and verify loading and revocation.
76
- - [Intercom](./docs/integrations/intercom.md): Load the Intercom messenger with functionality permission and configure its region.
77
- - [LinkedIn Insight Tag](./docs/integrations/linkedin-insights.md): Configure LinkedIn Insight Tag with c15t v3, understand marketing permission and verify loading and revocation.
78
- - [LogRocket](./docs/integrations/logrocket.md): Configure LogRocket with c15t v3, understand measurement permission and verify loading and revocation.
79
- - [Matomo Analytics](./docs/integrations/matomo-analytics.md): Choose gated loading or Matomo consent signaling and configure the correct tracker endpoints.
80
- - [Meta Pixel](./docs/integrations/meta-pixel.md): Register the Meta Pixel under marketing permission and verify event calls after revocation.
81
- - [Microsoft Clarity](./docs/integrations/microsoft-clarity.md): Configure Microsoft Clarity with c15t v3, understand measurement permission and verify loading and revocation.
82
- - [Microsoft UET](./docs/integrations/microsoft-uet.md): Configure Microsoft UET with c15t v3, understand marketing permission and verify loading and revocation.
83
- - [Mixpanel](./docs/integrations/mixpanel-analytics.md): Configure Mixpanel with c15t v3, understand measurement permission and verify loading and revocation.
84
- - [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.
85
- - [Overview](./docs/integrations/overview.md): Find all c15t integrations for analytics, tag managers, advertising, chat and embedded content.
86
- - [Pirsch](./docs/integrations/pirsch.md): Configure Pirsch with c15t v3, understand measurement permission and verify loading and revocation.
87
- - [Plausible Analytics](./docs/integrations/plausible-analytics.md): Configure Plausible Analytics with c15t v3, understand measurement permission and verify loading and revocation.
88
- - [PostHog](./docs/integrations/posthog.md): Choose PostHog loading and cookieless behavior, configure the region, and synchronize v3 permissions.
89
- - [Promptwatch](./docs/integrations/promptwatch.md): Configure Promptwatch with c15t v3, understand measurement permission and verify loading and revocation.
90
- - [Reddit Pixel](./docs/integrations/reddit-pixel.md): Configure Reddit Pixel with c15t v3, understand marketing permission and verify loading and revocation.
91
- - [RudderStack](./docs/integrations/rudderstack.md): Gate the RudderStack browser SDK or map c15t categories to destination consent IDs.
92
- - [Rybbit Analytics](./docs/integrations/rybbit-analytics.md): Configure Rybbit Analytics with c15t v3, understand measurement permission and verify loading and revocation.
93
- - [Segment](./docs/integrations/segment.md): Configure Segment with c15t v3, understand measurement permission and verify loading and revocation.
94
- - [Snapchat Pixel](./docs/integrations/snapchat-pixel.md): Configure Snapchat Pixel with c15t v3, understand marketing permission and verify loading and revocation.
95
- - [TikTok Pixel](./docs/integrations/tiktok-pixel.md): Configure TikTok Pixel with c15t v3, understand marketing permission and verify loading and revocation.
96
- - [Umami Analytics](./docs/integrations/umami-analytics.md): Configure Umami Analytics with c15t v3, understand measurement permission and verify loading and revocation.
97
- - [Vercel Analytics](./docs/integrations/vercel-analytics.md): Configure Vercel Analytics with c15t v3, understand measurement permission and verify loading and revocation.
98
- - [X Pixel](./docs/integrations/x-pixel.md): Configure X Pixel with c15t v3, understand marketing permission and verify loading and revocation.
85
+ - [Adobe Analytics](./docs/integrations/adobe-analytics.md): Load an Adobe Data Collection Tags property only after measurement consent with the c15t adobeAnalytics helper, and check its extensions in DevTools.
86
+ - [Ahrefs Analytics](./docs/integrations/ahrefs-analytics.md): Load Ahrefs Web Analytics only after measurement consent with the c15t ahrefsAnalytics helper, and check it in DevTools.
87
+ - [Amplitude](./docs/integrations/amplitude.md): Load the Amplitude Browser SDK 2 only after measurement consent with the c15t amplitude helper, which opts the SDK out on revocation and back in on a new grant.
88
+ - [Custom integrations](./docs/integrations/building-integrations.md): Gate a vendor that has no @c15t/integrations helper, or sync consent with an SDK your app already loads, using a c15t script configuration.
89
+ - [Clearbit](./docs/integrations/clearbit.md): Load the Clearbit enrichment tag only after marketing consent with the c15t clearbit helper, and check it in DevTools.
90
+ - [Cloudflare Web Analytics](./docs/integrations/cloudflare-web-analytics.md): Load the Cloudflare Web Analytics beacon only after measurement consent with the c15t cloudflareWebAnalytics helper, and check it in DevTools.
91
+ - [Cloudflare Zaraz](./docs/integrations/cloudflare-zaraz.md): Sync c15t permissions to Cloudflare Zaraz purposes with the c15t cloudflareZaraz bridge, which runs on every page without loading a script, and check the tools it controls.
92
+ - [Crisp](./docs/integrations/crisp.md): Load the Crisp chat widget only after functionality consent with the c15t crisp helper, pass its runtime settings and check it in DevTools.
93
+ - [Databuddy](./docs/integrations/databuddy.md): Load the Databuddy SDK on every page with the c15t databuddy helper, switch its disabled flag and config from measurement consent, and check both in DevTools.
94
+ - [Fathom Analytics](./docs/integrations/fathom-analytics.md): Load Fathom Analytics only after measurement consent with the c15t fathomAnalytics helper, set its SPA mode, and check it in DevTools.
95
+ - [Front Chat](./docs/integrations/front-chat.md): Load the Front Chat widget only after functionality consent with the c15t frontChat helper, forward CSP nonces, clear the session on revocation and check it in DevTools.
96
+ - [Google Maps](./docs/integrations/google-maps.md): Gate a Google Maps iframe embed with c15t v3 so the map loads only after the visitor allows its consent category, in Next.js, TanStack Start, React, Nuxt, Vue, Astro, Svelte, SvelteKit, HTML or JavaScript.
97
+ - [Google Tag](./docs/integrations/google-tag.md): Load gtag.js for Google Analytics or Google Ads before or after consent with c15t Consent Mode v2 signals, and verify the consent commands in DevTools.
98
+ - [Google Tag Manager](./docs/integrations/google-tag-manager.md): Load a Google Tag Manager container before or after consent with c15t Consent Mode v2 signals, configure consent checks inside the container, and verify both in DevTools.
99
+ - [Heap](./docs/integrations/heap.md): Load the Heap config script and heap.js only after measurement consent with the c15t heap helper, and check it in DevTools.
100
+ - [Hightouch](./docs/integrations/hightouch.md): Load the Hightouch Events browser SDK only after measurement consent with the c15t hightouch helper, and check page events in DevTools.
101
+ - [Hotjar](./docs/integrations/hotjar.md): Load Hotjar only after measurement consent with the c15t hotjar helper, and check its loader and recordings in DevTools.
102
+ - [Intercom](./docs/integrations/intercom.md): Load the Intercom messenger only after functionality consent with the c15t intercom helper, set its region and check it in DevTools.
103
+ - [Klaviyo](./docs/integrations/klaviyo.md): Load Klaviyo signup forms and onsite tracking only after marketing and measurement consent with the c15t klaviyo helper, gate your own events, and check it in DevTools.
104
+ - [LinkedIn Insight Tag](./docs/integrations/linkedin-insights.md): Load the LinkedIn Insight Tag only after marketing consent with the c15t linkedinInsights helper, guard lintrk conversion calls, and check it in DevTools.
105
+ - [LogRocket](./docs/integrations/logrocket.md): Load LogRocket session replay only after measurement consent with the c15t logRocket helper, including proxied setups, and check it in DevTools.
106
+ - [Matomo Analytics](./docs/integrations/matomo-analytics.md): Load Matomo after measurement consent with the c15t matomoAnalytics helper, or use Matomo's own consent mode, and check each mode in DevTools.
107
+ - [Meta Pixel](./docs/integrations/meta-pixel.md): Load the Meta Pixel only after marketing consent with the c15t metaPixel helper, guard fbq event calls, and check it in DevTools.
108
+ - [Microsoft Clarity](./docs/integrations/microsoft-clarity.md): Load Microsoft Clarity only after measurement consent with the c15t clarity helper, send Consent V2 storage signals and check them in DevTools.
109
+ - [Microsoft UET](./docs/integrations/microsoft-uet.md): Load Microsoft Advertising UET on every page with the c15t microsoftUet helper, send ad_storage consent defaults and updates, and verify both in DevTools.
110
+ - [Mixpanel](./docs/integrations/mixpanel-analytics.md): Load the Mixpanel SDK on every page with the c15t mixpanelAnalytics helper, which switches Mixpanel tracking on and off with measurement consent, and check it in DevTools.
111
+ - [OneDollarStats](./docs/integrations/one-dollar-stats.md): Load the OneDollarStats tracker only after measurement consent with the c15t oneDollarStats helper, forward its data-attribute settings, and check it in DevTools.
112
+ - [OpenAI Pixel](./docs/integrations/openai-pixel.md): Load the ChatGPT Ads Measurement Pixel only after marketing consent with the c15t openaiPixel helper, guard oaiq conversion calls, and check it in DevTools.
113
+ - [Integrations](./docs/integrations/overview.md): Find all c15t integrations for analytics, tag managers, advertising, email and SMS, chat and embedded content.
114
+ - [Pinterest Tag](./docs/integrations/pinterest-tag.md): Load the Pinterest Tag only after marketing consent with the c15t pinterestTag helper, guard pintrk event calls, and check it in DevTools.
115
+ - [Pirsch](./docs/integrations/pirsch.md): Load Pirsch Analytics only after measurement consent with the c15t pirsch helper, keep custom event bindings working, and check it in DevTools.
116
+ - [Plausible Analytics](./docs/integrations/plausible-analytics.md): Load the Plausible Analytics tracker only after measurement consent with the c15t plausibleAnalytics helper, and check it in DevTools.
117
+ - [PostHog](./docs/integrations/posthog.md): Load PostHog before or after measurement consent with the c15t posthog helper, choose its cookieless behavior, turn off PostHog modules you do not use, and sync consent with an SDK you already initialize.
118
+ - [Promptwatch](./docs/integrations/promptwatch.md): Load the Promptwatch attribution client only after measurement consent with the c15t promptwatch helper, and check it in DevTools.
119
+ - [Reddit Pixel](./docs/integrations/reddit-pixel.md): Load the Reddit Pixel only after marketing consent with the c15t redditPixel helper, guard rdt conversion calls, and check it in DevTools.
120
+ - [RudderStack](./docs/integrations/rudderstack.md): Load the RudderStack JavaScript SDK after measurement consent with the c15t rudderstack helper, or map c15t categories to destination consent IDs, and check each mode.
121
+ - [Rybbit Analytics](./docs/integrations/rybbit-analytics.md): Load Rybbit Analytics only after measurement consent with the c15t rybbitAnalytics helper, map its tracking options to data attributes, and check it in DevTools.
122
+ - [Segment](./docs/integrations/segment.md): Load Segment Analytics.js only after measurement consent with the c15t segment helper, guard your own track and identify calls, and check it in DevTools.
123
+ - [Sentry](./docs/integrations/sentry.md): Configure Sentry's CDN or your own SDK with consent for error monitoring, Session Replay and user data.
124
+ - [Snapchat Pixel](./docs/integrations/snapchat-pixel.md): Load the Snapchat Pixel only after marketing consent with the c15t snapchatPixel helper, guard snaptr event calls, and check it in DevTools.
125
+ - [TikTok Pixel](./docs/integrations/tiktok-pixel.md): Load the TikTok Pixel only after marketing consent with the c15t tiktokPixel helper, guard ttq event calls, and check it in DevTools.
126
+ - [Umami Analytics](./docs/integrations/umami-analytics.md): Load the Umami Analytics tracker only after measurement consent with the c15t umamiAnalytics helper, point it at a self-hosted instance, and check it in DevTools.
127
+ - [Vercel Analytics](./docs/integrations/vercel-analytics.md): Load the Vercel Web Analytics script only after measurement consent with the c15t vercelAnalytics helper, choose the debug script, and check it in DevTools.
128
+ - [X Pixel](./docs/integrations/x-pixel.md): Load the X Pixel only after marketing consent with the c15t xPixel helper, guard twq conversion events, and check it in DevTools.
99
129
  - [YouTube](./docs/integrations/youtube.md): Gate YouTube embeds with c15t v3 in Next.js, TanStack Start, React, Nuxt, Vue, Astro, Svelte, SvelteKit or JavaScript.
100
-
101
- ## Reference
102
-
103
- - [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
@@ -28,8 +28,8 @@ React cookie banner, consent manager, preference center, and headless CMP compon
28
28
  - Headless hooks for custom consent flows
29
29
  - Minimal configuration with TypeScript-first design
30
30
  - Comprehensive Consent Management Platform (CMP)
31
- - IAB TCF 2.3 UI and hooks through the @c15t/react/iab subpath
32
- - Google Tag Manager, Google Consent Mode v2, Meta Pixel, and analytics integrations through @c15t/scripts
31
+ - IAB TCF 2.4 UI and hooks through the @c15t/react/iab subpath
32
+ - Google Tag Manager, Google Consent Mode v2, Meta Pixel, and analytics integrations through @c15t/integrations
33
33
  - Built-in internationalization support
34
34
  - Seamless consent storage and tracking
35
35
 
@@ -73,32 +73,36 @@ Then add the prebuilt stylesheet to your app-level CSS entrypoint:
73
73
 
74
74
  If you use the prebuilt IAB TCF UI, also import `@c15t/react/iab/styles.css`. It is published separately so non-IAB apps do not ship those component rules.
75
75
 
76
- To manually install, follow the guide in our [docs – manual setup](https://c15t.com/docs/frameworks/react/quickstart#manual-setup).
76
+ To manually install, follow the [quickstart](https://c15t.com/docs/frameworks/react/quickstart).
77
77
 
78
78
  ## Usage
79
79
 
80
- 1. Import `ConsentManagerProvider` in your app's root component
81
- 2. Add `ConsentBanner` and `ConsentDialog` components
80
+ 1. Wrap your app in `ConsentProvider` with the backend URL from your Inth project
81
+ 2. Render `ConsentBanner`, `ConsentDialog` and `ConsentDialogLink` inside the provider, and mount it once for the life of the app
82
82
  3. Customize styling and behavior to fit your app
83
83
  4. For full implementation details, see the [React quickstart docs](https://c15t.com/docs/frameworks/react/quickstart)
84
84
 
85
85
  ```tsx
86
- // App.tsx
86
+ // src/consent.tsx
87
87
  import {
88
- ConsentManagerProvider,
89
88
  ConsentBanner,
90
89
  ConsentDialog,
90
+ ConsentDialogLink,
91
+ ConsentProvider,
92
+ hosted,
91
93
  } from '@c15t/react'
92
-
93
- function App() {
94
- return (
95
- <ConsentManagerProvider>
96
- <YourApp />
97
- <ConsentBanner />
98
- <ConsentDialog />
99
- </ConsentManagerProvider>
100
- )
101
- }
94
+ import type { ReactNode } from 'react'
95
+
96
+ const mode = hosted({ backendURL: 'https://your-project.inth.app' })
97
+
98
+ export const Consent = ({ children }: { children: ReactNode }) => (
99
+ <ConsentProvider options={{ mode }}>
100
+ {children}
101
+ <ConsentBanner />
102
+ <ConsentDialog />
103
+ <ConsentDialogLink>Privacy settings</ConsentDialogLink>
104
+ </ConsentProvider>
105
+ )
102
106
  ```
103
107
 
104
108
  ## Documentation
package/SKILL.md ADDED
@@ -0,0 +1,34 @@
1
+ ---
2
+ name: c15t-react
3
+ description: Set up, customize or debug c15t consent management with @c15t/react. Use when the project is a React app, such as Vite or React Router, or when a task mentions a cookie banner, consent dialog, GDPR or CCPA prompts, blocking analytics until consent, Google Consent Mode or IAB TCF.
4
+ ---
5
+
6
+ # c15t with @c15t/react
7
+
8
+ The Markdown under `./docs` matches the installed version. Read it before writing code: v3 renamed most v2 APIs, so remembered examples are usually wrong.
9
+
10
+ ## Before writing code
11
+
12
+ 1. Find the framework, router, rendering mode (server, static, cached or single-page) and host in the project. Check the framework config and route files for settings that prerender or cache pages.
13
+ 2. Pick the matching row in [Choose your setup](./docs/concepts/choose-your-setup.md).
14
+ 3. Follow that guide from start to finish: [React](./docs/frameworks/react/quickstart.md).
15
+
16
+ ## Rules
17
+
18
+ - Install with the `alpha` tag: `npm install c15t@alpha` and import `c15t/react`. npm `latest` is still v2. Keep every c15t package on the same release. New apps install `c15t` and import its framework subpath. An app that already depends on this scoped package can keep importing from it, but should not install both.
19
+ - The backend URL comes from the user's Inth project or self-hosted backend. It is public configuration. Never invent one; ask for it or read it from the environment.
20
+ - Register analytics, pixels and embeds through c15t and remove the vendor's own loader or plugin. With a bundler, use `@c15t/integrations` helpers and `ConsentGate`. On a plain HTML page, change the vendor's `<script>` to `type="text/plain"` with `data-c15t-category`. A banner does not block code loaded elsewhere.
21
+ - Gate features on the current permission. Never save a consent choice on page load or from code; only a visitor action records one.
22
+ - Offline mode keeps policies in code and choices in the browser, with no consent records. Not recommended for production environments.
23
+ - Keep one consent provider or root for the whole app, mounted outside route-level components.
24
+
25
+ ## Customize with the smallest change
26
+
27
+ Copy and languages use i18n configuration. Position and layout use component props. Colors, type, radius and spacing use theme tokens. One part of a component uses slots. Different markup uses compound or headless components.
28
+ Start at [Customization overview](./docs/customization/overview.md).
29
+
30
+ ## Finish with a check
31
+
32
+ A visible banner proves nothing. In a production build, confirm vendor requests are absent before consent, a rejection survives a reload, and preferences reopen. Follow [Verify consent before shipping](./docs/guides/verify-consent.md). If something fails, start with [Troubleshooting](./docs/guides/troubleshooting.md).
33
+
34
+ `./AGENTS.md` lists every bundled page.
@@ -1,2 +1,2 @@
1
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};
2
+ import{jsx as o}from"react/jsx-runtime";import{registerDialogChunkWarmer as e,useIdleDialogWarming as n}from"./chunk-warming.js";import{useActiveUI as t}from"./hooks.js";import{createDeferredModule as r}from"./utils/deferred-module.js";let i=r(()=>import("./components/panel/index.js")),c=r(()=>import("./components/preferences/index.js"));e(()=>{i.preload()});let s=i.component(o=>o.ConsentDialog),l=c.component(o=>o.ConsentWidget),a=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},d=a(e=>{let r=t();return(n("banner"===r),!0===e.open||"dialog"===r||e.showTrigger)?o(s,{...e}):null},["Card","Header","HeaderTitle","HeaderDescription","Content","Footer","ConsentCustomizationCard","ConsentDialogFooter","ConsentDialogHeader","ConsentDialogHeaderTitle","ConsentDialogHeaderDescription","ConsentDialogContent","Overlay","Root"],o=>i.component(e=>e[o])),m=a(e=>o(l,{...e}),["AccordionTrigger","AccordionTriggerInner","AccordionContent","AccordionArrow","Accordion","Switch","AccordionItems","AccordionItem","VendorList","Root","AcceptAllButton","CustomizeButton","SaveButton","RejectButton","PolicyActions","Footer","FooterSubGroup"],o=>c.component(e=>e[o]));export{d as ConsentDialog,m as ConsentWidget};
@@ -1 +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};
1
+ let e;import{useEffect as n}from"react";import{useUIConfig as t}from"./ui-config-context.js";let r=new Set,o=!1,i=function(e){return r.add(e),o&&e(),()=>{r.delete(e)}},a=function(){for(let e of(o=!0,r))e()},l=new Set(["slow-2g","2g"]),u=3e3,g=function(){if("u"<typeof navigator||!1===navigator.onLine)return!1;let{connection:e}=navigator;return e?.saveData!==!0&&!l.has(e?.effectiveType??"")},s=0,c=!1,f=function(){c=!1,s>0&&g()&&a()},m=function(){if(c||o||!g())return;c=!0;let n=()=>{"function"==typeof window.requestIdleCallback?window.requestIdleCallback(f):window.setTimeout(f,200)},t=()=>{e??=performance.now();let t=u-(performance.now()-e);t>0?window.setTimeout(n,t):n()};if("complete"===document.readyState){let[n]=performance.getEntriesByType("navigation");e??=n?.loadEventEnd||performance.now(),t()}else window.addEventListener("load",t,{once:!0})},d=function(e){let{preloadDialog:r="idle"}=t(),o=e&&"idle"===r;n(()=>{if(o)return s+=1,m(),()=>{s-=1}},[o])},w=function(n={}){o=!1,s=0,c=!1,e=void 0,u=n.idleWarmDelayMs??0};export{i as registerDialogChunkWarmer,w as resetDialogChunkWarmingForTests,d as useIdleDialogWarming,a as warmDialogChunk};
@@ -1,2 +1,2 @@
1
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};
2
+ import{actionAppearanceFromTheme as e,resolveConsentPresentation as r}from"@c15t/core";import{useCallback as o,useContext as s,useEffect as t,useMemo as c}from"react";import{GlobalThemeContext as n}from"../context/theme-context.js";import{useConsentSaveAction as a}from"../draft-context.js";import{useActiveUI as i,useDismissNotice as p,usePolicyRule as l,useResolvedPresentation as m,useSetActiveUI as u}from"../hooks.js";import{useTheme as f}from"../hooks/use-theme.js";let d=function(d){let g=i(),k=l(),h=m(),j=s(n),v=c(()=>({preferences:{scrollLock:j.scrollLock,trapFocus:j.trapFocus,...h?.preferences},prompt:{scrollLock:j.scrollLock,trapFocus:j.trapFocus,...h?.prompt}}),[h,j.scrollLock,j.trapFocus]),{theme:F}=f(),L=c(()=>e(F),[F]),_=a(),b=p(),x=u(),A=c(()=>({...r({actionAppearance:L,override:d?.prompt,policy:k,presentation:v,surface:"prompt"}),isVisible:"banner"===g}),[k,v,d?.prompt,g,L]),C=c(()=>({...r({actionAppearance:L,override:d?.preferences,policy:k,presentation:v,surface:"preferences"}),isVisible:"dialog"===g}),[k,v,d?.preferences,g,L]);t(()=>{if("production"!==process.env.NODE_ENV)for(let e of[...A.diagnostics,...C.diagnostics])console.warn(`c15t presentation: ${e.message}`,e.actions)},[A.diagnostics,C.diagnostics]);let V=o(()=>x("banner"),[x]),w=o(()=>x("dialog"),[x]),D=o(()=>x("none"),[x]),E=o(e=>{switch(e){case"accept":return _("all");case"reject":return _("none");case"save":return _();case"dismiss":return b();case"customize":return x("dialog");default:return}},[_,b,x]);return{activeUI:g,banner:A,closeUI:D,dialog:C,openBanner:V,openDialog:w,performAction:E,performBannerAction:E,performDialogAction:E,saveCustomPreferences:_}};export{d as useHeadlessConsentUI};
@@ -1,2 +1,2 @@
1
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};
2
+ import{saveIABConsentSurface as e}from"@c15t/core/surface-actions";import{resolveIABBannerSummary as o}from"@c15t/iab/headless";import{useCallback as t,useContext as s,useMemo as r}from"react";import{KernelContext as c}from"../context.js";import{useActiveUI as a,usePreferencesPresentation as n,usePromptPresentation as l,useSetActiveUI as i}from"../hooks.js";import{useIAB as m}from"../iab-context.js";let f=function(){let f=m(),d=s(c),p=a()??"none",u=l(),b=n(),v=i(),g=r(()=>o(f),[f]),j=t(()=>{f?.setPreferenceCenterTab("vendors"),v("dialog")},[f,v]),k=t(()=>v("none"),[v]),_=t(e=>{e?.tab&&f?.setPreferenceCenterTab(e.tab),v("dialog")},[f,v]),A=t(async o=>{f&&("accept"===o?f.acceptAll():"reject"===o&&f.rejectAll(),await (d?e(d,f.save):f.save()))},[f,d]),C=t(async e=>{"customize"===e?_():await A(e)},[_,A]),I=t(e=>A("customize"===e?void 0:e),[A]);return{activeUI:p,banner:{...g,scrollLock:u.scrollLock},closeUI:k,dialog:{isReady:!!(f?.gvl||f?.gvlReference),scrollLock:b.scrollLock},iab:f,openDialog:_,openVendorsDialog:j,performBannerAction:C,performDialogAction:I}};export{f as useHeadlessIABConsentUI};
@@ -1,2 +1,2 @@
1
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};
2
+ import{useCallback as e}from"react";import{useActiveUI as r,useHasConsentPreferences 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 @@
1
+ import{Fragment as t,jsx as e,jsxs as o}from"react/jsx-runtime";import s from"@c15t/ui/styles/components/consent-gate";import{forwardRef as r}from"react";import{useTranslations as n}from"../../component-hooks/use-translations.js";import{useUIConfig as a}from"../../ui-config-context.js";import{getSlotProps as i,mergeSlotProps as l}from"../../utils/merge-slot-props.js";import{FIRST_PAINT_SHEETS as m}from"../shared/first-paint-sheets.js";import{Box as c}from"../shared/primitives/box.js";import{ConsentButton as p}from"../shared/primitives/button.js";import{SurfaceStyles as d}from"../shared/surface-styles.js";let f=r(({children:r,...n},a)=>o(t,{children:[e(d,{sheets:m,noStyle:n.noStyle}),e(c,{ref:a,baseClassName:s.placeholder,"data-testid":"consent-gate-placeholder",slotKey:"consent-gate.root",...n,children:r})]})),u=r(({children:t,category:o,...r},a)=>{let{consentGate:i,consentTypes:l}=n(),m=o&&i?.title?i.title.replace("{category}",l?.[o]?.title??o):void 0;return e(c,{ref:a,baseClassName:s.title,"data-testid":"consent-gate-title",slotKey:"consent-gate.title",...r,children:t??m})}),g=r(({children:t,category:o,className:s,style:r,...m},c)=>{let{consentGate:d,consentTypes:f}=n(),{components:u}=a(),g=l(i(u,"consent-gate.button"),{className:s,style:r}),h=f?.[o]?.title??o,y=d?.actionButton?.replace("{category}",h);return e(p,{mode:"stroke",size:"small",variant:"primary",...g,...m,ref:c,action:"open-consent-dialog",category:o,"data-testid":"consent-gate-button",children:t??y})});f.displayName="ConsentGateRoot",u.displayName="ConsentGateTitle",g.displayName="ConsentGateButton";export{g as ConsentGateButton,f as ConsentGateRoot,u as ConsentGateTitle};
@@ -0,0 +1,2 @@
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{useTranslations as s}from"../../component-hooks/use-translations.js";import{usePolicyCategories as i,usePolicyScopeMode as l,useRegisterConsentCategories as n}from"../../hooks.js";import{useIsHydrated as c}from"../../hooks/use-is-hydrated.js";import{useCategoryAllowed as a}from"../../kernel-selector.js";import{ConsentGateButton as m,ConsentGateRoot as d,ConsentGateTitle as p}from"./atoms.js";let y=({category:r,policyBlocked:t,policyBlockedMessage:s})=>o(d,{children:[e(p,{category:r,children:t?s??"This content is unavailable under your region's consent policy.":void 0}),t?null:e(m,{category:r})]}),u=r(({children:o,category:r,placeholder:m,noStyle:d,className:p,theme:u,...h},f)=>{let k=a(r),j=c(),g=i(),v=l(),B=n(),{consentGate:x}=s(),C="necessary"!==r&&!g.includes("*")&&!g.includes(r);return t(()=>{B([r])},[r,B]),e("div",{ref:f,className:p,...h,children:k?j?o:null:m||e(y,{category:r,policyBlocked:"strict"===v&&C,policyBlockedMessage:x?.policyBlocked})})});u.displayName="ConsentGate";let h=u;export{h as ConsentGate};
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ import{jsx as t}from"react/jsx-runtime";import{forwardRef as e}from"react";import{ConsentGate as o}from"./consent-gate.js";import*as n from"./atoms.js";let a=new Set,r=function(t,e){"production"===process.env.NODE_ENV||a.has(t)||(a.add(t),console.warn(`c15t: \`${t}\` is deprecated and will be removed in a future major release. Use \`${e}\` instead.`))},s=function(o,n,a){let s=e((e,s)=>(r(n,a),t(o,{...e,ref:s})));return s.displayName=n,s},m=s(n.ConsentGateRoot,"FrameRoot","ConsentGate.Root"),i=s(n.ConsentGateTitle,"FrameTitle","ConsentGate.Title"),l=s(n.ConsentGateButton,"FrameButton","ConsentGate.Button"),u=Object.assign(s(o,"Frame","ConsentGate"),{Button:l,Root:m,Title:i});export{u as Frame,l as FrameButton,m as FrameRoot,i as FrameTitle};
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ import{ConsentGate as t}from"./consent-gate.js";import*as e from"./atoms.js";let o=Object.assign(t,{Button:e.ConsentGateButton,Root:e.ConsentGateRoot,Title:e.ConsentGateTitle});var n=e.ConsentGateButton,a=e.ConsentGateRoot,s=e.ConsentGateTitle;export{Frame,FrameButton,FrameRoot,FrameTitle}from"./frame.js";export{n as ConsentGateButton,a as ConsentGateRoot,s as ConsentGateTitle,o as ConsentGate};
@@ -1,2 +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};
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{useHasConsentPreferences 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,2 +1,2 @@
1
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};
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 i,useEffect as o,useRef as a,useState as n}from"react";import{useFocusTrap as s}from"../../../hooks/use-focus-trap.js";import{useTheme as l}from"../../../hooks/use-theme.js";import{useUIConfig as m}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}=l(),{components:C}=m(),h=a(null),x=i(t=>{if(h.current=t,"function"==typeof g)return g(t);g&&(g.current=t)},[g]),y=u(),[A,F]=n(!1);return s(!!j,h,{initialFocus:"first-tabbable"}),o(()=>{let t=requestAnimationFrame(()=>F(!0));return()=>cancelAnimationFrame(t)},[]),t("div",{ref:x,"aria-describedby":"iab-consent-dialog-description",...d(C?.["iab-dialog"]?.card,{baseClassName:c(e.card,A?e.contentVisible:e.contentHidden),className:p,"data-testid":f??"iab-consent-dialog-card",...b}),"aria-label":y.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 e,jsxs as r}from"react/jsx-runtime";import{iabDisplayTestId as t}from"@c15t/iab/headless";import o from"@c15t/ui/styles/components/iab-consent-dialog";import{useState as n}from"react";import{useTheme as i}from"../../../hooks/use-theme.js";import{useUIConfig as s}from"../../../ui-config-context.js";import{mergeSlotProps as l}from"../../../utils/merge-slot-props.js";import{useIABTranslations as a}from"../use-iab-translations.js";import*as p from"../../shared/ui/preference-item/index.js";let d=({feature:d,testId:m})=>{let{components:c}=s(),{noStyle:h}=i(),[u,g]=n(!1),[f,v]=n(!1),[y,C]=n(!1),S=a(),N=l(c?.["iab-purpose-item"]?.header,{baseClassName:o.purposeHeader,noStyle:h}),x=l(c?.["iab-purpose-item"]?.examples,{noStyle:h}),b=l(c?.["iab-purpose-item"]?.vendors,{noStyle:h});return r(p.Root,{className:h?void 0:o.purposeItem,"data-testid":m??t("feature",d.id),noStyle:!0,onOpenChange:g,open:u,slotKey:"iab-purpose-item.root",children:[e("div",{...N,children:r(p.Trigger,{className:h?void 0:o.purposeTrigger,noStyle:!0,slotKey:"iab-purpose-item.trigger",children:[e(p.Leading,{noStyle:!0,children:e("svg",{"aria-hidden":"true",className:o.purposeArrow,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:u?e("path",{d:"M19 9l-7 7-7-7"}):e("path",{d:"M9 5l7 7-7 7"})})}),r(p.Header,{className:o.purposeInfo,noStyle:!0,children:[e(p.Title,{className:o.purposeName,noStyle:!0,children:d.name}),e(p.Meta,{className:o.purposeMeta,noStyle:!0,children:S.preferenceCenter.purposeItem.partners.replace("{count}",String(d.vendors.length))})]})]})}),r(p.Content,{innerClassName:h?void 0:o.purposeContent,innerSlotKey:"iab-purpose-item.content",noStyle:h,children:[e("p",{className:o.purposeDescription,children:d.description}),d.illustrations.length>0&&e("div",{...x,children:r(p.Root,{noStyle:!0,onOpenChange:v,open:f,children:[r(p.Trigger,{className:o.examplesToggle,noStyle:!0,children:[e("svg",{"aria-hidden":"true",style:{height:"0.75rem",width:"0.75rem"},viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:f?e("path",{d:"M19 9l-7 7-7-7"}):e("path",{d:"M9 5l7 7-7 7"})}),S.preferenceCenter.purposeItem.examples," (",d.illustrations.length,")"]}),e(p.Content,{noStyle:h,children:e("ul",{className:o.examplesList,children:d.illustrations.map((r,t)=>e("li",{children:r},t))})})]})}),d.vendors.length>0&&e("div",{...b,children:r(p.Root,{noStyle:!0,onOpenChange:C,open:y,children:[r(p.Trigger,{className:o.vendorsToggle,noStyle:!0,children:[e("svg",{"aria-hidden":"true",style:{height:"0.75rem",width:"0.75rem"},viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:y?e("path",{d:"M19 9l-7 7-7-7"}):e("path",{d:"M9 5l7 7-7 7"})}),S.preferenceCenter.vendorList.iabVendorsHeading," (",d.vendors.length,")"]}),e(p.Content,{noStyle:h,children:e("ul",{className:o.examplesList,children:d.vendors.map(r=>e("li",{children:r.name},r.id))})})]})})]})]})};export{d as FeatureItem};
@@ -1,2 +1,2 @@
1
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};
2
+ import{Fragment as e,jsx as o,jsxs as t}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 a}from"../../../ui-config-context.js";import{mergeSlotProps as l}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}=a(),b=c(),{common:x}=n();return o("div",{ref:f,...l(g?.["iab-dialog"]?.header,{baseClassName:r.header,className:h}),children:i||t(e,{children:[t("div",{className:r.headerContent,children:[o("h2",{className:r.title,children:m??b.preferenceCenter.title}),o("p",{className:r.description,id:"iab-consent-dialog-description",children:d??b.preferenceCenter.description})]}),p&&o("button",{type:"button",onClick:()=>{u("none")},className:r.closeButton,"aria-label":x.close,"data-testid":"iab-consent-dialog-close",children:t("svg",{style:{height:"1rem",width:"1rem"},viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[o("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),o("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})})});m.displayName="IABConsentDialogHeader";export{m as IABConsentDialogHeader};
@@ -1,2 +1,2 @@
1
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};
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(),[B,T]=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=!1!==u.hasConsentBasis||!M,q=a(L?.["iab-purpose-item"]?.header,{baseClassName:i.purposeHeader,noStyle:w}),F=a(L?.["iab-purpose-item"]?.legitimateInterest,{baseClassName:i.purposeLiSection,noStyle:w}),G=a(L?.["iab-purpose-item"]?.examples,{noStyle:w}),J=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:T,open:B,slotKey:"iab-purpose-item.root",children:[r("div",{...q,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:B?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))]})]})]}),Y&&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",{...F,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",{...G,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",{...J,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};
@@ -1,2 +1,2 @@
1
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};
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 s}from"react";import{createPortal as m}from"react-dom";import{ConsentTrackingContext as a}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 h}from"../../../utils/cn.js";import{mergeSlotProps as j}from"../../../utils/merge-slot-props.js";import{IAB_DIALOG_SHEETS as b}from"../../shared/iab-dialog-sheets.js";import{SurfaceStyles as k}from"../../shared/surface-styles.js";import{IABConsentDialogOverlay as v}from"./overlay.js";let y=["iab"],x=({children:x,open:A,models:F=y,noStyle:L,disableAnimation:C,scrollLock:D,trapFocus:q,uiSource:w})=>{let{activeUI:B,translationConfig:E,iab:I,policyDialog:N,model:P}=d({preferences:{scrollLock:D,trapFocus:q}}),R=c(),{components:S}=g(),T=f(E.defaultLanguage),H=u(),[O,V]=s(!1),_=null!==P&&F.includes(P)&&(A??"dialog"===B),z=N.blocking,G=n(()=>({disableAnimation:C,noStyle:L,scrollLock:z,trapFocus:z}),[C,L,z]);p(!!(_&&z)),i(()=>{if(!_)return;let o=o=>{t(o.key)&&(o.preventDefault(),R("none"))};return document.addEventListener("keydown",o),()=>document.removeEventListener("keydown",o)},[_,R]),i(()=>{if(_){let o=requestAnimationFrame(()=>V(!0));return()=>cancelAnimationFrame(o)}if(C){let o=requestAnimationFrame(()=>V(!1));return()=>cancelAnimationFrame(o)}let o=setTimeout(()=>{V(!1)},150);return()=>clearTimeout(o)},[_,C]);let J=j(S?.["iab-dialog"]?.root,{baseClassName:h(r.root,C?void 0:O?r.dialogVisible:r.dialogHidden)}),K=n(()=>({uiSource:w??"iab_dialog"}),[w]);return H&&I?.config.enabled&&(_||O)?m(o(a.Provider,{value:K,children:e(l.Provider,{value:G,children:[o(k,{sheets:b,noStyle:L}),o(v,{isOpen:_}),o("div",{...J,"data-testid":"iab-consent-dialog-root",dir:T,children:x})]})}),document.body):null};x.displayName="IABConsentDialogRoot";export{x as IABConsentDialogRoot};