@redacto.io/consent-sdk-react 5.3.0 → 7.0.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.
Files changed (68) hide show
  1. package/.turbo/turbo-build.log +24 -0
  2. package/CHANGELOG.md +23 -0
  3. package/dist/privacy-center.d.mts +100 -42
  4. package/dist/privacy-center.d.ts +100 -42
  5. package/dist/privacy-center.js +4232 -2247
  6. package/dist/privacy-center.mjs +4266 -2284
  7. package/package.json +1 -1
  8. package/src/RedactoPrivacyCenter/PrivacyCenterLayout.tsx +6 -10
  9. package/src/RedactoPrivacyCenter/RedactoPrivacyCenter.tsx +18 -17
  10. package/src/RedactoPrivacyCenter/api/actions.ts +52 -8
  11. package/src/RedactoPrivacyCenter/api/client.ts +58 -15
  12. package/src/RedactoPrivacyCenter/api/orgBranding.ts +9 -0
  13. package/src/RedactoPrivacyCenter/components/ConsentManager.tsx +729 -278
  14. package/src/RedactoPrivacyCenter/components/ConsentManagerCells.tsx +187 -0
  15. package/src/RedactoPrivacyCenter/components/ConsentManagerColumns.tsx +65 -165
  16. package/src/RedactoPrivacyCenter/components/ConsentManagerExpandedRow.tsx +179 -0
  17. package/src/RedactoPrivacyCenter/components/ConsentManagerGroupedColumns.tsx +318 -0
  18. package/src/RedactoPrivacyCenter/components/ConsentManagerProductCards.tsx +333 -0
  19. package/src/RedactoPrivacyCenter/components/ConsentManagerPurposeCards.tsx +102 -0
  20. package/src/RedactoPrivacyCenter/components/ConsentManagerTableSkeleton.tsx +6 -2
  21. package/src/RedactoPrivacyCenter/components/Form.tsx +3 -3
  22. package/src/RedactoPrivacyCenter/components/ModifyConsentModal.tsx +9 -6
  23. package/src/RedactoPrivacyCenter/components/NotificationHub/NotificationBell.tsx +1 -1
  24. package/src/RedactoPrivacyCenter/components/PrivacyCenterLayout.tsx +101 -56
  25. package/src/RedactoPrivacyCenter/components/SideMenuBarPC/SideBarPC.tsx +16 -2
  26. package/src/RedactoPrivacyCenter/components/types.ts +2 -5
  27. package/src/RedactoPrivacyCenter/context/BrandingContext.tsx +44 -0
  28. package/src/RedactoPrivacyCenter/context/PageChromeContext.tsx +21 -1
  29. package/src/RedactoPrivacyCenter/lib/api.ts +70 -28
  30. package/src/RedactoPrivacyCenter/lib/consent-manager/utils.tsx +4 -2
  31. package/src/RedactoPrivacyCenter/lib/types.ts +79 -36
  32. package/src/RedactoPrivacyCenter/locales/as/translation.json +12 -1
  33. package/src/RedactoPrivacyCenter/locales/bho/translation.json +12 -1
  34. package/src/RedactoPrivacyCenter/locales/bn/translation.json +12 -1
  35. package/src/RedactoPrivacyCenter/locales/brx/translation.json +12 -1
  36. package/src/RedactoPrivacyCenter/locales/doi/translation.json +12 -1
  37. package/src/RedactoPrivacyCenter/locales/en/translation.json +16 -1
  38. package/src/RedactoPrivacyCenter/locales/gom/translation.json +12 -1
  39. package/src/RedactoPrivacyCenter/locales/gu/translation.json +12 -1
  40. package/src/RedactoPrivacyCenter/locales/hi/translation.json +15 -1
  41. package/src/RedactoPrivacyCenter/locales/kn/translation.json +12 -1
  42. package/src/RedactoPrivacyCenter/locales/ks/translation.json +12 -1
  43. package/src/RedactoPrivacyCenter/locales/mai/translation.json +12 -1
  44. package/src/RedactoPrivacyCenter/locales/ml/translation.json +12 -1
  45. package/src/RedactoPrivacyCenter/locales/mni-Mtei/translation.json +12 -1
  46. package/src/RedactoPrivacyCenter/locales/mr/translation.json +12 -1
  47. package/src/RedactoPrivacyCenter/locales/ne/translation.json +12 -1
  48. package/src/RedactoPrivacyCenter/locales/or/translation.json +12 -1
  49. package/src/RedactoPrivacyCenter/locales/pa/translation.json +12 -1
  50. package/src/RedactoPrivacyCenter/locales/sa/translation.json +12 -1
  51. package/src/RedactoPrivacyCenter/locales/sat/translation.json +12 -1
  52. package/src/RedactoPrivacyCenter/locales/sd/translation.json +12 -1
  53. package/src/RedactoPrivacyCenter/locales/ta/translation.json +12 -1
  54. package/src/RedactoPrivacyCenter/locales/te/translation.json +12 -1
  55. package/src/RedactoPrivacyCenter/locales/ur/translation.json +12 -1
  56. package/src/RedactoPrivacyCenter/styles/applyBrandingTheme.ts +66 -0
  57. package/src/RedactoPrivacyCenter/styles/injectStyles.ts +528 -114
  58. package/src/RedactoPrivacyCenter/styles/pcStyles.ts +3 -2
  59. package/src/RedactoPrivacyCenter/styles/variables.css +5 -42
  60. package/src/RedactoPrivacyCenter/table/AdvancedTable.tsx +36 -16
  61. package/src/RedactoPrivacyCenter/table/AdvancedTablePagination.tsx +4 -12
  62. package/src/RedactoPrivacyCenter/ui/Footer.tsx +4 -10
  63. package/src/RedactoPrivacyCenter/ui/PCInput.tsx +1 -1
  64. package/src/RedactoPrivacyCenter/ui/PCSelect.tsx +51 -5
  65. package/src/privacy-center.ts +7 -3
  66. package/src/RedactoPrivacyCenter/components/ThemeTransitionOverlay.tsx +0 -85
  67. package/src/RedactoPrivacyCenter/context/theme.tsx +0 -127
  68. package/src/RedactoPrivacyCenter/ui/ThemeToggle.tsx +0 -72
