@redacto.io/consent-sdk-react 3.5.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.
Files changed (152) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/LICENSE +176 -0
  3. package/dist/index.d.mts +51 -4
  4. package/dist/index.d.ts +51 -4
  5. package/dist/index.js +1891 -243
  6. package/dist/index.mjs +1890 -243
  7. package/dist/privacy-center.d.mts +566 -0
  8. package/dist/privacy-center.d.ts +566 -0
  9. package/dist/privacy-center.js +17174 -0
  10. package/dist/privacy-center.mjs +17136 -0
  11. package/package.json +47 -3
  12. package/src/RedactoNoticeConsent/RedactoNoticeConsent.test.tsx +201 -118
  13. package/src/RedactoNoticeConsent/RedactoNoticeConsent.tsx +1194 -93
  14. package/src/RedactoNoticeConsent/api/index.ts +335 -206
  15. package/src/RedactoNoticeConsent/api/types.ts +140 -16
  16. package/src/RedactoNoticeConsent/components/DigiLockerCallback.tsx +602 -0
  17. package/src/RedactoNoticeConsent/components/index.ts +7 -0
  18. package/src/RedactoNoticeConsent/injectStyles.ts +11 -0
  19. package/src/RedactoNoticeConsent/language-codes.ts +61 -0
  20. package/src/RedactoNoticeConsent/services/storage.ts +122 -0
  21. package/src/RedactoNoticeConsent/types.ts +2 -0
  22. package/src/RedactoPrivacyCenter/PrivacyCenterActivityPage.tsx +19 -0
  23. package/src/RedactoPrivacyCenter/PrivacyCenterConsentManagerPage.tsx +17 -0
  24. package/src/RedactoPrivacyCenter/PrivacyCenterFormPage.tsx +79 -0
  25. package/src/RedactoPrivacyCenter/PrivacyCenterHomePage.tsx +27 -0
  26. package/src/RedactoPrivacyCenter/PrivacyCenterLayout.tsx +142 -0
  27. package/src/RedactoPrivacyCenter/RedactoPrivacyCenter.tsx +51 -0
  28. package/src/RedactoPrivacyCenter/api/actions.ts +444 -0
  29. package/src/RedactoPrivacyCenter/api/client.ts +413 -0
  30. package/src/RedactoPrivacyCenter/api/config.ts +33 -0
  31. package/src/RedactoPrivacyCenter/api/fetcher.ts +181 -0
  32. package/src/RedactoPrivacyCenter/api/upload.ts +93 -0
  33. package/src/RedactoPrivacyCenter/assets/character.svg +31 -0
  34. package/src/RedactoPrivacyCenter/assets/fileAttach.svg +9 -0
  35. package/src/RedactoPrivacyCenter/assets/greenTick.svg +4 -0
  36. package/src/RedactoPrivacyCenter/assets/mail.svg +3 -0
  37. package/src/RedactoPrivacyCenter/assets/poweredByRedacto.svg +9 -0
  38. package/src/RedactoPrivacyCenter/assets/sentImg.svg +9 -0
  39. package/src/RedactoPrivacyCenter/assets/uploadFileIcon.svg +9 -0
  40. package/src/RedactoPrivacyCenter/components/ActivitiesList.tsx +272 -0
  41. package/src/RedactoPrivacyCenter/components/CaseDetailsModal.tsx +468 -0
  42. package/src/RedactoPrivacyCenter/components/CaseHistory.tsx +433 -0
  43. package/src/RedactoPrivacyCenter/components/ConsentManager.tsx +726 -0
  44. package/src/RedactoPrivacyCenter/components/ConsentManagerColumns.tsx +239 -0
  45. package/src/RedactoPrivacyCenter/components/ConsentManagerConstants.ts +7 -0
  46. package/src/RedactoPrivacyCenter/components/ConsentManagerTableSkeleton.tsx +155 -0
  47. package/src/RedactoPrivacyCenter/components/DataRequest/CorrectionDataSection.tsx +189 -0
  48. package/src/RedactoPrivacyCenter/components/DataRequest/GrievanceDataSection.tsx +118 -0
  49. package/src/RedactoPrivacyCenter/components/DataRequest/NominationDataSection.tsx +66 -0
  50. package/src/RedactoPrivacyCenter/components/DataRequest/PurposeSelectionSection.tsx +305 -0
  51. package/src/RedactoPrivacyCenter/components/Form.tsx +1455 -0
  52. package/src/RedactoPrivacyCenter/components/GrievanceTable.tsx +176 -0
  53. package/src/RedactoPrivacyCenter/components/GrievanceTablePagination.tsx +330 -0
  54. package/src/RedactoPrivacyCenter/components/ModifyConsentModal.tsx +329 -0
  55. package/src/RedactoPrivacyCenter/components/Pagination.tsx +140 -0
  56. package/src/RedactoPrivacyCenter/components/PrivacyCenterLayout.tsx +302 -0
  57. package/src/RedactoPrivacyCenter/components/RequestSubmit.tsx +218 -0
  58. package/src/RedactoPrivacyCenter/components/SideMenuBarPC/SideBarPC.tsx +475 -0
  59. package/src/RedactoPrivacyCenter/components/SideMenuBarPC/SideMenuPC.tsx +412 -0
  60. package/src/RedactoPrivacyCenter/components/SideMenuBarPC/constants.tsx +42 -0
  61. package/src/RedactoPrivacyCenter/components/SideMenuBarPC/menuItemsPC.tsx +1 -0
  62. package/src/RedactoPrivacyCenter/components/SideMenuBarPC/types.ts +40 -0
  63. package/src/RedactoPrivacyCenter/components/SideMenuBarPC/utils.ts +38 -0
  64. package/src/RedactoPrivacyCenter/components/ThemeTransitionOverlay.tsx +85 -0
  65. package/src/RedactoPrivacyCenter/components/activitiesColumns.tsx +141 -0
  66. package/src/RedactoPrivacyCenter/components/caseHistoryColumns.tsx +179 -0
  67. package/src/RedactoPrivacyCenter/components/constant.ts +20 -0
  68. package/src/RedactoPrivacyCenter/components/types.ts +68 -0
  69. package/src/RedactoPrivacyCenter/components/utils.tsx +10 -0
  70. package/src/RedactoPrivacyCenter/config/routes.ts +9 -0
  71. package/src/RedactoPrivacyCenter/config/table.ts +25 -0
  72. package/src/RedactoPrivacyCenter/context/AuthContext.tsx +123 -0
  73. package/src/RedactoPrivacyCenter/context/BaseUrlContext.tsx +44 -0
  74. package/src/RedactoPrivacyCenter/context/LocaleContext.tsx +11 -0
  75. package/src/RedactoPrivacyCenter/context/NavigationContext.tsx +64 -0
  76. package/src/RedactoPrivacyCenter/context/OrganizationContext.tsx +30 -0
  77. package/src/RedactoPrivacyCenter/context/PageChromeContext.tsx +60 -0
  78. package/src/RedactoPrivacyCenter/context/theme.tsx +127 -0
  79. package/src/RedactoPrivacyCenter/lib/api.ts +468 -0
  80. package/src/RedactoPrivacyCenter/lib/consent-manager/utils.tsx +63 -0
  81. package/src/RedactoPrivacyCenter/lib/constants.ts +116 -0
  82. package/src/RedactoPrivacyCenter/lib/i18n.ts +81 -0
  83. package/src/RedactoPrivacyCenter/lib/locales.ts +105 -0
  84. package/src/RedactoPrivacyCenter/lib/queries.ts +30 -0
  85. package/src/RedactoPrivacyCenter/lib/types.ts +346 -0
  86. package/src/RedactoPrivacyCenter/lib/useCurrentLanguage.ts +37 -0
  87. package/src/RedactoPrivacyCenter/lib/utils.ts +625 -0
  88. package/src/RedactoPrivacyCenter/locales/as/translation.json +188 -0
  89. package/src/RedactoPrivacyCenter/locales/bho/translation.json +188 -0
  90. package/src/RedactoPrivacyCenter/locales/bn/translation.json +188 -0
  91. package/src/RedactoPrivacyCenter/locales/brx/translation.json +188 -0
  92. package/src/RedactoPrivacyCenter/locales/doi/translation.json +188 -0
  93. package/src/RedactoPrivacyCenter/locales/en/translation.json +188 -0
  94. package/src/RedactoPrivacyCenter/locales/gom/translation.json +188 -0
  95. package/src/RedactoPrivacyCenter/locales/gu/translation.json +188 -0
  96. package/src/RedactoPrivacyCenter/locales/hi/translation.json +188 -0
  97. package/src/RedactoPrivacyCenter/locales/kn/translation.json +188 -0
  98. package/src/RedactoPrivacyCenter/locales/ks/translation.json +188 -0
  99. package/src/RedactoPrivacyCenter/locales/mai/translation.json +188 -0
  100. package/src/RedactoPrivacyCenter/locales/ml/translation.json +188 -0
  101. package/src/RedactoPrivacyCenter/locales/mni-Mtei/translation.json +188 -0
  102. package/src/RedactoPrivacyCenter/locales/mr/translation.json +188 -0
  103. package/src/RedactoPrivacyCenter/locales/ne/translation.json +188 -0
  104. package/src/RedactoPrivacyCenter/locales/or/translation.json +188 -0
  105. package/src/RedactoPrivacyCenter/locales/pa/translation.json +188 -0
  106. package/src/RedactoPrivacyCenter/locales/sa/translation.json +188 -0
  107. package/src/RedactoPrivacyCenter/locales/sat/translation.json +188 -0
  108. package/src/RedactoPrivacyCenter/locales/sd/translation.json +188 -0
  109. package/src/RedactoPrivacyCenter/locales/ta/translation.json +188 -0
  110. package/src/RedactoPrivacyCenter/locales/te/translation.json +188 -0
  111. package/src/RedactoPrivacyCenter/locales/ur/translation.json +188 -0
  112. package/src/RedactoPrivacyCenter/styles/base.css +117 -0
  113. package/src/RedactoPrivacyCenter/styles/injectStyles.ts +1000 -0
  114. package/src/RedactoPrivacyCenter/styles/pcStyles.ts +819 -0
  115. package/src/RedactoPrivacyCenter/styles/responsive.ts +138 -0
  116. package/src/RedactoPrivacyCenter/styles/variables.css +133 -0
  117. package/src/RedactoPrivacyCenter/table/AdvancedTable.tsx +365 -0
  118. package/src/RedactoPrivacyCenter/table/AdvancedTablePagination.tsx +479 -0
  119. package/src/RedactoPrivacyCenter/table/index.ts +2 -0
  120. package/src/RedactoPrivacyCenter/types/images.d.ts +29 -0
  121. package/src/RedactoPrivacyCenter/ui/Footer.tsx +73 -0
  122. package/src/RedactoPrivacyCenter/ui/FormBlockWrapper.tsx +54 -0
  123. package/src/RedactoPrivacyCenter/ui/PCAccordion.tsx +87 -0
  124. package/src/RedactoPrivacyCenter/ui/PCActionIcon.tsx +47 -0
  125. package/src/RedactoPrivacyCenter/ui/PCAvatar.tsx +69 -0
  126. package/src/RedactoPrivacyCenter/ui/PCBadge.tsx +48 -0
  127. package/src/RedactoPrivacyCenter/ui/PCButton.tsx +77 -0
  128. package/src/RedactoPrivacyCenter/ui/PCCheckbox.tsx +55 -0
  129. package/src/RedactoPrivacyCenter/ui/PCCollapse.tsx +97 -0
  130. package/src/RedactoPrivacyCenter/ui/PCEmpty.tsx +35 -0
  131. package/src/RedactoPrivacyCenter/ui/PCInput.tsx +128 -0
  132. package/src/RedactoPrivacyCenter/ui/PCLoader.tsx +30 -0
  133. package/src/RedactoPrivacyCenter/ui/PCModal.tsx +104 -0
  134. package/src/RedactoPrivacyCenter/ui/PCPopover.tsx +175 -0
  135. package/src/RedactoPrivacyCenter/ui/PCSelect.tsx +381 -0
  136. package/src/RedactoPrivacyCenter/ui/PCTable.tsx +137 -0
  137. package/src/RedactoPrivacyCenter/ui/PCText.tsx +39 -0
  138. package/src/RedactoPrivacyCenter/ui/PCTextarea.tsx +43 -0
  139. package/src/RedactoPrivacyCenter/ui/PCTitle.tsx +37 -0
  140. package/src/RedactoPrivacyCenter/ui/PCTooltip.tsx +119 -0
  141. package/src/RedactoPrivacyCenter/ui/SimpleBar.tsx +25 -0
  142. package/src/RedactoPrivacyCenter/ui/StatusBadge.tsx +55 -0
  143. package/src/RedactoPrivacyCenter/ui/ThemeToggle.tsx +70 -0
  144. package/src/RedactoPrivacyCenter/ui/index.ts +18 -0
  145. package/src/RedactoPrivacyCenter/utils/cn.ts +28 -0
  146. package/src/RedactoPrivacyCenter/utils/date.ts +48 -0
  147. package/src/RedactoPrivacyCenter/utils/status.ts +111 -0
  148. package/src/RedactoPrivacyCenter/utils/toast.ts +130 -0
  149. package/src/index.ts +10 -0
  150. package/src/privacy-center.ts +107 -0
  151. package/tsconfig.json +2 -0
  152. package/tsup.config.ts +16 -1
