@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.
- package/.turbo/turbo-build.log +24 -0
- package/CHANGELOG.md +23 -0
- package/dist/privacy-center.d.mts +100 -42
- package/dist/privacy-center.d.ts +100 -42
- package/dist/privacy-center.js +4232 -2247
- package/dist/privacy-center.mjs +4266 -2284
- package/package.json +1 -1
- package/src/RedactoPrivacyCenter/PrivacyCenterLayout.tsx +6 -10
- package/src/RedactoPrivacyCenter/RedactoPrivacyCenter.tsx +18 -17
- package/src/RedactoPrivacyCenter/api/actions.ts +52 -8
- package/src/RedactoPrivacyCenter/api/client.ts +58 -15
- package/src/RedactoPrivacyCenter/api/orgBranding.ts +9 -0
- package/src/RedactoPrivacyCenter/components/ConsentManager.tsx +729 -278
- package/src/RedactoPrivacyCenter/components/ConsentManagerCells.tsx +187 -0
- package/src/RedactoPrivacyCenter/components/ConsentManagerColumns.tsx +65 -165
- package/src/RedactoPrivacyCenter/components/ConsentManagerExpandedRow.tsx +179 -0
- package/src/RedactoPrivacyCenter/components/ConsentManagerGroupedColumns.tsx +318 -0
- package/src/RedactoPrivacyCenter/components/ConsentManagerProductCards.tsx +333 -0
- package/src/RedactoPrivacyCenter/components/ConsentManagerPurposeCards.tsx +102 -0
- package/src/RedactoPrivacyCenter/components/ConsentManagerTableSkeleton.tsx +6 -2
- package/src/RedactoPrivacyCenter/components/Form.tsx +3 -3
- package/src/RedactoPrivacyCenter/components/ModifyConsentModal.tsx +9 -6
- package/src/RedactoPrivacyCenter/components/NotificationHub/NotificationBell.tsx +1 -1
- package/src/RedactoPrivacyCenter/components/PrivacyCenterLayout.tsx +101 -56
- package/src/RedactoPrivacyCenter/components/SideMenuBarPC/SideBarPC.tsx +16 -2
- package/src/RedactoPrivacyCenter/components/types.ts +2 -5
- package/src/RedactoPrivacyCenter/context/BrandingContext.tsx +44 -0
- package/src/RedactoPrivacyCenter/context/PageChromeContext.tsx +21 -1
- package/src/RedactoPrivacyCenter/lib/api.ts +70 -28
- package/src/RedactoPrivacyCenter/lib/consent-manager/utils.tsx +4 -2
- package/src/RedactoPrivacyCenter/lib/types.ts +79 -36
- package/src/RedactoPrivacyCenter/locales/as/translation.json +12 -1
- package/src/RedactoPrivacyCenter/locales/bho/translation.json +12 -1
- package/src/RedactoPrivacyCenter/locales/bn/translation.json +12 -1
- package/src/RedactoPrivacyCenter/locales/brx/translation.json +12 -1
- package/src/RedactoPrivacyCenter/locales/doi/translation.json +12 -1
- package/src/RedactoPrivacyCenter/locales/en/translation.json +16 -1
- package/src/RedactoPrivacyCenter/locales/gom/translation.json +12 -1
- package/src/RedactoPrivacyCenter/locales/gu/translation.json +12 -1
- package/src/RedactoPrivacyCenter/locales/hi/translation.json +15 -1
- package/src/RedactoPrivacyCenter/locales/kn/translation.json +12 -1
- package/src/RedactoPrivacyCenter/locales/ks/translation.json +12 -1
- package/src/RedactoPrivacyCenter/locales/mai/translation.json +12 -1
- package/src/RedactoPrivacyCenter/locales/ml/translation.json +12 -1
- package/src/RedactoPrivacyCenter/locales/mni-Mtei/translation.json +12 -1
- package/src/RedactoPrivacyCenter/locales/mr/translation.json +12 -1
- package/src/RedactoPrivacyCenter/locales/ne/translation.json +12 -1
- package/src/RedactoPrivacyCenter/locales/or/translation.json +12 -1
- package/src/RedactoPrivacyCenter/locales/pa/translation.json +12 -1
- package/src/RedactoPrivacyCenter/locales/sa/translation.json +12 -1
- package/src/RedactoPrivacyCenter/locales/sat/translation.json +12 -1
- package/src/RedactoPrivacyCenter/locales/sd/translation.json +12 -1
- package/src/RedactoPrivacyCenter/locales/ta/translation.json +12 -1
- package/src/RedactoPrivacyCenter/locales/te/translation.json +12 -1
- package/src/RedactoPrivacyCenter/locales/ur/translation.json +12 -1
- package/src/RedactoPrivacyCenter/styles/applyBrandingTheme.ts +66 -0
- package/src/RedactoPrivacyCenter/styles/injectStyles.ts +528 -114
- package/src/RedactoPrivacyCenter/styles/pcStyles.ts +3 -2
- package/src/RedactoPrivacyCenter/styles/variables.css +5 -42
- package/src/RedactoPrivacyCenter/table/AdvancedTable.tsx +36 -16
- package/src/RedactoPrivacyCenter/table/AdvancedTablePagination.tsx +4 -12
- package/src/RedactoPrivacyCenter/ui/Footer.tsx +4 -10
- package/src/RedactoPrivacyCenter/ui/PCInput.tsx +1 -1
- package/src/RedactoPrivacyCenter/ui/PCSelect.tsx +51 -5
- package/src/privacy-center.ts +7 -3
- package/src/RedactoPrivacyCenter/components/ThemeTransitionOverlay.tsx +0 -85
- package/src/RedactoPrivacyCenter/context/theme.tsx +0 -127
- package/src/RedactoPrivacyCenter/ui/ThemeToggle.tsx +0 -72
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import { useRef } from 'react';
|
|
2
|
-
import { useTranslation } from 'react-i18next';
|
|
3
|
-
import { PCActionIcon } from './index';
|
|
4
|
-
import { IoSunnyOutline, IoMoonOutline } from 'react-icons/io5';
|
|
5
|
-
import { useTheme } from '../context/theme';
|
|
6
|
-
import { PCTooltip } from './PCTooltip';
|
|
7
|
-
|
|
8
|
-
const getVar = (varName: string): string => `var(${varName})`;
|
|
9
|
-
|
|
10
|
-
type ThemeToggleProps = {
|
|
11
|
-
className?: string;
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
export default function ThemeToggle({ className }: ThemeToggleProps) {
|
|
15
|
-
const { t } = useTranslation();
|
|
16
|
-
const { theme, toggleTheme } = useTheme();
|
|
17
|
-
const buttonRef = useRef<HTMLButtonElement>(null);
|
|
18
|
-
const tooltipLabel =
|
|
19
|
-
theme === 'light' ? t('switchToDarkMode') : t('switchToLightMode');
|
|
20
|
-
|
|
21
|
-
const handleClick = () => {
|
|
22
|
-
// Capture click position for animation
|
|
23
|
-
let position: { x: number; y: number };
|
|
24
|
-
|
|
25
|
-
if (buttonRef.current) {
|
|
26
|
-
const rect = buttonRef.current.getBoundingClientRect();
|
|
27
|
-
position = {
|
|
28
|
-
x: rect.left + rect.width / 2,
|
|
29
|
-
y: rect.top + rect.height / 2
|
|
30
|
-
};
|
|
31
|
-
} else {
|
|
32
|
-
// Fallback to center
|
|
33
|
-
position = {
|
|
34
|
-
x: window.innerWidth / 2,
|
|
35
|
-
y: window.innerHeight / 2
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
// Store position globally for ThemeTransitionOverlay to access
|
|
40
|
-
if (typeof window !== 'undefined') {
|
|
41
|
-
(window as any).__pcThemeTransitionPosition = position;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
toggleTheme();
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
return (
|
|
48
|
-
<PCTooltip content={tooltipLabel} placement="bottom" color="invert">
|
|
49
|
-
<div style={{ display: 'inline-flex' }}>
|
|
50
|
-
<PCActionIcon
|
|
51
|
-
ref={buttonRef}
|
|
52
|
-
variant="default"
|
|
53
|
-
className={className}
|
|
54
|
-
onClick={handleClick}
|
|
55
|
-
aria-label={tooltipLabel}
|
|
56
|
-
style={{
|
|
57
|
-
width: '32px',
|
|
58
|
-
height: '32px',
|
|
59
|
-
color: getVar('--pc-text-primary'),
|
|
60
|
-
transition: 'color 0.3s ease, transform 0.2s ease',
|
|
61
|
-
}}
|
|
62
|
-
>
|
|
63
|
-
{theme === 'light' ? (
|
|
64
|
-
<IoMoonOutline size={18} />
|
|
65
|
-
) : (
|
|
66
|
-
<IoSunnyOutline size={18} />
|
|
67
|
-
)}
|
|
68
|
-
</PCActionIcon>
|
|
69
|
-
</div>
|
|
70
|
-
</PCTooltip>
|
|
71
|
-
);
|
|
72
|
-
}
|