@c15t/nextjs 2.1.0 → 2.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (162) hide show
  1. package/AGENTS.md +155 -0
  2. package/README.md +31 -15
  3. package/client/components/integrations.js +3 -0
  4. package/dist/components/integrations/index.cjs +1 -0
  5. package/dist/components/integrations/index.js +1 -0
  6. package/dist/headless.cjs +1 -1
  7. package/dist/index.cjs +1 -1
  8. package/dist/libs/browser-initial-data.cjs +1 -1
  9. package/dist/libs/initial-data.cjs +1 -1
  10. package/dist/styles.tw3.css +1 -1
  11. package/dist/version.cjs +1 -1
  12. package/dist/version.js +1 -1
  13. package/dist-types/components/integrations/index.d.ts +1 -0
  14. package/dist-types/libs/browser-initial-data.d.ts +1 -1
  15. package/dist-types/version.d.ts +1 -1
  16. package/docs/README.md +155 -73
  17. package/docs/{building-headless-components.md → frameworks/next/building-headless-components.md} +3 -1
  18. package/docs/{callbacks.md → frameworks/next/callbacks.md} +3 -1
  19. package/docs/{components → frameworks/next/components}/consent-banner.md +10 -21
  20. package/docs/{components → frameworks/next/components}/consent-dialog-link.md +8 -5
  21. package/docs/frameworks/next/components/consent-dialog-trigger.md +202 -0
  22. package/docs/{components → frameworks/next/components}/consent-dialog.md +7 -15
  23. package/docs/frameworks/next/components/consent-manager-provider.md +327 -0
  24. package/docs/{components → frameworks/next/components}/consent-widget.md +8 -6
  25. package/docs/{components → frameworks/next/components}/dev-tools.md +9 -6
  26. package/docs/{components → frameworks/next/components}/frame.md +8 -9
  27. package/docs/{concepts → frameworks/next/concepts}/client-modes.md +4 -2
  28. package/docs/{concepts → frameworks/next/concepts}/consent-categories.md +1 -0
  29. package/docs/{concepts → frameworks/next/concepts}/consent-models.md +1 -0
  30. package/docs/{concepts → frameworks/next/concepts}/cookie-management.md +3 -3
  31. package/docs/{concepts → frameworks/next/concepts}/glossary.md +1 -0
  32. package/docs/{concepts → frameworks/next/concepts}/initialization-flow.md +1 -0
  33. package/docs/{concepts → frameworks/next/concepts}/policy-packs.md +1 -0
  34. package/docs/{headless.md → frameworks/next/headless.md} +3 -1
  35. package/docs/{hooks → frameworks/next/hooks}/use-color-scheme.md +1 -0
  36. package/docs/{hooks → frameworks/next/hooks}/use-consent-manager/checking-consent.md +3 -1
  37. package/docs/{hooks → frameworks/next/hooks}/use-consent-manager/location-info.md +3 -1
  38. package/docs/frameworks/next/hooks/use-consent-manager/overview.md +185 -0
  39. package/docs/{hooks → frameworks/next/hooks}/use-consent-manager/setting-consent.md +3 -1
  40. package/docs/{hooks → frameworks/next/hooks}/use-draggable.md +3 -1
  41. package/docs/{hooks → frameworks/next/hooks}/use-focus-trap.md +1 -0
  42. package/docs/{hooks → frameworks/next/hooks}/use-reduced-motion.md +3 -1
  43. package/docs/{hooks → frameworks/next/hooks}/use-ssr-status.md +6 -5
  44. package/docs/{hooks → frameworks/next/hooks}/use-text-direction.md +1 -0
  45. package/docs/frameworks/next/hooks/use-translations.md +55 -0
  46. package/docs/{iab → frameworks/next/iab}/consent-banner.md +9 -12
  47. package/docs/{iab → frameworks/next/iab}/consent-dialog.md +9 -14
  48. package/docs/{iab → frameworks/next/iab}/overview.md +4 -2
  49. package/docs/{iab → frameworks/next/iab}/use-gvl-data.md +3 -2
  50. package/docs/{iframe-blocking.md → frameworks/next/iframe-blocking.md} +8 -9
  51. package/docs/{internationalization.md → frameworks/next/internationalization.md} +13 -3
  52. package/docs/{network-blocker.md → frameworks/next/network-blocker.md} +13 -51
  53. package/docs/{optimization.md → frameworks/next/optimization.md} +5 -4
  54. package/docs/{policy-packs.md → frameworks/next/policy-packs.md} +3 -1
  55. package/docs/{quickstart.md → frameworks/next/quickstart.md} +26 -42
  56. package/docs/{script-loader.md → frameworks/next/script-loader.md} +72 -90
  57. package/docs/{server-side.md → frameworks/next/server-side.md} +12 -15
  58. package/docs/{styling → frameworks/next/styling}/classnames.md +3 -1
  59. package/docs/{styling → frameworks/next/styling}/color-scheme.md +3 -1
  60. package/docs/frameworks/next/styling/css-variables.md +53 -0
  61. package/docs/frameworks/next/styling/overview.md +299 -0
  62. package/docs/frameworks/next/styling/slots.md +94 -0
  63. package/docs/{styling → frameworks/next/styling}/tailwind.md +3 -1
  64. package/docs/frameworks/next/styling/tokens.md +156 -0
  65. package/docs/{troubleshooting.md → frameworks/next/troubleshooting.md} +3 -1
  66. package/docs/integrations/adobe-analytics.md +160 -0
  67. package/docs/integrations/ahrefs-analytics.md +15 -82
  68. package/docs/integrations/amplitude.md +230 -0
  69. package/docs/integrations/building-integrations.md +15 -181
  70. package/docs/integrations/clearbit.md +130 -0
  71. package/docs/integrations/cloudflare-web-analytics.md +15 -83
  72. package/docs/integrations/crisp.md +13 -87
  73. package/docs/integrations/databuddy.md +16 -85
  74. package/docs/integrations/fathom-analytics.md +15 -86
  75. package/docs/integrations/google-maps.md +263 -0
  76. package/docs/integrations/google-tag-manager.md +18 -86
  77. package/docs/integrations/google-tag.md +15 -84
  78. package/docs/integrations/heap.md +219 -0
  79. package/docs/integrations/hightouch.md +199 -0
  80. package/docs/integrations/hotjar.md +15 -83
  81. package/docs/integrations/intercom.md +13 -83
  82. package/docs/integrations/linkedin-insights.md +15 -82
  83. package/docs/integrations/logrocket.md +175 -0
  84. package/docs/integrations/matomo-analytics.md +13 -88
  85. package/docs/integrations/meta-pixel.md +33 -316
  86. package/docs/integrations/microsoft-clarity.md +15 -83
  87. package/docs/integrations/microsoft-uet.md +16 -83
  88. package/docs/integrations/mixpanel-analytics.md +15 -83
  89. package/docs/integrations/overview.md +55 -6
  90. package/docs/integrations/pirsch.md +142 -0
  91. package/docs/integrations/plausible-analytics.md +14 -97
  92. package/docs/integrations/posthog.md +26 -98
  93. package/docs/integrations/promptwatch.md +16 -82
  94. package/docs/integrations/reddit-pixel.md +27 -122
  95. package/docs/integrations/rudderstack.md +271 -0
  96. package/docs/integrations/rybbit-analytics.md +15 -94
  97. package/docs/integrations/segment.md +15 -82
  98. package/docs/integrations/snapchat-pixel.md +21 -102
  99. package/docs/integrations/tiktok-pixel.md +13 -81
  100. package/docs/integrations/umami-analytics.md +16 -88
  101. package/docs/integrations/vercel-analytics.md +13 -85
  102. package/docs/integrations/x-pixel.md +27 -102
  103. package/docs/integrations/youtube.md +193 -0
  104. package/docs/shared/concepts/client-modes.md +103 -0
  105. package/docs/shared/concepts/consent-categories.md +41 -0
  106. package/docs/shared/concepts/consent-models.md +72 -0
  107. package/docs/shared/concepts/cookie-management.md +88 -0
  108. package/docs/shared/concepts/glossary.md +24 -0
  109. package/docs/shared/concepts/initialization-flow.md +105 -0
  110. package/docs/shared/concepts/policy-packs.md +225 -0
  111. package/docs/shared/react/components/consent-banner.md +242 -0
  112. package/docs/shared/react/components/consent-dialog-link.md +45 -0
  113. package/docs/shared/react/components/consent-dialog-trigger.md +185 -0
  114. package/docs/shared/react/components/consent-dialog.md +119 -0
  115. package/docs/shared/react/components/consent-manager-provider.md +225 -0
  116. package/docs/shared/react/components/consent-widget.md +121 -0
  117. package/docs/shared/react/components/dev-tools.md +81 -0
  118. package/docs/shared/react/components/frame.md +52 -0
  119. package/docs/shared/react/guides/building-headless-components.md +110 -0
  120. package/docs/shared/react/guides/callbacks.md +89 -0
  121. package/docs/shared/react/guides/headless.md +31 -0
  122. package/docs/shared/react/guides/iframe-blocking.md +65 -0
  123. package/docs/shared/react/guides/internationalization.md +123 -0
  124. package/docs/shared/react/guides/network-blocker.md +72 -0
  125. package/docs/shared/react/guides/optimization.md +44 -0
  126. package/docs/shared/react/guides/policy-packs.md +173 -0
  127. package/docs/shared/react/guides/script-loader.md +311 -0
  128. package/docs/shared/react/hooks/use-color-scheme.md +31 -0
  129. package/docs/shared/react/hooks/use-consent-manager/checking-consent.md +95 -0
  130. package/docs/shared/react/hooks/use-consent-manager/location-info.md +96 -0
  131. package/docs/shared/react/hooks/use-consent-manager/overview.md +74 -0
  132. package/docs/shared/react/hooks/use-consent-manager/setting-consent.md +93 -0
  133. package/docs/shared/react/hooks/use-draggable.md +30 -0
  134. package/docs/shared/react/hooks/use-focus-trap.md +20 -0
  135. package/docs/shared/react/hooks/use-reduced-motion.md +33 -0
  136. package/docs/shared/react/hooks/use-ssr-status.md +16 -0
  137. package/docs/shared/react/hooks/use-text-direction.md +38 -0
  138. package/docs/shared/react/hooks/use-translations.md +15 -0
  139. package/docs/shared/react/iab/consent-banner.md +60 -0
  140. package/docs/shared/react/iab/consent-dialog.md +76 -0
  141. package/docs/shared/react/iab/overview.md +80 -0
  142. package/docs/shared/react/iab/use-gvl-data.md +21 -0
  143. package/docs/shared/react/styling/classnames.md +93 -0
  144. package/docs/shared/react/styling/color-scheme.md +35 -0
  145. package/docs/shared/react/styling/css-variables.md +53 -0
  146. package/docs/shared/react/styling/overview.md +261 -0
  147. package/docs/shared/react/styling/slots.md +93 -0
  148. package/docs/shared/react/styling/stylesheet-entrypoint.md +8 -0
  149. package/docs/shared/react/styling/tailwind.md +88 -0
  150. package/docs/shared/react/styling/tokens.md +155 -0
  151. package/docs/shared/troubleshooting.md +82 -0
  152. package/package.json +19 -10
  153. package/readme.json +14 -8
  154. package/docs/ai-agents.md +0 -111
  155. package/docs/components/consent-dialog-trigger.md +0 -103
  156. package/docs/components/consent-manager-provider.md +0 -425
  157. package/docs/hooks/use-consent-manager/overview.md +0 -420
  158. package/docs/hooks/use-translations.md +0 -118
  159. package/docs/styling/css-variables.md +0 -92
  160. package/docs/styling/overview.md +0 -457
  161. package/docs/styling/slots.md +0 -128
  162. package/docs/styling/tokens.md +0 -216
