@c15t/nextjs 2.0.0-rc.6 → 2.0.0-rc.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -0
- package/dist/iab/styles.css +12 -1
- package/dist/iab/styles.tw3.css +14 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/styles.css +10 -1
- package/dist/styles.tw3.css +13 -0
- package/dist/version.cjs +1 -1
- package/dist/version.js +1 -1
- package/dist-types/headless.d.ts +1 -1
- package/dist-types/index.d.ts +2 -2
- package/dist-types/libs/browser-initial-data.d.ts +2 -2
- package/dist-types/libs/initial-data.d.ts +1 -1
- package/dist-types/types.d.ts +3 -3
- package/dist-types/version.d.ts +1 -1
- package/docs/building-headless-components.md +43 -22
- package/docs/callbacks.md +76 -9
- package/docs/components/consent-banner.md +148 -24
- package/docs/components/consent-dialog.md +42 -3
- package/docs/components/consent-manager-provider.md +3 -1
- package/docs/components/consent-widget.md +91 -9
- package/docs/concepts/client-modes.md +16 -4
- package/docs/concepts/initialization-flow.md +9 -2
- package/docs/concepts/policy-packs.md +2 -2
- package/docs/headless.md +13 -7
- package/docs/hooks/use-consent-manager/overview.md +17 -3
- package/docs/hooks/use-ssr-status.md +1 -1
- package/docs/hooks/use-translations.md +1 -0
- package/docs/iab/consent-banner.md +2 -5
- package/docs/iab/consent-dialog.md +3 -6
- package/docs/iab/overview.md +11 -5
- package/docs/integrations/building-integrations.md +405 -0
- package/docs/integrations/databuddy.md +22 -5
- package/docs/integrations/google-tag-manager.md +2 -2
- package/docs/integrations/google-tag.md +2 -29
- package/docs/integrations/linkedin-insights.md +1 -1
- package/docs/integrations/meta-pixel.md +1 -1
- package/docs/integrations/microsoft-uet.md +1 -1
- package/docs/integrations/overview.md +18 -2
- package/docs/integrations/posthog.md +39 -17
- package/docs/integrations/tiktok-pixel.md +1 -1
- package/docs/integrations/x-pixel.md +1 -1
- package/docs/optimization.md +68 -9
- package/docs/policy-packs.md +7 -7
- package/docs/quickstart.md +11 -5
- package/docs/script-loader.md +22 -1
- package/docs/server-side.md +1 -1
- package/docs/styling/classnames.md +17 -9
- package/docs/styling/overview.md +166 -29
- package/docs/styling/slots.md +37 -7
- package/docs/styling/tailwind.md +25 -27
- package/iab/styles.css +1 -0
- package/package.json +15 -7
- package/readme.json +4 -0
- package/src/iab/styles.css +12 -0
- package/src/iab/styles.tw3.css +14 -0
- package/src/styles.css +10 -0
- package/src/styles.tw3.css +13 -0
- package/styles.css +1 -0
package/docs/styling/overview.md
CHANGED
|
@@ -2,24 +2,34 @@
|
|
|
2
2
|
title: Styling Overview
|
|
3
3
|
description: Five approaches for theming consent components — design tokens, component slots, CSS variables, className, and noStyle mode.
|
|
4
4
|
---
|
|
5
|
-
c15t's theming system gives you multiple levels of control,
|
|
5
|
+
c15t's theming system gives you multiple levels of control, but most customization should stay inside the pre-built components.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Start with the lowest-power tool that solves the problem:
|
|
8
8
|
|
|
9
|
-
1. **
|
|
10
|
-
2.
|
|
11
|
-
3.
|
|
12
|
-
4.
|
|
9
|
+
1. **Pre-built component APIs** — provider options and component props such as `layout`, `direction`, `primaryButton`, `legalLinks`, and `theme.consentActions`
|
|
10
|
+
2. **Design tokens** — global colors, typography, spacing, radius, shadows, and motion
|
|
11
|
+
3. **Slots** — targeted styling for specific parts such as the banner card, footer, or title
|
|
12
|
+
4. **CSS variables or className-level overrides** — when you need to integrate with external CSS systems
|
|
13
|
+
5. **Compound components** — when you must rearrange markup while still using c15t primitives
|
|
14
|
+
6. **`noStyle`** — when you want c15t structure but you need to own all visual styling
|
|
15
|
+
7. **Headless** — when you want fully custom markup and behavior
|
|
16
|
+
|
|
17
|
+
Keep styling and escalation as separate decisions:
|
|
18
|
+
|
|
19
|
+
* If you are still using the stock banner, dialog, or widget, stay with props, tokens, and slots.
|
|
20
|
+
* Escalate to compound components, `noStyle`, or headless only when the structure or behavior itself must change.
|
|
13
21
|
|
|
14
22
|
## Styling Approaches
|
|
15
23
|
|
|
16
24
|
|Approach|Control|Use When|
|
|
17
25
|
|--|--|--|
|
|
26
|
+
|**Component and provider APIs**|High|Reordering actions, changing button emphasis, configuring links, hiding branding, changing copy via `i18n`|
|
|
18
27
|
|**Tokens**|High|Changing global colors, typography, spacing, radius, shadows, or motion|
|
|
19
|
-
|**Slots**|Medium|Targeting specific component parts (
|
|
20
|
-
|**CSS
|
|
21
|
-
|**
|
|
22
|
-
|**noStyle**|Full|
|
|
28
|
+
|**Slots**|Medium|Targeting specific component parts (for example `consentBannerFooter` or `consentDialogCard`)|
|
|
29
|
+
|**CSS variables / className**|Medium|Integrating with an existing stylesheet or utility classes after tokens and slots|
|
|
30
|
+
|**Compound components**|Structure|Rearranging existing c15t primitives without going fully custom|
|
|
31
|
+
|**noStyle**|Full visuals|Keeping c15t structure but replacing all visual defaults|
|
|
32
|
+
|**Headless**|Full|Replacing both markup and behavior|
|
|
23
33
|
|
|
24
34
|
## Quick Start
|
|
25
35
|
|
|
@@ -58,9 +68,25 @@ export function ConsentManager({ children }) {
|
|
|
58
68
|
}
|
|
59
69
|
```
|
|
60
70
|
|
|
61
|
-
## Styling
|
|
71
|
+
## Styling Inside Pre-Built Components
|
|
72
|
+
|
|
73
|
+
Start here before you consider compound components or headless mode.
|
|
74
|
+
|
|
75
|
+
### 1. Provider and component configuration
|
|
76
|
+
|
|
77
|
+
Use the stock APIs first:
|
|
78
|
+
|
|
79
|
+
* `layout`, `direction`, and `primaryButton` for banner action arrangement
|
|
80
|
+
* `legalLinks` for link visibility
|
|
81
|
+
* `hideBranding` and `showTrigger` for dialog and widget behavior
|
|
82
|
+
* `theme.consentActions` for stock banner and dialog button treatment
|
|
83
|
+
* `i18n` on `ConsentManagerProvider` for copy changes
|
|
84
|
+
|
|
85
|
+
```tsx
|
|
86
|
+
<ConsentBanner layout={['customize', ['reject', 'accept']]} primaryButton="accept" />
|
|
87
|
+
```
|
|
62
88
|
|
|
63
|
-
###
|
|
89
|
+
### 2. Design tokens
|
|
64
90
|
|
|
65
91
|
Set global values for colors, typography, spacing, radius, shadows, and motion:
|
|
66
92
|
|
|
@@ -68,55 +94,140 @@ Set global values for colors, typography, spacing, radius, shadows, and motion:
|
|
|
68
94
|
options={{ theme: { colors: { primary: '#6366f1' } } }}
|
|
69
95
|
```
|
|
70
96
|
|
|
71
|
-
|
|
97
|
+
Use tokens first when the change is semantic:
|
|
98
|
+
|
|
99
|
+
* Banner card background -> `theme.colors.surface`
|
|
100
|
+
* Banner footer background -> `theme.colors.surfaceHover`
|
|
101
|
+
* Shared copy color -> `theme.colors.text` and `theme.colors.textMuted`
|
|
102
|
+
|
|
103
|
+
```tsx
|
|
104
|
+
options={{
|
|
105
|
+
theme: {
|
|
106
|
+
colors: {
|
|
107
|
+
surface: '#ffffff',
|
|
108
|
+
surfaceHover: '#f6f3ee',
|
|
109
|
+
},
|
|
110
|
+
},
|
|
111
|
+
}}
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### 3. Component slots
|
|
72
115
|
|
|
73
116
|
Target specific component parts via the `slots` object:
|
|
74
117
|
|
|
75
118
|
```tsx
|
|
76
|
-
options={{
|
|
119
|
+
options={{
|
|
120
|
+
theme: {
|
|
121
|
+
slots: {
|
|
122
|
+
consentBannerCard: 'rounded-[28px] shadow-xl',
|
|
123
|
+
consentBannerFooter: 'border-t border-black/10',
|
|
124
|
+
consentBannerTitle: 'tracking-tight',
|
|
125
|
+
},
|
|
126
|
+
},
|
|
127
|
+
}}
|
|
77
128
|
```
|
|
78
129
|
|
|
79
|
-
|
|
130
|
+
Use slots when the component part is right but the local styling needs adjustment.
|
|
80
131
|
|
|
81
|
-
|
|
132
|
+
### 4. CSS variables and className-level overrides
|
|
82
133
|
|
|
83
|
-
|
|
134
|
+
Override `--c15t-*` custom properties in your stylesheet or attach classes through slots when your app styling is driven externally.
|
|
84
135
|
|
|
85
|
-
|
|
136
|
+
Reach for this after tokens and slots, not before.
|
|
86
137
|
|
|
87
138
|
```tsx
|
|
88
|
-
|
|
139
|
+
options={{
|
|
140
|
+
theme: {
|
|
141
|
+
slots: {
|
|
142
|
+
consentBannerFooter: 'bg-[var(--banner-footer)]',
|
|
143
|
+
},
|
|
144
|
+
},
|
|
145
|
+
}}
|
|
89
146
|
```
|
|
90
147
|
|
|
91
|
-
|
|
148
|
+
## Escalating Beyond Pre-Built Components
|
|
149
|
+
|
|
150
|
+
Only move up this ladder when the lower rung cannot satisfy the request.
|
|
92
151
|
|
|
93
|
-
|
|
152
|
+
### 5. Compound components
|
|
153
|
+
|
|
154
|
+
Use compound components when you need to rearrange existing c15t primitives:
|
|
155
|
+
|
|
156
|
+
```tsx
|
|
157
|
+
<ConsentBanner.Root>
|
|
158
|
+
<ConsentBanner.Card>
|
|
159
|
+
<ConsentBanner.Header>
|
|
160
|
+
<ConsentBanner.Title />
|
|
161
|
+
<ConsentBanner.Description />
|
|
162
|
+
</ConsentBanner.Header>
|
|
163
|
+
<ConsentBanner.Footer>
|
|
164
|
+
<ConsentBanner.CustomizeButton />
|
|
165
|
+
<ConsentBanner.FooterSubGroup>
|
|
166
|
+
<ConsentBanner.RejectButton />
|
|
167
|
+
<ConsentBanner.AcceptButton />
|
|
168
|
+
</ConsentBanner.FooterSubGroup>
|
|
169
|
+
</ConsentBanner.Footer>
|
|
170
|
+
</ConsentBanner.Card>
|
|
171
|
+
</ConsentBanner.Root>
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
### 6. `noStyle`
|
|
175
|
+
|
|
176
|
+
Use `noStyle` only when the c15t structure is still correct but you want to replace all visual defaults:
|
|
94
177
|
|
|
95
178
|
```tsx
|
|
96
179
|
<ConsentBanner noStyle />
|
|
97
180
|
```
|
|
98
181
|
|
|
182
|
+
### 7. Headless
|
|
183
|
+
|
|
184
|
+
Go headless only when you are replacing both markup and behavior. For that path, continue to [Headless Mode](../headless).
|
|
185
|
+
|
|
99
186
|
## Common Styling Tasks
|
|
100
187
|
|
|
101
|
-
### Change
|
|
188
|
+
### Change the banner footer background
|
|
102
189
|
|
|
103
190
|
```tsx
|
|
104
|
-
options={{
|
|
191
|
+
options={{
|
|
192
|
+
theme: {
|
|
193
|
+
colors: {
|
|
194
|
+
surfaceHover: '#f6f3ee',
|
|
195
|
+
},
|
|
196
|
+
},
|
|
197
|
+
}}
|
|
105
198
|
```
|
|
106
199
|
|
|
107
|
-
|
|
200
|
+
Use `theme.colors.surfaceHover` before trying raw CSS.
|
|
201
|
+
|
|
202
|
+
### Change the banner card background
|
|
108
203
|
|
|
109
204
|
```tsx
|
|
110
|
-
options={{
|
|
205
|
+
options={{
|
|
206
|
+
theme: {
|
|
207
|
+
colors: {
|
|
208
|
+
surface: '#fffdf8',
|
|
209
|
+
},
|
|
210
|
+
},
|
|
211
|
+
}}
|
|
111
212
|
```
|
|
112
213
|
|
|
113
|
-
|
|
214
|
+
Use `theme.colors.surface` before overriding banner CSS variables directly.
|
|
215
|
+
|
|
216
|
+
### Tweak the banner card, footer, or title styling without changing markup
|
|
114
217
|
|
|
115
218
|
```tsx
|
|
116
|
-
options={{
|
|
219
|
+
options={{
|
|
220
|
+
theme: {
|
|
221
|
+
slots: {
|
|
222
|
+
consentBannerCard: 'rounded-[28px] shadow-xl',
|
|
223
|
+
consentBannerFooter: 'border-t border-black/10 px-6',
|
|
224
|
+
consentBannerTitle: 'text-xl tracking-tight',
|
|
225
|
+
},
|
|
226
|
+
},
|
|
227
|
+
}}
|
|
117
228
|
```
|
|
118
229
|
|
|
119
|
-
### Change consent action button styles semantically
|
|
230
|
+
### Change stock consent action button styles semantically
|
|
120
231
|
|
|
121
232
|
```tsx
|
|
122
233
|
options={{
|
|
@@ -132,6 +243,29 @@ options={{
|
|
|
132
243
|
|
|
133
244
|
Use `theme.consentActions` when you want to change the stock banner/dialog button treatment without rewriting the component layout. Policy packs still control action arrangement and primary-action hints. The theme controls whether those actions render as `stroke`, `filled`, `ghost`, or `lighter`.
|
|
134
245
|
|
|
246
|
+
### Change banner copy without replacing the component
|
|
247
|
+
|
|
248
|
+
```tsx
|
|
249
|
+
options={{
|
|
250
|
+
i18n: {
|
|
251
|
+
locale: 'en',
|
|
252
|
+
messages: {
|
|
253
|
+
en: {
|
|
254
|
+
cookieBanner: {
|
|
255
|
+
title: 'We value your privacy',
|
|
256
|
+
description: 'We use cookies to improve the site and measure performance.',
|
|
257
|
+
},
|
|
258
|
+
common: {
|
|
259
|
+
acceptAll: 'Accept all',
|
|
260
|
+
rejectAll: 'Reject all',
|
|
261
|
+
customize: 'Manage preferences',
|
|
262
|
+
},
|
|
263
|
+
},
|
|
264
|
+
},
|
|
265
|
+
},
|
|
266
|
+
}}
|
|
267
|
+
```
|
|
268
|
+
|
|
135
269
|
### Enable dark mode safely
|
|
136
270
|
|
|
137
271
|
```tsx
|
|
@@ -144,8 +278,11 @@ options={{
|
|
|
144
278
|
}}
|
|
145
279
|
```
|
|
146
280
|
|
|
281
|
+
> ℹ️ **Info:**
|
|
282
|
+
> If a token change does not show up where you expect, check how that component maps tokens to CSS variables before escalating. For example, the stock banner footer background comes from colors.surfaceHover, not a separate footer token.
|
|
283
|
+
>
|
|
147
284
|
> ⚠️ **Warning:**
|
|
148
|
-
> noStyle: true removes layout and visual defaults.
|
|
285
|
+
> Do not jump to CSS overrides or !important because a token did not appear to work at first glance.noStyle: true removes layout and visual defaults. Treat it as an advanced opt-out, not a normal theming step.Headless mode is for replacing markup and behavior, not for styling-only requests.Use either tokens/slots or raw CSS variable overrides intentionally to avoid conflicting style sources.For dark mode, c15t supports .dark and .c15t-dark.
|
|
149
286
|
|
|
150
287
|
## API Reference
|
|
151
288
|
|
package/docs/styling/slots.md
CHANGED
|
@@ -4,7 +4,19 @@ description: Target individual component parts with styles using the slot system
|
|
|
4
4
|
---
|
|
5
5
|
## What are Slots?
|
|
6
6
|
|
|
7
|
-
Slots let you target specific parts of consent components with styles. Each component is built from named
|
|
7
|
+
Slots let you target specific parts of consent components with styles. Each component is built from named slots such as `consentBannerTitle` and `consentDialogFooter`.
|
|
8
|
+
|
|
9
|
+
Use slots after the stock component APIs and design tokens:
|
|
10
|
+
|
|
11
|
+
* If the change is semantic, prefer tokens first. For example, the stock banner footer background comes from `theme.colors.surfaceHover`.
|
|
12
|
+
* If the component part is correct but you need a local tweak, use a slot.
|
|
13
|
+
|
|
14
|
+
Common banner slot choices:
|
|
15
|
+
|
|
16
|
+
* `consentBannerCard` for card radius, shadow, width, and local background treatment
|
|
17
|
+
* `consentBannerFooter` for spacing, borders, and local footer styling
|
|
18
|
+
* `consentBannerTitle` for title typography
|
|
19
|
+
* `buttonPrimary` and `buttonSecondary` for shared button classes
|
|
8
20
|
|
|
9
21
|
## Using Slots
|
|
10
22
|
|
|
@@ -13,8 +25,8 @@ Pass slot styles in the theme's `slots` object:
|
|
|
13
25
|
```tsx
|
|
14
26
|
const theme = {
|
|
15
27
|
slots: {
|
|
16
|
-
|
|
17
|
-
consentBannerTitle: 'text-xl font-bold
|
|
28
|
+
consentBannerFooter: 'border-t border-black/10 px-6',
|
|
29
|
+
consentBannerTitle: 'text-xl font-bold tracking-tight',
|
|
18
30
|
|
|
19
31
|
// Object value = className + inline styles
|
|
20
32
|
consentBannerCard: {
|
|
@@ -34,13 +46,31 @@ Each slot accepts either a `string` (treated as className) or a `SlotStyle` obje
|
|
|
34
46
|
consentBannerTitle: 'my-custom-class'
|
|
35
47
|
|
|
36
48
|
// Object: className + style + noStyle
|
|
37
|
-
|
|
38
|
-
className: '
|
|
39
|
-
style: {
|
|
40
|
-
noStyle: false, // Set true
|
|
49
|
+
consentBannerFooter: {
|
|
50
|
+
className: 'border-t border-black/10',
|
|
51
|
+
style: { paddingBlock: '1rem' },
|
|
52
|
+
noStyle: false, // Set true only when you want to remove this slot's default styling
|
|
41
53
|
}
|
|
42
54
|
```
|
|
43
55
|
|
|
56
|
+
`noStyle` on a slot is an advanced escape hatch. Start with className and style overrides first.
|
|
57
|
+
|
|
58
|
+
## Example: Style the stock banner without changing markup
|
|
59
|
+
|
|
60
|
+
```tsx
|
|
61
|
+
const theme = {
|
|
62
|
+
colors: {
|
|
63
|
+
surface: '#fffdf8',
|
|
64
|
+
surfaceHover: '#f6f3ee',
|
|
65
|
+
},
|
|
66
|
+
slots: {
|
|
67
|
+
consentBannerCard: 'rounded-[28px] shadow-xl',
|
|
68
|
+
consentBannerFooter: 'border-t border-black/10 px-6',
|
|
69
|
+
consentBannerTitle: 'tracking-tight',
|
|
70
|
+
},
|
|
71
|
+
} satisfies Theme;
|
|
72
|
+
```
|
|
73
|
+
|
|
44
74
|
## Available Slots
|
|
45
75
|
|
|
46
76
|
Use the typed API reference below for the full slot list and descriptions. It stays in sync with the actual component slot surface.
|
package/docs/styling/tailwind.md
CHANGED
|
@@ -6,50 +6,48 @@ c15t works with Tailwind CSS out of the box. Use the `slots` theme option to app
|
|
|
6
6
|
|
|
7
7
|
## Setup
|
|
8
8
|
|
|
9
|
-
Import the standard c15t stylesheet once
|
|
9
|
+
Import the standard c15t stylesheet once in your app-level CSS entrypoint:
|
|
10
10
|
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
import
|
|
11
|
+
```css
|
|
12
|
+
/* React: src/index.css */
|
|
13
|
+
@import "@c15t/react/styles.css";
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
import
|
|
15
|
+
/* Next.js: app/globals.css */
|
|
16
|
+
@import "@c15t/nextjs/styles.css";
|
|
17
17
|
```
|
|
18
18
|
|
|
19
|
+
Keeping the c15t stylesheet in your global CSS entrypoint makes layer and cascade order explicit. JS/TSX side-effect imports can load in a different order across framework and Tailwind tooling, which makes style regressions harder to debug.
|
|
20
|
+
|
|
19
21
|
### Tailwind v4
|
|
20
22
|
|
|
21
|
-
Tailwind v4 automatically scans your source files.
|
|
23
|
+
Tailwind v4 automatically scans your source files. Import Tailwind normally, then place the c15t stylesheet immediately after it. c15t component styles join Tailwind's `components` layer automatically, so no extra c15t-specific layer declaration is needed:
|
|
22
24
|
|
|
23
|
-
```css
|
|
24
|
-
@layer theme, base, components, c15t, utilities;
|
|
25
|
+
```css title="src/index.css"
|
|
25
26
|
@import "tailwindcss";
|
|
27
|
+
@import "@c15t/react/styles.css";
|
|
26
28
|
```
|
|
27
29
|
|
|
28
|
-
### Tailwind v3
|
|
29
|
-
|
|
30
|
-
Keep Tailwind's directives in your app stylesheet, but wrap `@tailwind base` in a native `base` layer so c15t's `@layer c15t` rules can sit above Preflight:
|
|
31
|
-
|
|
32
30
|
```css title="app/globals.css"
|
|
33
|
-
@
|
|
31
|
+
@import "tailwindcss";
|
|
32
|
+
@import "@c15t/nextjs/styles.css";
|
|
33
|
+
```
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
### Tailwind v3
|
|
36
|
+
|
|
37
|
+
Import the Tailwind 3-compatible c15t stylesheet after `@tailwind components;` and before `@tailwind utilities;`:
|
|
38
38
|
|
|
39
|
+
```css title="src/index.css"
|
|
40
|
+
@tailwind base;
|
|
39
41
|
@tailwind components;
|
|
42
|
+
@import "@c15t/react/styles.tw3.css";
|
|
40
43
|
@tailwind utilities;
|
|
41
44
|
```
|
|
42
45
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
'./src/**/*.{js,ts,jsx,tsx}',
|
|
49
|
-
'./node_modules/@c15t/react/**/*.{js,mjs}',
|
|
50
|
-
'./node_modules/@c15t/nextjs/**/*.{js,mjs}',
|
|
51
|
-
],
|
|
52
|
-
};
|
|
46
|
+
```css title="app/globals.css"
|
|
47
|
+
@tailwind base;
|
|
48
|
+
@tailwind components;
|
|
49
|
+
@import "@c15t/nextjs/styles.tw3.css";
|
|
50
|
+
@tailwind utilities;
|
|
53
51
|
```
|
|
54
52
|
|
|
55
53
|
## Using Tailwind with Slots
|
package/iab/styles.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import "../dist/iab/styles.css";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@c15t/nextjs",
|
|
3
|
-
"version": "2.0.0-rc.
|
|
3
|
+
"version": "2.0.0-rc.8",
|
|
4
4
|
"description": "Developer-first CMP for Next.js: cookie banner, consent manager, preferences centre. GDPR ready with minimal setup and rich customization.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"nextjs",
|
|
@@ -33,7 +33,9 @@
|
|
|
33
33
|
"type": "module",
|
|
34
34
|
"exports": {
|
|
35
35
|
"./styles.css": "./dist/styles.css",
|
|
36
|
+
"./styles.tw3.css": "./dist/styles.tw3.css",
|
|
36
37
|
"./iab/styles.css": "./dist/iab/styles.css",
|
|
38
|
+
"./iab/styles.tw3.css": "./dist/iab/styles.tw3.css",
|
|
37
39
|
"./headless": {
|
|
38
40
|
"types": "./dist-types/headless.d.ts",
|
|
39
41
|
"import": "./dist/headless.js",
|
|
@@ -57,14 +59,20 @@
|
|
|
57
59
|
"dist",
|
|
58
60
|
"docs",
|
|
59
61
|
"dist-types",
|
|
60
|
-
"client"
|
|
62
|
+
"client",
|
|
63
|
+
"styles.css",
|
|
64
|
+
"iab",
|
|
65
|
+
"src/styles.css",
|
|
66
|
+
"src/styles.tw3.css",
|
|
67
|
+
"src/iab/styles.css",
|
|
68
|
+
"src/iab/styles.tw3.css"
|
|
61
69
|
],
|
|
62
70
|
"scripts": {
|
|
63
71
|
"prebuild": "genversion --esm --semi src/version.ts",
|
|
64
|
-
"build": "bun prebuild && rslib build && bun ../../scripts/agent-docs/generate-package-docs.ts @c15t/nextjs",
|
|
72
|
+
"build": "bun prebuild && rslib build && bun ../../scripts/normalize-dist-types.mjs && bun scripts/generate-distribution-css.ts && bun ../../scripts/agent-docs/generate-package-docs.ts @c15t/nextjs",
|
|
65
73
|
"build:agent-docs": "bun ../../scripts/agent-docs/generate-package-docs.ts @c15t/nextjs",
|
|
66
74
|
"check-types": "bun prebuild && tsc --noEmit",
|
|
67
|
-
"dev": "bun prebuild && rslib build",
|
|
75
|
+
"dev": "bun prebuild && rslib build && bun ../../scripts/normalize-dist-types.mjs && bun scripts/generate-distribution-css.ts",
|
|
68
76
|
"fmt": "bun biome format --write . && bun biome check --formatter-enabled=false --linter-enabled=false --write",
|
|
69
77
|
"lint": "bun biome lint ./src",
|
|
70
78
|
"prepack": "cd ../.. && bunx turbo run build --filter=@c15t/nextjs",
|
|
@@ -72,9 +80,9 @@
|
|
|
72
80
|
"test:watch": "bun prebuild && vitest --passWithNoTests"
|
|
73
81
|
},
|
|
74
82
|
"dependencies": {
|
|
75
|
-
"@c15t/react": "2.0.0-rc.
|
|
76
|
-
"@c15t/translations": "2.0.0-rc.
|
|
77
|
-
"c15t": "2.0.0-rc.
|
|
83
|
+
"@c15t/react": "2.0.0-rc.8",
|
|
84
|
+
"@c15t/translations": "2.0.0-rc.8",
|
|
85
|
+
"c15t": "2.0.0-rc.8"
|
|
78
86
|
},
|
|
79
87
|
"devDependencies": {
|
|
80
88
|
"@c15t/typescript-config": "0.0.1-beta.1",
|
package/readme.json
CHANGED
|
@@ -21,6 +21,10 @@
|
|
|
21
21
|
"",
|
|
22
22
|
"```bash\npnpm add @c15t/nextjs\n```",
|
|
23
23
|
"",
|
|
24
|
+
"Then add the prebuilt stylesheet to your app-level CSS entrypoint:",
|
|
25
|
+
"",
|
|
26
|
+
"```css\n/* app/globals.css */\n@import \"@c15t/nextjs/styles.css\";\n```",
|
|
27
|
+
"",
|
|
24
28
|
"To manually install, follow the guide in our [docs – manual setup](https://c15t.com/docs/frameworks/nextjs/quickstart#manual-setup)."
|
|
25
29
|
],
|
|
26
30
|
"usage": [
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @c15t/nextjs — IAB TCF component styles.
|
|
3
|
+
*
|
|
4
|
+
* Add this stylesheet to the same global CSS entrypoint as your base c15t styles
|
|
5
|
+
* when using IAB consent components in Next.js. Do not import either stylesheet
|
|
6
|
+
* from JS/TSX.
|
|
7
|
+
*
|
|
8
|
+
* Usage (app/globals.css):
|
|
9
|
+
* @import "@c15t/nextjs/styles.css";
|
|
10
|
+
* @import "@c15t/nextjs/iab/styles.css";
|
|
11
|
+
*/
|
|
12
|
+
@import "@c15t/react/iab/styles.css";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @c15t/nextjs/iab — Tailwind 3-compatible IAB component styles.
|
|
3
|
+
*
|
|
4
|
+
* Add this stylesheet to the same global CSS entrypoint as your base c15t styles.
|
|
5
|
+
* Do not import either stylesheet from JS/TSX files.
|
|
6
|
+
*
|
|
7
|
+
* Usage (app/globals.css):
|
|
8
|
+
* @tailwind base;
|
|
9
|
+
* @tailwind components;
|
|
10
|
+
* @import "@c15t/nextjs/styles.tw3.css";
|
|
11
|
+
* @import "@c15t/nextjs/iab/styles.tw3.css";
|
|
12
|
+
* @tailwind utilities;
|
|
13
|
+
*/
|
|
14
|
+
@import "@c15t/react/iab/styles.tw3.css";
|
package/src/styles.css
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @c15t/nextjs — Non-IAB prebuilt component styles.
|
|
3
|
+
*
|
|
4
|
+
* Import this stylesheet once from your app-level CSS entrypoint when using
|
|
5
|
+
* prebuilt (styled) consent components.
|
|
6
|
+
*
|
|
7
|
+
* Usage (app/globals.css):
|
|
8
|
+
* @import "@c15t/nextjs/styles.css";
|
|
9
|
+
*/
|
|
10
|
+
@import "@c15t/react/styles.css";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @c15t/nextjs — Tailwind 3-compatible prebuilt component styles.
|
|
3
|
+
*
|
|
4
|
+
* Import this stylesheet in the same global CSS entrypoint as Tailwind 3,
|
|
5
|
+
* after `@tailwind components;` and before `@tailwind utilities;`.
|
|
6
|
+
*
|
|
7
|
+
* Usage (app/globals.css):
|
|
8
|
+
* @tailwind base;
|
|
9
|
+
* @tailwind components;
|
|
10
|
+
* @import "@c15t/nextjs/styles.tw3.css";
|
|
11
|
+
* @tailwind utilities;
|
|
12
|
+
*/
|
|
13
|
+
@import "@c15t/react/styles.tw3.css";
|
package/styles.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import "./dist/styles.css";
|