@c15t/react 0.0.1-rc.12 → 0.0.1-rc.13
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.
|
@@ -34,7 +34,7 @@ const use_theme_cjs_namespaceObject = require("../../../hooks/use-theme.cjs");
|
|
|
34
34
|
const use_styles_cjs_namespaceObject = require("../../../utils/use-styles.cjs");
|
|
35
35
|
const index_cjs_namespaceObject = require("../ui/button/index.cjs");
|
|
36
36
|
const ConsentButton = /*#__PURE__*/ (0, external_react_namespaceObject.forwardRef)(({ asChild, className: forwardedClassName, style, noStyle, action, themeKey, baseClassName, variant = 'neutral', mode = 'stroke', size = 'small', onClick: forwardedOnClick, closeCookieBanner = false, closeCustomizeDialog = false, ...props }, ref)=>{
|
|
37
|
-
const { saveConsents, setShowPopup, setIsPrivacyDialogOpen
|
|
37
|
+
const { saveConsents, setShowPopup, setIsPrivacyDialogOpen } = (0, use_consent_manager_cjs_namespaceObject.useConsentManager)();
|
|
38
38
|
const { noStyle: contextNoStyle } = (0, use_theme_cjs_namespaceObject.useTheme)();
|
|
39
39
|
const buttonStyle = (0, use_styles_cjs_namespaceObject.useStyles)(themeKey ?? 'button', {
|
|
40
40
|
baseClassName: [
|
|
@@ -52,60 +52,12 @@ const ConsentButton = /*#__PURE__*/ (0, external_react_namespaceObject.forwardRe
|
|
|
52
52
|
switch(action){
|
|
53
53
|
case 'accept-consent':
|
|
54
54
|
saveConsents('all');
|
|
55
|
-
client?.setConsent({
|
|
56
|
-
body: {
|
|
57
|
-
type: 'cookie_banner',
|
|
58
|
-
domain: window.location.hostname,
|
|
59
|
-
preferences: {
|
|
60
|
-
analytics: true,
|
|
61
|
-
marketing: true,
|
|
62
|
-
necessary: true,
|
|
63
|
-
functional: true,
|
|
64
|
-
experience: true
|
|
65
|
-
},
|
|
66
|
-
metadata: {
|
|
67
|
-
source: 'cookie_banner',
|
|
68
|
-
acceptanceMethod: 'accept_all_button'
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
});
|
|
72
55
|
break;
|
|
73
56
|
case 'reject-consent':
|
|
74
57
|
saveConsents('necessary');
|
|
75
|
-
client?.setConsent({
|
|
76
|
-
body: {
|
|
77
|
-
type: 'cookie_banner',
|
|
78
|
-
domain: window.location.hostname,
|
|
79
|
-
preferences: {
|
|
80
|
-
analytics: false,
|
|
81
|
-
marketing: false,
|
|
82
|
-
necessary: true,
|
|
83
|
-
functional: false,
|
|
84
|
-
experience: false
|
|
85
|
-
},
|
|
86
|
-
metadata: {
|
|
87
|
-
source: 'cookie_banner',
|
|
88
|
-
acceptanceMethod: 'reject_all_button'
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
});
|
|
92
58
|
break;
|
|
93
59
|
case 'custom-consent':
|
|
94
60
|
saveConsents('custom');
|
|
95
|
-
client?.setConsent({
|
|
96
|
-
body: {
|
|
97
|
-
type: 'cookie_banner',
|
|
98
|
-
domain: window.location.hostname,
|
|
99
|
-
preferences: {
|
|
100
|
-
...consents,
|
|
101
|
-
necessary: true
|
|
102
|
-
},
|
|
103
|
-
metadata: {
|
|
104
|
-
source: 'consent_widget',
|
|
105
|
-
acceptanceMethod: 'save_preferences_button'
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
});
|
|
109
61
|
break;
|
|
110
62
|
case 'open-consent-dialog':
|
|
111
63
|
setIsPrivacyDialogOpen(true);
|
|
@@ -124,9 +76,7 @@ const ConsentButton = /*#__PURE__*/ (0, external_react_namespaceObject.forwardRe
|
|
|
124
76
|
saveConsents,
|
|
125
77
|
setIsPrivacyDialogOpen,
|
|
126
78
|
setShowPopup,
|
|
127
|
-
action
|
|
128
|
-
client?.setConsent,
|
|
129
|
-
consents
|
|
79
|
+
action
|
|
130
80
|
]);
|
|
131
81
|
const Comp = asChild ? react_slot_namespaceObject.Slot : 'button';
|
|
132
82
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(Comp, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../../src/components/shared/primitives/button.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAMtD,OAAO,KAAK,EAAwB,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAE/E;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAKpB,gBAAgB,GAChB,gBAAgB,GAChB,gBAAgB,GAChB,qBAAqB;2BACD,OAAO;wBACV,OAAO;
|
|
1
|
+
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../../src/components/shared/primitives/button.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAMtD,OAAO,KAAK,EAAwB,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAE/E;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAKpB,gBAAgB,GAChB,gBAAgB,GAChB,gBAAgB,GAChB,qBAAqB;2BACD,OAAO;wBACV,OAAO;qDAuF7B,CAAC"}
|
|
@@ -6,7 +6,7 @@ import * as __WEBPACK_EXTERNAL_MODULE__hooks_use_theme_js_3abff3d7__ from "../..
|
|
|
6
6
|
import * as __WEBPACK_EXTERNAL_MODULE__utils_use_styles_js_413e0e0a__ from "../../../utils/use-styles.js";
|
|
7
7
|
import * as __WEBPACK_EXTERNAL_MODULE__ui_button_index_js_15bac350__ from "../ui/button/index.js";
|
|
8
8
|
const ConsentButton = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react__.forwardRef)(({ asChild, className: forwardedClassName, style, noStyle, action, themeKey, baseClassName, variant = 'neutral', mode = 'stroke', size = 'small', onClick: forwardedOnClick, closeCookieBanner = false, closeCustomizeDialog = false, ...props }, ref)=>{
|
|
9
|
-
const { saveConsents, setShowPopup, setIsPrivacyDialogOpen
|
|
9
|
+
const { saveConsents, setShowPopup, setIsPrivacyDialogOpen } = (0, __WEBPACK_EXTERNAL_MODULE__hooks_use_consent_manager_js_8a30bd26__.useConsentManager)();
|
|
10
10
|
const { noStyle: contextNoStyle } = (0, __WEBPACK_EXTERNAL_MODULE__hooks_use_theme_js_3abff3d7__.useTheme)();
|
|
11
11
|
const buttonStyle = (0, __WEBPACK_EXTERNAL_MODULE__utils_use_styles_js_413e0e0a__.useStyles)(themeKey ?? 'button', {
|
|
12
12
|
baseClassName: [
|
|
@@ -24,60 +24,12 @@ const ConsentButton = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react__.forwar
|
|
|
24
24
|
switch(action){
|
|
25
25
|
case 'accept-consent':
|
|
26
26
|
saveConsents('all');
|
|
27
|
-
client?.setConsent({
|
|
28
|
-
body: {
|
|
29
|
-
type: 'cookie_banner',
|
|
30
|
-
domain: window.location.hostname,
|
|
31
|
-
preferences: {
|
|
32
|
-
analytics: true,
|
|
33
|
-
marketing: true,
|
|
34
|
-
necessary: true,
|
|
35
|
-
functional: true,
|
|
36
|
-
experience: true
|
|
37
|
-
},
|
|
38
|
-
metadata: {
|
|
39
|
-
source: 'cookie_banner',
|
|
40
|
-
acceptanceMethod: 'accept_all_button'
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
27
|
break;
|
|
45
28
|
case 'reject-consent':
|
|
46
29
|
saveConsents('necessary');
|
|
47
|
-
client?.setConsent({
|
|
48
|
-
body: {
|
|
49
|
-
type: 'cookie_banner',
|
|
50
|
-
domain: window.location.hostname,
|
|
51
|
-
preferences: {
|
|
52
|
-
analytics: false,
|
|
53
|
-
marketing: false,
|
|
54
|
-
necessary: true,
|
|
55
|
-
functional: false,
|
|
56
|
-
experience: false
|
|
57
|
-
},
|
|
58
|
-
metadata: {
|
|
59
|
-
source: 'cookie_banner',
|
|
60
|
-
acceptanceMethod: 'reject_all_button'
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
});
|
|
64
30
|
break;
|
|
65
31
|
case 'custom-consent':
|
|
66
32
|
saveConsents('custom');
|
|
67
|
-
client?.setConsent({
|
|
68
|
-
body: {
|
|
69
|
-
type: 'cookie_banner',
|
|
70
|
-
domain: window.location.hostname,
|
|
71
|
-
preferences: {
|
|
72
|
-
...consents,
|
|
73
|
-
necessary: true
|
|
74
|
-
},
|
|
75
|
-
metadata: {
|
|
76
|
-
source: 'consent_widget',
|
|
77
|
-
acceptanceMethod: 'save_preferences_button'
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
});
|
|
81
33
|
break;
|
|
82
34
|
case 'open-consent-dialog':
|
|
83
35
|
setIsPrivacyDialogOpen(true);
|
|
@@ -96,9 +48,7 @@ const ConsentButton = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react__.forwar
|
|
|
96
48
|
saveConsents,
|
|
97
49
|
setIsPrivacyDialogOpen,
|
|
98
50
|
setShowPopup,
|
|
99
|
-
action
|
|
100
|
-
client?.setConsent,
|
|
101
|
-
consents
|
|
51
|
+
action
|
|
102
52
|
]);
|
|
103
53
|
const Comp = asChild ? __WEBPACK_EXTERNAL_MODULE__radix_ui_react_slot_85c2da36__.Slot : 'button';
|
|
104
54
|
return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(Comp, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@c15t/react",
|
|
3
|
-
"version": "0.0.1-rc.
|
|
3
|
+
"version": "0.0.1-rc.13",
|
|
4
4
|
"license": "GPL-3.0-only",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"type": "module",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"motion": "^12.4.10",
|
|
66
66
|
"tailwind-variants": "^0.3.1",
|
|
67
67
|
"zustand": "^5.0.3",
|
|
68
|
-
"c15t": "0.0.1-rc.
|
|
68
|
+
"c15t": "0.0.1-rc.13"
|
|
69
69
|
},
|
|
70
70
|
"devDependencies": {
|
|
71
71
|
"@c15t/typescript-config": "0.0.1-beta.1"
|