@@ -276,5 +276,16 @@
276
276
  "removeAttachment": "ꯑꯦꯇꯦꯆꯃꯦꯟꯇ ꯂꯧꯊꯣꯛꯄ",
277
277
  "document": "ꯗꯣꯀꯨꯃꯦꯟꯇ",
278
278
  "downloadAttachment": "{{fileName}} ꯗꯥꯎꯅꯂꯣꯗ ꯇꯧꯕ",
279
- "sortByColumn": "ꯀꯣꯂꯝ ꯅ ꯁꯣꯔꯠ ꯇꯧꯕ"
279
+ "sortByColumn": "ꯀꯣꯂꯝ ꯅ ꯁꯣꯔꯠ ꯇꯧꯕ",
280
+ "manage": "Manage",
281
+ "consents": "Consents",
282
+ "consentCount_one": "{{count}} consent",
283
+ "consentCount_other": "{{count}} consents",
284
+ "purposes": "Purposes",
285
+ "latestActivity": "Latest activity",
286
+ "activeWithCount": "{{count}} active",
287
+ "withdrawnWithCount": "{{count}} withdrawn",
288
+ "expiredWithCount": "{{count}} expired",
289
+ "declinedWithCount": "{{count}} declined",
290
+ "productsAndConsentsSummary": "{{products}} products, {{consents}} consents"
280
291
  }
@@ -276,5 +276,16 @@
276
276
  "removeAttachment": "संलग्नक काढा",
277
277
  "document": "दस्तऐवज",
278
278
  "downloadAttachment": "{{fileName}} डाउनलोड करा",
279
- "sortByColumn": "स्तंभानुसार क्रमवारी लावा"
279
+ "sortByColumn": "स्तंभानुसार क्रमवारी लावा",
280
+ "manage": "Manage",
281
+ "consents": "Consents",
282
+ "consentCount_one": "{{count}} consent",
283
+ "consentCount_other": "{{count}} consents",
284
+ "purposes": "Purposes",
285
+ "latestActivity": "Latest activity",
286
+ "activeWithCount": "{{count}} active",
287
+ "withdrawnWithCount": "{{count}} withdrawn",
288
+ "expiredWithCount": "{{count}} expired",
289
+ "declinedWithCount": "{{count}} declined",
290
+ "productsAndConsentsSummary": "{{products}} products, {{consents}} consents"
280
291
  }
