react-lgpd-consent 0.3.3 → 0.3.5

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/QUICKSTART.md ADDED
@@ -0,0 +1,617 @@
1
+ # 🚀 Guia de Início Rápido
2
+
3
+ Este guia fornece tudo o que você precisa para integrar rapidamente a biblioteca `react-lgpd-consent` em seu projeto React.
4
+
5
+ ## 📦 Instalação
6
+
7
+ ```bash
8
+ npm install react-lgpd-consent
9
+ # ou
10
+ yarn add react-lgpd-consent
11
+ ```
12
+
13
+ ### Dependências Peer
14
+
15
+ ```bash
16
+ npm install @mui/material @mui/icons-material @emotion/react @emotion/styled
17
+ ```
18
+
19
+ ## 🎯 Uso Básico (30 segundos)
20
+
21
+ ````tsx
22
+ import React from 'react'
23
+ import { ConsentProvider } from 'react-lgpd-consent'
24
+
25
+ function App() {
26
+ return (
27
+ <ConsentProvider
28
+ categories={{
29
+ enabledCategories: ['analytics', 'marketing'],
30
+ }}
31
+ >
32
+ <main>
33
+ <h1>Minha Aplicação</h1>
34
+ {/* Seu conteúdo aqui */}
35
+ </main>
36
+ </ConsentProvider>
37
+ )
38
+
39
+ ## 🧭 Storybook — quick note
40
+
41
+ This repository ships an interactive Storybook playground used for manual testing and visual exploration of components. Quick commands:
42
+
43
+ - Run locally (development):
44
+
45
+ ```bash
46
+ npm run storybook
47
+ ````
48
+
49
+ - Build static Storybook (for publishing to GitHub Pages):
50
+
51
+ ```bash
52
+ npm run build-storybook
53
+ ```
54
+
55
+ Notes:
56
+
57
+ - The Storybook preview (`.storybook/preview.tsx`) applies a clean environment between stories (removes consent cookie and performs defensive DOM cleanup). Check that file when creating stories that rely on a clean initial state.
58
+
59
+ }
60
+
61
+ export default App
62
+
63
+ ````
64
+
65
+ ## 📋 Tabela Completa de Props do ConsentProvider
66
+
67
+ | Prop | Tipo | Obrigatória | Padrão | Descrição |
68
+ | ------------------------------------ | ----------------------------------------------------------- | ----------- | ------------------- | ---------------------------------------------- |
69
+ | `categories` | `ProjectCategoriesConfig` | ✅ **Sim** | - | Define as categorias de cookies do projeto |
70
+ | `texts` | `Partial<ConsentTexts>` | ❌ Não | Textos padrão PT-BR | Customiza textos da interface |
71
+ | `theme` | `any` | ❌ Não | Tema padrão | Tema Material-UI para os componentes |
72
+ | `designTokens` | `DesignTokens` | ❌ Não | Tokens padrão | Tokens de design para customização avançada |
73
+ | `blocking` | `boolean` | ❌ Não | `false` | Exibe overlay bloqueando interação até decisão |
74
+ | `blockingStrategy` | `'auto' \| 'provider'` | ❌ Não | `'auto'` | Estratégia de renderização do overlay |
75
+ | `hideBranding` | `boolean` | ❌ Não | `false` | Oculta branding "fornecido por" |
76
+ | `onConsentGiven` | `(state: ConsentState) => void` | ❌ Não | - | Callback na primeira vez que usuário consente |
77
+ | `onPreferencesSaved` | `(prefs: ConsentPreferences) => void` | ❌ Não | - | Callback quando preferências são salvas |
78
+ | `disableDeveloperGuidance` | `boolean` | ❌ Não | `false` | Desativa orientações no console |
79
+ | `disableFloatingPreferencesButton` | `boolean` | ❌ Não | `false` | Desabilita botão flutuante de preferências |
80
+ | `CookieBannerComponent` | `React.ComponentType<CustomCookieBannerProps>` | ❌ Não | Banner padrão | Componente de banner customizado |
81
+ | `PreferencesModalComponent` | `React.ComponentType<CustomPreferencesModalProps>` | ❌ Não | Modal padrão | Componente de modal customizado |
82
+ | `FloatingPreferencesButtonComponent` | `React.ComponentType<CustomFloatingPreferencesButtonProps>` | ❌ Não | Botão padrão | Componente de botão flutuante customizado |
83
+ | `cookieBannerProps` | `object` | ❌ Não | `{}` | Props adicionais para o banner |
84
+ | `preferencesModalProps` | `object` | ❌ Não | `{}` | Props adicionais para o modal |
85
+ | `floatingPreferencesButtonProps` | `object` | ❌ Não | `{}` | Props adicionais para o botão flutuante |
86
+ | `initialState` | `ConsentState` | ❌ Não | - | Estado inicial para hidratação SSR |
87
+ | `cookie` | `Partial<ConsentCookieOptions>` | ❌ Não | Opções padrão | Configurações do cookie de consentimento |
88
+
89
+ ## 🎨 Componentes Customizados com TypeScript
90
+
91
+ ### Banner Personalizado
92
+
93
+ ```tsx
94
+ import React from 'react'
95
+ import { ConsentProvider, type CustomCookieBannerProps } from 'react-lgpd-consent'
96
+
97
+ // Componente de banner customizado
98
+ const MeuBannerCustomizado: React.FC<CustomCookieBannerProps> = ({
99
+ consented,
100
+ acceptAll,
101
+ rejectAll,
102
+ openPreferences,
103
+ texts,
104
+ blocking,
105
+ }) => {
106
+ return (
107
+ <div
108
+ style={{
109
+ position: 'fixed',
110
+ bottom: 0,
111
+ left: 0,
112
+ right: 0,
113
+ backgroundColor: blocking ? 'red' : 'blue',
114
+ color: 'white',
115
+ padding: '1rem',
116
+ zIndex: 1000,
117
+ }}
118
+ >
119
+ <p>{texts.bannerMessage}</p>
120
+ <div style={{ display: 'flex', gap: '1rem', marginTop: '1rem' }}>
121
+ <button onClick={acceptAll}>{texts.acceptAll}</button>
122
+ <button onClick={rejectAll}>{texts.declineAll}</button>
123
+ <button onClick={openPreferences}>{texts.preferences}</button>
124
+ </div>
125
+ </div>
126
+ )
127
+ }
128
+
129
+ // Usando o banner customizado
130
+ function App() {
131
+ return (
132
+ <ConsentProvider
133
+ categories={{ enabledCategories: ['analytics'] }}
134
+ CookieBannerComponent={MeuBannerCustomizado}
135
+ blocking={true}
136
+ >
137
+ <main>Minha App</main>
138
+ </ConsentProvider>
139
+ )
140
+ }
141
+ ````
142
+
143
+ ### Modal de Preferências Personalizado
144
+
145
+ ---
146
+
147
+ ## Nota sobre ThemeProvider
148
+
149
+ A biblioteca `react-lgpd-consent` não injeta um `ThemeProvider` global por conta própria. Ela foi projetada para herdar o tema do app quando um `ThemeProvider` do MUI está presente. Se você precisa garantir um tema de fallback apenas para os componentes da biblioteca, use a fábrica exportada `createDefaultConsentTheme()` e passe pelo prop `theme` do `ConsentProvider`:
150
+
151
+ ```tsx
152
+ import { ConsentProvider, createDefaultConsentTheme } from 'react-lgpd-consent'
153
+
154
+ ;<ConsentProvider
155
+ theme={createDefaultConsentTheme()}
156
+ categories={{ enabledCategories: ['analytics'] }}
157
+ >
158
+ <App />
159
+ </ConsentProvider>
160
+ ```
161
+
162
+ Isso evita alterações indesejadas no contexto do MUI do seu app e problemas de SSR.
163
+
164
+ ```tsx
165
+ import React from 'react'
166
+ import { ConsentProvider, type CustomPreferencesModalProps } from 'react-lgpd-consent'
167
+
168
+ const MeuModalCustomizado: React.FC<CustomPreferencesModalProps> = ({
169
+ preferences,
170
+ setPreferences,
171
+ closePreferences,
172
+ isModalOpen,
173
+ texts,
174
+ }) => {
175
+ if (!isModalOpen) return null
176
+
177
+ return (
178
+ <div
179
+ style={{
180
+ position: 'fixed',
181
+ top: '50%',
182
+ left: '50%',
183
+ transform: 'translate(-50%, -50%)',
184
+ backgroundColor: 'white',
185
+ border: '2px solid #ccc',
186
+ borderRadius: '8px',
187
+ padding: '2rem',
188
+ zIndex: 2000,
189
+ minWidth: '400px',
190
+ }}
191
+ >
192
+ <h2>{texts.modalTitle}</h2>
193
+ <p>{texts.modalIntro}</p>
194
+
195
+ {/* Lista de categorias */}
196
+ <div style={{ margin: '1rem 0' }}>
197
+ {Object.entries(preferences).map(([category, enabled]) => (
198
+ <label key={category} style={{ display: 'block', marginBottom: '0.5rem' }}>
199
+ <input
200
+ type="checkbox"
201
+ checked={enabled}
202
+ onChange={(e) =>
203
+ setPreferences({
204
+ ...preferences,
205
+ [category]: e.target.checked,
206
+ })
207
+ }
208
+ disabled={category === 'necessary'}
209
+ />{' '}
210
+ {category === 'necessary' ? texts.necessaryAlwaysOn : `Cookies ${category}`}
211
+ </label>
212
+ ))}
213
+ </div>
214
+
215
+ <div style={{ display: 'flex', gap: '1rem', justifyContent: 'flex-end' }}>
216
+ <button onClick={closePreferences}>Cancelar</button>
217
+ <button onClick={closePreferences}>{texts.save}</button>
218
+ </div>
219
+ </div>
220
+ )
221
+ }
222
+
223
+ function App() {
224
+ return (
225
+ <ConsentProvider
226
+ categories={{ enabledCategories: ['analytics', 'marketing'] }}
227
+ PreferencesModalComponent={MeuModalCustomizado}
228
+ >
229
+ <main>Minha App</main>
230
+ </ConsentProvider>
231
+ )
232
+ }
233
+ ```
234
+
235
+ ## 🎮 Controle Programático
236
+
237
+ ### Hook useOpenPreferencesModal (React)
238
+
239
+ ```tsx
240
+ import React from 'react'
241
+ import { useOpenPreferencesModal, useConsent } from 'react-lgpd-consent'
242
+
243
+ function MeuComponente() {
244
+ const openPreferences = useOpenPreferencesModal()
245
+ const { preferences, acceptAll, rejectAll } = useConsent()
246
+
247
+ return (
248
+ <div>
249
+ <h3>Status atual: {preferences.analytics ? 'Analytics ativo' : 'Analytics inativo'}</h3>
250
+
251
+ <button onClick={openPreferences}>⚙️ Gerenciar Preferências</button>
252
+
253
+ <button onClick={acceptAll}>✅ Aceitar Todos</button>
254
+
255
+ <button onClick={rejectAll}>❌ Recusar Todos</button>
256
+ </div>
257
+ )
258
+ }
259
+ ```
260
+
261
+ ### window.openPreferencesModal (JavaScript Puro)
262
+
263
+ ```html
264
+ <!-- Em templates HTML, emails ou widgets externos -->
265
+ <button onclick="window.openPreferencesModal?.()">Configurar Cookies</button>
266
+
267
+ <script>
268
+ // Ou em JavaScript puro
269
+ function abrirConfiguracoesCookies() {
270
+ if (window.openPreferencesModal) {
271
+ window.openPreferencesModal()
272
+ } else {
273
+ console.warn('Sistema de consentimento não carregado')
274
+ }
275
+ }
276
+
277
+ // Verificar se função está disponível
278
+ if (typeof window.openPreferencesModal === 'function') {
279
+ console.log('✅ Sistema de consentimento disponível')
280
+ }
281
+ </script>
282
+ ```
283
+
284
+ ## 🐛 Sistema de Debug
285
+
286
+ ### Configuração de Debug
287
+
288
+ ```tsx
289
+ import { setDebugLogging, LogLevel } from 'react-lgpd-consent'
290
+
291
+ // Ativar todos os logs (desenvolvimento)
292
+ setDebugLogging(true, LogLevel.DEBUG)
293
+
294
+ // Apenas logs importantes (staging)
295
+ setDebugLogging(true, LogLevel.INFO)
296
+
297
+ // Apenas erros (produção)
298
+ setDebugLogging(true, LogLevel.ERROR)
299
+
300
+ // Desativar completamente
301
+ setDebugLogging(false)
302
+ ```
303
+
304
+ ### Exemplo de Logs no Console
305
+
306
+ ```jsx
307
+ // Em desenvolvimento, você verá logs como:
308
+ // [🍪 LGPD-CONSENT] 🔧 Categorias Ativas (para UI customizada)
309
+ // [🍪 LGPD-CONSENT] ℹ️ User accepted all cookies
310
+ // [🍪 LGPD-CONSENT] 🐛 Category preference changed: analytics = true
311
+ ```
312
+
313
+ ### Hook para Debug Runtime
314
+
315
+ ```tsx
316
+ import { useConsent } from 'react-lgpd-consent'
317
+
318
+ function DebugPanel() {
319
+ const { preferences, consented } = useConsent()
320
+
321
+ // Apenas mostrar em desenvolvimento
322
+ if (process.env.NODE_ENV !== 'development') return null
323
+
324
+ return (
325
+ <div
326
+ style={{
327
+ position: 'fixed',
328
+ top: 0,
329
+ right: 0,
330
+ background: 'rgba(0,0,0,0.8)',
331
+ color: 'white',
332
+ padding: '1rem',
333
+ fontSize: '12px',
334
+ fontFamily: 'monospace',
335
+ }}
336
+ >
337
+ <h4>🍪 Debug LGPD</h4>
338
+ <p>Consentimento: {consented ? '✅' : '❌'}</p>
339
+ <pre>{JSON.stringify(preferences, null, 2)}</pre>
340
+ </div>
341
+ )
342
+ }
343
+ ```
344
+
345
+ ## 🎨 Integração com Material-UI ThemeProvider
346
+
347
+ ### Configuração Completa
348
+
349
+ ```tsx
350
+ import React from 'react'
351
+ import { ThemeProvider, createTheme } from '@mui/material/styles'
352
+ import CssBaseline from '@mui/material/CssBaseline'
353
+ import { ConsentProvider } from 'react-lgpd-consent'
354
+
355
+ // Seu tema personalizado
356
+ const meuTema = createTheme({
357
+ palette: {
358
+ primary: {
359
+ main: '#1976d2',
360
+ },
361
+ secondary: {
362
+ main: '#dc004e',
363
+ },
364
+ },
365
+ typography: {
366
+ fontFamily: '"Roboto", "Helvetica", "Arial", sans-serif',
367
+ },
368
+ })
369
+
370
+ // Tema específico para componentes de consentimento (opcional)
371
+ const temaConsentimento = createTheme({
372
+ ...meuTema,
373
+ components: {
374
+ MuiPaper: {
375
+ styleOverrides: {
376
+ root: {
377
+ borderRadius: 12,
378
+ },
379
+ },
380
+ },
381
+ MuiButton: {
382
+ styleOverrides: {
383
+ root: {
384
+ textTransform: 'none',
385
+ fontWeight: 600,
386
+ },
387
+ },
388
+ },
389
+ },
390
+ })
391
+
392
+ function App() {
393
+ return (
394
+ <ThemeProvider theme={meuTema}>
395
+ <CssBaseline />
396
+ <ConsentProvider
397
+ categories={{
398
+ enabledCategories: ['analytics', 'marketing', 'advertising'],
399
+ }}
400
+ theme={temaConsentimento} // Tema específico para consentimento
401
+ texts={{
402
+ bannerMessage: 'Utilizamos cookies para personalizar sua experiência.',
403
+ acceptAll: 'Aceitar Todos',
404
+ declineAll: 'Apenas Necessários',
405
+ preferences: 'Personalizar',
406
+ }}
407
+ onConsentGiven={(state) => {
408
+ console.log('✅ Consentimento dado:', state.preferences)
409
+ }}
410
+ >
411
+ <main>
412
+ <h1>Minha Aplicação com Material-UI</h1>
413
+ {/* Seus componentes aqui */}
414
+ </main>
415
+ </ConsentProvider>
416
+ </ThemeProvider>
417
+ )
418
+ }
419
+
420
+ export default App
421
+ ```
422
+
423
+ ## 🔧 Configurações Avançadas
424
+
425
+ ### Personalização de Design Tokens
426
+
427
+ ```tsx
428
+ import { ConsentProvider, type DesignTokens } from 'react-lgpd-consent'
429
+
430
+ const meusTokens: DesignTokens = {
431
+ colors: {
432
+ primary: '#6366f1',
433
+ secondary: '#f59e0b',
434
+ background: '#ffffff',
435
+ text: '#1f2937',
436
+ border: '#e5e7eb',
437
+ },
438
+ layout: {
439
+ borderRadius: '12px',
440
+ spacing: '1rem',
441
+ backdrop: 'rgba(0, 0, 0, 0.6)', // ou false para transparente
442
+ },
443
+ typography: {
444
+ fontFamily: '"Inter", system-ui, sans-serif',
445
+ fontSize: '14px',
446
+ fontWeight: '500',
447
+ },
448
+ }
449
+
450
+ function App() {
451
+ return (
452
+ <ConsentProvider
453
+ categories={{ enabledCategories: ['analytics'] }}
454
+ designTokens={meusTokens}
455
+ blocking={true}
456
+ blockingStrategy="provider"
457
+ >
458
+ <main>Minha App</main>
459
+ </ConsentProvider>
460
+ )
461
+ }
462
+ ```
463
+
464
+ ### Configuração de Cookie Personalizada
465
+
466
+ ```tsx
467
+ import { ConsentProvider } from 'react-lgpd-consent'
468
+
469
+ function App() {
470
+ return (
471
+ <ConsentProvider
472
+ categories={{ enabledCategories: ['analytics'] }}
473
+ cookie={{
474
+ name: 'meu_app_consent', // Nome customizado
475
+ maxAge: 365 * 24 * 60 * 60, // 1 ano em segundos
476
+ domain: '.meudominio.com.br', // Cookie compartilhado entre subdomínios
477
+ secure: true, // Apenas HTTPS
478
+ sameSite: 'Lax', // Política SameSite
479
+ }}
480
+ >
481
+ <main>Minha App</main>
482
+ </ConsentProvider>
483
+ )
484
+ }
485
+ ```
486
+
487
+ ## 🚀 Casos de Uso Comuns
488
+
489
+ ### 1. E-commerce com Analytics + Marketing
490
+
491
+ ```tsx
492
+ <ConsentProvider
493
+ categories={{
494
+ enabledCategories: ['analytics', 'marketing', 'advertising'],
495
+ }}
496
+ texts={{
497
+ bannerMessage:
498
+ 'Usamos cookies para melhorar sua experiência de compra e exibir ofertas personalizadas.',
499
+ acceptAll: 'Aceitar e continuar',
500
+ declineAll: 'Apenas essenciais',
501
+ }}
502
+ onConsentGiven={(state) => {
503
+ // Inicializar ferramentas baseado no consentimento
504
+ if (state.preferences.analytics) {
505
+ // gtag('config', 'GA_MEASUREMENT_ID')
506
+ }
507
+ if (state.preferences.marketing) {
508
+ // fbq('init', 'FACEBOOK_PIXEL_ID')
509
+ }
510
+ }}
511
+ >
512
+ {/* Sua loja */}
513
+ </ConsentProvider>
514
+ ```
515
+
516
+ ### 2. Blog/Site Institucional Simples
517
+
518
+ ```tsx
519
+ <ConsentProvider
520
+ categories={{
521
+ enabledCategories: ['analytics'],
522
+ }}
523
+ disableFloatingPreferencesButton={false}
524
+ hideBranding={true}
525
+ >
526
+ {/* Seu conteúdo */}
527
+ </ConsentProvider>
528
+ ```
529
+
530
+ ### 3. Aplicação Corporativa com Controle Rigoroso
531
+
532
+ ```tsx
533
+ <ConsentProvider
534
+ categories={{
535
+ enabledCategories: ['analytics', 'functional'],
536
+ }}
537
+ blocking={true}
538
+ blockingStrategy="provider"
539
+ disableDeveloperGuidance={false}
540
+ onPreferencesSaved={(prefs) => {
541
+ // Log de auditoria
542
+ console.log('Audit: User preferences updated', prefs)
543
+ }}
544
+ >
545
+ {/* Sua app corporativa */}
546
+ </ConsentProvider>
547
+ ```
548
+
549
+ ## 🆘 Solução de Problemas Comuns
550
+
551
+ ### "ConsentProvider must be used within ConsentProvider"
552
+
553
+ ```tsx
554
+ // ❌ Errado - hook usado fora do provider
555
+ function MeuComponente() {
556
+ const { preferences } = useConsent() // Erro!
557
+ return <div>...</div>
558
+ }
559
+
560
+ function App() {
561
+ return (
562
+ <div>
563
+ <MeuComponente /> {/* useConsent usado aqui falhará */}
564
+ <ConsentProvider categories={{ enabledCategories: ['analytics'] }}>
565
+ <main>App</main>
566
+ </ConsentProvider>
567
+ </div>
568
+ )
569
+ }
570
+
571
+ // ✅ Correto - hook usado dentro do provider
572
+ function App() {
573
+ return (
574
+ <ConsentProvider categories={{ enabledCategories: ['analytics'] }}>
575
+ <div>
576
+ <MeuComponente /> {/* Agora funciona */}
577
+ <main>App</main>
578
+ </div>
579
+ </ConsentProvider>
580
+ )
581
+ }
582
+ ```
583
+
584
+ ### Banner não aparece
585
+
586
+ 1. Verificar se não há consentimento salvo no cookie:
587
+
588
+ ```js
589
+ // Limpar cookie para teste
590
+ document.cookie = 'cookieConsent=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/'
591
+ ```
592
+
593
+ 2. Verificar se `hideBranding` e outras configs estão corretas
594
+ 3. Conferir se o `z-index` não está sendo sobrescrito por outros elementos
595
+
596
+ ### TypeScript - tipos não encontrados
597
+
598
+ ```ts
599
+ // Se você tiver problemas com tipos, adicione ao tsconfig.json:
600
+ {
601
+ "compilerOptions": {
602
+ "moduleResolution": "bundler", // ou "node"
603
+ "skipLibCheck": true
604
+ }
605
+ }
606
+ ```
607
+
608
+ ## 📚 Próximos Passos
609
+
610
+ - 📖 [Documentação Completa da API](./API.md)
611
+ - 🏗️ [Guia de Conformidade LGPD](./CONFORMIDADE.md)
612
+ - 🔌 [Integrações Nativas](./INTEGRACOES.md)
613
+ - 🧪 [Executar o Exemplo](./example/)
614
+
615
+ ---
616
+
617
+ 💡 **Dica**: Use `setDebugLogging(true, LogLevel.DEBUG)` durante o desenvolvimento para ver logs detalhados do comportamento da biblioteca.
package/README.en.md ADDED
@@ -0,0 +1,86 @@
1
+ <div align="center">
2
+ <h1>react-lgpd-consent 🍪</h1>
3
+ <p><strong>A React library for cookie consent management compliant with Brazil's LGPD.</strong></p>
4
+
5
+ <div>
6
+ <a href="https://www.npmjs.com/package/react-lgpd-consent"><img src="https://img.shields.io/npm/v/react-lgpd-consent?style=for-the-badge&logo=npm&color=cb3837&logoColor=white" alt="NPM Version"></a>
7
+ <a href="https://www.npmjs.com/package/react-lgpd-consent"><img src="https://img.shields.io/npm/dm/react-lgpd-consent?style=for-the-badge&logo=npm&color=ff6b35&logoColor=white" alt="Downloads"></a>
8
+ <a href="https://github.com/lucianoedipo/react-lgpd-consent/blob/main/LICENSE"><img src="https://img.shields.io/npm/l/react-lgpd-consent?style=for-the-badge&color=green&logoColor=white" alt="License"></a>
9
+ <a href="https://lucianoedipo.github.io/react-lgpd-consent/storybook/"><img src="https://img.shields.io/badge/Storybook-Playground-ff4785?style=for-the-badge&logo=storybook&logoColor=white" alt="Storybook"></a>
10
+ </div>
11
+
12
+ <div>
13
+ <a href="https://www.typescriptlang.org/"><img src="https://img.shields.io/badge/TypeScript-Ready-3178c6?style=for-the-badge&logo=typescript&logoColor=white" alt="TypeScript Ready"></a>
14
+ <a href="https://reactjs.org/"><img src="https://img.shields.io/badge/React-18+-61dafb?style=for-the-badge&logo=react&logoColor=white" alt="React 18+"></a>
15
+ <a href="https://nextjs.org/"><img src="https://img.shields.io/badge/Next.js-Compatible-000000?style=for-the-badge&logo=next.js&logoColor=white" alt="Next.js Compatible"></a>
16
+ </div>
17
+
18
+ <br />
19
+
20
+ <p>
21
+ <a href="#installation"><strong>Installation</strong></a> •
22
+ <a href="#basic-usage"><strong>Basic Usage</strong></a> •
23
+ <a href="./QUICKSTART.md"><strong>📚 Quickstart</strong></a> •
24
+ <a href="#documentation"><strong>Documentation</strong></a> •
25
+ <a href="#contributing"><strong>Contributing</strong></a>
26
+ </p>
27
+
28
+ <p align="center">
29
+ <a href="./QUICKSTART.en.md"><img src="https://img.shields.io/badge/Quickstart-Get%20Started-blue?style=for-the-badge&logo=book" alt="Quickstart"></a>
30
+ </p>
31
+
32
+ <p align="center"><strong>Start here:</strong> follow the <a href="./QUICKSTART.en.md">Quickstart guide (QUICKSTART.en.md)</a> for step-by-step setup, TypeScript examples, props summary and MUI integration — recommended for new users.</p>
33
+ </div>
34
+
35
+ ---
36
+
37
+ ## 🚀 Installation
38
+
39
+ ```bash
40
+ npm install react-lgpd-consent @mui/material @emotion/react @emotion/styled js-cookie
41
+ ```
42
+
43
+ **Peer dependencies:** `react`, `react-dom`, `@mui/material` and `js-cookie`.
44
+
45
+ ---
46
+
47
+ ## 📖 Basic Usage
48
+
49
+ Wrap your app with `ConsentProvider` (minimal example):
50
+
51
+ ```tsx
52
+ import { ConsentProvider } from 'react-lgpd-consent'
53
+
54
+ export default function App() {
55
+ return (
56
+ <ConsentProvider categories={{ enabledCategories: ['analytics'] }}>
57
+ <YourApp />
58
+ </ConsentProvider>
59
+ )
60
+ }
61
+ ```
62
+
63
+ - For full guides, TypeScript examples, props table and integrations see:
64
+ -
65
+ - **[QUICKSTART.en.md](./QUICKSTART.en.md)** (recommended)
66
+ - **[Docs / API](./API.md)**
67
+ - **[LGPD Compliance](./CONFORMIDADE.md)**
68
+ - **[Integrations](./INTEGRACOES.md)**
69
+
70
+ ### 🎨 Interactive Documentation (GitHub Pages)
71
+ - **[📖 Storybook - Interactive Playground](https://lucianoedipo.github.io/react-lgpd-consent/storybook/)**: Explore and test all components live with interactive controls.
72
+ - **[⚙️ TypeDoc - API Reference](https://lucianoedipo.github.io/react-lgpd-consent/docs/)**: Automatically generated complete API documentation.
73
+ - **[🏠 Documentation Portal](https://lucianoedipo.github.io/react-lgpd-consent/)**: Home page that navigates between all docs sites.
74
+
75
+ ---
76
+
77
+ ## 🤝 Contributing
78
+
79
+ 1. Open an Issue for bugs or feature requests.
80
+ 2. Follow `DEVELOPMENT.md` to submit a PR.
81
+
82
+ ---
83
+
84
+ ## 📄 License
85
+
86
+ MIT — see the `LICENSE` file.