@redacto.io/consent-sdk-react 3.4.0 → 3.6.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/CHANGELOG.md +12 -0
- package/LICENSE +176 -0
- package/dist/index.d.mts +51 -4
- package/dist/index.d.ts +51 -4
- package/dist/index.js +1912 -345
- package/dist/index.mjs +1911 -345
- package/dist/privacy-center.d.mts +566 -0
- package/dist/privacy-center.d.ts +566 -0
- package/dist/privacy-center.js +17174 -0
- package/dist/privacy-center.mjs +17136 -0
- package/package.json +47 -3
- package/src/RedactoNoticeConsent/RedactoNoticeConsent.test.tsx +201 -118
- package/src/RedactoNoticeConsent/RedactoNoticeConsent.tsx +1194 -93
- package/src/RedactoNoticeConsent/api/index.ts +337 -246
- package/src/RedactoNoticeConsent/api/types.ts +140 -41
- package/src/RedactoNoticeConsent/components/DigiLockerCallback.tsx +602 -0
- package/src/RedactoNoticeConsent/components/index.ts +7 -0
- package/src/RedactoNoticeConsent/injectStyles.ts +11 -0
- package/src/RedactoNoticeConsent/language-codes.ts +61 -0
- package/src/RedactoNoticeConsent/services/storage.ts +122 -0
- package/src/RedactoNoticeConsent/types.ts +2 -0
- package/src/RedactoNoticeConsentInline/api/index.ts +26 -64
- package/src/RedactoNoticeConsentInline/api/types.ts +0 -25
- package/src/RedactoPrivacyCenter/PrivacyCenterActivityPage.tsx +19 -0
- package/src/RedactoPrivacyCenter/PrivacyCenterConsentManagerPage.tsx +17 -0
- package/src/RedactoPrivacyCenter/PrivacyCenterFormPage.tsx +79 -0
- package/src/RedactoPrivacyCenter/PrivacyCenterHomePage.tsx +27 -0
- package/src/RedactoPrivacyCenter/PrivacyCenterLayout.tsx +142 -0
- package/src/RedactoPrivacyCenter/RedactoPrivacyCenter.tsx +51 -0
- package/src/RedactoPrivacyCenter/api/actions.ts +444 -0
- package/src/RedactoPrivacyCenter/api/client.ts +413 -0
- package/src/RedactoPrivacyCenter/api/config.ts +33 -0
- package/src/RedactoPrivacyCenter/api/fetcher.ts +181 -0
- package/src/RedactoPrivacyCenter/api/upload.ts +93 -0
- package/src/RedactoPrivacyCenter/assets/character.svg +31 -0
- package/src/RedactoPrivacyCenter/assets/fileAttach.svg +9 -0
- package/src/RedactoPrivacyCenter/assets/greenTick.svg +4 -0
- package/src/RedactoPrivacyCenter/assets/mail.svg +3 -0
- package/src/RedactoPrivacyCenter/assets/poweredByRedacto.svg +9 -0
- package/src/RedactoPrivacyCenter/assets/sentImg.svg +9 -0
- package/src/RedactoPrivacyCenter/assets/uploadFileIcon.svg +9 -0
- package/src/RedactoPrivacyCenter/components/ActivitiesList.tsx +272 -0
- package/src/RedactoPrivacyCenter/components/CaseDetailsModal.tsx +468 -0
- package/src/RedactoPrivacyCenter/components/CaseHistory.tsx +433 -0
- package/src/RedactoPrivacyCenter/components/ConsentManager.tsx +726 -0
- package/src/RedactoPrivacyCenter/components/ConsentManagerColumns.tsx +239 -0
- package/src/RedactoPrivacyCenter/components/ConsentManagerConstants.ts +7 -0
- package/src/RedactoPrivacyCenter/components/ConsentManagerTableSkeleton.tsx +155 -0
- package/src/RedactoPrivacyCenter/components/DataRequest/CorrectionDataSection.tsx +189 -0
- package/src/RedactoPrivacyCenter/components/DataRequest/GrievanceDataSection.tsx +118 -0
- package/src/RedactoPrivacyCenter/components/DataRequest/NominationDataSection.tsx +66 -0
- package/src/RedactoPrivacyCenter/components/DataRequest/PurposeSelectionSection.tsx +305 -0
- package/src/RedactoPrivacyCenter/components/Form.tsx +1455 -0
- package/src/RedactoPrivacyCenter/components/GrievanceTable.tsx +176 -0
- package/src/RedactoPrivacyCenter/components/GrievanceTablePagination.tsx +330 -0
- package/src/RedactoPrivacyCenter/components/ModifyConsentModal.tsx +329 -0
- package/src/RedactoPrivacyCenter/components/Pagination.tsx +140 -0
- package/src/RedactoPrivacyCenter/components/PrivacyCenterLayout.tsx +302 -0
- package/src/RedactoPrivacyCenter/components/RequestSubmit.tsx +218 -0
- package/src/RedactoPrivacyCenter/components/SideMenuBarPC/SideBarPC.tsx +475 -0
- package/src/RedactoPrivacyCenter/components/SideMenuBarPC/SideMenuPC.tsx +412 -0
- package/src/RedactoPrivacyCenter/components/SideMenuBarPC/constants.tsx +42 -0
- package/src/RedactoPrivacyCenter/components/SideMenuBarPC/menuItemsPC.tsx +1 -0
- package/src/RedactoPrivacyCenter/components/SideMenuBarPC/types.ts +40 -0
- package/src/RedactoPrivacyCenter/components/SideMenuBarPC/utils.ts +38 -0
- package/src/RedactoPrivacyCenter/components/ThemeTransitionOverlay.tsx +85 -0
- package/src/RedactoPrivacyCenter/components/activitiesColumns.tsx +141 -0
- package/src/RedactoPrivacyCenter/components/caseHistoryColumns.tsx +179 -0
- package/src/RedactoPrivacyCenter/components/constant.ts +20 -0
- package/src/RedactoPrivacyCenter/components/types.ts +68 -0
- package/src/RedactoPrivacyCenter/components/utils.tsx +10 -0
- package/src/RedactoPrivacyCenter/config/routes.ts +9 -0
- package/src/RedactoPrivacyCenter/config/table.ts +25 -0
- package/src/RedactoPrivacyCenter/context/AuthContext.tsx +123 -0
- package/src/RedactoPrivacyCenter/context/BaseUrlContext.tsx +44 -0
- package/src/RedactoPrivacyCenter/context/LocaleContext.tsx +11 -0
- package/src/RedactoPrivacyCenter/context/NavigationContext.tsx +64 -0
- package/src/RedactoPrivacyCenter/context/OrganizationContext.tsx +30 -0
- package/src/RedactoPrivacyCenter/context/PageChromeContext.tsx +60 -0
- package/src/RedactoPrivacyCenter/context/theme.tsx +127 -0
- package/src/RedactoPrivacyCenter/lib/api.ts +468 -0
- package/src/RedactoPrivacyCenter/lib/consent-manager/utils.tsx +63 -0
- package/src/RedactoPrivacyCenter/lib/constants.ts +116 -0
- package/src/RedactoPrivacyCenter/lib/i18n.ts +81 -0
- package/src/RedactoPrivacyCenter/lib/locales.ts +105 -0
- package/src/RedactoPrivacyCenter/lib/queries.ts +30 -0
- package/src/RedactoPrivacyCenter/lib/types.ts +346 -0
- package/src/RedactoPrivacyCenter/lib/useCurrentLanguage.ts +37 -0
- package/src/RedactoPrivacyCenter/lib/utils.ts +625 -0
- package/src/RedactoPrivacyCenter/locales/as/translation.json +188 -0
- package/src/RedactoPrivacyCenter/locales/bho/translation.json +188 -0
- package/src/RedactoPrivacyCenter/locales/bn/translation.json +188 -0
- package/src/RedactoPrivacyCenter/locales/brx/translation.json +188 -0
- package/src/RedactoPrivacyCenter/locales/doi/translation.json +188 -0
- package/src/RedactoPrivacyCenter/locales/en/translation.json +188 -0
- package/src/RedactoPrivacyCenter/locales/gom/translation.json +188 -0
- package/src/RedactoPrivacyCenter/locales/gu/translation.json +188 -0
- package/src/RedactoPrivacyCenter/locales/hi/translation.json +188 -0
- package/src/RedactoPrivacyCenter/locales/kn/translation.json +188 -0
- package/src/RedactoPrivacyCenter/locales/ks/translation.json +188 -0
- package/src/RedactoPrivacyCenter/locales/mai/translation.json +188 -0
- package/src/RedactoPrivacyCenter/locales/ml/translation.json +188 -0
- package/src/RedactoPrivacyCenter/locales/mni-Mtei/translation.json +188 -0
- package/src/RedactoPrivacyCenter/locales/mr/translation.json +188 -0
- package/src/RedactoPrivacyCenter/locales/ne/translation.json +188 -0
- package/src/RedactoPrivacyCenter/locales/or/translation.json +188 -0
- package/src/RedactoPrivacyCenter/locales/pa/translation.json +188 -0
- package/src/RedactoPrivacyCenter/locales/sa/translation.json +188 -0
- package/src/RedactoPrivacyCenter/locales/sat/translation.json +188 -0
- package/src/RedactoPrivacyCenter/locales/sd/translation.json +188 -0
- package/src/RedactoPrivacyCenter/locales/ta/translation.json +188 -0
- package/src/RedactoPrivacyCenter/locales/te/translation.json +188 -0
- package/src/RedactoPrivacyCenter/locales/ur/translation.json +188 -0
- package/src/RedactoPrivacyCenter/styles/base.css +117 -0
- package/src/RedactoPrivacyCenter/styles/injectStyles.ts +1000 -0
- package/src/RedactoPrivacyCenter/styles/pcStyles.ts +819 -0
- package/src/RedactoPrivacyCenter/styles/responsive.ts +138 -0
- package/src/RedactoPrivacyCenter/styles/variables.css +133 -0
- package/src/RedactoPrivacyCenter/table/AdvancedTable.tsx +365 -0
- package/src/RedactoPrivacyCenter/table/AdvancedTablePagination.tsx +479 -0
- package/src/RedactoPrivacyCenter/table/index.ts +2 -0
- package/src/RedactoPrivacyCenter/types/images.d.ts +29 -0
- package/src/RedactoPrivacyCenter/ui/Footer.tsx +73 -0
- package/src/RedactoPrivacyCenter/ui/FormBlockWrapper.tsx +54 -0
- package/src/RedactoPrivacyCenter/ui/PCAccordion.tsx +87 -0
- package/src/RedactoPrivacyCenter/ui/PCActionIcon.tsx +47 -0
- package/src/RedactoPrivacyCenter/ui/PCAvatar.tsx +69 -0
- package/src/RedactoPrivacyCenter/ui/PCBadge.tsx +48 -0
- package/src/RedactoPrivacyCenter/ui/PCButton.tsx +77 -0
- package/src/RedactoPrivacyCenter/ui/PCCheckbox.tsx +55 -0
- package/src/RedactoPrivacyCenter/ui/PCCollapse.tsx +97 -0
- package/src/RedactoPrivacyCenter/ui/PCEmpty.tsx +35 -0
- package/src/RedactoPrivacyCenter/ui/PCInput.tsx +128 -0
- package/src/RedactoPrivacyCenter/ui/PCLoader.tsx +30 -0
- package/src/RedactoPrivacyCenter/ui/PCModal.tsx +104 -0
- package/src/RedactoPrivacyCenter/ui/PCPopover.tsx +175 -0
- package/src/RedactoPrivacyCenter/ui/PCSelect.tsx +381 -0
- package/src/RedactoPrivacyCenter/ui/PCTable.tsx +137 -0
- package/src/RedactoPrivacyCenter/ui/PCText.tsx +39 -0
- package/src/RedactoPrivacyCenter/ui/PCTextarea.tsx +43 -0
- package/src/RedactoPrivacyCenter/ui/PCTitle.tsx +37 -0
- package/src/RedactoPrivacyCenter/ui/PCTooltip.tsx +119 -0
- package/src/RedactoPrivacyCenter/ui/SimpleBar.tsx +25 -0
- package/src/RedactoPrivacyCenter/ui/StatusBadge.tsx +55 -0
- package/src/RedactoPrivacyCenter/ui/ThemeToggle.tsx +70 -0
- package/src/RedactoPrivacyCenter/ui/index.ts +18 -0
- package/src/RedactoPrivacyCenter/utils/cn.ts +28 -0
- package/src/RedactoPrivacyCenter/utils/date.ts +48 -0
- package/src/RedactoPrivacyCenter/utils/status.ts +111 -0
- package/src/RedactoPrivacyCenter/utils/toast.ts +130 -0
- package/src/index.ts +10 -0
- package/src/privacy-center.ts +107 -0
- package/tsconfig.json +2 -0
- package/tsup.config.ts +16 -1
- package/src/utils/isLegacyApi.ts +0 -12
|
@@ -0,0 +1,479 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useTranslation } from 'react-i18next';
|
|
3
|
+
import { type Table as ReactTableType } from '@tanstack/react-table';
|
|
4
|
+
import {
|
|
5
|
+
PiCaretDoubleLeftBold,
|
|
6
|
+
PiCaretDoubleRightBold,
|
|
7
|
+
PiCaretLeftBold,
|
|
8
|
+
PiCaretRightBold,
|
|
9
|
+
} from 'react-icons/pi';
|
|
10
|
+
import { PCActionIcon, PCSelect, PCText, type SelectOption } from '../ui';
|
|
11
|
+
import { pcStyles } from '../styles/pcStyles';
|
|
12
|
+
|
|
13
|
+
const getVar = (varName: string): string => `var(${varName})`;
|
|
14
|
+
|
|
15
|
+
const pageSizeOptions = [
|
|
16
|
+
{ value: 5, label: '5' },
|
|
17
|
+
{ value: 10, label: '10' },
|
|
18
|
+
{ value: 15, label: '15' },
|
|
19
|
+
{ value: 20, label: '20' },
|
|
20
|
+
{ value: 25, label: '25' },
|
|
21
|
+
];
|
|
22
|
+
|
|
23
|
+
export type AdvancedTablePaginationProps<TData extends Record<string, any>> = {
|
|
24
|
+
table: ReactTableType<TData>;
|
|
25
|
+
showPageSize?: boolean;
|
|
26
|
+
showSelectedCount?: boolean;
|
|
27
|
+
className?: string;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export default function AdvancedTablePagination<
|
|
31
|
+
TData extends Record<string, any>,
|
|
32
|
+
>({
|
|
33
|
+
table,
|
|
34
|
+
showPageSize = true,
|
|
35
|
+
showSelectedCount = false,
|
|
36
|
+
className,
|
|
37
|
+
}: AdvancedTablePaginationProps<TData>) {
|
|
38
|
+
const { t } = useTranslation();
|
|
39
|
+
const currentPageSize = table.getState().pagination.pageSize;
|
|
40
|
+
const currentPageSizeOption = pageSizeOptions.find(opt => opt.value === currentPageSize) || pageSizeOptions[1];
|
|
41
|
+
|
|
42
|
+
const currentPage = table.getState().pagination.pageIndex + 1;
|
|
43
|
+
const totalPages = table.getPageCount();
|
|
44
|
+
const totalRows = table.getFilteredRowModel().rows.length;
|
|
45
|
+
const pageStart = totalRows === 0 ? 0 : (currentPage - 1) * currentPageSize + 1;
|
|
46
|
+
const pageEnd = Math.min(currentPage * currentPageSize, totalRows);
|
|
47
|
+
|
|
48
|
+
// Preserve pagination visibility even when rows are temporarily empty during loading
|
|
49
|
+
const shouldShowPagination = totalPages > 0 || totalRows > 0;
|
|
50
|
+
|
|
51
|
+
// Don't render if there's truly no data and no pages
|
|
52
|
+
if (!shouldShowPagination && totalRows === 0 && totalPages === 0) {
|
|
53
|
+
return null;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
return (
|
|
57
|
+
<div
|
|
58
|
+
className={className}
|
|
59
|
+
style={{
|
|
60
|
+
...pcStyles.flex,
|
|
61
|
+
...pcStyles.flexCol,
|
|
62
|
+
...pcStyles.itemsCenter,
|
|
63
|
+
width: '100%',
|
|
64
|
+
paddingTop: getVar('--pc-spacing-sm'),
|
|
65
|
+
paddingBottom: getVar('--pc-spacing-sm'),
|
|
66
|
+
gap: getVar('--pc-spacing-sm'),
|
|
67
|
+
minHeight: '52px',
|
|
68
|
+
opacity: shouldShowPagination ? 1 : 0.5,
|
|
69
|
+
pointerEvents: shouldShowPagination ? 'auto' : 'none',
|
|
70
|
+
}}
|
|
71
|
+
>
|
|
72
|
+
{/* Mobile Layout: Stacked (screens < 640px) */}
|
|
73
|
+
<div style={{
|
|
74
|
+
...pcStyles.flex,
|
|
75
|
+
...pcStyles.flexCol,
|
|
76
|
+
...pcStyles.itemsCenter,
|
|
77
|
+
...pcStyles.gapSm,
|
|
78
|
+
width: '100%',
|
|
79
|
+
}} className="pc-block-xs pc-hidden-sm">
|
|
80
|
+
{showPageSize && (
|
|
81
|
+
<div style={{
|
|
82
|
+
...pcStyles.flex,
|
|
83
|
+
...pcStyles.itemsCenter,
|
|
84
|
+
...pcStyles.gapSm,
|
|
85
|
+
width: '100%',
|
|
86
|
+
...pcStyles.justifyCenter,
|
|
87
|
+
}}>
|
|
88
|
+
<PCText
|
|
89
|
+
size="sm"
|
|
90
|
+
color="secondary"
|
|
91
|
+
style={{
|
|
92
|
+
whiteSpace: 'nowrap',
|
|
93
|
+
flexShrink: 0,
|
|
94
|
+
}}
|
|
95
|
+
>
|
|
96
|
+
{t('rowsPerPage')}
|
|
97
|
+
</PCText>
|
|
98
|
+
<PCSelect
|
|
99
|
+
size="sm"
|
|
100
|
+
options={pageSizeOptions}
|
|
101
|
+
value={currentPageSizeOption}
|
|
102
|
+
onChange={(v) => {
|
|
103
|
+
if (v) {
|
|
104
|
+
table.setPageSize(Number(v.value));
|
|
105
|
+
}
|
|
106
|
+
}}
|
|
107
|
+
style={{
|
|
108
|
+
width: '56px',
|
|
109
|
+
minWidth: '56px',
|
|
110
|
+
flexShrink: 0,
|
|
111
|
+
}}
|
|
112
|
+
/>
|
|
113
|
+
</div>
|
|
114
|
+
)}
|
|
115
|
+
|
|
116
|
+
<div style={{
|
|
117
|
+
...pcStyles.flex,
|
|
118
|
+
...pcStyles.itemsCenter,
|
|
119
|
+
...pcStyles.gapSm,
|
|
120
|
+
flexWrap: 'wrap',
|
|
121
|
+
...pcStyles.justifyCenter,
|
|
122
|
+
}}>
|
|
123
|
+
{totalPages > 0 && (
|
|
124
|
+
<div style={{
|
|
125
|
+
...pcStyles.flex,
|
|
126
|
+
...pcStyles.itemsCenter,
|
|
127
|
+
...pcStyles.gapXs,
|
|
128
|
+
marginRight: getVar('--pc-spacing-xs'),
|
|
129
|
+
flexShrink: 0,
|
|
130
|
+
}}>
|
|
131
|
+
<PCText
|
|
132
|
+
size="sm"
|
|
133
|
+
color="secondary"
|
|
134
|
+
style={{ whiteSpace: 'nowrap' }}
|
|
135
|
+
>
|
|
136
|
+
{t('pageOf', { current: currentPage, total: totalPages })}
|
|
137
|
+
</PCText>
|
|
138
|
+
</div>
|
|
139
|
+
)}
|
|
140
|
+
<div style={{
|
|
141
|
+
display: 'grid',
|
|
142
|
+
gridTemplateColumns: 'repeat(4, 1fr)',
|
|
143
|
+
gap: '0.25rem',
|
|
144
|
+
flexShrink: 0,
|
|
145
|
+
}}>
|
|
146
|
+
<PCActionIcon
|
|
147
|
+
size="sm"
|
|
148
|
+
variant="outline"
|
|
149
|
+
aria-label="Go to first page"
|
|
150
|
+
onClick={() => table.firstPage()}
|
|
151
|
+
disabled={!table.getCanPreviousPage()}
|
|
152
|
+
style={{
|
|
153
|
+
borderRadius: '0.5rem',
|
|
154
|
+
boxShadow: getVar('--pc-shadow-sm'),
|
|
155
|
+
borderColor: getVar('--pc-border-color'),
|
|
156
|
+
color: getVar('--pc-text-primary'),
|
|
157
|
+
backgroundColor: getVar('--pc-bg-primary'),
|
|
158
|
+
transition: 'all 0.2s ease',
|
|
159
|
+
}}
|
|
160
|
+
onMouseEnter={(e) => {
|
|
161
|
+
if (!table.getCanPreviousPage()) return;
|
|
162
|
+
e.currentTarget.style.backgroundColor = getVar('--pc-bg-hover');
|
|
163
|
+
e.currentTarget.style.borderColor = getVar('--pc-primary');
|
|
164
|
+
e.currentTarget.style.color = getVar('--pc-primary');
|
|
165
|
+
}}
|
|
166
|
+
onMouseLeave={(e) => {
|
|
167
|
+
e.currentTarget.style.backgroundColor = getVar('--pc-bg-primary');
|
|
168
|
+
e.currentTarget.style.borderColor = getVar('--pc-border-color');
|
|
169
|
+
e.currentTarget.style.color = getVar('--pc-text-primary');
|
|
170
|
+
}}
|
|
171
|
+
>
|
|
172
|
+
<PiCaretDoubleLeftBold size={14} />
|
|
173
|
+
</PCActionIcon>
|
|
174
|
+
<PCActionIcon
|
|
175
|
+
size="sm"
|
|
176
|
+
variant="outline"
|
|
177
|
+
aria-label="Go to previous page"
|
|
178
|
+
onClick={() => table.previousPage()}
|
|
179
|
+
disabled={!table.getCanPreviousPage()}
|
|
180
|
+
style={{
|
|
181
|
+
borderRadius: '0.5rem',
|
|
182
|
+
boxShadow: getVar('--pc-shadow-sm'),
|
|
183
|
+
borderColor: getVar('--pc-border-color'),
|
|
184
|
+
color: getVar('--pc-text-primary'),
|
|
185
|
+
backgroundColor: getVar('--pc-bg-primary'),
|
|
186
|
+
transition: 'all 0.2s ease',
|
|
187
|
+
}}
|
|
188
|
+
onMouseEnter={(e) => {
|
|
189
|
+
if (!table.getCanPreviousPage()) return;
|
|
190
|
+
e.currentTarget.style.backgroundColor = getVar('--pc-bg-hover');
|
|
191
|
+
e.currentTarget.style.borderColor = getVar('--pc-primary');
|
|
192
|
+
e.currentTarget.style.color = getVar('--pc-primary');
|
|
193
|
+
}}
|
|
194
|
+
onMouseLeave={(e) => {
|
|
195
|
+
e.currentTarget.style.backgroundColor = getVar('--pc-bg-primary');
|
|
196
|
+
e.currentTarget.style.borderColor = getVar('--pc-border-color');
|
|
197
|
+
e.currentTarget.style.color = getVar('--pc-text-primary');
|
|
198
|
+
}}
|
|
199
|
+
>
|
|
200
|
+
<PiCaretLeftBold size={14} />
|
|
201
|
+
</PCActionIcon>
|
|
202
|
+
<PCActionIcon
|
|
203
|
+
size="sm"
|
|
204
|
+
variant="outline"
|
|
205
|
+
aria-label="Go to next page"
|
|
206
|
+
onClick={() => table.nextPage()}
|
|
207
|
+
disabled={!table.getCanNextPage()}
|
|
208
|
+
style={{
|
|
209
|
+
borderRadius: '0.5rem',
|
|
210
|
+
boxShadow: getVar('--pc-shadow-sm'),
|
|
211
|
+
borderColor: getVar('--pc-border-color'),
|
|
212
|
+
color: getVar('--pc-text-primary'),
|
|
213
|
+
backgroundColor: getVar('--pc-bg-primary'),
|
|
214
|
+
transition: 'all 0.2s ease',
|
|
215
|
+
}}
|
|
216
|
+
onMouseEnter={(e) => {
|
|
217
|
+
if (!table.getCanNextPage()) return;
|
|
218
|
+
e.currentTarget.style.backgroundColor = getVar('--pc-bg-hover');
|
|
219
|
+
e.currentTarget.style.borderColor = getVar('--pc-primary');
|
|
220
|
+
e.currentTarget.style.color = getVar('--pc-primary');
|
|
221
|
+
}}
|
|
222
|
+
onMouseLeave={(e) => {
|
|
223
|
+
e.currentTarget.style.backgroundColor = getVar('--pc-bg-primary');
|
|
224
|
+
e.currentTarget.style.borderColor = getVar('--pc-border-color');
|
|
225
|
+
e.currentTarget.style.color = getVar('--pc-text-primary');
|
|
226
|
+
}}
|
|
227
|
+
>
|
|
228
|
+
<PiCaretRightBold size={14} />
|
|
229
|
+
</PCActionIcon>
|
|
230
|
+
<PCActionIcon
|
|
231
|
+
size="sm"
|
|
232
|
+
variant="outline"
|
|
233
|
+
aria-label="Go to last page"
|
|
234
|
+
onClick={() => table.lastPage()}
|
|
235
|
+
disabled={!table.getCanNextPage()}
|
|
236
|
+
style={{
|
|
237
|
+
borderRadius: '0.5rem',
|
|
238
|
+
boxShadow: getVar('--pc-shadow-sm'),
|
|
239
|
+
borderColor: getVar('--pc-border-color'),
|
|
240
|
+
color: getVar('--pc-text-primary'),
|
|
241
|
+
backgroundColor: getVar('--pc-bg-primary'),
|
|
242
|
+
transition: 'all 0.2s ease',
|
|
243
|
+
}}
|
|
244
|
+
onMouseEnter={(e) => {
|
|
245
|
+
if (!table.getCanNextPage()) return;
|
|
246
|
+
e.currentTarget.style.backgroundColor = getVar('--pc-bg-hover');
|
|
247
|
+
e.currentTarget.style.borderColor = getVar('--pc-primary');
|
|
248
|
+
e.currentTarget.style.color = getVar('--pc-primary');
|
|
249
|
+
}}
|
|
250
|
+
onMouseLeave={(e) => {
|
|
251
|
+
e.currentTarget.style.backgroundColor = getVar('--pc-bg-primary');
|
|
252
|
+
e.currentTarget.style.borderColor = getVar('--pc-border-color');
|
|
253
|
+
e.currentTarget.style.color = getVar('--pc-text-primary');
|
|
254
|
+
}}
|
|
255
|
+
>
|
|
256
|
+
<PiCaretDoubleRightBold size={14} />
|
|
257
|
+
</PCActionIcon>
|
|
258
|
+
</div>
|
|
259
|
+
</div>
|
|
260
|
+
</div>
|
|
261
|
+
|
|
262
|
+
{/* Desktop/Tablet Layout: Horizontal (screens >= 640px) */}
|
|
263
|
+
<div style={{
|
|
264
|
+
...pcStyles.flex,
|
|
265
|
+
...pcStyles.itemsCenter,
|
|
266
|
+
...pcStyles.justifyBetween,
|
|
267
|
+
width: '100%',
|
|
268
|
+
flexWrap: 'wrap',
|
|
269
|
+
gap: getVar('--pc-spacing-sm'),
|
|
270
|
+
}} className="pc-hidden-xs pc-flex-sm">
|
|
271
|
+
{/* Left Group: Rows per page */}
|
|
272
|
+
<div style={{
|
|
273
|
+
...pcStyles.flex,
|
|
274
|
+
...pcStyles.itemsCenter,
|
|
275
|
+
...pcStyles.gapSm,
|
|
276
|
+
flexShrink: 0,
|
|
277
|
+
flexWrap: 'wrap',
|
|
278
|
+
}}>
|
|
279
|
+
{showPageSize && (
|
|
280
|
+
<div style={{
|
|
281
|
+
...pcStyles.flex,
|
|
282
|
+
...pcStyles.itemsCenter,
|
|
283
|
+
...pcStyles.gapSm,
|
|
284
|
+
flexShrink: 0,
|
|
285
|
+
}}>
|
|
286
|
+
<PCText
|
|
287
|
+
size="sm"
|
|
288
|
+
color="secondary"
|
|
289
|
+
style={{
|
|
290
|
+
whiteSpace: 'nowrap',
|
|
291
|
+
flexShrink: 0,
|
|
292
|
+
}}
|
|
293
|
+
>
|
|
294
|
+
{t('rowsPerPage')}
|
|
295
|
+
</PCText>
|
|
296
|
+
<PCSelect
|
|
297
|
+
size="sm"
|
|
298
|
+
options={pageSizeOptions}
|
|
299
|
+
value={currentPageSizeOption}
|
|
300
|
+
onChange={(v) => {
|
|
301
|
+
if (v) {
|
|
302
|
+
table.setPageSize(Number(v.value));
|
|
303
|
+
}
|
|
304
|
+
}}
|
|
305
|
+
style={{
|
|
306
|
+
width: '56px',
|
|
307
|
+
minWidth: '56px',
|
|
308
|
+
flexShrink: 0,
|
|
309
|
+
}}
|
|
310
|
+
/>
|
|
311
|
+
</div>
|
|
312
|
+
)}
|
|
313
|
+
|
|
314
|
+
{showSelectedCount && (
|
|
315
|
+
<PCText
|
|
316
|
+
size="sm"
|
|
317
|
+
color="secondary"
|
|
318
|
+
style={{
|
|
319
|
+
whiteSpace: 'nowrap',
|
|
320
|
+
flexShrink: 0,
|
|
321
|
+
}}
|
|
322
|
+
>
|
|
323
|
+
{t('rowsSelected', {
|
|
324
|
+
count: table.getFilteredSelectedRowModel().rows.length,
|
|
325
|
+
total: table.getFilteredRowModel().rows.length,
|
|
326
|
+
})}
|
|
327
|
+
</PCText>
|
|
328
|
+
)}
|
|
329
|
+
</div>
|
|
330
|
+
|
|
331
|
+
{/* Right Group: Page info + Navigation */}
|
|
332
|
+
<div style={{
|
|
333
|
+
...pcStyles.flex,
|
|
334
|
+
...pcStyles.itemsCenter,
|
|
335
|
+
...pcStyles.gapSm,
|
|
336
|
+
flexShrink: 0,
|
|
337
|
+
flexWrap: 'wrap',
|
|
338
|
+
}}>
|
|
339
|
+
{totalPages > 0 && (
|
|
340
|
+
<div style={{
|
|
341
|
+
...pcStyles.flex,
|
|
342
|
+
...pcStyles.itemsCenter,
|
|
343
|
+
...pcStyles.gapXs,
|
|
344
|
+
marginRight: getVar('--pc-spacing-xs'),
|
|
345
|
+
flexShrink: 0,
|
|
346
|
+
}}>
|
|
347
|
+
<PCText
|
|
348
|
+
size="sm"
|
|
349
|
+
color="secondary"
|
|
350
|
+
style={{ whiteSpace: 'nowrap' }}
|
|
351
|
+
>
|
|
352
|
+
{t('pageOf', { current: currentPage, total: totalPages })}
|
|
353
|
+
</PCText>
|
|
354
|
+
</div>
|
|
355
|
+
)}
|
|
356
|
+
<div style={{
|
|
357
|
+
display: 'grid',
|
|
358
|
+
gridTemplateColumns: 'repeat(4, 1fr)',
|
|
359
|
+
gap: '0.25rem',
|
|
360
|
+
flexShrink: 0,
|
|
361
|
+
}}>
|
|
362
|
+
<PCActionIcon
|
|
363
|
+
size="sm"
|
|
364
|
+
variant="outline"
|
|
365
|
+
aria-label="Go to first page"
|
|
366
|
+
onClick={() => table.firstPage()}
|
|
367
|
+
disabled={!table.getCanPreviousPage()}
|
|
368
|
+
style={{
|
|
369
|
+
borderRadius: '0.5rem',
|
|
370
|
+
boxShadow: getVar('--pc-shadow-sm'),
|
|
371
|
+
borderColor: getVar('--pc-border-color'),
|
|
372
|
+
color: getVar('--pc-text-primary'),
|
|
373
|
+
backgroundColor: getVar('--pc-bg-primary'),
|
|
374
|
+
transition: 'all 0.2s ease',
|
|
375
|
+
}}
|
|
376
|
+
onMouseEnter={(e) => {
|
|
377
|
+
if (!table.getCanPreviousPage()) return;
|
|
378
|
+
e.currentTarget.style.backgroundColor = getVar('--pc-bg-hover');
|
|
379
|
+
e.currentTarget.style.borderColor = getVar('--pc-primary');
|
|
380
|
+
e.currentTarget.style.color = getVar('--pc-primary');
|
|
381
|
+
}}
|
|
382
|
+
onMouseLeave={(e) => {
|
|
383
|
+
e.currentTarget.style.backgroundColor = getVar('--pc-bg-primary');
|
|
384
|
+
e.currentTarget.style.borderColor = getVar('--pc-border-color');
|
|
385
|
+
e.currentTarget.style.color = getVar('--pc-text-primary');
|
|
386
|
+
}}
|
|
387
|
+
>
|
|
388
|
+
<PiCaretDoubleLeftBold size={14} />
|
|
389
|
+
</PCActionIcon>
|
|
390
|
+
<PCActionIcon
|
|
391
|
+
size="sm"
|
|
392
|
+
variant="outline"
|
|
393
|
+
aria-label="Go to previous page"
|
|
394
|
+
onClick={() => table.previousPage()}
|
|
395
|
+
disabled={!table.getCanPreviousPage()}
|
|
396
|
+
style={{
|
|
397
|
+
borderRadius: '0.5rem',
|
|
398
|
+
boxShadow: getVar('--pc-shadow-sm'),
|
|
399
|
+
borderColor: getVar('--pc-border-color'),
|
|
400
|
+
color: getVar('--pc-text-primary'),
|
|
401
|
+
backgroundColor: getVar('--pc-bg-primary'),
|
|
402
|
+
transition: 'all 0.2s ease',
|
|
403
|
+
}}
|
|
404
|
+
onMouseEnter={(e) => {
|
|
405
|
+
if (!table.getCanPreviousPage()) return;
|
|
406
|
+
e.currentTarget.style.backgroundColor = getVar('--pc-bg-hover');
|
|
407
|
+
e.currentTarget.style.borderColor = getVar('--pc-primary');
|
|
408
|
+
e.currentTarget.style.color = getVar('--pc-primary');
|
|
409
|
+
}}
|
|
410
|
+
onMouseLeave={(e) => {
|
|
411
|
+
e.currentTarget.style.backgroundColor = getVar('--pc-bg-primary');
|
|
412
|
+
e.currentTarget.style.borderColor = getVar('--pc-border-color');
|
|
413
|
+
e.currentTarget.style.color = getVar('--pc-text-primary');
|
|
414
|
+
}}
|
|
415
|
+
>
|
|
416
|
+
<PiCaretLeftBold size={14} />
|
|
417
|
+
</PCActionIcon>
|
|
418
|
+
<PCActionIcon
|
|
419
|
+
size="sm"
|
|
420
|
+
variant="outline"
|
|
421
|
+
aria-label="Go to next page"
|
|
422
|
+
onClick={() => table.nextPage()}
|
|
423
|
+
disabled={!table.getCanNextPage()}
|
|
424
|
+
style={{
|
|
425
|
+
borderRadius: '0.5rem',
|
|
426
|
+
boxShadow: getVar('--pc-shadow-sm'),
|
|
427
|
+
borderColor: getVar('--pc-border-color'),
|
|
428
|
+
color: getVar('--pc-text-primary'),
|
|
429
|
+
backgroundColor: getVar('--pc-bg-primary'),
|
|
430
|
+
transition: 'all 0.2s ease',
|
|
431
|
+
}}
|
|
432
|
+
onMouseEnter={(e) => {
|
|
433
|
+
if (!table.getCanNextPage()) return;
|
|
434
|
+
e.currentTarget.style.backgroundColor = getVar('--pc-bg-hover');
|
|
435
|
+
e.currentTarget.style.borderColor = getVar('--pc-primary');
|
|
436
|
+
e.currentTarget.style.color = getVar('--pc-primary');
|
|
437
|
+
}}
|
|
438
|
+
onMouseLeave={(e) => {
|
|
439
|
+
e.currentTarget.style.backgroundColor = getVar('--pc-bg-primary');
|
|
440
|
+
e.currentTarget.style.borderColor = getVar('--pc-border-color');
|
|
441
|
+
e.currentTarget.style.color = getVar('--pc-text-primary');
|
|
442
|
+
}}
|
|
443
|
+
>
|
|
444
|
+
<PiCaretRightBold size={14} />
|
|
445
|
+
</PCActionIcon>
|
|
446
|
+
<PCActionIcon
|
|
447
|
+
size="sm"
|
|
448
|
+
variant="outline"
|
|
449
|
+
aria-label="Go to last page"
|
|
450
|
+
onClick={() => table.lastPage()}
|
|
451
|
+
disabled={!table.getCanNextPage()}
|
|
452
|
+
style={{
|
|
453
|
+
borderRadius: '0.5rem',
|
|
454
|
+
boxShadow: getVar('--pc-shadow-sm'),
|
|
455
|
+
borderColor: getVar('--pc-border-color'),
|
|
456
|
+
color: getVar('--pc-text-primary'),
|
|
457
|
+
backgroundColor: getVar('--pc-bg-primary'),
|
|
458
|
+
transition: 'all 0.2s ease',
|
|
459
|
+
}}
|
|
460
|
+
onMouseEnter={(e) => {
|
|
461
|
+
if (!table.getCanNextPage()) return;
|
|
462
|
+
e.currentTarget.style.backgroundColor = getVar('--pc-bg-hover');
|
|
463
|
+
e.currentTarget.style.borderColor = getVar('--pc-primary');
|
|
464
|
+
e.currentTarget.style.color = getVar('--pc-primary');
|
|
465
|
+
}}
|
|
466
|
+
onMouseLeave={(e) => {
|
|
467
|
+
e.currentTarget.style.backgroundColor = getVar('--pc-bg-primary');
|
|
468
|
+
e.currentTarget.style.borderColor = getVar('--pc-border-color');
|
|
469
|
+
e.currentTarget.style.color = getVar('--pc-text-primary');
|
|
470
|
+
}}
|
|
471
|
+
>
|
|
472
|
+
<PiCaretDoubleRightBold size={14} />
|
|
473
|
+
</PCActionIcon>
|
|
474
|
+
</div>
|
|
475
|
+
</div>
|
|
476
|
+
</div>
|
|
477
|
+
</div>
|
|
478
|
+
);
|
|
479
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
declare module "*.svg" {
|
|
2
|
+
const content: string;
|
|
3
|
+
export default content;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
declare module "*.png" {
|
|
7
|
+
const content: string;
|
|
8
|
+
export default content;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
declare module "*.jpg" {
|
|
12
|
+
const content: string;
|
|
13
|
+
export default content;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
declare module "*.jpeg" {
|
|
17
|
+
const content: string;
|
|
18
|
+
export default content;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
declare module "*.gif" {
|
|
22
|
+
const content: string;
|
|
23
|
+
export default content;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
declare module "*.webp" {
|
|
27
|
+
const content: string;
|
|
28
|
+
export default content;
|
|
29
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { pcStyles } from '../styles/pcStyles';
|
|
2
|
+
import PoweredByRedacto from '../assets/poweredByRedacto.svg';
|
|
3
|
+
import { useTheme } from '../context/theme';
|
|
4
|
+
|
|
5
|
+
const getVar = (varName: string): string => `var(${varName})`;
|
|
6
|
+
|
|
7
|
+
export default function Footer() {
|
|
8
|
+
const { theme } = useTheme();
|
|
9
|
+
|
|
10
|
+
return (
|
|
11
|
+
<footer
|
|
12
|
+
style={{
|
|
13
|
+
...pcStyles.flex,
|
|
14
|
+
...pcStyles.justifyCenter,
|
|
15
|
+
width: '100%',
|
|
16
|
+
paddingTop: '0.25rem',
|
|
17
|
+
paddingBottom: '0.25rem',
|
|
18
|
+
}}
|
|
19
|
+
>
|
|
20
|
+
<div
|
|
21
|
+
style={{
|
|
22
|
+
...pcStyles.flex,
|
|
23
|
+
...pcStyles.flexCol,
|
|
24
|
+
...pcStyles.itemsCenter,
|
|
25
|
+
...pcStyles.justifyCenter,
|
|
26
|
+
...pcStyles.gapSm,
|
|
27
|
+
...pcStyles.textCenter,
|
|
28
|
+
minWidth: 'fit-content',
|
|
29
|
+
}}
|
|
30
|
+
>
|
|
31
|
+
<span
|
|
32
|
+
style={{
|
|
33
|
+
...pcStyles.fontWeightBold,
|
|
34
|
+
color: getVar('--pc-text-secondary'),
|
|
35
|
+
fontSize: 'clamp(0.75rem, 1.5vw, 1rem)',
|
|
36
|
+
lineHeight: 1.2,
|
|
37
|
+
}}
|
|
38
|
+
>
|
|
39
|
+
Powered by
|
|
40
|
+
</span>
|
|
41
|
+
<div
|
|
42
|
+
style={{
|
|
43
|
+
display: 'inline-flex',
|
|
44
|
+
alignItems: 'center',
|
|
45
|
+
justifyContent: 'center',
|
|
46
|
+
minHeight: '1.75rem',
|
|
47
|
+
padding:
|
|
48
|
+
theme === 'dark' ? '0.25rem 0.5rem' : 0,
|
|
49
|
+
backgroundColor:
|
|
50
|
+
theme === 'dark' ? 'rgba(255, 255, 255, 0.92)' : 'transparent',
|
|
51
|
+
borderRadius: '9999px',
|
|
52
|
+
boxShadow:
|
|
53
|
+
theme === 'dark'
|
|
54
|
+
? '0 8px 18px rgba(2, 6, 23, 0.28)'
|
|
55
|
+
: 'none',
|
|
56
|
+
}}
|
|
57
|
+
>
|
|
58
|
+
<img
|
|
59
|
+
src={PoweredByRedacto}
|
|
60
|
+
alt="Redacto Logo"
|
|
61
|
+
style={{
|
|
62
|
+
height: 'clamp(1.125rem, 2.5vw, 1.75rem)',
|
|
63
|
+
width: 'auto',
|
|
64
|
+
objectFit: 'contain',
|
|
65
|
+
display: 'block',
|
|
66
|
+
filter: 'drop-shadow(0 1px 1px rgba(15, 23, 42, 0.06))',
|
|
67
|
+
}}
|
|
68
|
+
/>
|
|
69
|
+
</div>
|
|
70
|
+
</div>
|
|
71
|
+
</footer>
|
|
72
|
+
);
|
|
73
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { PCTitle, PCText } from './index';
|
|
2
|
+
import { pcStyles } from '../styles/pcStyles';
|
|
3
|
+
|
|
4
|
+
const getVar = (varName: string): string => `var(${varName})`;
|
|
5
|
+
|
|
6
|
+
// form block wrapper
|
|
7
|
+
export function FormBlockWrapper({
|
|
8
|
+
title,
|
|
9
|
+
description,
|
|
10
|
+
children,
|
|
11
|
+
className,
|
|
12
|
+
inputClassName,
|
|
13
|
+
}: React.PropsWithChildren<{
|
|
14
|
+
title?: string;
|
|
15
|
+
description?: string;
|
|
16
|
+
className?: string;
|
|
17
|
+
inputClassName?: string;
|
|
18
|
+
}>) {
|
|
19
|
+
return (
|
|
20
|
+
<section
|
|
21
|
+
className={className}
|
|
22
|
+
style={{
|
|
23
|
+
display: 'flex',
|
|
24
|
+
flexDirection: 'column',
|
|
25
|
+
width: '100%',
|
|
26
|
+
gap: pcStyles.gapMd.gap,
|
|
27
|
+
}}
|
|
28
|
+
>
|
|
29
|
+
{title && (
|
|
30
|
+
<header style={{ marginBottom: pcStyles.mbSm.marginBottom }}>
|
|
31
|
+
<PCTitle as="h5" style={{ ...pcStyles.fontWeightSemibold, color: getVar('--pc-text-primary') }}>
|
|
32
|
+
{title}
|
|
33
|
+
</PCTitle>
|
|
34
|
+
{description && (
|
|
35
|
+
<PCText size="sm" color="secondary" style={{ marginTop: pcStyles.mtXs.marginTop }}>
|
|
36
|
+
{description}
|
|
37
|
+
</PCText>
|
|
38
|
+
)}
|
|
39
|
+
</header>
|
|
40
|
+
)}
|
|
41
|
+
<div
|
|
42
|
+
className={inputClassName}
|
|
43
|
+
style={{
|
|
44
|
+
width: '100%',
|
|
45
|
+
display: 'flex',
|
|
46
|
+
flexDirection: 'column',
|
|
47
|
+
gap: pcStyles.gapMd.gap,
|
|
48
|
+
}}
|
|
49
|
+
>
|
|
50
|
+
{children}
|
|
51
|
+
</div>
|
|
52
|
+
</section>
|
|
53
|
+
);
|
|
54
|
+
}
|