@@ -1,216 +0,0 @@
1
- ---
2
- title: Design Tokens
3
- description: The six base token categories that control colors, typography, spacing, radius, shadows, and motion, plus optional dark-mode overrides.
4
- ---
5
- ## Color Tokens
6
-
7
- Color tokens define the palette for all consent components. Set `colors` for light mode and `dark` for dark mode overrides.
8
-
9
- When `textOnPrimary` is omitted, c15t derives it automatically from `primary` to keep text readable on primary-filled surfaces such as stock branding tags and buttons. Set `textOnPrimary` explicitly when you need a specific foreground color.
10
-
11
- ```tsx
12
- const theme = {
13
- colors: {
14
- primary: '#6366f1',
15
- primaryHover: '#4f46e5',
16
- surface: '#ffffff',
17
- surfaceHover: '#f9fafb',
18
- border: '#e5e7eb',
19
- borderHover: '#d1d5db',
20
- text: '#1f2937',
21
- textMuted: '#6b7280',
22
- textOnPrimary: '#ffffff',
23
- overlay: 'rgba(0, 0, 0, 0.5)',
24
- switchTrack: '#d1d5db',
25
- switchTrackActive: '#6366f1',
26
- switchThumb: '#ffffff',
27
- },
28
- dark: {
29
- primary: '#818cf8',
30
- surface: '#1f2937',
31
- text: '#f9fafb',
32
- textMuted: '#9ca3af',
33
- border: '#374151',
34
- },
35
- } satisfies Theme;
36
- ```
37
-
38
- ### ColorTokens
39
-
40
- |Property|Type|Description|Default|Required|
41
- |:--|:--|:--|:--|:--:|
42
- |primary|string \|undefined|Primary brand/accent color for interactive elements.|-|Optional|
43
- |primaryHover|string \|undefined|Hover/active state for primary elements.|-|Optional|
44
- |surface|string \|undefined|Main background color for panels and containers.|-|Optional|
45
- |surfaceHover|string \|undefined|Hover state for surface elements.|-|Optional|
46
- |border|string \|undefined|Border color for containers and inputs.|-|Optional|
47
- |borderHover|string \|undefined|Hover state for bordered elements.|-|Optional|
48
- |text|string \|undefined|Primary text color for headings and body.|-|Optional|
49
- |textMuted|string \|undefined|Muted text color for secondary content.|-|Optional|
50
- |textOnPrimary|string \|undefined|Text color for content on primary background. Auto-derived from \`primary\` when omitted.|-|Optional|
51
- |overlay|string \|undefined|Overlay color for modal backdrops.|-|Optional|
52
- |switchTrack|string \|undefined|Toggle track color (off state).|-|Optional|
53
- |switchTrackActive|string \|undefined|Toggle track color (on state).|-|Optional|
54
- |switchThumb|string \|undefined|Toggle thumb color.|-|Optional|
55
-
56
- ## Typography Tokens
57
-
58
- Control font family, sizes, weights, and line heights.
59
-
60
- ```tsx
61
- const theme = {
62
- typography: {
63
- fontFamily: 'Inter, system-ui, sans-serif',
64
- fontSize: { sm: '0.875rem', base: '1rem', lg: '1.125rem' },
65
- fontWeight: { normal: 400, medium: 500, semibold: 600 },
66
- lineHeight: { tight: '1.25', normal: '1.5', relaxed: '1.75' },
67
- },
68
- } satisfies Theme;
69
- ```
70
-
71
- ### TypographyTokens
72
-
73
- |Property|Type|Description|Default|Required|
74
- |:--|:--|:--|:--|:--:|
75
- |fontFamily|string \|undefined|Font family for all components.|-|Optional|
76
- |fontSize|Object \|undefined|Font sizes for text hierarchy.|-|Optional|
77
- |fontWeight|Object \|undefined|Font weights for emphasis.|-|Optional|
78
- |lineHeight|Object \|undefined|Line heights for readability.|-|Optional|
79
-
80
- #### `fontSize`
81
-
82
- Font sizes for text hierarchy.
83
-
84
- |Property|Type|Description|Default|Required|
85
- |:--|:--|:--|:--|:--:|
86
- |sm|string \|undefined|@default '0.875rem'|-|Optional|
87
- |base|string \|undefined|@default '1rem'|-|Optional|
88
- |lg|string \|undefined|@default '1.125rem'|-|Optional|
89
-
90
- #### `fontWeight`
91
-
92
- Font weights for emphasis.
93
-
94
- |Property|Type|Description|Default|Required|
95
- |:--|:--|:--|:--|:--:|
96
- |normal|number \|undefined|@default 400|-|Optional|
97
- |medium|number \|undefined|@default 500|-|Optional|
98
- |semibold|number \|undefined|@default 600|-|Optional|
99
-
100
- #### `lineHeight`
101
-
102
- Line heights for readability.
103
-
104
- |Property|Type|Description|Default|Required|
105
- |:--|:--|:--|:--|:--:|
106
- |tight|string \|undefined|@default '1.25'|-|Optional|
107
- |normal|string \|undefined|@default '1.5'|-|Optional|
108
- |relaxed|string \|undefined|@default '1.75'|-|Optional|
109
-
110
- ## Spacing Tokens
111
-
112
- Five-step scale for internal padding, margins, and gaps.
113
-
114
- ```tsx
115
- const theme = {
116
- spacing: {
117
- xs: '0.25rem', // 4px
118
- sm: '0.5rem', // 8px
119
- md: '1rem', // 16px
120
- lg: '1.5rem', // 24px
121
- xl: '2rem', // 32px
122
- },
123
- } satisfies Theme;
124
- ```
125
-
126
- ### SpacingTokens
127
-
128
- |Property|Type|Description|Default|Required|
129
- |:--|:--|:--|:--|:--:|
130
- |xs|string \|undefined|@default '0.25rem' (4px)|'0.25rem' (4px)|Optional|
131
- |sm|string \|undefined|@default '0.5rem' (8px)|'0.5rem' (8px)|Optional|
132
- |md|string \|undefined|@default '1rem' (16px)|'1rem' (16px)|Optional|
133
- |lg|string \|undefined|@default '1.5rem' (24px)|'1.5rem' (24px)|Optional|
134
- |xl|string \|undefined|@default '2rem' (32px)|'2rem' (32px)|Optional|
135
-
136
- ## Radius Tokens
137
-
138
- Border radius scale for rounded corners.
139
-
140
- ```tsx
141
- const theme = {
142
- radius: {
143
- sm: '0.25rem', // 4px
144
- md: '0.5rem', // 8px
145
- lg: '0.75rem', // 12px
146
- full: '9999px', // Pill shape
147
- },
148
- } satisfies Theme;
149
- ```
150
-
151
- ### RadiusTokens
152
-
153
- |Property|Type|Description|Default|Required|
154
- |:--|:--|:--|:--|:--:|
155
- |sm|string \|undefined|@default '0.25rem' (4px)|'0.25rem' (4px)|Optional|
156
- |md|string \|undefined|@default '0.5rem' (8px)|'0.5rem' (8px)|Optional|
157
- |lg|string \|undefined|@default '0.75rem' (12px)|'0.75rem' (12px)|Optional|
158
- |full|string \|undefined|@default '9999px'|'9999px'|Optional|
159
-
160
- ## Shadow Tokens
161
-
162
- Box shadow scale for depth and elevation.
163
-
164
- ```tsx
165
- const theme = {
166
- shadows: {
167
- sm: '0 1px 2px hsla(0, 0%, 0%, 0.05)',
168
- md: '0 4px 12px hsla(0, 0%, 0%, 0.08)',
169
- lg: '0 8px 24px hsla(0, 0%, 0%, 0.12)',
170
- },
171
- } satisfies Theme;
172
- ```
173
-
174
- ### ShadowTokens
175
-
176
- |Property|Type|Description|Default|Required|
177
- |:--|:--|:--|:--|:--:|
178
- |sm|string \|undefined|@default '0 1px 2px hsla(0, 0%, 0%, 0.05)'|'0 1px 2px hsla(0, 0%, 0%, 0.05)'|Optional|
179
- |md|string \|undefined|@default '0 4px 12px hsla(0, 0%, 0%, 0.08)'|'0 4px 12px hsla(0, 0%, 0%, 0.08)'|Optional|
180
- |lg|string \|undefined|@default '0 8px 24px hsla(0, 0%, 0%, 0.12)'|'0 8px 24px hsla(0, 0%, 0%, 0.12)'|Optional|
181
-
182
- ## Motion Tokens
183
-
184
- Animation duration and easing presets.
185
-
186
- ```tsx
187
- const theme = {
188
- motion: {
189
- duration: { fast: '100ms', normal: '200ms', slow: '300ms' },
190
- easing: 'cubic-bezier(0.4, 0, 0.2, 1)',
191
- easingOut: 'cubic-bezier(0.215, 0.61, 0.355, 1)',
192
- easingInOut: 'cubic-bezier(0.645, 0.045, 0.355, 1)',
193
- easingSpring: 'cubic-bezier(0.34, 1.56, 0.64, 1)',
194
- },
195
- } satisfies Theme;
196
- ```
197
-
198
- ### MotionTokens
199
-
200
- |Property|Type|Description|Default|Required|
201
- |:--|:--|:--|:--|:--:|
202
- |duration|Object \|undefined|Duration presets for transitions.|-|Optional|
203
- |easing|string \|undefined|Default CSS easing function for general animation curves.|'cubic-bezier(0.4, 0, 0.2, 1)'|Optional|
204
- |easingOut|string \|undefined|CSS easing function for enter/exit animations. Use for modals, tooltips, dropdowns, and any element entering or exiting.|'cubic-bezier(0.215, 0.61, 0.355, 1)'|Optional|
205
- |easingInOut|string \|undefined|CSS easing function for on-screen movement. Use when elements already on screen need to move or morph.|'cubic-bezier(0.645, 0.045, 0.355, 1)'|Optional|
206
- |easingSpring|string \|undefined|CSS easing function with spring-like overshoot. Use for playful, bouncy animations.|'cubic-bezier(0.34, 1.56, 0.64, 1)'|Optional|
207
-
208
- #### `duration`
209
-
210
- Duration presets for transitions.
211
-
212
- |Property|Type|Description|Default|Required|
213
- |:--|:--|:--|:--|:--:|
214
- |fast|string \|undefined|@default '100ms'|-|Optional|
215
- |normal|string \|undefined|@default '200ms'|-|Optional|
216
- |slow|string \|undefined|@default '300ms'|-|Optional|