react-lgpd-consent 0.3.4 → 0.3.6
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 +10 -8
- package/LICENSE +21 -21
- package/QUICKSTART.md +25 -4
- package/README.md +23 -0
- package/dist/{PreferencesModal-XYBFROAB.js → PreferencesModal-KAZMVPBD.js} +1 -1
- package/dist/{chunk-7D2F6JFW.js → chunk-MHCQFGRJ.js} +69 -214
- package/dist/index.cjs +162 -250
- package/dist/index.d.cts +11 -3
- package/dist/index.d.ts +11 -3
- package/dist/index.js +73 -2
- package/package.json +6 -6
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';
|
|
@@ -1625,7 +1625,15 @@ declare function loadScript(id: string, src: string, category?: 'analytics' | 'm
|
|
|
1625
1625
|
* @remarks
|
|
1626
1626
|
* Pode ser sobrescrito via ThemeProvider externo se necessário.
|
|
1627
1627
|
*/
|
|
1628
|
-
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;
|
|
1629
1637
|
|
|
1630
1638
|
/**
|
|
1631
1639
|
* @interface ScriptIntegration
|
|
@@ -2155,4 +2163,4 @@ declare function validateProjectPreferences(preferences: ConsentPreferences, con
|
|
|
2155
2163
|
*/
|
|
2156
2164
|
declare function getAllProjectCategories(config?: ProjectCategoriesConfig): CategoryDefinition[];
|
|
2157
2165
|
|
|
2158
|
-
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';
|
|
@@ -1625,7 +1625,15 @@ declare function loadScript(id: string, src: string, category?: 'analytics' | 'm
|
|
|
1625
1625
|
* @remarks
|
|
1626
1626
|
* Pode ser sobrescrito via ThemeProvider externo se necessário.
|
|
1627
1627
|
*/
|
|
1628
|
-
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;
|
|
1629
1637
|
|
|
1630
1638
|
/**
|
|
1631
1639
|
* @interface ScriptIntegration
|
|
@@ -2155,4 +2163,4 @@ declare function validateProjectPreferences(preferences: ConsentPreferences, con
|
|
|
2155
2163
|
*/
|
|
2156
2164
|
declare function getAllProjectCategories(config?: ProjectCategoriesConfig): CategoryDefinition[];
|
|
2157
2165
|
|
|
2158
|
-
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,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-lgpd-consent",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.6",
|
|
4
4
|
"description": "Biblioteca de consentimento LGPD, integrações nativas e sistema extensível para React.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"lgpd",
|
|
@@ -114,8 +114,8 @@
|
|
|
114
114
|
"@types/jest": "^30.0.0",
|
|
115
115
|
"@types/js-cookie": "^3.0.6",
|
|
116
116
|
"@types/node": "^24.3.0",
|
|
117
|
-
"@types/react": "^19.1.
|
|
118
|
-
"@types/react-dom": "^19.1.
|
|
117
|
+
"@types/react": "^19.1.12",
|
|
118
|
+
"@types/react-dom": "^19.1.9",
|
|
119
119
|
"@typescript-eslint/eslint-plugin": "^8.41.0",
|
|
120
120
|
"@typescript-eslint/parser": "^8.41.0",
|
|
121
121
|
"cross-env": "^10.0.0",
|
|
@@ -124,8 +124,8 @@
|
|
|
124
124
|
"eslint-plugin-jest": "^29.0.1",
|
|
125
125
|
"eslint-plugin-react-hooks": "^5.2.0",
|
|
126
126
|
"eslint-plugin-storybook": "^9.1.3",
|
|
127
|
-
"jest": "^30.
|
|
128
|
-
"jest-environment-jsdom": "^30.
|
|
127
|
+
"jest": "^30.1.1",
|
|
128
|
+
"jest-environment-jsdom": "^30.1.1",
|
|
129
129
|
"prettier": "^3.6.2",
|
|
130
130
|
"react": "^19.1.1",
|
|
131
131
|
"react-dom": "^19.1.1",
|
|
@@ -138,4 +138,4 @@
|
|
|
138
138
|
"typescript": "^5.9.2",
|
|
139
139
|
"typescript-eslint": "^8.41.0"
|
|
140
140
|
}
|
|
141
|
-
}
|
|
141
|
+
}
|