@react-lgpd-consent/mui 0.7.2 → 0.8.0
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 +13 -2
- package/dist/index.cjs +4 -0
- package/dist/index.js +4 -0
- package/dist/ui.cjs +4 -0
- package/dist/ui.js +4 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -97,9 +97,9 @@ import { ConsentProvider } from '@react-lgpd-consent/mui'
|
|
|
97
97
|
### Presets ANPD
|
|
98
98
|
|
|
99
99
|
```tsx
|
|
100
|
-
import {
|
|
100
|
+
import { createAnpdCategoriesConfig } from '@react-lgpd-consent/mui'
|
|
101
101
|
|
|
102
|
-
const categories =
|
|
102
|
+
const categories = createAnpdCategoriesConfig({
|
|
103
103
|
include: ['analytics', 'marketing']
|
|
104
104
|
})
|
|
105
105
|
|
|
@@ -161,6 +161,17 @@ function CustomUI() {
|
|
|
161
161
|
/>
|
|
162
162
|
```
|
|
163
163
|
|
|
164
|
+
Para bloquear navegação até a decisão, use `blockingMode="hard"` no provider:
|
|
165
|
+
|
|
166
|
+
```tsx
|
|
167
|
+
<ConsentProvider
|
|
168
|
+
categories={{ enabledCategories: ['analytics'] }}
|
|
169
|
+
blocking
|
|
170
|
+
blockingMode="hard"
|
|
171
|
+
blockingStrategy="provider"
|
|
172
|
+
/>
|
|
173
|
+
```
|
|
174
|
+
|
|
164
175
|
## 📚 Documentação
|
|
165
176
|
|
|
166
177
|
- [Documentação Principal](https://lucianoedipo.github.io/react-lgpd-consent/)
|
package/dist/index.cjs
CHANGED
|
@@ -464,6 +464,7 @@ function PreferencesModal({
|
|
|
464
464
|
setTempPreferences(preferences);
|
|
465
465
|
closePreferences();
|
|
466
466
|
};
|
|
467
|
+
const descriptionId = "cookie-pref-description";
|
|
467
468
|
const modalTitleSx = (theme) => ({
|
|
468
469
|
fontSize: designTokens?.typography?.fontSize?.modal ?? void 0,
|
|
469
470
|
color: designTokens?.colors?.text ?? theme.palette.text.primary
|
|
@@ -488,11 +489,13 @@ function PreferencesModal({
|
|
|
488
489
|
...modalZIndexToken ? { style: { zIndex: modalZIndexToken } } : {},
|
|
489
490
|
"data-testid": dialogRest?.slotProps?.root?.["data-testid"] ?? "lgpd-preferences-modal-root"
|
|
490
491
|
};
|
|
492
|
+
const ariaDescribedBy = dialogRest["aria-describedby"] ?? descriptionId;
|
|
491
493
|
const mergedDialogProps = {
|
|
492
494
|
open,
|
|
493
495
|
fullWidth: true,
|
|
494
496
|
maxWidth: "sm",
|
|
495
497
|
...dialogRest,
|
|
498
|
+
"aria-describedby": ariaDescribedBy,
|
|
496
499
|
slotProps: {
|
|
497
500
|
...dialogRest?.slotProps,
|
|
498
501
|
root: rootSlotProps
|
|
@@ -504,6 +507,7 @@ function PreferencesModal({
|
|
|
504
507
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
505
508
|
Typography__default.default,
|
|
506
509
|
{
|
|
510
|
+
id: descriptionId,
|
|
507
511
|
variant: "body2",
|
|
508
512
|
sx: (theme) => ({
|
|
509
513
|
mb: 2,
|
package/dist/index.js
CHANGED
|
@@ -426,6 +426,7 @@ function PreferencesModal({
|
|
|
426
426
|
setTempPreferences(preferences);
|
|
427
427
|
closePreferences();
|
|
428
428
|
};
|
|
429
|
+
const descriptionId = "cookie-pref-description";
|
|
429
430
|
const modalTitleSx = (theme) => ({
|
|
430
431
|
fontSize: designTokens?.typography?.fontSize?.modal ?? void 0,
|
|
431
432
|
color: designTokens?.colors?.text ?? theme.palette.text.primary
|
|
@@ -450,11 +451,13 @@ function PreferencesModal({
|
|
|
450
451
|
...modalZIndexToken ? { style: { zIndex: modalZIndexToken } } : {},
|
|
451
452
|
"data-testid": dialogRest?.slotProps?.root?.["data-testid"] ?? "lgpd-preferences-modal-root"
|
|
452
453
|
};
|
|
454
|
+
const ariaDescribedBy = dialogRest["aria-describedby"] ?? descriptionId;
|
|
453
455
|
const mergedDialogProps = {
|
|
454
456
|
open,
|
|
455
457
|
fullWidth: true,
|
|
456
458
|
maxWidth: "sm",
|
|
457
459
|
...dialogRest,
|
|
460
|
+
"aria-describedby": ariaDescribedBy,
|
|
458
461
|
slotProps: {
|
|
459
462
|
...dialogRest?.slotProps,
|
|
460
463
|
root: rootSlotProps
|
|
@@ -466,6 +469,7 @@ function PreferencesModal({
|
|
|
466
469
|
/* @__PURE__ */ jsx(
|
|
467
470
|
Typography,
|
|
468
471
|
{
|
|
472
|
+
id: descriptionId,
|
|
469
473
|
variant: "body2",
|
|
470
474
|
sx: (theme) => ({
|
|
471
475
|
mb: 2,
|
package/dist/ui.cjs
CHANGED
|
@@ -463,6 +463,7 @@ function PreferencesModal({
|
|
|
463
463
|
setTempPreferences(preferences);
|
|
464
464
|
closePreferences();
|
|
465
465
|
};
|
|
466
|
+
const descriptionId = "cookie-pref-description";
|
|
466
467
|
const modalTitleSx = (theme) => ({
|
|
467
468
|
fontSize: designTokens?.typography?.fontSize?.modal ?? void 0,
|
|
468
469
|
color: designTokens?.colors?.text ?? theme.palette.text.primary
|
|
@@ -487,11 +488,13 @@ function PreferencesModal({
|
|
|
487
488
|
...modalZIndexToken ? { style: { zIndex: modalZIndexToken } } : {},
|
|
488
489
|
"data-testid": dialogRest?.slotProps?.root?.["data-testid"] ?? "lgpd-preferences-modal-root"
|
|
489
490
|
};
|
|
491
|
+
const ariaDescribedBy = dialogRest["aria-describedby"] ?? descriptionId;
|
|
490
492
|
const mergedDialogProps = {
|
|
491
493
|
open,
|
|
492
494
|
fullWidth: true,
|
|
493
495
|
maxWidth: "sm",
|
|
494
496
|
...dialogRest,
|
|
497
|
+
"aria-describedby": ariaDescribedBy,
|
|
495
498
|
slotProps: {
|
|
496
499
|
...dialogRest?.slotProps,
|
|
497
500
|
root: rootSlotProps
|
|
@@ -503,6 +506,7 @@ function PreferencesModal({
|
|
|
503
506
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
504
507
|
Typography__default.default,
|
|
505
508
|
{
|
|
509
|
+
id: descriptionId,
|
|
506
510
|
variant: "body2",
|
|
507
511
|
sx: (theme) => ({
|
|
508
512
|
mb: 2,
|
package/dist/ui.js
CHANGED
|
@@ -422,6 +422,7 @@ function PreferencesModal({
|
|
|
422
422
|
setTempPreferences(preferences);
|
|
423
423
|
closePreferences();
|
|
424
424
|
};
|
|
425
|
+
const descriptionId = "cookie-pref-description";
|
|
425
426
|
const modalTitleSx = (theme) => ({
|
|
426
427
|
fontSize: designTokens?.typography?.fontSize?.modal ?? void 0,
|
|
427
428
|
color: designTokens?.colors?.text ?? theme.palette.text.primary
|
|
@@ -446,11 +447,13 @@ function PreferencesModal({
|
|
|
446
447
|
...modalZIndexToken ? { style: { zIndex: modalZIndexToken } } : {},
|
|
447
448
|
"data-testid": dialogRest?.slotProps?.root?.["data-testid"] ?? "lgpd-preferences-modal-root"
|
|
448
449
|
};
|
|
450
|
+
const ariaDescribedBy = dialogRest["aria-describedby"] ?? descriptionId;
|
|
449
451
|
const mergedDialogProps = {
|
|
450
452
|
open,
|
|
451
453
|
fullWidth: true,
|
|
452
454
|
maxWidth: "sm",
|
|
453
455
|
...dialogRest,
|
|
456
|
+
"aria-describedby": ariaDescribedBy,
|
|
454
457
|
slotProps: {
|
|
455
458
|
...dialogRest?.slotProps,
|
|
456
459
|
root: rootSlotProps
|
|
@@ -462,6 +465,7 @@ function PreferencesModal({
|
|
|
462
465
|
/* @__PURE__ */ jsx(
|
|
463
466
|
Typography,
|
|
464
467
|
{
|
|
468
|
+
id: descriptionId,
|
|
465
469
|
variant: "body2",
|
|
466
470
|
sx: (theme) => ({
|
|
467
471
|
mb: 2,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-lgpd-consent/mui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "Componentes Material-UI prontos para gerenciamento de consentimento LGPD",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"lgpd",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
}
|
|
64
64
|
},
|
|
65
65
|
"dependencies": {
|
|
66
|
-
"@react-lgpd-consent/core": "^0.
|
|
66
|
+
"@react-lgpd-consent/core": "^0.8.0"
|
|
67
67
|
},
|
|
68
68
|
"scripts": {
|
|
69
69
|
"clean": "rimraf dist",
|