@redacto.io/consent-sdk-react 0.0.2 → 1.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 (30) hide show
  1. package/.turbo/turbo-build.log +8 -8
  2. package/CHANGELOG.md +11 -0
  3. package/dist/index.d.mts +58 -4
  4. package/dist/index.d.ts +58 -4
  5. package/dist/index.js +3125 -1014
  6. package/dist/index.mjs +3131 -1014
  7. package/package.json +2 -3
  8. package/src/RedactoNoticeConsent/RedactoNoticeConsent.test.tsx +504 -17
  9. package/src/RedactoNoticeConsent/RedactoNoticeConsent.tsx +1286 -269
  10. package/src/RedactoNoticeConsent/api/index.ts +267 -46
  11. package/src/RedactoNoticeConsent/api/types.ts +76 -0
  12. package/src/RedactoNoticeConsent/injectStyles.ts +102 -0
  13. package/src/RedactoNoticeConsent/styles.ts +13 -1
  14. package/src/RedactoNoticeConsent/types.ts +2 -0
  15. package/src/RedactoNoticeConsentInline/RedactoNoticeConsentInline.test.tsx +369 -0
  16. package/src/RedactoNoticeConsentInline/RedactoNoticeConsentInline.tsx +597 -0
  17. package/src/RedactoNoticeConsentInline/api/index.ts +159 -0
  18. package/src/RedactoNoticeConsentInline/api/types.ts +190 -0
  19. package/src/RedactoNoticeConsentInline/assets/redacto-logo.png +0 -0
  20. package/src/RedactoNoticeConsentInline/index.ts +1 -0
  21. package/src/RedactoNoticeConsentInline/injectStyles.ts +40 -0
  22. package/src/RedactoNoticeConsentInline/styles.ts +397 -0
  23. package/src/RedactoNoticeConsentInline/types.ts +45 -0
  24. package/src/RedactoNoticeConsentInline/useMediaQuery.ts +36 -0
  25. package/src/index.ts +1 -0
  26. package/tests/mocks.ts +98 -2
  27. package/tests/setup.ts +15 -0
  28. package/.changeset/README.md +0 -8
  29. package/.changeset/config.json +0 -11
  30. package/.changeset/fifty-candies-drop.md +0 -5
@@ -1,6 +1,6 @@
1
1
 
2
2
  
3
- > @redacto.io/consent-sdk-react@0.0.1 build /Users/abhishekashyap/Documents/redacto/consent-sdk/packages/consent-sdk-react
3
+ > @redacto.io/consent-sdk-react@0.0.3 build /Users/abhishekashyap/Documents/redacto/consent-sdk/packages/consent-sdk-react
4
4
  > tsup
5
5
 
6
6
  CLI Building entry: {"index":"src/index.ts"}
@@ -11,11 +11,11 @@
11
11
  CLI Cleaning output folder
12
12
  ESM Build start
13
13
  CJS Build start
14
- ESM dist/index.mjs 68.11 KB
15
- ESM ⚡️ Build success in 13ms
16
- CJS dist/index.js 70.90 KB
17
- CJS ⚡️ Build success in 13ms
14
+ CJS dist/index.js 103.01 KB
15
+ CJS ⚡️ Build success in 14ms
16
+ ESM dist/index.mjs 99.59 KB
17
+ ESM ⚡️ Build success in 14ms
18
18
  DTS Build start
19
- DTS ⚡️ Build success in 818ms
20
- DTS dist/index.d.mts 1.13 KB
21
- DTS dist/index.d.ts 1.13 KB
19
+ DTS ⚡️ Build success in 645ms
20
+ DTS dist/index.d.mts 2.40 KB
21
+ DTS dist/index.d.ts 2.40 KB
package/CHANGELOG.md ADDED
@@ -0,0 +1,11 @@
1
+ # @redacto.io/consent-sdk-react
2
+
3
+ ## 1.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - Inline consent sdk added
8
+
9
+ ### Patch Changes
10
+
11
+ - 0eac64c: Added base url as prop
package/dist/index.d.mts CHANGED
@@ -1,6 +1,7 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import * as react from 'react';
2
3
 