@@ -0,0 +1,302 @@
1
+ import { Suspense, useState, useEffect, useCallback } from 'react';
2
+ import SideBarPC from './SideMenuBarPC/SideBarPC';
3
+ import Footer from '../ui/Footer';
4
+ import ThemeToggle from '../ui/ThemeToggle';
5
+ import ThemeTransitionOverlay from './ThemeTransitionOverlay';
6
+ import { PCSelect } from '../ui';
7
+ import { useTranslation } from 'react-i18next';
8
+ import { PAGE_CHROME_BY_PAGE, languageOptions } from '../lib/constants';
9
+ import { LocaleContext } from '../context/LocaleContext';
10
+ import { useInternalNavigation } from '../context/NavigationContext';
11
+ import { usePageChrome } from '../context/PageChromeContext';
12
+ import i18n from '../lib/i18n';
13
+ import { pcStyles } from '../styles/pcStyles';
14
+ import type { PrivacyCenterLayoutProps } from './types';
15
+
16
+ const getVar = (varName: string): string => `var(${varName})`;
17
+
18
+ export default function PrivacyCenterLayout({
19
+ children,
20
+ sidebarClassName,
21
+ contentClassName,
22
+ onBack,
23
+ }: PrivacyCenterLayoutProps) {
24
+ const { t } = useTranslation();
25
+ const { currentPage } = useInternalNavigation();
26
+ const { pageChromeOverride } = usePageChrome();
27
+ const [locale, setLocale] = useState(i18n.language);
28
+ const pageChrome = pageChromeOverride ?? PAGE_CHROME_BY_PAGE[currentPage];
29
+
30
+ const handleLanguageChange = useCallback((value: unknown) => {
31
+ const langValue = value as { value: string; label: string };
32
+ i18n.changeLanguage(langValue.value);
33
+ }, []);
34
+
35
+ useEffect(() => {
36
+ const handleLanguageChanged = () => setLocale(i18n.language);
37
+ i18n.on('languageChanged', handleLanguageChanged);
38
+ return () => i18n.off('languageChanged', handleLanguageChanged);
39
+ }, []);
40
+
41
+ return (
42
+ <LocaleContext.Provider value={{ locale, setLocale }}>
43
+ <Suspense fallback={<div style={{ ...pcStyles.flex, ...pcStyles.itemsCenter, ...pcStyles.justifyCenter, minHeight: '100vh' }}>Loading...</div>}>
44
+ <ThemeTransitionOverlay />
45
+ <main
46
+ className="pc-root"
47
+ style={{
48
+ ...pcStyles.flex,
49
+ minHeight: '100vh',
50
+ flexGrow: 1,
51
+ position: 'relative',
52
+ backgroundColor: getVar('--pc-bg-shell'),
53
+ }}
54
+ >
55
+ <SideBarPC className={sidebarClassName} onBack={onBack} />
56
+ <div style={{
57
+ ...pcStyles.flex,
58
+ ...pcStyles.flexCol,
59
+ flex: 1,
60
+ minWidth: 0,
61
+ backgroundColor: getVar('--pc-bg-shell'),
62
+ }} className="pc-content-wrapper">
63
+ {/* Top Navbar with Theme Toggle */}
64
+ <nav style={{
65
+ position: 'fixed',
66
+ top: 0,
67
+ zIndex: 50,
68
+ ...pcStyles.flex,
69
+ ...pcStyles.itemsCenter,
70
+ ...pcStyles.justifyBetween,
71
+ gap: '0.75rem',
72
+ backgroundColor: getVar('--pc-bg-shell'),
73
+ paddingLeft: 'var(--pc-navbar-padding-left, 0.75rem)',
74
+ paddingRight: 'var(--pc-navbar-padding-right, 0.75rem)',
75
+ paddingTop: 'var(--pc-navbar-padding-top, 0.625rem)',
76
+ paddingBottom: 'var(--pc-navbar-padding-bottom, 0.625rem)',
77
+ transition: 'background-color 0.3s ease, border-color 0.3s ease, width 0.3s ease, left 0.3s ease',
78
+ willChange: 'background-color, border-color, width, left',
79
+ }} className="pc-navbar">
80
+ <div
81
+ className="pc-navbar-page-meta"
82
+ style={{
83
+ display: 'flex',
84
+ flexDirection: 'column',
85
+ justifyContent: 'center',
86
+ minWidth: 0,
87
+ flex: 1,
88
+ gap: '0.125rem',
89
+ }}
90
+ >
91
+ <p
92
+ className="pc-navbar-title"
93
+ style={{
94
+ margin: 0,
95
+ color: getVar('--pc-text-primary'),
96
+ fontSize: '1rem',
97
+ fontWeight: 600,
98
+ lineHeight: 1.3,
99
+ whiteSpace: 'nowrap',
100
+ overflow: 'hidden',
101
+ textOverflow: 'ellipsis',
102
+ }}
103
+ >
104
+ {t(pageChrome.titleKey)}
105
+ </p>
106
+ {pageChrome.descriptionKey && (
107
+ <p
108
+ className="pc-navbar-description"
109
+ style={{
110
+ margin: 0,
111
+ color: getVar('--pc-text-secondary'),
112
+ fontSize: '0.8125rem',
113
+ lineHeight: 1.35,
114
+ whiteSpace: 'nowrap',
115
+ overflow: 'hidden',
116
+ textOverflow: 'ellipsis',
117
+ }}
118
+ >
119
+ {t(pageChrome.descriptionKey)}
120
+ </p>
121
+ )}
122
+ </div>
123
+ <div style={{
124
+ display: 'flex',
125
+ alignItems: 'center',
126
+ gap: '0.5rem',
127
+ flexShrink: 0,
128
+ }} className="pc-navbar-actions">
129
+ <PCSelect
130
+ size="sm"
131
+ searchable
132
+ style={{
133
+ width: 'auto',
134
+ minWidth: '92px',
135
+ maxWidth: '136px',
136
+ flexShrink: 0,
137
+ }}
138
+ options={languageOptions}
139
+ value={languageOptions.find((opt) => opt.value === locale) || null}
140
+ onChange={handleLanguageChange}
141
+ />
142
+ <ThemeToggle />
143
+ </div>
144
+ </nav>
145
+ <div style={{
146
+ ...pcStyles.flex,
147
+ ...pcStyles.flexCol,
148
+ flexGrow: 1,
149
+ paddingLeft: 'var(--pc-content-padding-left, 0.75rem)',
150
+ paddingRight: 'var(--pc-content-padding-right, 0.75rem)',
151
+ paddingTop: 'var(--pc-content-padding-top, 4rem)',
152
+ minWidth: 0,
153
+ backgroundColor: getVar('--pc-bg-shell'),
154
+ }} className="pc-content-container">
155
+ <div style={{
156
+ minHeight: '100vh',
157
+ width: '100%',
158
+ }}>
159
+ <div style={{
160
+ ...pcStyles.flex,
161
+ ...pcStyles.flexCol,
162
+ height: '100%',
163
+ minHeight: '100vh',
164
+ ...pcStyles.justifyBetween,
165
+ ...pcStyles.gapMd,
166
+ paddingLeft: '0.5rem',
167
+ paddingRight: '0.5rem',
168
+ paddingTop: '1rem',
169
+ paddingBottom: '1rem',
170
+ }}>
171
+ <div className={contentClassName} style={{ width: '100%' }}>{children}</div>
172
+ <div style={{
173
+ ...pcStyles.flex,
174
+ width: '100%',
175
+ ...pcStyles.itemsCenter,
176
+ ...pcStyles.justifyCenter,
177
+ }}>
178
+ <Footer />
179
+ </div>
180
+ </div>
181
+ </div>
182
+ </div>
183
+ </div>
184
+ </main>
185
+ <style>{`
186
+ /* Layout sizing is driven by a single sidebar offset variable.
187
+ This prevents overlap when zoom changes effective breakpoints. */
188
+ .pc-content-wrapper {
189
+ --pc-sidebar-offset: 0px;
190
+ margin-left: var(--pc-sidebar-offset) !important;
191
+ width: calc(100% - var(--pc-sidebar-offset)) !important;
192
+ min-width: 0 !important;
193
+ transition: margin-left 0.3s ease, width 0.3s ease !important;
194
+ }
195
+
196
+ .pc-navbar {
197
+ --pc-navbar-padding-left: 0.75rem;
198
+ --pc-navbar-padding-right: 0.75rem;
199
+ --pc-navbar-padding-top: 0.625rem;
200
+ --pc-navbar-padding-bottom: 0.625rem;
201
+ left: var(--pc-sidebar-offset) !important;
202
+ width: calc(100% - var(--pc-sidebar-offset)) !important;
203
+ transition: left 0.3s ease, width 0.3s ease !important;
204
+ }
205
+
206
+ .pc-content-container {
207
+ --pc-content-padding-left: 0.75rem;
208
+ --pc-content-padding-right: 0.75rem;
209
+ --pc-content-padding-top: 4rem;
210
+ }
211
+
212
+ .pc-navbar-page-meta {
213
+ min-width: 0;
214
+ max-width: 100%;
215
+ padding-right: 0.5rem;
216
+ }
217
+
218
+ .pc-navbar-title,
219
+ .pc-navbar-description {
220
+ overflow: hidden;
221
+ text-overflow: ellipsis;
222
+ white-space: nowrap;
223
+ }
224
+
225
+ /* Medium screens (768px+): Sidebar visible, collapsed by default */
226
+ @media (min-width: 768px) {
227
+ .pc-sidebar ~ .pc-content-wrapper {
228
+ --pc-sidebar-offset: var(--pc-sidebar-collapsed-width, 80px);
229
+ }
230
+ .pc-sidebar:not(.pc-sidebar-collapsed) ~ .pc-content-wrapper {
231
+ --pc-sidebar-offset: var(--pc-sidebar-expanded-width, 300px);
232
+ }
233
+ }
234
+
235
+ /* 2XL screens (1536px+): Sidebar expands to 320px in injected styles */
236
+ @media (min-width: 1536px) {
237
+ .pc-sidebar:not(.pc-sidebar-collapsed) ~ .pc-content-wrapper {
238
+ --pc-sidebar-offset: var(--pc-sidebar-expanded-width-2xl, 320px);
239
+ }
240
+ }
241
+
242
+ /* Responsive padding for navbar */
243
+ @media (max-width: 767px) {
244
+ .pc-navbar {
245
+ --pc-navbar-padding-left: 3.75rem;
246
+ --pc-navbar-padding-right: 0.75rem;
247
+ --pc-navbar-padding-top: 0.625rem;
248
+ --pc-navbar-padding-bottom: 0.625rem;
249
+ }
250
+ .pc-navbar-description {
251
+ display: none;
252
+ }
253
+ .pc-navbar-page-meta {
254
+ max-width: calc(100% - 8.25rem);
255
+ padding-right: 0.25rem;
256
+ }
257
+ .pc-navbar-actions {
258
+ gap: 0.375rem;
259
+ }
260
+ .pc-content-container {
261
+ --pc-content-padding-top: 4rem;
262
+ }
263
+ }
264
+ @media (min-width: 768px) {
265
+ .pc-navbar {
266
+ --pc-navbar-padding-left: 1rem;
267
+ --pc-navbar-padding-right: 1rem;
268
+ --pc-navbar-padding-top: 0.75rem;
269
+ --pc-navbar-padding-bottom: 0.75rem;
270
+ }
271
+ .pc-navbar-description {
272
+ display: block;
273
+ }
274
+ .pc-content-container {
275
+ --pc-content-padding-top: 4.5rem;
276
+ }
277
+ }
278
+ @media (min-width: 768px) {
279
+ .pc-navbar-title {
280
+ font-size: 1.0625rem;
281
+ }
282
+ .pc-navbar-description {
283
+ font-size: 0.8125rem;
284
+ }
285
+ .pc-content-container {
286
+ --pc-content-padding-left: 1.25rem;
287
+ --pc-content-padding-right: 1.25rem;
288
+ --pc-content-padding-top: 4.5rem;
289
+ }
290
+ }
291
+ @media (min-width: 1024px) {
292
+ .pc-content-container {
293
+ --pc-content-padding-left: 1.5rem;
294
+ --pc-content-padding-right: 1.5rem;
295
+ --pc-content-padding-top: 4.75rem;
296
+ }
297
+ }
298
+ `}</style>
299
+ </Suspense>
300
+ </LocaleContext.Provider>
301
+ );
302
+ }
@@ -0,0 +1,218 @@
1
+ import character from '../assets/character.svg';
2
+ import greenTick from '../assets/greenTick.svg';
3
+ import mailIcon from '../assets/mail.svg';
4
+ import sentImg from '../assets/sentImg.svg';
5
+ import { useTranslation } from 'react-i18next';
6
+ import { PCButton, PCText } from '../ui';
7
+ import { pcStyles } from '../styles/pcStyles';
8
+ import type { RequestSubmitProps } from './types';
9
+ import { Mail } from 'lucide-react';
10
+
11
+ const getVar = (varName: string): string => `var(${varName})`;
12
+
13
+ export default function RequestSubmit({
14
+ caseId,
15
+ contact,
16
+ onCreateRequest,
17
+ }: RequestSubmitProps) {
18
+ const { t } = useTranslation();
19
+ return (
20
+ <div style={{ marginTop: pcStyles.mtMd.marginTop, position: 'relative' }}>
21
+ <img
22
+ src={sentImg}
23
+ alt="sent"
24
+ className="pc-hidden-xs"
25
+ style={{
26
+ position: 'absolute',
27
+ right: '0.75rem',
28
+ top: '0.75rem',
29
+ height: '3rem',
30
+ width: '3rem',
31
+ opacity: 0.65,
32
+ filter: 'brightness(0) saturate(100%) invert(var(--pc-icon-filter, 0))',
33
+ }}
34
+ />
35
+ <div style={{
36
+ ...pcStyles.card,
37
+ borderRadius: pcStyles.borderRadiusXl,
38
+ padding: pcStyles.pLg.padding,
39
+ position: 'relative',
40
+ ...pcStyles.bgPrimary,
41
+ border: `1px solid ${pcStyles.borderColor}`,
42
+ }} className="pc-padding-responsive">
43
+ <div style={{
44
+ ...pcStyles.flex,
45
+ ...pcStyles.flexCol,
46
+ ...pcStyles.itemsStart,
47
+ ...pcStyles.gapMd,
48
+ }} className="pc-flex-responsive">
49
+ <div style={{
50
+ ...pcStyles.flex,
51
+ ...pcStyles.itemsStart,
52
+ ...pcStyles.gapMd,
53
+ width: '100%',
54
+ }}>
55
+ <div style={{
56
+ height: '2.5rem',
57
+ width: '2.5rem',
58
+ flexShrink: 0,
59
+ display: 'flex',
60
+ alignItems: 'center',
61
+ justifyContent: 'center',
62
+ borderRadius: '50%',
63
+ backgroundColor: `${getVar('--pc-success')}33`,
64
+ padding: '0.375rem',
65
+ }}>
66
+ <img
67
+ src={greenTick}
68
+ alt="success"
69
+ style={{
70
+ height: '1.5rem',
71
+ width: '1.5rem',
72
+ }}
73
+ />
74
+ </div>
75
+ <div style={{ minWidth: 0, flex: 1 }}>
76
+ <PCText
77
+ size="base"
78
+ weight="semibold"
79
+ style={{
80
+ marginBottom: pcStyles.mbXs.marginBottom,
81
+ }}
82
+ className="pc-text-responsive"
83
+ >
84
+ {t('requestSubmittedSuccessfully')}
85
+ </PCText>
86
+ <PCText
87
+ size="sm"
88
+ weight="medium"
89
+ color="secondary"
90
+ style={{
91
+ marginBottom: pcStyles.mbMd.marginBottom,
92
+ }}
93
+ >
94
+ {t('thankYouForSubmittingYourRequest')}.
95
+ </PCText>
96
+ <div style={{
97
+ marginTop: pcStyles.mtMd.marginTop,
98
+ padding: pcStyles.pSm.padding,
99
+ ...pcStyles.bgSecondary,
100
+ borderRadius: pcStyles.borderRadiusMd,
101
+ border: `1px solid ${pcStyles.borderColor}`,
102
+ }}>
103
+ <PCText
104
+ size="base"
105
+ weight="bold"
106
+ style={{
107
+ color: pcStyles.primary,
108
+ wordBreak: 'break-word',
109
+ marginBottom: pcStyles.mbXs.marginBottom,
110
+ }}
111
+ className="pc-text-responsive"
112
+ >
113
+ {t('caseID')}: {caseId}
114
+ </PCText>
115
+ <PCText
116
+ size="xs"
117
+ weight="medium"
118
+ color="secondary"
119
+ >
120
+ {t('saveThisID')}.
121
+ </PCText>
122
+ </div>
123
+ <div style={{
124
+ ...pcStyles.flex,
125
+ ...pcStyles.itemsStart,
126
+ ...pcStyles.gapSm,
127
+ marginTop: pcStyles.mtMd.marginTop,
128
+ padding: '0.5rem 0.625rem',
129
+ ...pcStyles.bgSecondary,
130
+ borderRadius: pcStyles.borderRadiusMd,
131
+ }}>
132
+ <Mail
133
+ size={16}
134
+ style={{
135
+ flexShrink: 0,
136
+ color: getVar('--pc-text-secondary'),
137
+ marginTop: '2px',
138
+ }}
139
+ />
140
+ <PCText
141
+ size="xs"
142
+ weight="medium"
143
+ color="secondary"
144
+ style={{
145
+ wordBreak: 'break-word',
146
+ }}
147
+ >
148
+ {t('confirmationSentTo')}: {contact}
149
+ </PCText>
150
+ </div>
151
+ <PCText
152
+ size="xs"
153
+ weight="medium"
154
+ color="secondary"
155
+ style={{
156
+ marginTop: pcStyles.mtMd.marginTop,
157
+ }}
158
+ >
159
+ {t('processRequest')}.
160
+ </PCText>
161
+ </div>
162
+ </div>
163
+ <div className="pc-hidden-xs pc-block-md" style={{ width: '100%' }}>
164
+ <img
165
+ src={character}
166
+ alt="character"
167
+ style={{
168
+ margin: '0 auto',
169
+ height: '6rem',
170
+ width: '6rem',
171
+ display: 'block',
172
+ filter: 'brightness(0) saturate(100%) invert(var(--pc-icon-filter, 0))',
173
+ opacity: 0.9,
174
+ }}
175
+ />
176
+ <div style={{
177
+ marginTop: pcStyles.mtMd.marginTop,
178
+ ...pcStyles.flex,
179
+ ...pcStyles.justifyCenter
180
+ }}>
181
+ <PCButton
182
+ variant="primary"
183
+ size="sm"
184
+ onClick={onCreateRequest}
185
+ className="pc-w-full-mobile"
186
+ >
187
+ {t('backToHome')}
188
+ </PCButton>
189
+ </div>
190
+ </div>
191
+ </div>
192
+ <div className="pc-block-xs pc-hidden-md" style={{ marginTop: pcStyles.mtMd.marginTop }}>
193
+ <div style={{ ...pcStyles.flex, ...pcStyles.justifyCenter }}>
194
+ <PCButton
195
+ variant="primary"
196
+ size="sm"
197
+ onClick={onCreateRequest}
198
+ style={{ width: '100%' }}
199
+ >
200
+ {t('backToHome')}
201
+ </PCButton>
202
+ </div>
203
+ </div>
204
+ </div>
205
+ <PCText
206
+ size="xs"
207
+ weight="medium"
208
+ color="tertiary"
209
+ style={{
210
+ marginTop: pcStyles.mtLg.marginTop,
211
+ textAlign: 'center',
212
+ }}
213
+ >
214
+ {t('yourDataIsSafeWithUs')}.
215
+ </PCText>
216
+ </div>
217
+ );
218
+ }