@@ -276,5 +276,16 @@
276
276
  "removeAttachment": "संलग्न हटाउनुहोस्",
277
277
  "document": "कागजात",
278
278
  "downloadAttachment": "{{fileName}} डाउनलोड गर्नुहोस्",
279
- "sortByColumn": "स्तम्भ अनुसार क्रमबद्ध गर्नुहोस्"
279
+ "sortByColumn": "स्तम्भ अनुसार क्रमबद्ध गर्नुहोस्",
280
+ "manage": "Manage",
281
+ "consents": "Consents",
282
+ "consentCount_one": "{{count}} consent",
283
+ "consentCount_other": "{{count}} consents",
284
+ "purposes": "Purposes",
285
+ "latestActivity": "Latest activity",
286
+ "activeWithCount": "{{count}} active",
287
+ "withdrawnWithCount": "{{count}} withdrawn",
288
+ "expiredWithCount": "{{count}} expired",
289
+ "declinedWithCount": "{{count}} declined",
290
+ "productsAndConsentsSummary": "{{products}} products, {{consents}} consents"
280
291
  }
@@ -276,5 +276,16 @@
276
276
  "removeAttachment": "ସଂଲଗ୍ନ ହଟାନ୍ତୁ",
277
277
  "document": "ଦଲିଲ",
278
278
  "downloadAttachment": "{{fileName}} ଡାଉନଲୋଡ୍ କରନ୍ତୁ",
279
- "sortByColumn": "ସ୍ତମ୍ଭ ଅନୁସାରେ ସଜାନ୍ତୁ"
279
+ "sortByColumn": "ସ୍ତମ୍ଭ ଅନୁସାରେ ସଜାନ୍ତୁ",
280
+ "manage": "Manage",
281
+ "consents": "Consents",
282
+ "consentCount_one": "{{count}} consent",
283
+ "consentCount_other": "{{count}} consents",
284
+ "purposes": "Purposes",
285
+ "latestActivity": "Latest activity",
286
+ "activeWithCount": "{{count}} active",
287
+ "withdrawnWithCount": "{{count}} withdrawn",
288
+ "expiredWithCount": "{{count}} expired",
289
+ "declinedWithCount": "{{count}} declined",
290
+ "productsAndConsentsSummary": "{{products}} products, {{consents}} consents"
280
291
  }
@@ -276,5 +276,16 @@
276
276
  "removeAttachment": "ਅਟੈਚਮੈਂਟ ਹਟਾਓ",
277
277
  "document": "ਦਸਤਾਵੇਜ਼",
278
278
  "downloadAttachment": "{{fileName}} ਡਾਊਨਲੋਡ ਕਰੋ",
279
- "sortByColumn": "ਕਾਲਮ ਅਨੁਸਾਰ ਕ੍ਰਮਬੱਧ ਕਰੋ"
279
+ "sortByColumn": "ਕਾਲਮ ਅਨੁਸਾਰ ਕ੍ਰਮਬੱਧ ਕਰੋ",
280
+ "manage": "Manage",
281
+ "consents": "Consents",
282
+ "consentCount_one": "{{count}} consent",
283
+ "consentCount_other": "{{count}} consents",
284
+ "purposes": "Purposes",
285
+ "latestActivity": "Latest activity",
286
+ "activeWithCount": "{{count}} active",
287
+ "withdrawnWithCount": "{{count}} withdrawn",
288
+ "expiredWithCount": "{{count}} expired",
289
+ "declinedWithCount": "{{count}} declined",
290
+ "productsAndConsentsSummary": "{{products}} products, {{consents}} consents"
280
291
  }
@@ -276,5 +276,16 @@
276
276
  "removeAttachment": "संलग्नकम् अपनयतु",
277
277
  "document": "प्रलेखः",
278
278
  "downloadAttachment": "{{fileName}} अवतारयतु",
279
- "sortByColumn": "स्तम्भानुसारेण क्रमयतु"
279
+ "sortByColumn": "स्तम्भानुसारेण क्रमयतु",
280
+ "manage": "Manage",
281
+ "consents": "Consents",
282
+ "consentCount_one": "{{count}} consent",
283
+ "consentCount_other": "{{count}} consents",
284
+ "purposes": "Purposes",
285
+ "latestActivity": "Latest activity",
286
+ "activeWithCount": "{{count}} active",
287
+ "withdrawnWithCount": "{{count}} withdrawn",
288
+ "expiredWithCount": "{{count}} expired",
289
+ "declinedWithCount": "{{count}} declined",
290
+ "productsAndConsentsSummary": "{{products}} products, {{consents}} consents"
280
291
  }