3
- type Settings = {
4
+ type Settings$1 = {
4
5
  button: {
5
6
  accept: {
6
7
  backgroundColor: string;
@@ -23,6 +24,7 @@ type Settings = {
23
24
  headingColor?: string;
24
25
  textColor?: string;
25
26
  borderColor?: string;
27
+ font?: string;
26
28
  };
27
29
 
28
30
  type Props = Readonly<{
@@ -30,15 +32,67 @@ type Props = Readonly<{
30
32
  accessToken: string;
31
33
  refreshToken: string;
32
34
  baseUrl?: string;
33
- settings?: Partial<Settings>;
35
+ settings?: Partial<Settings$1>;
34
36
  language?: string;
35
37
  blockUI?: boolean;
36
38
  onAccept: () => void;
37
39
  onDecline: () => void;
38
40
  onError?: (error: Error) => void;
39
41
  applicationId?: string;
42
+ checkMode?: "all" | "required";
40
43
  }>;
41
44
 
42
- declare const RedactoNoticeConsent: ({ noticeId, accessToken, refreshToken, baseUrl, language, blockUI, onAccept, onDecline, onError, settings, applicationId, }: Props) => react_jsx_runtime.JSX.Element;
45
+ /**
46
+ * RedactoNoticeConsent
47
+ *
48
+ * Main consent management component that provides a comprehensive UI for users
49
+ * to view and manage their consent preferences. Supports both initial consent
50
+ * collection and reconsent flows.
51
+ */
52
+ declare const RedactoNoticeConsent: ({ noticeId, accessToken, refreshToken, baseUrl, language, blockUI, onAccept, onDecline, onError, settings, applicationId, checkMode, }: Props) => react_jsx_runtime.JSX.Element;
53
+
54
+ type Settings = {
55
+ button: {
56
+ accept: {
57
+ backgroundColor: string;
58
+ textColor: string;
59
+ };
60
+ decline: {
61
+ backgroundColor: string;
62
+ textColor: string;
63
+ };
64
+ language: {
65
+ backgroundColor: string;
66
+ textColor: string;
67
+ selectedBackgroundColor?: string;
68
+ selectedTextColor?: string;
69
+ };
70
+ };
71
+ link: string;
72
+ borderRadius?: string;
73
+ backgroundColor?: string;
74
+ headingColor?: string;
75
+ textColor?: string;
76
+ borderColor?: string;
77
+ };
78
+
79
+ declare const RedactoConsentInline: react.NamedExoticComponent<Readonly<{
80
+ org_uuid: string;
81
+ workspace_uuid: string;
82
+ notice_uuid: string;
83
+ accessToken?: string;
84
+ refreshToken?: string;
85
+ baseUrl?: string;
86
+ settings?: Partial<Settings>;
87
+ language?: string;
88
+ onAccept?: () => void;
89
+ onDecline?: () => void;
90
+ onError?: (error: Error) => void;
91
+ onValidationChange?: (isValid: boolean) => void;
92
+ applicationId?: string;
93
+ }> & react.RefAttributes<{
94
+ submitConsent: (accessTokenOverride?: string) => Promise<void>;
95
+ areAllRequiredElementsChecked: boolean;
96
+ }>>;
43
97
 
44
- export { RedactoNoticeConsent };
98
+ export { RedactoNoticeConsent, RedactoConsentInline as RedactoNoticeConsentInline };
package/dist/index.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import * as react from 'react';
2
3
 
3
- type Settings = {
4
+ type Settings$1 = {
4
5
  button: {
5
6
  accept: {
6
7
  backgroundColor: string;
@@ -23,6 +24,7 @@ type Settings = {
23
24
  headingColor?: string;
24
25
  textColor?: string;
25
26
  borderColor?: string;
27
+ font?: string;
26
28
  };
27
29
 
28
30
  type Props = Readonly<{
@@ -30,15 +32,67 @@ type Props = Readonly<{
30
32
  accessToken: string;
31
33
  refreshToken: string;
32
34
  baseUrl?: string;
33
- settings?: Partial<Settings>;
35
+ settings?: Partial<Settings$1>;
34
36
  language?: string;
35
37
  blockUI?: boolean;
36
38
  onAccept: () => void;
37
39
  onDecline: () => void;
38
40
  onError?: (error: Error) => void;
39
41
  applicationId?: string;
42
+ checkMode?: "all" | "required";
40
43
  }>;
41
44
 
42
- declare const RedactoNoticeConsent: ({ noticeId, accessToken, refreshToken, baseUrl, language, blockUI, onAccept, onDecline, onError, settings, applicationId, }: Props) => react_jsx_runtime.JSX.Element;
45
+ /**
46
+ * RedactoNoticeConsent
47
+ *
48
+ * Main consent management component that provides a comprehensive UI for users
49
+ * to view and manage their consent preferences. Supports both initial consent
50
+ * collection and reconsent flows.
51
+ */
52
+ declare const RedactoNoticeConsent: ({ noticeId, accessToken, refreshToken, baseUrl, language, blockUI, onAccept, onDecline, onError, settings, applicationId, checkMode, }: Props) => react_jsx_runtime.JSX.Element;
53
+
54
+ type Settings = {
55
+ button: {
56
+ accept: {
57
+ backgroundColor: string;
58
+ textColor: string;
59
+ };
60
+ decline: {
61
+ backgroundColor: string;
62
+ textColor: string;
63
+ };
64
+ language: {
65
+ backgroundColor: string;
66
+ textColor: string;
67
+ selectedBackgroundColor?: string;
68
+ selectedTextColor?: string;
69
+ };
70
+ };
71
+ link: string;
72
+ borderRadius?: string;
73
+ backgroundColor?: string;
74
+ headingColor?: string;
75
+ textColor?: string;
76
+ borderColor?: string;
77
+ };
78
+
79
+ declare const RedactoConsentInline: react.NamedExoticComponent<Readonly<{
80
+ org_uuid: string;
81
+ workspace_uuid: string;
82
+ notice_uuid: string;
83
+ accessToken?: string;
84
+ refreshToken?: string;
85
+ baseUrl?: string;
86
+ settings?: Partial<Settings>;
87
+ language?: string;
88
+ onAccept?: () => void;
89
+ onDecline?: () => void;
90
+ onError?: (error: Error) => void;
91
+ onValidationChange?: (isValid: boolean) => void;
92
+ applicationId?: string;
93
+ }> & react.RefAttributes<{
94
+ submitConsent: (accessTokenOverride?: string) => Promise<void>;
95
+ areAllRequiredElementsChecked: boolean;
96
+ }>>;
43
97
 
44
- export { RedactoNoticeConsent };
98
+ export { RedactoNoticeConsent, RedactoConsentInline as RedactoNoticeConsentInline };