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/CHANGELOG.md +66 -3
- package/LICENSE +21 -21
- package/QUICKSTART.en.md +245 -0
- package/QUICKSTART.md +617 -0
- package/README.en.md +86 -0
- package/README.md +46 -81
- package/dist/{PreferencesModal-HTTMUZND.js → PreferencesModal-KAZMVPBD.js} +1 -1
- package/dist/{chunk-GPLNN3FD.js → chunk-MHCQFGRJ.js} +131 -218
- package/dist/index.cjs +226 -253
- package/dist/index.d.cts +36 -6
- package/dist/index.d.ts +36 -6
- package/dist/index.js +73 -2
- package/package.json +33 -17
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { DialogProps } from '@mui/material/Dialog';
|
|
3
3
|
import * as React$1 from 'react';
|
|
4
|
-
import
|
|
4
|
+
import { Theme } from '@mui/material/styles';
|
|
5
5
|
import { PaperProps } from '@mui/material/Paper';
|
|
6
6
|
import { SnackbarProps } from '@mui/material/Snackbar';
|
|
7
7
|
import { FabProps } from '@mui/material/Fab';
|
|
@@ -567,7 +567,7 @@ interface DesignTokens {
|
|
|
567
567
|
mobile?: string;
|
|
568
568
|
desktop?: string;
|
|
569
569
|
};
|
|
570
|
-
backdrop?: boolean;
|
|
570
|
+
backdrop?: boolean | string;
|
|
571
571
|
};
|
|
572
572
|
}
|
|
573
573
|
/**
|
|
@@ -713,6 +713,22 @@ interface ConsentProviderProps {
|
|
|
713
713
|
* - `true`: Banner bloqueia interação até decisão (compliance rigorosa)
|
|
714
714
|
*/
|
|
715
715
|
blocking?: boolean;
|
|
716
|
+
/**
|
|
717
|
+
* Estratégia de bloqueio quando `blocking` estiver habilitado.
|
|
718
|
+
* - 'auto' (padrão):
|
|
719
|
+
* - Se usar o banner padrão da lib, o bloqueio visual/funcional fica a cargo do próprio banner.
|
|
720
|
+
* - Se usar `CookieBannerComponent` custom, o Provider NÃO cria overlay; o bloqueio fica a cargo do componente custom (compatibilidade atual).
|
|
721
|
+
* - 'provider': o Provider cria um overlay de bloqueio por cima da aplicação (e abaixo do banner),
|
|
722
|
+
* garantindo que cliques sejam bloqueados, independentemente do banner custom implementar ou não esse comportamento.
|
|
723
|
+
* - 'component': nenhum overlay do Provider; espera-se que o banner (padrão ou custom) trate o bloqueio.
|
|
724
|
+
*
|
|
725
|
+
* Observações:
|
|
726
|
+
* - Visual do overlay do Provider controlado por `designTokens.layout.backdrop`:
|
|
727
|
+
* - `false`: overlay transparente (bloqueia cliques sem escurecer — útil quando o app já possui um dark-filter visual próprio).
|
|
728
|
+
* - `string` (ex.: 'rgba(0,0,0,0.4)'): overlay com escurecimento gerenciado pela lib.
|
|
729
|
+
* - A11y: recomenda-se que o banner use semântica de diálogo (role="dialog", aria-modal="true") e trap de foco.
|
|
730
|
+
*/
|
|
731
|
+
blockingStrategy?: 'auto' | 'provider' | 'component';
|
|
716
732
|
/** Oculta o branding "fornecido por LÉdipO.eti.br" dos componentes. */
|
|
717
733
|
hideBranding?: boolean;
|
|
718
734
|
/**
|
|
@@ -776,6 +792,12 @@ interface CustomCookieBannerProps {
|
|
|
776
792
|
rejectAll: () => void;
|
|
777
793
|
openPreferences: () => void;
|
|
778
794
|
texts: ConsentTexts;
|
|
795
|
+
/**
|
|
796
|
+
* Indica se o modo bloqueante está ativo no contexto.
|
|
797
|
+
* Esta prop é apenas informativa para banners customizados ajustarem sua UI.
|
|
798
|
+
* O bloqueio funcional pode ser garantido pelo Provider quando `blockingStrategy='provider'`.
|
|
799
|
+
*/
|
|
800
|
+
blocking?: boolean;
|
|
779
801
|
}
|
|
780
802
|
/**
|
|
781
803
|
* Props esperadas por um componente customizado de PreferencesModal.
|
|
@@ -883,7 +905,7 @@ interface ConsentContextValue {
|
|
|
883
905
|
* </ConsentProvider>
|
|
884
906
|
* ```
|
|
885
907
|
*/
|
|
886
|
-
declare function ConsentProvider({ initialState, categories, texts: textsProp, theme, designTokens, PreferencesModalComponent, preferencesModalProps, CookieBannerComponent, cookieBannerProps, FloatingPreferencesButtonComponent, floatingPreferencesButtonProps, disableFloatingPreferencesButton, hideBranding, onConsentGiven, onPreferencesSaved, cookie: cookieOpts, disableDeveloperGuidance, children, }: Readonly<ConsentProviderProps>): react_jsx_runtime.JSX.Element;
|
|
908
|
+
declare function ConsentProvider({ initialState, categories, texts: textsProp, theme, designTokens, PreferencesModalComponent, preferencesModalProps, CookieBannerComponent, cookieBannerProps, FloatingPreferencesButtonComponent, floatingPreferencesButtonProps, disableFloatingPreferencesButton, blocking, blockingStrategy, hideBranding, onConsentGiven, onPreferencesSaved, cookie: cookieOpts, disableDeveloperGuidance, children, }: Readonly<ConsentProviderProps>): react_jsx_runtime.JSX.Element;
|
|
887
909
|
declare const defaultTexts: ConsentTexts;
|
|
888
910
|
|
|
889
911
|
/**
|
|
@@ -916,7 +938,7 @@ declare const defaultTexts: ConsentTexts;
|
|
|
916
938
|
* - **`setPreferences(preferences)`**: Define múltiplas categorias de uma vez
|
|
917
939
|
* - **`openPreferences()`**: Abre o modal de preferências
|
|
918
940
|
* - **`closePreferences()`**: Fecha o modal de preferências
|
|
919
|
-
* - **`resetConsent()`**: Limpa
|
|
941
|
+
* - **`resetConsent()`**: Limpa all consentimento (volta ao estado inicial)
|
|
920
942
|
*
|
|
921
943
|
* ### Performance e SSR
|
|
922
944
|
* - O hook é otimizado com `useMemo` interno para evitar re-renders desnecessários
|
|
@@ -1603,7 +1625,15 @@ declare function loadScript(id: string, src: string, category?: 'analytics' | 'm
|
|
|
1603
1625
|
* @remarks
|
|
1604
1626
|
* Pode ser sobrescrito via ThemeProvider externo se necessário.
|
|
1605
1627
|
*/
|
|
1606
|
-
declare
|
|
1628
|
+
declare function createDefaultConsentTheme(): Theme;
|
|
1629
|
+
/**
|
|
1630
|
+
* Compatibilidade: getter para o tema padrão.
|
|
1631
|
+
*
|
|
1632
|
+
* @deprecated Use `createDefaultConsentTheme()` em vez de importar um tema criado no escopo do módulo.
|
|
1633
|
+
* Importar um tema já instanciado pode causar side-effects em SSR e conflitos de contexto.
|
|
1634
|
+
* Esta função retorna uma nova instância do tema quando chamada.
|
|
1635
|
+
*/
|
|
1636
|
+
declare const defaultConsentTheme: () => Theme;
|
|
1607
1637
|
|
|
1608
1638
|
/**
|
|
1609
1639
|
* @interface ScriptIntegration
|
|
@@ -2133,4 +2163,4 @@ declare function validateProjectPreferences(preferences: ConsentPreferences, con
|
|
|
2133
2163
|
*/
|
|
2134
2164
|
declare function getAllProjectCategories(config?: ProjectCategoriesConfig): CategoryDefinition[];
|
|
2135
2165
|
|
|
2136
|
-
export { COMMON_INTEGRATIONS, type CategoriesContextValue, type Category, type CategoryDefinition, type ConsentContextValue, type ConsentCookieData, type ConsentCookieOptions, ConsentGate, type ConsentPreferences, ConsentProvider, type ConsentProviderProps, ConsentScriptLoader, type ConsentScriptLoaderProps, type ConsentState, type ConsentTexts, CookieBanner, type CookieBannerProps, type CustomCookieBannerProps, type CustomFloatingPreferencesButtonProps, type CustomPreferencesModalProps, DEFAULT_PROJECT_CATEGORIES, type DesignTokens, type DeveloperGuidance, FloatingPreferencesButton, type FloatingPreferencesButtonProps, type GoogleAnalyticsConfig, type GoogleTagManagerConfig, LogLevel, PreferencesModal, type PreferencesModalProps, type ProjectCategoriesConfig, type ScriptIntegration, type UserWayConfig, analyzeDeveloperConfiguration, createGoogleAnalyticsIntegration, createGoogleTagManagerIntegration, createProjectPreferences, createUserWayIntegration, defaultConsentTheme, defaultTexts, getAllProjectCategories, loadScript, openPreferencesModal, setDebugLogging, useCategories, useCategoryStatus, useConsent, useConsentHydration, useConsentScriptLoader, useConsentTexts, useOpenPreferencesModal, validateProjectPreferences };
|
|
2166
|
+
export { COMMON_INTEGRATIONS, type CategoriesContextValue, type Category, type CategoryDefinition, type ConsentContextValue, type ConsentCookieData, type ConsentCookieOptions, ConsentGate, type ConsentPreferences, ConsentProvider, type ConsentProviderProps, ConsentScriptLoader, type ConsentScriptLoaderProps, type ConsentState, type ConsentTexts, CookieBanner, type CookieBannerProps, type CustomCookieBannerProps, type CustomFloatingPreferencesButtonProps, type CustomPreferencesModalProps, DEFAULT_PROJECT_CATEGORIES, type DesignTokens, type DeveloperGuidance, FloatingPreferencesButton, type FloatingPreferencesButtonProps, type GoogleAnalyticsConfig, type GoogleTagManagerConfig, LogLevel, PreferencesModal, type PreferencesModalProps, type ProjectCategoriesConfig, type ScriptIntegration, type UserWayConfig, analyzeDeveloperConfiguration, createDefaultConsentTheme, createGoogleAnalyticsIntegration, createGoogleTagManagerIntegration, createProjectPreferences, createUserWayIntegration, defaultConsentTheme, defaultTexts, getAllProjectCategories, loadScript, openPreferencesModal, setDebugLogging, useCategories, useCategoryStatus, useConsent, useConsentHydration, useConsentScriptLoader, useConsentTexts, useOpenPreferencesModal, validateProjectPreferences };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { DialogProps } from '@mui/material/Dialog';
|
|
3
3
|
import * as React$1 from 'react';
|
|
4
|
-
import
|
|
4
|
+
import { Theme } from '@mui/material/styles';
|
|
5
5
|
import { PaperProps } from '@mui/material/Paper';
|
|
6
6
|
import { SnackbarProps } from '@mui/material/Snackbar';
|
|
7
7
|
import { FabProps } from '@mui/material/Fab';
|
|
@@ -567,7 +567,7 @@ interface DesignTokens {
|
|
|
567
567
|
mobile?: string;
|
|
568
568
|
desktop?: string;
|
|
569
569
|
};
|
|
570
|
-
backdrop?: boolean;
|
|
570
|
+
backdrop?: boolean | string;
|
|
571
571
|
};
|
|
572
572
|
}
|
|
573
573
|
/**
|
|
@@ -713,6 +713,22 @@ interface ConsentProviderProps {
|
|
|
713
713
|
* - `true`: Banner bloqueia interação até decisão (compliance rigorosa)
|
|
714
714
|
*/
|
|
715
715
|
blocking?: boolean;
|
|
716
|
+
/**
|
|
717
|
+
* Estratégia de bloqueio quando `blocking` estiver habilitado.
|
|
718
|
+
* - 'auto' (padrão):
|
|
719
|
+
* - Se usar o banner padrão da lib, o bloqueio visual/funcional fica a cargo do próprio banner.
|
|
720
|
+
* - Se usar `CookieBannerComponent` custom, o Provider NÃO cria overlay; o bloqueio fica a cargo do componente custom (compatibilidade atual).
|
|
721
|
+
* - 'provider': o Provider cria um overlay de bloqueio por cima da aplicação (e abaixo do banner),
|
|
722
|
+
* garantindo que cliques sejam bloqueados, independentemente do banner custom implementar ou não esse comportamento.
|
|
723
|
+
* - 'component': nenhum overlay do Provider; espera-se que o banner (padrão ou custom) trate o bloqueio.
|
|
724
|
+
*
|
|
725
|
+
* Observações:
|
|
726
|
+
* - Visual do overlay do Provider controlado por `designTokens.layout.backdrop`:
|
|
727
|
+
* - `false`: overlay transparente (bloqueia cliques sem escurecer — útil quando o app já possui um dark-filter visual próprio).
|
|
728
|
+
* - `string` (ex.: 'rgba(0,0,0,0.4)'): overlay com escurecimento gerenciado pela lib.
|
|
729
|
+
* - A11y: recomenda-se que o banner use semântica de diálogo (role="dialog", aria-modal="true") e trap de foco.
|
|
730
|
+
*/
|
|
731
|
+
blockingStrategy?: 'auto' | 'provider' | 'component';
|
|
716
732
|
/** Oculta o branding "fornecido por LÉdipO.eti.br" dos componentes. */
|
|
717
733
|
hideBranding?: boolean;
|
|
718
734
|
/**
|
|
@@ -776,6 +792,12 @@ interface CustomCookieBannerProps {
|
|
|
776
792
|
rejectAll: () => void;
|
|
777
793
|
openPreferences: () => void;
|
|
778
794
|
texts: ConsentTexts;
|
|
795
|
+
/**
|
|
796
|
+
* Indica se o modo bloqueante está ativo no contexto.
|
|
797
|
+
* Esta prop é apenas informativa para banners customizados ajustarem sua UI.
|
|
798
|
+
* O bloqueio funcional pode ser garantido pelo Provider quando `blockingStrategy='provider'`.
|
|
799
|
+
*/
|
|
800
|
+
blocking?: boolean;
|
|
779
801
|
}
|
|
780
802
|
/**
|
|
781
803
|
* Props esperadas por um componente customizado de PreferencesModal.
|
|
@@ -883,7 +905,7 @@ interface ConsentContextValue {
|
|
|
883
905
|
* </ConsentProvider>
|
|
884
906
|
* ```
|
|
885
907
|
*/
|
|
886
|
-
declare function ConsentProvider({ initialState, categories, texts: textsProp, theme, designTokens, PreferencesModalComponent, preferencesModalProps, CookieBannerComponent, cookieBannerProps, FloatingPreferencesButtonComponent, floatingPreferencesButtonProps, disableFloatingPreferencesButton, hideBranding, onConsentGiven, onPreferencesSaved, cookie: cookieOpts, disableDeveloperGuidance, children, }: Readonly<ConsentProviderProps>): react_jsx_runtime.JSX.Element;
|
|
908
|
+
declare function ConsentProvider({ initialState, categories, texts: textsProp, theme, designTokens, PreferencesModalComponent, preferencesModalProps, CookieBannerComponent, cookieBannerProps, FloatingPreferencesButtonComponent, floatingPreferencesButtonProps, disableFloatingPreferencesButton, blocking, blockingStrategy, hideBranding, onConsentGiven, onPreferencesSaved, cookie: cookieOpts, disableDeveloperGuidance, children, }: Readonly<ConsentProviderProps>): react_jsx_runtime.JSX.Element;
|
|
887
909
|
declare const defaultTexts: ConsentTexts;
|
|
888
910
|
|
|
889
911
|
/**
|
|
@@ -916,7 +938,7 @@ declare const defaultTexts: ConsentTexts;
|
|
|
916
938
|
* - **`setPreferences(preferences)`**: Define múltiplas categorias de uma vez
|
|
917
939
|
* - **`openPreferences()`**: Abre o modal de preferências
|
|
918
940
|
* - **`closePreferences()`**: Fecha o modal de preferências
|
|
919
|
-
* - **`resetConsent()`**: Limpa
|
|
941
|
+
* - **`resetConsent()`**: Limpa all consentimento (volta ao estado inicial)
|
|
920
942
|
*
|
|
921
943
|
* ### Performance e SSR
|
|
922
944
|
* - O hook é otimizado com `useMemo` interno para evitar re-renders desnecessários
|
|
@@ -1603,7 +1625,15 @@ declare function loadScript(id: string, src: string, category?: 'analytics' | 'm
|
|
|
1603
1625
|
* @remarks
|
|
1604
1626
|
* Pode ser sobrescrito via ThemeProvider externo se necessário.
|
|
1605
1627
|
*/
|
|
1606
|
-
declare
|
|
1628
|
+
declare function createDefaultConsentTheme(): Theme;
|
|
1629
|
+
/**
|
|
1630
|
+
* Compatibilidade: getter para o tema padrão.
|
|
1631
|
+
*
|
|
1632
|
+
* @deprecated Use `createDefaultConsentTheme()` em vez de importar um tema criado no escopo do módulo.
|
|
1633
|
+
* Importar um tema já instanciado pode causar side-effects em SSR e conflitos de contexto.
|
|
1634
|
+
* Esta função retorna uma nova instância do tema quando chamada.
|
|
1635
|
+
*/
|
|
1636
|
+
declare const defaultConsentTheme: () => Theme;
|
|
1607
1637
|
|
|
1608
1638
|
/**
|
|
1609
1639
|
* @interface ScriptIntegration
|
|
@@ -2133,4 +2163,4 @@ declare function validateProjectPreferences(preferences: ConsentPreferences, con
|
|
|
2133
2163
|
*/
|
|
2134
2164
|
declare function getAllProjectCategories(config?: ProjectCategoriesConfig): CategoryDefinition[];
|
|
2135
2165
|
|
|
2136
|
-
export { COMMON_INTEGRATIONS, type CategoriesContextValue, type Category, type CategoryDefinition, type ConsentContextValue, type ConsentCookieData, type ConsentCookieOptions, ConsentGate, type ConsentPreferences, ConsentProvider, type ConsentProviderProps, ConsentScriptLoader, type ConsentScriptLoaderProps, type ConsentState, type ConsentTexts, CookieBanner, type CookieBannerProps, type CustomCookieBannerProps, type CustomFloatingPreferencesButtonProps, type CustomPreferencesModalProps, DEFAULT_PROJECT_CATEGORIES, type DesignTokens, type DeveloperGuidance, FloatingPreferencesButton, type FloatingPreferencesButtonProps, type GoogleAnalyticsConfig, type GoogleTagManagerConfig, LogLevel, PreferencesModal, type PreferencesModalProps, type ProjectCategoriesConfig, type ScriptIntegration, type UserWayConfig, analyzeDeveloperConfiguration, createGoogleAnalyticsIntegration, createGoogleTagManagerIntegration, createProjectPreferences, createUserWayIntegration, defaultConsentTheme, defaultTexts, getAllProjectCategories, loadScript, openPreferencesModal, setDebugLogging, useCategories, useCategoryStatus, useConsent, useConsentHydration, useConsentScriptLoader, useConsentTexts, useOpenPreferencesModal, validateProjectPreferences };
|
|
2166
|
+
export { COMMON_INTEGRATIONS, type CategoriesContextValue, type Category, type CategoryDefinition, type ConsentContextValue, type ConsentCookieData, type ConsentCookieOptions, ConsentGate, type ConsentPreferences, ConsentProvider, type ConsentProviderProps, ConsentScriptLoader, type ConsentScriptLoaderProps, type ConsentState, type ConsentTexts, CookieBanner, type CookieBannerProps, type CustomCookieBannerProps, type CustomFloatingPreferencesButtonProps, type CustomPreferencesModalProps, DEFAULT_PROJECT_CATEGORIES, type DesignTokens, type DeveloperGuidance, FloatingPreferencesButton, type FloatingPreferencesButtonProps, type GoogleAnalyticsConfig, type GoogleTagManagerConfig, LogLevel, PreferencesModal, type PreferencesModalProps, type ProjectCategoriesConfig, type ScriptIntegration, type UserWayConfig, analyzeDeveloperConfiguration, createDefaultConsentTheme, createGoogleAnalyticsIntegration, createGoogleTagManagerIntegration, createProjectPreferences, createUserWayIntegration, defaultConsentTheme, defaultTexts, getAllProjectCategories, loadScript, openPreferencesModal, setDebugLogging, useCategories, useCategoryStatus, useConsent, useConsentHydration, useConsentScriptLoader, useConsentTexts, useOpenPreferencesModal, validateProjectPreferences };
|
package/dist/index.js
CHANGED
|
@@ -7,7 +7,6 @@ import {
|
|
|
7
7
|
PreferencesModal,
|
|
8
8
|
analyzeDeveloperConfiguration,
|
|
9
9
|
createProjectPreferences,
|
|
10
|
-
defaultConsentTheme,
|
|
11
10
|
defaultTexts,
|
|
12
11
|
getAllProjectCategories,
|
|
13
12
|
logger,
|
|
@@ -20,7 +19,7 @@ import {
|
|
|
20
19
|
useConsentTexts,
|
|
21
20
|
useOpenPreferencesModal,
|
|
22
21
|
validateProjectPreferences
|
|
23
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-MHCQFGRJ.js";
|
|
24
23
|
|
|
25
24
|
// src/utils/ConsentGate.tsx
|
|
26
25
|
import { Fragment, jsx } from "react/jsx-runtime";
|
|
@@ -67,6 +66,77 @@ function loadScript(id, src, category = null, attrs = {}) {
|
|
|
67
66
|
});
|
|
68
67
|
}
|
|
69
68
|
|
|
69
|
+
// src/utils/theme.ts
|
|
70
|
+
import { createTheme } from "@mui/material/styles";
|
|
71
|
+
function createDefaultConsentTheme() {
|
|
72
|
+
return createTheme({
|
|
73
|
+
palette: {
|
|
74
|
+
primary: {
|
|
75
|
+
main: "#1976d2",
|
|
76
|
+
contrastText: "#ffffff"
|
|
77
|
+
},
|
|
78
|
+
secondary: {
|
|
79
|
+
main: "#dc004e",
|
|
80
|
+
contrastText: "#ffffff"
|
|
81
|
+
},
|
|
82
|
+
background: {
|
|
83
|
+
default: "#fafafa",
|
|
84
|
+
paper: "#ffffff"
|
|
85
|
+
},
|
|
86
|
+
text: {
|
|
87
|
+
primary: "#333333",
|
|
88
|
+
secondary: "#666666"
|
|
89
|
+
},
|
|
90
|
+
action: {
|
|
91
|
+
hover: "rgba(25, 118, 210, 0.04)"
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
typography: {
|
|
95
|
+
fontFamily: '"Roboto", "Helvetica", "Arial", sans-serif',
|
|
96
|
+
body2: {
|
|
97
|
+
fontSize: "0.875rem",
|
|
98
|
+
lineHeight: 1.43
|
|
99
|
+
},
|
|
100
|
+
button: {
|
|
101
|
+
fontWeight: 500,
|
|
102
|
+
textTransform: "none"
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
components: {
|
|
106
|
+
MuiButton: {
|
|
107
|
+
styleOverrides: {
|
|
108
|
+
root: {
|
|
109
|
+
borderRadius: 8,
|
|
110
|
+
paddingX: 16,
|
|
111
|
+
paddingY: 8
|
|
112
|
+
},
|
|
113
|
+
contained: {
|
|
114
|
+
boxShadow: "0 2px 4px rgba(0,0,0,0.1)",
|
|
115
|
+
"&:hover": {
|
|
116
|
+
boxShadow: "0 4px 8px rgba(0,0,0,0.15)"
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
MuiPaper: {
|
|
122
|
+
styleOverrides: {
|
|
123
|
+
root: {
|
|
124
|
+
borderRadius: 12
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
MuiDialog: {
|
|
129
|
+
styleOverrides: {
|
|
130
|
+
paper: {
|
|
131
|
+
borderRadius: 16
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
var defaultConsentTheme = () => createDefaultConsentTheme();
|
|
139
|
+
|
|
70
140
|
// src/utils/ConsentScriptLoader.tsx
|
|
71
141
|
import * as React from "react";
|
|
72
142
|
function ConsentScriptLoader({
|
|
@@ -205,6 +275,7 @@ export {
|
|
|
205
275
|
LogLevel,
|
|
206
276
|
PreferencesModal,
|
|
207
277
|
analyzeDeveloperConfiguration,
|
|
278
|
+
createDefaultConsentTheme,
|
|
208
279
|
createGoogleAnalyticsIntegration,
|
|
209
280
|
createGoogleTagManagerIntegration,
|
|
210
281
|
createProjectPreferences,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-lgpd-consent",
|
|
3
|
-
"version": "0.3.
|
|
4
|
-
"description": "Biblioteca
|
|
3
|
+
"version": "0.3.5",
|
|
4
|
+
"description": "Biblioteca de consentimento LGPD, integrações nativas e sistema extensível para React.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"lgpd",
|
|
7
7
|
"anpd",
|
|
@@ -47,23 +47,30 @@
|
|
|
47
47
|
"files": [
|
|
48
48
|
"dist",
|
|
49
49
|
"README.md",
|
|
50
|
+
"README.en.md",
|
|
51
|
+
"QUICKSTART.md",
|
|
52
|
+
"QUICKSTART.en.md",
|
|
50
53
|
"LICENSE",
|
|
51
54
|
"CHANGELOG.md"
|
|
52
55
|
],
|
|
53
56
|
"engines": {
|
|
54
57
|
"node": ">=18.18"
|
|
55
58
|
},
|
|
56
|
-
"packageManager": "npm@10.
|
|
59
|
+
"packageManager": "npm@10.9.3",
|
|
57
60
|
"scripts": {
|
|
58
|
-
"clean": "rimraf node_modules package-lock.json dist",
|
|
61
|
+
"clean": "rimraf node_modules package-lock.json dist docs storybook-static .cache .stryker-tmp",
|
|
59
62
|
"build": "cross-env NODE_ENV=production tsup src/index.ts --format esm,cjs --dts --clean",
|
|
60
63
|
"dev": "cross-env NODE_ENV=development tsup src/index.ts --format esm,cjs --dts --watch",
|
|
61
64
|
"lint": "eslint . --ext .ts,.tsx",
|
|
62
65
|
"format": "prettier --write \"src/**/*.{ts,tsx,json,md}\" \"eslint.config.js\"",
|
|
63
66
|
"type-check": "tsc --noEmit",
|
|
64
67
|
"test": "jest --config jest.config.ts",
|
|
68
|
+
"mutation": "npx stryker run",
|
|
69
|
+
"mutation:tests": "npx stryker run ./stryker.tests.conf.json",
|
|
65
70
|
"prepublishOnly": "npm run build",
|
|
66
|
-
"docs:generate": "typedoc --out docs"
|
|
71
|
+
"docs:generate": "typedoc --out docs",
|
|
72
|
+
"storybook": "storybook dev -p 6006",
|
|
73
|
+
"build-storybook": "storybook build"
|
|
67
74
|
},
|
|
68
75
|
"repository": {
|
|
69
76
|
"type": "git",
|
|
@@ -88,38 +95,47 @@
|
|
|
88
95
|
"js-cookie": "^3.0.5"
|
|
89
96
|
},
|
|
90
97
|
"devDependencies": {
|
|
98
|
+
"@chromatic-com/storybook": "^4.1.1",
|
|
91
99
|
"@emotion/react": "^11.14.0",
|
|
92
100
|
"@emotion/styled": "^11.14.1",
|
|
93
101
|
"@eslint/compat": "^1.3.2",
|
|
94
102
|
"@mui/icons-material": "^7.3.1",
|
|
95
103
|
"@mui/material": "^7.3.1",
|
|
104
|
+
"@storybook/addon-a11y": "^9.1.3",
|
|
105
|
+
"@storybook/addon-docs": "^9.1.3",
|
|
106
|
+
"@storybook/addon-vitest": "^9.1.3",
|
|
107
|
+
"@storybook/react-vite": "^9.1.3",
|
|
108
|
+
"@stryker-mutator/core": "^9.0.1",
|
|
109
|
+
"@stryker-mutator/jest-runner": "^9.0.1",
|
|
96
110
|
"@testing-library/dom": "^10.4.1",
|
|
97
|
-
"@testing-library/jest-dom": "^6.
|
|
111
|
+
"@testing-library/jest-dom": "^6.8.0",
|
|
98
112
|
"@testing-library/react": "^16.3.0",
|
|
99
113
|
"@testing-library/user-event": "^14.6.1",
|
|
100
|
-
"@types/jest": "^
|
|
114
|
+
"@types/jest": "^30.0.0",
|
|
101
115
|
"@types/js-cookie": "^3.0.6",
|
|
102
|
-
"@types/node": "^24.
|
|
103
|
-
"@types/react": "^19.1.
|
|
104
|
-
"@types/react-dom": "^19.1.
|
|
105
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
106
|
-
"@typescript-eslint/parser": "^8.
|
|
116
|
+
"@types/node": "^24.3.0",
|
|
117
|
+
"@types/react": "^19.1.12",
|
|
118
|
+
"@types/react-dom": "^19.1.9",
|
|
119
|
+
"@typescript-eslint/eslint-plugin": "^8.41.0",
|
|
120
|
+
"@typescript-eslint/parser": "^8.41.0",
|
|
107
121
|
"cross-env": "^10.0.0",
|
|
108
|
-
"eslint": "^9.
|
|
122
|
+
"eslint": "^9.34.0",
|
|
109
123
|
"eslint-config-prettier": "^10.1.8",
|
|
110
124
|
"eslint-plugin-jest": "^29.0.1",
|
|
111
125
|
"eslint-plugin-react-hooks": "^5.2.0",
|
|
112
|
-
"
|
|
113
|
-
"jest
|
|
126
|
+
"eslint-plugin-storybook": "^9.1.3",
|
|
127
|
+
"jest": "^30.1.1",
|
|
128
|
+
"jest-environment-jsdom": "^30.1.1",
|
|
114
129
|
"prettier": "^3.6.2",
|
|
115
130
|
"react": "^19.1.1",
|
|
116
131
|
"react-dom": "^19.1.1",
|
|
117
132
|
"rimraf": "^6.0.1",
|
|
133
|
+
"storybook": "^9.1.3",
|
|
118
134
|
"ts-jest": "^29.4.1",
|
|
119
135
|
"ts-node": "^10.9.2",
|
|
120
136
|
"tsup": "^8.5.0",
|
|
121
|
-
"typedoc": "^0.28.
|
|
137
|
+
"typedoc": "^0.28.11",
|
|
122
138
|
"typescript": "^5.9.2",
|
|
123
|
-
"typescript-eslint": "^8.
|
|
139
|
+
"typescript-eslint": "^8.41.0"
|
|
124
140
|
}
|
|
125
141
|
}
|