@@ -276,5 +276,16 @@
276
276
  "removeAttachment": "ᱞᱟᱜᱟᱣ ᱚᱪᱚᱜ",
277
277
  "document": "ᱫᱚᱞᱤᱞ",
278
278
  "downloadAttachment": "{{fileName}} ᱰᱟᱣᱱᱞᱳᱰ",
279
- "sortByColumn": "ᱠᱚᱞᱚᱢ ᱛᱮ ᱥᱟᱡᱟᱣ"
279
+ "sortByColumn": "ᱠᱚᱞᱚᱢ ᱛᱮ ᱥᱟᱡᱟᱣ",
280
+ "manage": "Manage",
281
+ "consents": "Consents",
282
+ "consentCount_one": "{{count}} consent",
283
+ "consentCount_other": "{{count}} consents",
284
+ "purposes": "Purposes",
285
+ "latestActivity": "Latest activity",
286
+ "activeWithCount": "{{count}} active",
287
+ "withdrawnWithCount": "{{count}} withdrawn",
288
+ "expiredWithCount": "{{count}} expired",
289
+ "declinedWithCount": "{{count}} declined",
290
+ "productsAndConsentsSummary": "{{products}} products, {{consents}} consents"
280
291
  }
@@ -276,5 +276,16 @@
276
276
  "removeAttachment": "ڳنڍيل هٽايو",
277
277
  "document": "دستاويز",
278
278
  "downloadAttachment": "{{fileName}} ڊائونلوڊ ڪريو",
279
- "sortByColumn": "ڪالم موجب ترتيب ڏيو"
279
+ "sortByColumn": "ڪالم موجب ترتيب ڏيو",
280
+ "manage": "Manage",
281
+ "consents": "Consents",
282
+ "consentCount_one": "{{count}} consent",
283
+ "consentCount_other": "{{count}} consents",
284
+ "purposes": "Purposes",
285
+ "latestActivity": "Latest activity",
286
+ "activeWithCount": "{{count}} active",
287
+ "withdrawnWithCount": "{{count}} withdrawn",
288
+ "expiredWithCount": "{{count}} expired",
289
+ "declinedWithCount": "{{count}} declined",
290
+ "productsAndConsentsSummary": "{{products}} products, {{consents}} consents"
280
291
  }
@@ -276,5 +276,16 @@
276
276
  "removeAttachment": "இணைப்பை அகற்றவும்",
277
277
  "document": "ஆவணம்",
278
278
  "downloadAttachment": "{{fileName}} பதிவிறக்கவும்",
279
- "sortByColumn": "நெடுவரிசை மூலம் வரிசைப்படுத்தவும்"
279
+ "sortByColumn": "நெடுவரிசை மூலம் வரிசைப்படுத்தவும்",
280
+ "manage": "Manage",
281
+ "consents": "Consents",
282
+ "consentCount_one": "{{count}} consent",
283
+ "consentCount_other": "{{count}} consents",
284
+ "purposes": "Purposes",
285
+ "latestActivity": "Latest activity",
286
+ "activeWithCount": "{{count}} active",
287
+ "withdrawnWithCount": "{{count}} withdrawn",
288
+ "expiredWithCount": "{{count}} expired",
289
+ "declinedWithCount": "{{count}} declined",
290
+ "productsAndConsentsSummary": "{{products}} products, {{consents}} consents"
280
291
  }
@@ -276,5 +276,16 @@
276
276
  "removeAttachment": "జోడింపు తీసివేయండి",
277
277
  "document": "పత్రం",
278
278
  "downloadAttachment": "{{fileName}} డౌన్‌లోడ్ చేయండి",
279
- "sortByColumn": "కాలమ్ ద్వారా క్రమబద్ధీకరించండి"
279
+ "sortByColumn": "కాలమ్ ద్వారా క్రమబద్ధీకరించండి",
280
+ "manage": "Manage",
281
+ "consents": "Consents",
282
+ "consentCount_one": "{{count}} consent",
283
+ "consentCount_other": "{{count}} consents",
284
+ "purposes": "Purposes",
285
+ "latestActivity": "Latest activity",
286
+ "activeWithCount": "{{count}} active",
287
+ "withdrawnWithCount": "{{count}} withdrawn",
288
+ "expiredWithCount": "{{count}} expired",
289
+ "declinedWithCount": "{{count}} declined",
290
+ "productsAndConsentsSummary": "{{products}} products, {{consents}} consents"
280
291
  }
@@ -276,5 +276,16 @@
276
276
  "removeAttachment": "منسلکہ ہٹائیں",
277
277
  "document": "دستاویز",
278
278
  "downloadAttachment": "{{fileName}} ڈاؤنلوڈ کریں",
279
- "sortByColumn": "کالم کے مطابق ترتیب دیں"
279
+ "sortByColumn": "کالم کے مطابق ترتیب دیں",
280
+ "manage": "Manage",
281
+ "consents": "Consents",
282
+ "consentCount_one": "{{count}} consent",
283
+ "consentCount_other": "{{count}} consents",
284
+ "purposes": "Purposes",
285
+ "latestActivity": "Latest activity",
286
+ "activeWithCount": "{{count}} active",
287
+ "withdrawnWithCount": "{{count}} withdrawn",
288
+ "expiredWithCount": "{{count}} expired",
289
+ "declinedWithCount": "{{count}} declined",
290
+ "productsAndConsentsSummary": "{{products}} products, {{consents}} consents"
280
291
  }
@@ -0,0 +1,66 @@
1
+ import type { OrgBrandingTheme } from '../lib/types';
2
+
3
+ const OVERRIDDEN_VARS = [
4
+ '--pc-primary',
5
+ '--pc-primary-hover',
6
+ '--pc-primary-active',
7
+ '--pc-info',
8
+ '--pc-border-color-focus',
9
+ '--pc-secondary',
10
+ '--pc-secondary-hover',
11
+ '--pc-text-inverse',
12
+ '--pc-bg-shell',
13
+ '--pc-bg-primary',
14
+ '--pc-text-primary',
15
+ '--pc-text-secondary',
16
+ '--pc-border-color',
17
+ '--pc-success',
18
+ '--pc-warning',
19
+ '--pc-error',
20
+ ] as const;
21
+
22
+ function darken(hex: string, amount: number): string {
23
+ const h = hex.replace('#', '').trim();
24
+ if (h.length !== 6) return hex;
25
+ const num = parseInt(h, 16);
26
+ if (Number.isNaN(num)) return hex;
27
+ const r = Math.max(0, ((num >> 16) & 0xff) - Math.round(255 * amount));
28
+ const g = Math.max(0, ((num >> 8) & 0xff) - Math.round(255 * amount));
29
+ const b = Math.max(0, (num & 0xff) - Math.round(255 * amount));
30
+ return `#${((r << 16) | (g << 8) | b).toString(16).padStart(6, '0')}`;
31
+ }
32
+
33
+ export function applyBrandingTheme(theme: OrgBrandingTheme): void {
34
+ if (typeof document === 'undefined') return;
35
+ const root = document.documentElement;
36
+ const set = (prop: string, value: string) => root.style.setProperty(prop, value);
37
+
38
+ set('--pc-primary', theme.primary);
39
+ set('--pc-primary-hover', darken(theme.primary, 0.08));
40
+ set('--pc-primary-active', darken(theme.primary, 0.16));
41
+ set('--pc-info', theme.primary);
42
+ set('--pc-border-color-focus', theme.primary);
43
+
44
+ set('--pc-secondary', theme.secondary);
45
+ set('--pc-secondary-hover', darken(theme.secondary, 0.08));
46
+
47
+ set('--pc-text-inverse', theme.primary_contrast);
48
+
49
+ set('--pc-bg-shell', theme.surface);
50
+ set('--pc-bg-primary', theme.surface);
51
+
52
+ set('--pc-text-primary', theme.text);
53
+ set('--pc-text-secondary', theme.text_muted);
54
+
55
+ set('--pc-border-color', theme.border);
56
+
57
+ set('--pc-success', theme.success);
58
+ set('--pc-warning', theme.warning);
59
+ set('--pc-error', theme.danger);
60
+ }
61
+
62
+ export function clearBrandingTheme(): void {
63
+ if (typeof document === 'undefined') return;
64
+ const root = document.documentElement;
65
+ for (const prop of OVERRIDDEN_VARS) root.style.removeProperty(prop);
66
+ }