@c15t/react 0.0.1-rc.3
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/LICENSE.md +595 -0
- package/README.md +55 -0
- package/dist/common/components/consent-manager-provider.cjs +93 -0
- package/dist/common/components/consent-manager-provider.d.ts +16 -0
- package/dist/common/components/consent-manager-provider.d.ts.map +1 -0
- package/dist/common/components/consent-manager-provider.js +59 -0
- package/dist/common/context/consent-manager-context.cjs +38 -0
- package/dist/common/context/consent-manager-context.d.ts +13 -0
- package/dist/common/context/consent-manager-context.d.ts.map +1 -0
- package/dist/common/context/consent-manager-context.js +4 -0
- package/dist/common/hooks/use-consent-manager.cjs +45 -0
- package/dist/common/hooks/use-consent-manager.d.ts +20 -0
- package/dist/common/hooks/use-consent-manager.d.ts.map +1 -0
- package/dist/common/hooks/use-consent-manager.js +11 -0
- package/dist/common/index.cjs +42 -0
- package/dist/common/index.d.ts +7 -0
- package/dist/common/index.d.ts.map +1 -0
- package/dist/common/index.js +9 -0
- package/dist/common/store/use-consent-manager.cjs +47 -0
- package/dist/common/store/use-consent-manager.d.ts +136 -0
- package/dist/common/store/use-consent-manager.d.ts.map +1 -0
- package/dist/common/store/use-consent-manager.js +13 -0
- package/dist/common/store/use-translations.cjs +58 -0
- package/dist/common/store/use-translations.d.ts +29 -0
- package/dist/common/store/use-translations.d.ts.map +1 -0
- package/dist/common/store/use-translations.js +24 -0
- package/dist/common/types/consent-manager.cjs +19 -0
- package/dist/common/types/consent-manager.d.ts +82 -0
- package/dist/common/types/consent-manager.d.ts.map +1 -0
- package/dist/common/types/consent-manager.js +0 -0
- package/dist/common/utils/theme.cjs +47 -0
- package/dist/common/utils/theme.d.ts +8 -0
- package/dist/common/utils/theme.d.ts.map +1 -0
- package/dist/common/utils/theme.js +13 -0
- package/dist/common/utils/translations.cjs +86 -0
- package/dist/common/utils/translations.d.ts +14 -0
- package/dist/common/utils/translations.d.ts.map +1 -0
- package/dist/common/utils/translations.js +50 -0
- package/dist/consent-manager-dialog/__tests__/styles.spec.cjs +218 -0
- package/dist/consent-manager-dialog/__tests__/styles.spec.d.ts +2 -0
- package/dist/consent-manager-dialog/__tests__/styles.spec.d.ts.map +1 -0
- package/dist/consent-manager-dialog/__tests__/styles.spec.js +183 -0
- package/dist/consent-manager-dialog/__tests__/utils.cjs +68 -0
- package/dist/consent-manager-dialog/__tests__/utils.d.ts +13 -0
- package/dist/consent-manager-dialog/__tests__/utils.d.ts.map +1 -0
- package/dist/consent-manager-dialog/__tests__/utils.js +34 -0
- package/dist/consent-manager-dialog/atoms/dialog-card.cjs +139 -0
- package/dist/consent-manager-dialog/atoms/dialog-card.d.ts +90 -0
- package/dist/consent-manager-dialog/atoms/dialog-card.d.ts.map +1 -0
- package/dist/consent-manager-dialog/atoms/dialog-card.js +94 -0
- package/dist/consent-manager-dialog/atoms/overlay.cjs +67 -0
- package/dist/consent-manager-dialog/atoms/overlay.d.ts +71 -0
- package/dist/consent-manager-dialog/atoms/overlay.d.ts.map +1 -0
- package/dist/consent-manager-dialog/atoms/overlay.js +32 -0
- package/dist/consent-manager-dialog/consent-manager-dialog.cjs +129 -0
- package/dist/consent-manager-dialog/consent-manager-dialog.css +75 -0
- package/dist/consent-manager-dialog/consent-manager-dialog.d.ts +44 -0
- package/dist/consent-manager-dialog/consent-manager-dialog.d.ts.map +1 -0
- package/dist/consent-manager-dialog/consent-manager-dialog.js +95 -0
- package/dist/consent-manager-dialog/index.cjs +51 -0
- package/dist/consent-manager-dialog/index.d.ts +4 -0
- package/dist/consent-manager-dialog/index.d.ts.map +1 -0
- package/dist/consent-manager-dialog/index.js +18 -0
- package/dist/consent-manager-dialog/theme.cjs +19 -0
- package/dist/consent-manager-dialog/theme.d.ts +19 -0
- package/dist/consent-manager-dialog/theme.d.ts.map +1 -0
- package/dist/consent-manager-dialog/theme.js +0 -0
- package/dist/consent-manager-widget/__tests__/styles.spec.cjs +228 -0
- package/dist/consent-manager-widget/__tests__/styles.spec.d.ts +2 -0
- package/dist/consent-manager-widget/__tests__/styles.spec.d.ts.map +1 -0
- package/dist/consent-manager-widget/__tests__/styles.spec.js +193 -0
- package/dist/consent-manager-widget/__tests__/utils.cjs +68 -0
- package/dist/consent-manager-widget/__tests__/utils.d.ts +13 -0
- package/dist/consent-manager-widget/__tests__/utils.d.ts.map +1 -0
- package/dist/consent-manager-widget/__tests__/utils.js +34 -0
- package/dist/consent-manager-widget/atoms/accordion.cjs +147 -0
- package/dist/consent-manager-widget/atoms/accordion.d.ts +57 -0
- package/dist/consent-manager-widget/atoms/accordion.d.ts.map +1 -0
- package/dist/consent-manager-widget/atoms/accordion.js +98 -0
- package/dist/consent-manager-widget/atoms/button.cjs +77 -0
- package/dist/consent-manager-widget/atoms/button.d.ts +17 -0
- package/dist/consent-manager-widget/atoms/button.d.ts.map +1 -0
- package/dist/consent-manager-widget/atoms/button.js +38 -0
- package/dist/consent-manager-widget/atoms/footer.cjs +70 -0
- package/dist/consent-manager-widget/atoms/footer.d.ts +22 -0
- package/dist/consent-manager-widget/atoms/footer.d.ts.map +1 -0
- package/dist/consent-manager-widget/atoms/footer.js +34 -0
- package/dist/consent-manager-widget/atoms/logo.cjs +101 -0
- package/dist/consent-manager-widget/atoms/logo.d.ts +8 -0
- package/dist/consent-manager-widget/atoms/logo.d.ts.map +1 -0
- package/dist/consent-manager-widget/atoms/logo.js +67 -0
- package/dist/consent-manager-widget/atoms/root.cjs +64 -0
- package/dist/consent-manager-widget/atoms/root.d.ts +82 -0
- package/dist/consent-manager-widget/atoms/root.d.ts.map +1 -0
- package/dist/consent-manager-widget/atoms/root.js +29 -0
- package/dist/consent-manager-widget/consent-manager-widget.cjs +98 -0
- package/dist/consent-manager-widget/consent-manager-widget.css +79 -0
- package/dist/consent-manager-widget/consent-manager-widget.d.ts +51 -0
- package/dist/consent-manager-widget/consent-manager-widget.d.ts.map +1 -0
- package/dist/consent-manager-widget/consent-manager-widget.js +64 -0
- package/dist/consent-manager-widget/index.cjs +62 -0
- package/dist/consent-manager-widget/index.d.ts +10 -0
- package/dist/consent-manager-widget/index.d.ts.map +1 -0
- package/dist/consent-manager-widget/index.js +29 -0
- package/dist/consent-manager-widget/theme.cjs +19 -0
- package/dist/consent-manager-widget/theme.d.ts +48 -0
- package/dist/consent-manager-widget/theme.d.ts.map +1 -0
- package/dist/consent-manager-widget/theme.js +0 -0
- package/dist/consent-manager-widget/types.cjs +19 -0
- package/dist/consent-manager-widget/types.d.ts +18 -0
- package/dist/consent-manager-widget/types.d.ts.map +1 -0
- package/dist/consent-manager-widget/types.js +0 -0
- package/dist/cookie-banner/__tests__/styles.spec.cjs +234 -0
- package/dist/cookie-banner/__tests__/styles.spec.d.ts +2 -0
- package/dist/cookie-banner/__tests__/styles.spec.d.ts.map +1 -0
- package/dist/cookie-banner/__tests__/styles.spec.js +199 -0
- package/dist/cookie-banner/__tests__/utils.cjs +67 -0
- package/dist/cookie-banner/__tests__/utils.d.ts +13 -0
- package/dist/cookie-banner/__tests__/utils.d.ts.map +1 -0
- package/dist/cookie-banner/__tests__/utils.js +33 -0
- package/dist/cookie-banner/atoms/overlay.cjs +71 -0
- package/dist/cookie-banner/atoms/overlay.d.ts +46 -0
- package/dist/cookie-banner/atoms/overlay.d.ts.map +1 -0
- package/dist/cookie-banner/atoms/overlay.js +36 -0
- package/dist/cookie-banner/atoms/root.cjs +116 -0
- package/dist/cookie-banner/atoms/root.d.ts +79 -0
- package/dist/cookie-banner/atoms/root.d.ts.map +1 -0
- package/dist/cookie-banner/atoms/root.js +81 -0
- package/dist/cookie-banner/components.cjs +160 -0
- package/dist/cookie-banner/components.d.ts +136 -0
- package/dist/cookie-banner/components.d.ts.map +1 -0
- package/dist/cookie-banner/components.js +109 -0
- package/dist/cookie-banner/cookie-banner.cjs +99 -0
- package/dist/cookie-banner/cookie-banner.css +226 -0
- package/dist/cookie-banner/cookie-banner.d.ts +134 -0
- package/dist/cookie-banner/cookie-banner.d.ts.map +1 -0
- package/dist/cookie-banner/cookie-banner.js +65 -0
- package/dist/cookie-banner/error-boundary.cjs +68 -0
- package/dist/cookie-banner/error-boundary.d.ts +56 -0
- package/dist/cookie-banner/error-boundary.d.ts.map +1 -0
- package/dist/cookie-banner/error-boundary.js +34 -0
- package/dist/cookie-banner/index.cjs +59 -0
- package/dist/cookie-banner/index.d.ts +52 -0
- package/dist/cookie-banner/index.d.ts.map +1 -0
- package/dist/cookie-banner/index.js +26 -0
- package/dist/cookie-banner/theme.cjs +19 -0
- package/dist/cookie-banner/theme.d.ts +30 -0
- package/dist/cookie-banner/theme.d.ts.map +1 -0
- package/dist/cookie-banner/theme.js +0 -0
- package/dist/index.cjs +89 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +8 -0
- package/dist/primitives/box.cjs +54 -0
- package/dist/primitives/box.d.ts +47 -0
- package/dist/primitives/box.d.ts.map +1 -0
- package/dist/primitives/box.js +20 -0
- package/dist/primitives/button.cjs +93 -0
- package/dist/primitives/button.d.ts +207 -0
- package/dist/primitives/button.d.ts.map +1 -0
- package/dist/primitives/button.js +59 -0
- package/dist/primitives/button.types.cjs +19 -0
- package/dist/primitives/button.types.d.ts +34 -0
- package/dist/primitives/button.types.d.ts.map +1 -0
- package/dist/primitives/button.types.js +0 -0
- package/dist/theme/context.cjs +44 -0
- package/dist/theme/context.d.ts +96 -0
- package/dist/theme/context.d.ts.map +1 -0
- package/dist/theme/context.js +9 -0
- package/dist/theme/index.cjs +39 -0
- package/dist/theme/index.d.ts +6 -0
- package/dist/theme/index.d.ts.map +1 -0
- package/dist/theme/index.js +6 -0
- package/dist/theme/style-keys.cjs +39 -0
- package/dist/theme/style-keys.d.ts +77 -0
- package/dist/theme/style-keys.d.ts.map +1 -0
- package/dist/theme/style-keys.js +5 -0
- package/dist/theme/use-style.cjs +95 -0
- package/dist/theme/use-style.d.ts +32 -0
- package/dist/theme/use-style.d.ts.map +1 -0
- package/dist/theme/use-style.js +61 -0
- package/dist/theme/utils/merge-styles.cjs +62 -0
- package/dist/theme/utils/merge-styles.d.ts +3 -0
- package/dist/theme/utils/merge-styles.d.ts.map +1 -0
- package/dist/theme/utils/merge-styles.js +28 -0
- package/dist/ui/components/accordion.cjs +204 -0
- package/dist/ui/components/accordion.css +158 -0
- package/dist/ui/components/accordion.d.ts +45 -0
- package/dist/ui/components/accordion.d.ts.map +1 -0
- package/dist/ui/components/accordion.js +164 -0
- package/dist/ui/components/button.cjs +185 -0
- package/dist/ui/components/button.css +303 -0
- package/dist/ui/components/button.d.ts +445 -0
- package/dist/ui/components/button.d.ts.map +1 -0
- package/dist/ui/components/button.js +149 -0
- package/dist/ui/components/card.cjs +80 -0
- package/dist/ui/components/card.css +55 -0
- package/dist/ui/components/card.d.ts +10 -0
- package/dist/ui/components/card.d.ts.map +1 -0
- package/dist/ui/components/card.js +41 -0
- package/dist/ui/components/icon.cjs +57 -0
- package/dist/ui/components/icon.d.ts +8 -0
- package/dist/ui/components/icon.d.ts.map +1 -0
- package/dist/ui/components/icon.js +23 -0
- package/dist/ui/components/logo.cjs +101 -0
- package/dist/ui/components/logo.d.ts +8 -0
- package/dist/ui/components/logo.d.ts.map +1 -0
- package/dist/ui/components/logo.js +67 -0
- package/dist/ui/components/switch.cjs +81 -0
- package/dist/ui/components/switch.css +135 -0
- package/dist/ui/components/switch.d.ts +25 -0
- package/dist/ui/components/switch.d.ts.map +1 -0
- package/dist/ui/components/switch.js +47 -0
- package/dist/ui/libs/cn.cjs +55 -0
- package/dist/ui/libs/cn.d.ts +11 -0
- package/dist/ui/libs/cn.d.ts.map +1 -0
- package/dist/ui/libs/cn.js +6 -0
- package/dist/ui/libs/polymorphic.cjs +19 -0
- package/dist/ui/libs/polymorphic.d.ts +15 -0
- package/dist/ui/libs/polymorphic.d.ts.map +1 -0
- package/dist/ui/libs/polymorphic.js +0 -0
- package/dist/ui/libs/recursive-clone-children.cjs +49 -0
- package/dist/ui/libs/recursive-clone-children.d.ts +14 -0
- package/dist/ui/libs/recursive-clone-children.d.ts.map +1 -0
- package/dist/ui/libs/recursive-clone-children.js +15 -0
- package/dist/ui/theme/context.cjs +6 -0
- package/dist/ui/theme/context.d.ts +2 -0
- package/dist/ui/theme/context.d.ts.map +1 -0
- package/dist/ui/theme/context.js +0 -0
- package/package.json +71 -0
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import * as __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__ from "react/jsx-runtime";
|
|
2
|
+
import * as __WEBPACK_EXTERNAL_MODULE_vitest__ from "vitest";
|
|
3
|
+
import * as __WEBPACK_EXTERNAL_MODULE__index_js_cbfda0f6__ from "../../index.js";
|
|
4
|
+
import * as __WEBPACK_EXTERNAL_MODULE__utils_js_d88b7fe1__ from "./utils.js";
|
|
5
|
+
const ALL_COMPONENTS = [
|
|
6
|
+
{
|
|
7
|
+
testId: 'consent-manager-dialog-root',
|
|
8
|
+
themeKey: 'consent-manager-dialog.root',
|
|
9
|
+
styles: 'custom-dialog-root'
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
testId: 'consent-manager-dialog-overlay',
|
|
13
|
+
themeKey: 'consent-manager-dialog.overlay',
|
|
14
|
+
styles: 'custom-dialog-overlay'
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
testId: 'consent-manager-dialog-header',
|
|
18
|
+
themeKey: 'consent-manager-dialog.header',
|
|
19
|
+
styles: 'custom-dialog-header'
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
testId: 'consent-manager-dialog-title',
|
|
23
|
+
themeKey: 'consent-manager-dialog.title',
|
|
24
|
+
styles: 'custom-dialog-title'
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
testId: "consent-manager-dialog-description",
|
|
28
|
+
themeKey: "consent-manager-dialog.description",
|
|
29
|
+
styles: "custom-dialog-description"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
testId: 'consent-manager-dialog-content',
|
|
33
|
+
themeKey: 'consent-manager-dialog.content',
|
|
34
|
+
styles: 'custom-dialog-content'
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
testId: 'consent-manager-dialog-footer',
|
|
38
|
+
themeKey: 'consent-manager-dialog.footer',
|
|
39
|
+
styles: 'custom-dialog-footer'
|
|
40
|
+
}
|
|
41
|
+
];
|
|
42
|
+
(0, __WEBPACK_EXTERNAL_MODULE_vitest__.test)('Theme prop applies string classnames to all components', async ()=>{
|
|
43
|
+
const test = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__index_js_cbfda0f6__.ConsentManagerDialog, {
|
|
44
|
+
open: true,
|
|
45
|
+
theme: ALL_COMPONENTS.reduce((acc, { themeKey, styles })=>{
|
|
46
|
+
acc[themeKey] = styles;
|
|
47
|
+
return acc;
|
|
48
|
+
}, {})
|
|
49
|
+
});
|
|
50
|
+
await (0, __WEBPACK_EXTERNAL_MODULE__utils_js_d88b7fe1__["default"])({
|
|
51
|
+
component: test,
|
|
52
|
+
testCases: ALL_COMPONENTS.map(({ testId, styles })=>({
|
|
53
|
+
testId,
|
|
54
|
+
styles
|
|
55
|
+
}))
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
(0, __WEBPACK_EXTERNAL_MODULE_vitest__.test)('Theme prop supports object format with className and style for all components', async ()=>{
|
|
59
|
+
const style = {
|
|
60
|
+
backgroundColor: '#ffffff',
|
|
61
|
+
padding: '20px',
|
|
62
|
+
border: '1px solid #000000'
|
|
63
|
+
};
|
|
64
|
+
const testCases = ALL_COMPONENTS.map(({ testId, themeKey, styles })=>({
|
|
65
|
+
testId,
|
|
66
|
+
themeKey,
|
|
67
|
+
className: styles,
|
|
68
|
+
style
|
|
69
|
+
}));
|
|
70
|
+
const test = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__index_js_cbfda0f6__.ConsentManagerDialog, {
|
|
71
|
+
open: true,
|
|
72
|
+
theme: testCases.reduce((acc, { themeKey, className, style })=>{
|
|
73
|
+
acc[themeKey] = {
|
|
74
|
+
className,
|
|
75
|
+
style
|
|
76
|
+
};
|
|
77
|
+
return acc;
|
|
78
|
+
}, {})
|
|
79
|
+
});
|
|
80
|
+
await (0, __WEBPACK_EXTERNAL_MODULE__utils_js_d88b7fe1__["default"])({
|
|
81
|
+
component: test,
|
|
82
|
+
testCases: testCases.map(({ testId, className, style })=>({
|
|
83
|
+
testId,
|
|
84
|
+
styles: {
|
|
85
|
+
className,
|
|
86
|
+
style
|
|
87
|
+
}
|
|
88
|
+
}))
|
|
89
|
+
});
|
|
90
|
+
});
|
|
91
|
+
(0, __WEBPACK_EXTERNAL_MODULE_vitest__.test)('No style prop removes default styles but keeps custom classNames', async ()=>{
|
|
92
|
+
const test = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__index_js_cbfda0f6__.ConsentManagerDialog, {
|
|
93
|
+
noStyle: true,
|
|
94
|
+
open: true,
|
|
95
|
+
theme: ALL_COMPONENTS.reduce((acc, { themeKey, styles })=>{
|
|
96
|
+
acc[themeKey] = styles;
|
|
97
|
+
return acc;
|
|
98
|
+
}, {})
|
|
99
|
+
});
|
|
100
|
+
await (0, __WEBPACK_EXTERNAL_MODULE__utils_js_d88b7fe1__["default"])({
|
|
101
|
+
component: test,
|
|
102
|
+
testCases: ALL_COMPONENTS.map(({ testId, styles })=>({
|
|
103
|
+
testId,
|
|
104
|
+
styles
|
|
105
|
+
})),
|
|
106
|
+
noStyle: true
|
|
107
|
+
});
|
|
108
|
+
});
|
|
109
|
+
(0, __WEBPACK_EXTERNAL_MODULE_vitest__.test)('Theme prop handles mixed format (string and object) correctly', async ()=>{
|
|
110
|
+
const mixedTheme = {
|
|
111
|
+
'consent-manager-dialog.root': {
|
|
112
|
+
className: 'custom-dialog-root',
|
|
113
|
+
style: {
|
|
114
|
+
backgroundColor: 'rgb(255, 255, 255)',
|
|
115
|
+
padding: '16px'
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
'consent-manager-dialog.overlay': 'custom-dialog-overlay'
|
|
119
|
+
};
|
|
120
|
+
const test = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__index_js_cbfda0f6__.ConsentManagerDialog, {
|
|
121
|
+
theme: mixedTheme,
|
|
122
|
+
open: true
|
|
123
|
+
});
|
|
124
|
+
await (0, __WEBPACK_EXTERNAL_MODULE__utils_js_d88b7fe1__["default"])({
|
|
125
|
+
component: test,
|
|
126
|
+
testCases: [
|
|
127
|
+
{
|
|
128
|
+
testId: 'consent-manager-dialog-root',
|
|
129
|
+
styles: {
|
|
130
|
+
className: 'custom-dialog-root',
|
|
131
|
+
style: {
|
|
132
|
+
backgroundColor: 'rgb(255, 255, 255)',
|
|
133
|
+
padding: '16px'
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
testId: 'consent-manager-dialog-overlay',
|
|
139
|
+
styles: 'custom-dialog-overlay'
|
|
140
|
+
}
|
|
141
|
+
]
|
|
142
|
+
});
|
|
143
|
+
});
|
|
144
|
+
(0, __WEBPACK_EXTERNAL_MODULE_vitest__.test)('Theme prop handles edge cases gracefully', async ()=>{
|
|
145
|
+
const edgeCaseTheme = {
|
|
146
|
+
'consent-manager-dialog.root': '',
|
|
147
|
+
'consent-manager-dialog.overlay': '',
|
|
148
|
+
'consent-manager-dialog.content': {
|
|
149
|
+
className: '',
|
|
150
|
+
style: {
|
|
151
|
+
margin: '0',
|
|
152
|
+
padding: '0'
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
};
|
|
156
|
+
const test = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__index_js_cbfda0f6__.ConsentManagerDialog, {
|
|
157
|
+
open: true,
|
|
158
|
+
theme: edgeCaseTheme
|
|
159
|
+
});
|
|
160
|
+
await (0, __WEBPACK_EXTERNAL_MODULE__utils_js_d88b7fe1__["default"])({
|
|
161
|
+
component: test,
|
|
162
|
+
testCases: [
|
|
163
|
+
{
|
|
164
|
+
testId: 'consent-manager-dialog-root',
|
|
165
|
+
styles: ''
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
testId: 'consent-manager-dialog-overlay',
|
|
169
|
+
styles: ''
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
testId: 'consent-manager-dialog-content',
|
|
173
|
+
styles: {
|
|
174
|
+
className: '',
|
|
175
|
+
style: {
|
|
176
|
+
margin: '0',
|
|
177
|
+
padding: '0'
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
]
|
|
182
|
+
});
|
|
183
|
+
});
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = function(exports1, definition) {
|
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: definition[key]
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
})();
|
|
11
|
+
(()=>{
|
|
12
|
+
__webpack_require__.o = function(obj, prop) {
|
|
13
|
+
return Object.prototype.hasOwnProperty.call(obj, prop);
|
|
14
|
+
};
|
|
15
|
+
})();
|
|
16
|
+
(()=>{
|
|
17
|
+
__webpack_require__.r = function(exports1) {
|
|
18
|
+
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
19
|
+
value: 'Module'
|
|
20
|
+
});
|
|
21
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
22
|
+
value: true
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
})();
|
|
26
|
+
var __webpack_exports__ = {};
|
|
27
|
+
__webpack_require__.r(__webpack_exports__);
|
|
28
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
29
|
+
default: ()=>utils_rslib_entry_
|
|
30
|
+
});
|
|
31
|
+
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
32
|
+
const external_vitest_namespaceObject = require("vitest");
|
|
33
|
+
const external_vitest_browser_react_namespaceObject = require("vitest-browser-react");
|
|
34
|
+
const external_index_cjs_namespaceObject = require("../../index.cjs");
|
|
35
|
+
async function testComponentStyles({ component, testCases, noStyle = false }) {
|
|
36
|
+
const { getByTestId } = (0, external_vitest_browser_react_namespaceObject.render)(/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_index_cjs_namespaceObject.ConsentManagerProvider, {
|
|
37
|
+
noStyle: noStyle,
|
|
38
|
+
children: component
|
|
39
|
+
}));
|
|
40
|
+
for (const { testId, styles } of testCases){
|
|
41
|
+
const element = getByTestId(testId);
|
|
42
|
+
if ('string' == typeof styles || styles?.className) {
|
|
43
|
+
const classNames = 'string' == typeof styles ? styles : styles?.className;
|
|
44
|
+
if (classNames) await external_vitest_namespaceObject.expect.element(element).toHaveClass(classNames, {
|
|
45
|
+
exact: noStyle
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
if ('object' == typeof styles && styles?.style) {
|
|
49
|
+
const styleEntries = Object.entries(styles.style).map(([key, value])=>{
|
|
50
|
+
const cssKey = key.replace(/([A-Z])/g, '-$1').toLowerCase();
|
|
51
|
+
return [
|
|
52
|
+
cssKey,
|
|
53
|
+
value
|
|
54
|
+
];
|
|
55
|
+
});
|
|
56
|
+
await new Promise((resolve)=>setTimeout(resolve, 100));
|
|
57
|
+
for (const [property, value] of styleEntries)await external_vitest_namespaceObject.expect.element(element).toHaveStyle({
|
|
58
|
+
[property]: value
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
const utils_rslib_entry_ = testComponentStyles;
|
|
64
|
+
var __webpack_export_target__ = exports;
|
|
65
|
+
for(var __webpack_i__ in __webpack_exports__)__webpack_export_target__[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
66
|
+
if (__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_target__, '__esModule', {
|
|
67
|
+
value: true
|
|
68
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { ThemeValue } from '../../theme/types/style-types';
|
|
3
|
+
interface ComponentStyles {
|
|
4
|
+
component: ReactNode;
|
|
5
|
+
testCases: {
|
|
6
|
+
testId: string;
|
|
7
|
+
styles: string | ThemeValue;
|
|
8
|
+
}[];
|
|
9
|
+
noStyle?: boolean;
|
|
10
|
+
}
|
|
11
|
+
declare function testComponentStyles({ component, testCases, noStyle, }: ComponentStyles): Promise<void>;
|
|
12
|
+
export default testComponentStyles;
|
|
13
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/consent-manager-dialog/__tests__/utils.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAEhE,UAAU,eAAe;IACxB,SAAS,EAAE,SAAS,CAAC;IACrB,SAAS,EAAE;QACV,MAAM,EAAE,MAAM,CAAC;QACf,MAAM,EAAE,MAAM,GAAG,UAAU,CAAC;KAC5B,EAAE,CAAC;IACJ,OAAO,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,iBAAe,mBAAmB,CAAC,EAClC,SAAS,EACT,SAAS,EACT,OAAe,GACf,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAyCjC;AAED,eAAe,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import * as __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__ from "react/jsx-runtime";
|
|
2
|
+
import * as __WEBPACK_EXTERNAL_MODULE_vitest__ from "vitest";
|
|
3
|
+
import * as __WEBPACK_EXTERNAL_MODULE_vitest_browser_react_6a851916__ from "vitest-browser-react";
|
|
4
|
+
import * as __WEBPACK_EXTERNAL_MODULE__index_js_cbfda0f6__ from "../../index.js";
|
|
5
|
+
async function testComponentStyles({ component, testCases, noStyle = false }) {
|
|
6
|
+
const { getByTestId } = (0, __WEBPACK_EXTERNAL_MODULE_vitest_browser_react_6a851916__.render)(/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__index_js_cbfda0f6__.ConsentManagerProvider, {
|
|
7
|
+
noStyle: noStyle,
|
|
8
|
+
children: component
|
|
9
|
+
}));
|
|
10
|
+
for (const { testId, styles } of testCases){
|
|
11
|
+
const element = getByTestId(testId);
|
|
12
|
+
if ('string' == typeof styles || styles?.className) {
|
|
13
|
+
const classNames = 'string' == typeof styles ? styles : styles?.className;
|
|
14
|
+
if (classNames) await __WEBPACK_EXTERNAL_MODULE_vitest__.expect.element(element).toHaveClass(classNames, {
|
|
15
|
+
exact: noStyle
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
if ('object' == typeof styles && styles?.style) {
|
|
19
|
+
const styleEntries = Object.entries(styles.style).map(([key, value])=>{
|
|
20
|
+
const cssKey = key.replace(/([A-Z])/g, '-$1').toLowerCase();
|
|
21
|
+
return [
|
|
22
|
+
cssKey,
|
|
23
|
+
value
|
|
24
|
+
];
|
|
25
|
+
});
|
|
26
|
+
await new Promise((resolve)=>setTimeout(resolve, 100));
|
|
27
|
+
for (const [property, value] of styleEntries)await __WEBPACK_EXTERNAL_MODULE_vitest__.expect.element(element).toHaveStyle({
|
|
28
|
+
[property]: value
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
const utils_rslib_entry_ = testComponentStyles;
|
|
34
|
+
export { utils_rslib_entry_ as default };
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
"use strict";
|
|
3
|
+
var __webpack_require__ = {};
|
|
4
|
+
(()=>{
|
|
5
|
+
__webpack_require__.d = function(exports1, definition) {
|
|
6
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: definition[key]
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
})();
|
|
12
|
+
(()=>{
|
|
13
|
+
__webpack_require__.o = function(obj, prop) {
|
|
14
|
+
return Object.prototype.hasOwnProperty.call(obj, prop);
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
(()=>{
|
|
18
|
+
__webpack_require__.r = function(exports1) {
|
|
19
|
+
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
20
|
+
value: 'Module'
|
|
21
|
+
});
|
|
22
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
23
|
+
value: true
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
})();
|
|
27
|
+
var __webpack_exports__ = {};
|
|
28
|
+
__webpack_require__.r(__webpack_exports__);
|
|
29
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
30
|
+
Footer: ()=>Footer,
|
|
31
|
+
Content: ()=>Content,
|
|
32
|
+
Header: ()=>Header,
|
|
33
|
+
Card: ()=>Card,
|
|
34
|
+
DialogHeaderTitle: ()=>DialogHeaderTitle,
|
|
35
|
+
HeaderDescription: ()=>HeaderDescription,
|
|
36
|
+
ConsentCustomizationCard: ()=>ConsentCustomizationCard,
|
|
37
|
+
DialogFooter: ()=>DialogFooter,
|
|
38
|
+
DialogHeaderDescription: ()=>DialogHeaderDescription,
|
|
39
|
+
DialogHeader: ()=>DialogHeader,
|
|
40
|
+
DialogContent: ()=>DialogContent,
|
|
41
|
+
HeaderTitle: ()=>HeaderTitle
|
|
42
|
+
});
|
|
43
|
+
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
44
|
+
const external_react_namespaceObject = require("react");
|
|
45
|
+
const use_translations_cjs_namespaceObject = require("../../common/store/use-translations.cjs");
|
|
46
|
+
const consent_manager_widget_cjs_namespaceObject = require("../../consent-manager-widget/consent-manager-widget.cjs");
|
|
47
|
+
const box_cjs_namespaceObject = require("../../primitives/box.cjs");
|
|
48
|
+
const logo_cjs_namespaceObject = require("../../ui/components/logo.cjs");
|
|
49
|
+
const DialogCard = /*#__PURE__*/ (0, external_react_namespaceObject.forwardRef)(({ children, ...props }, ref)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(box_cjs_namespaceObject.Box, {
|
|
50
|
+
ref: ref,
|
|
51
|
+
baseClassName: "c15t-card c15t-consent-manager-dialog-card",
|
|
52
|
+
...props,
|
|
53
|
+
themeKey: "consent-manager-dialog.root",
|
|
54
|
+
"data-testid": "consent-manager-dialog-root",
|
|
55
|
+
children: children
|
|
56
|
+
}));
|
|
57
|
+
const DialogHeader = /*#__PURE__*/ (0, external_react_namespaceObject.forwardRef)(({ children, ...props }, ref)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(box_cjs_namespaceObject.Box, {
|
|
58
|
+
ref: ref,
|
|
59
|
+
baseClassName: "c15t-card-header c15t-consent-manager-dialog-card",
|
|
60
|
+
...props,
|
|
61
|
+
themeKey: "consent-manager-dialog.header",
|
|
62
|
+
"data-testid": "consent-manager-dialog-header",
|
|
63
|
+
children: children
|
|
64
|
+
}));
|
|
65
|
+
const DialogHeaderTitle = /*#__PURE__*/ (0, external_react_namespaceObject.forwardRef)(({ children, ...props }, ref)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(box_cjs_namespaceObject.Box, {
|
|
66
|
+
ref: ref,
|
|
67
|
+
baseClassName: "c15t-card-title",
|
|
68
|
+
themeKey: "consent-manager-dialog.title",
|
|
69
|
+
...props,
|
|
70
|
+
"data-testid": "consent-manager-dialog-title",
|
|
71
|
+
children: children
|
|
72
|
+
}));
|
|
73
|
+
const DialogHeaderDescription = /*#__PURE__*/ (0, external_react_namespaceObject.forwardRef)(({ children, ...props }, ref)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(box_cjs_namespaceObject.Box, {
|
|
74
|
+
ref: ref,
|
|
75
|
+
baseClassName: "c15t-card-description",
|
|
76
|
+
themeKey: "consent-manager-dialog.description",
|
|
77
|
+
...props,
|
|
78
|
+
"data-testid": "consent-manager-dialog-description",
|
|
79
|
+
children: children
|
|
80
|
+
}));
|
|
81
|
+
const DialogContent = /*#__PURE__*/ (0, external_react_namespaceObject.forwardRef)(({ children, ...props }, ref)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(box_cjs_namespaceObject.Box, {
|
|
82
|
+
ref: ref,
|
|
83
|
+
baseClassName: "c15t-card-content",
|
|
84
|
+
themeKey: "consent-manager-dialog.content",
|
|
85
|
+
"data-testid": "consent-manager-dialog-content",
|
|
86
|
+
...props,
|
|
87
|
+
children: children
|
|
88
|
+
}));
|
|
89
|
+
const DialogFooter = /*#__PURE__*/ (0, external_react_namespaceObject.forwardRef)(({ ...props }, ref)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(box_cjs_namespaceObject.Box, {
|
|
90
|
+
ref: ref,
|
|
91
|
+
baseClassName: "c15t-card-footer",
|
|
92
|
+
themeKey: "consent-manager-dialog.footer",
|
|
93
|
+
...props,
|
|
94
|
+
"data-testid": "consent-manager-dialog-footer",
|
|
95
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("a", {
|
|
96
|
+
className: "c15t-consent-manager-widget-branding-link",
|
|
97
|
+
href: "https://c15t.com",
|
|
98
|
+
children: [
|
|
99
|
+
"Secured by ",
|
|
100
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(logo_cjs_namespaceObject.ConsentManagementIcon, {})
|
|
101
|
+
]
|
|
102
|
+
})
|
|
103
|
+
}));
|
|
104
|
+
const ConsentCustomizationCard = ({ noStyle })=>{
|
|
105
|
+
const translations = (0, use_translations_cjs_namespaceObject.useTranslations)();
|
|
106
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(DialogCard, {
|
|
107
|
+
children: [
|
|
108
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(DialogHeader, {
|
|
109
|
+
children: [
|
|
110
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(DialogHeaderTitle, {
|
|
111
|
+
children: translations.consentManagerDialog.title
|
|
112
|
+
}),
|
|
113
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(DialogHeaderDescription, {
|
|
114
|
+
children: translations.consentManagerDialog.description
|
|
115
|
+
})
|
|
116
|
+
]
|
|
117
|
+
}),
|
|
118
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(DialogContent, {
|
|
119
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(consent_manager_widget_cjs_namespaceObject.ConsentManagerWidget, {
|
|
120
|
+
hideBrading: true,
|
|
121
|
+
noStyle: noStyle,
|
|
122
|
+
useProvider: false
|
|
123
|
+
})
|
|
124
|
+
}),
|
|
125
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(DialogFooter, {})
|
|
126
|
+
]
|
|
127
|
+
});
|
|
128
|
+
};
|
|
129
|
+
const Card = DialogCard;
|
|
130
|
+
const Header = DialogHeader;
|
|
131
|
+
const HeaderTitle = DialogHeaderTitle;
|
|
132
|
+
const HeaderDescription = DialogHeaderDescription;
|
|
133
|
+
const Content = DialogContent;
|
|
134
|
+
const Footer = DialogFooter;
|
|
135
|
+
var __webpack_export_target__ = exports;
|
|
136
|
+
for(var __webpack_i__ in __webpack_exports__)__webpack_export_target__[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
137
|
+
if (__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_target__, '__esModule', {
|
|
138
|
+
value: true
|
|
139
|
+
});
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @packageDocumentation
|
|
3
|
+
* A collection of components for building privacy consent management dialogs.
|
|
4
|
+
* Built with accessibility and customization in mind, following GDPR, CCPA, and other privacy regulation requirements.
|
|
5
|
+
*/
|
|
6
|
+
import { type ReactNode } from 'react';
|
|
7
|
+
import { type BoxProps } from '../../primitives/box';
|
|
8
|
+
import type { ClassNameStyle } from '../../theme';
|
|
9
|
+
/**
|
|
10
|
+
* The header section of the privacy dialog.
|
|
11
|
+
* Should contain the DialogHeaderTitle and optionally DialogHeaderDescription.
|
|
12
|
+
*
|
|
13
|
+
* @remarks
|
|
14
|
+
* - Provides semantic structure for accessibility
|
|
15
|
+
* - Should be the first child of DialogCard
|
|
16
|
+
* - Styled according to the theme configuration
|
|
17
|
+
*/
|
|
18
|
+
declare const DialogHeader: import("react").ForwardRefExoticComponent<Omit<BoxProps, "themeKey"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
19
|
+
/**
|
|
20
|
+
* The title component for the privacy dialog header.
|
|
21
|
+
* Displays the main heading of the consent management interface.
|
|
22
|
+
*
|
|
23
|
+
* @remarks
|
|
24
|
+
* - Uses proper heading semantics for accessibility
|
|
25
|
+
* - Should be used within DialogHeader
|
|
26
|
+
* - Supports theme customization
|
|
27
|
+
*/
|
|
28
|
+
declare const DialogHeaderTitle: import("react").ForwardRefExoticComponent<Omit<BoxProps, "themeKey"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
29
|
+
/**
|
|
30
|
+
* The description component for the privacy dialog header.
|
|
31
|
+
* Provides additional context about privacy settings and consent choices.
|
|
32
|
+
*
|
|
33
|
+
* @remarks
|
|
34
|
+
* - Should be used after DialogHeaderTitle
|
|
35
|
+
* - Supports theme customization
|
|
36
|
+
* - Important for explaining privacy choices to users
|
|
37
|
+
*/
|
|
38
|
+
declare const DialogHeaderDescription: import("react").ForwardRefExoticComponent<Omit<BoxProps, "themeKey"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
39
|
+
/**
|
|
40
|
+
* The main content area of the privacy dialog.
|
|
41
|
+
* Contains the consent management interface and privacy controls.
|
|
42
|
+
*
|
|
43
|
+
* @remarks
|
|
44
|
+
* - Typically contains ConsentManagerWidget
|
|
45
|
+
* - Supports custom content and styling
|
|
46
|
+
* - Handles user interactions with privacy settings
|
|
47
|
+
*/
|
|
48
|
+
declare const DialogContent: import("react").ForwardRefExoticComponent<Omit<BoxProps, "themeKey"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
49
|
+
/**
|
|
50
|
+
* The footer section of the privacy dialog.
|
|
51
|
+
* Contains branding and additional privacy-related links.
|
|
52
|
+
*
|
|
53
|
+
* @remarks
|
|
54
|
+
* - Should be the last child of DialogCard
|
|
55
|
+
* - Includes c15t.com branding by default
|
|
56
|
+
* - Can be customized through theme configuration
|
|
57
|
+
*/
|
|
58
|
+
declare const DialogFooter: import("react").ForwardRefExoticComponent<Omit<BoxProps, "themeKey"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
59
|
+
/**
|
|
60
|
+
* A pre-configured privacy settings dialog card.
|
|
61
|
+
* Combines all dialog components with default content for privacy customization.
|
|
62
|
+
*
|
|
63
|
+
* @param {Object} props - Component props
|
|
64
|
+
* @param {boolean} [props.noStyle] - When true, removes default styling
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* ```tsx
|
|
68
|
+
* <ConsentCustomizationCard noStyle={false} />
|
|
69
|
+
* ```
|
|
70
|
+
*
|
|
71
|
+
* @remarks
|
|
72
|
+
* - Provides a complete privacy settings interface
|
|
73
|
+
* - Follows GDPR and CCPA requirements
|
|
74
|
+
* - Includes consent type management
|
|
75
|
+
* - Built-in accessibility features
|
|
76
|
+
*/
|
|
77
|
+
declare const ConsentCustomizationCard: ({ noStyle }: {
|
|
78
|
+
noStyle?: boolean;
|
|
79
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
80
|
+
declare const Card: import("react").ForwardRefExoticComponent<{
|
|
81
|
+
/** The content to be rendered inside the dialog card */
|
|
82
|
+
children?: ReactNode;
|
|
83
|
+
} & ClassNameStyle & import("react").RefAttributes<HTMLDivElement>>;
|
|
84
|
+
declare const Header: import("react").ForwardRefExoticComponent<Omit<BoxProps, "themeKey"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
85
|
+
declare const HeaderTitle: import("react").ForwardRefExoticComponent<Omit<BoxProps, "themeKey"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
86
|
+
declare const HeaderDescription: import("react").ForwardRefExoticComponent<Omit<BoxProps, "themeKey"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
87
|
+
declare const Content: import("react").ForwardRefExoticComponent<Omit<BoxProps, "themeKey"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
88
|
+
declare const Footer: import("react").ForwardRefExoticComponent<Omit<BoxProps, "themeKey"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
89
|
+
export { Card, Header, HeaderTitle, HeaderDescription, Content, Footer, ConsentCustomizationCard, DialogFooter, DialogHeader, DialogHeaderTitle, DialogHeaderDescription, DialogContent, };
|
|
90
|
+
//# sourceMappingURL=dialog-card.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dialog-card.d.ts","sourceRoot":"","sources":["../../../src/consent-manager-dialog/atoms/dialog-card.tsx"],"names":[],"mappings":"AAEA;;;;GAIG;AAEH,OAAO,EAAE,KAAK,SAAS,EAAwB,MAAM,OAAO,CAAC;AAI7D,OAAO,EAAO,KAAK,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AA2ClD;;;;;;;;GAQG;AACH,QAAA,MAAM,YAAY,uHAcjB,CAAC;AAEF;;;;;;;;GAQG;AACH,QAAA,MAAM,iBAAiB,uHAerB,CAAC;AAEH;;;;;;;;GAQG;AACH,QAAA,MAAM,uBAAuB,uHAe3B,CAAC;AAEH;;;;;;;;GAQG;AACH,QAAA,MAAM,aAAa,uHAclB,CAAC;AAEF;;;;;;;;GAQG;AACH,QAAA,MAAM,YAAY,uHAmBjB,CAAC;AAEF;;;;;;;;;;;;;;;;;GAiBG;AACH,QAAA,MAAM,wBAAwB,gBAAiB;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,4CAuBnE,CAAC;AAEF,QAAA,MAAM,IAAI;IAnNT,wDAAwD;eAC7C,SAAS;mEAkNE,CAAC;AACxB,QAAA,MAAM,MAAM,uHAAe,CAAC;AAC5B,QAAA,MAAM,WAAW,uHAAoB,CAAC;AACtC,QAAA,MAAM,iBAAiB,uHAA0B,CAAC;AAClD,QAAA,MAAM,OAAO,uHAAgB,CAAC;AAC9B,QAAA,MAAM,MAAM,uHAAe,CAAC;AAE5B,OAAO,EACN,IAAI,EACJ,MAAM,EACN,WAAW,EACX,iBAAiB,EACjB,OAAO,EACP,MAAM,EACN,wBAAwB,EACxB,YAAY,EACZ,YAAY,EACZ,iBAAiB,EACjB,uBAAuB,EACvB,aAAa,GACb,CAAC"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import * as __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__ from "react/jsx-runtime";
|
|
3
|
+
import * as __WEBPACK_EXTERNAL_MODULE_react__ from "react";
|
|
4
|
+
import * as __WEBPACK_EXTERNAL_MODULE__common_store_use_translations_js_31056175__ from "../../common/store/use-translations.js";
|
|
5
|
+
import * as __WEBPACK_EXTERNAL_MODULE__consent_manager_widget_consent_manager_widget_js_3e4fb923__ from "../../consent-manager-widget/consent-manager-widget.js";
|
|
6
|
+
import * as __WEBPACK_EXTERNAL_MODULE__primitives_box_js_62a8881e__ from "../../primitives/box.js";
|
|
7
|
+
import * as __WEBPACK_EXTERNAL_MODULE__ui_components_logo_js_31da8a14__ from "../../ui/components/logo.js";
|
|
8
|
+
const DialogCard = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react__.forwardRef)(({ children, ...props }, ref)=>/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__primitives_box_js_62a8881e__.Box, {
|
|
9
|
+
ref: ref,
|
|
10
|
+
baseClassName: "c15t-card c15t-consent-manager-dialog-card",
|
|
11
|
+
...props,
|
|
12
|
+
themeKey: "consent-manager-dialog.root",
|
|
13
|
+
"data-testid": "consent-manager-dialog-root",
|
|
14
|
+
children: children
|
|
15
|
+
}));
|
|
16
|
+
const DialogHeader = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react__.forwardRef)(({ children, ...props }, ref)=>/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__primitives_box_js_62a8881e__.Box, {
|
|
17
|
+
ref: ref,
|
|
18
|
+
baseClassName: "c15t-card-header c15t-consent-manager-dialog-card",
|
|
19
|
+
...props,
|
|
20
|
+
themeKey: "consent-manager-dialog.header",
|
|
21
|
+
"data-testid": "consent-manager-dialog-header",
|
|
22
|
+
children: children
|
|
23
|
+
}));
|
|
24
|
+
const DialogHeaderTitle = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react__.forwardRef)(({ children, ...props }, ref)=>/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__primitives_box_js_62a8881e__.Box, {
|
|
25
|
+
ref: ref,
|
|
26
|
+
baseClassName: "c15t-card-title",
|
|
27
|
+
themeKey: "consent-manager-dialog.title",
|
|
28
|
+
...props,
|
|
29
|
+
"data-testid": "consent-manager-dialog-title",
|
|
30
|
+
children: children
|
|
31
|
+
}));
|
|
32
|
+
const DialogHeaderDescription = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react__.forwardRef)(({ children, ...props }, ref)=>/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__primitives_box_js_62a8881e__.Box, {
|
|
33
|
+
ref: ref,
|
|
34
|
+
baseClassName: "c15t-card-description",
|
|
35
|
+
themeKey: "consent-manager-dialog.description",
|
|
36
|
+
...props,
|
|
37
|
+
"data-testid": "consent-manager-dialog-description",
|
|
38
|
+
children: children
|
|
39
|
+
}));
|
|
40
|
+
const DialogContent = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react__.forwardRef)(({ children, ...props }, ref)=>/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__primitives_box_js_62a8881e__.Box, {
|
|
41
|
+
ref: ref,
|
|
42
|
+
baseClassName: "c15t-card-content",
|
|
43
|
+
themeKey: "consent-manager-dialog.content",
|
|
44
|
+
"data-testid": "consent-manager-dialog-content",
|
|
45
|
+
...props,
|
|
46
|
+
children: children
|
|
47
|
+
}));
|
|
48
|
+
const DialogFooter = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react__.forwardRef)(({ ...props }, ref)=>/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__primitives_box_js_62a8881e__.Box, {
|
|
49
|
+
ref: ref,
|
|
50
|
+
baseClassName: "c15t-card-footer",
|
|
51
|
+
themeKey: "consent-manager-dialog.footer",
|
|
52
|
+
...props,
|
|
53
|
+
"data-testid": "consent-manager-dialog-footer",
|
|
54
|
+
children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsxs)("a", {
|
|
55
|
+
className: "c15t-consent-manager-widget-branding-link",
|
|
56
|
+
href: "https://c15t.com",
|
|
57
|
+
children: [
|
|
58
|
+
"Secured by ",
|
|
59
|
+
/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__ui_components_logo_js_31da8a14__.ConsentManagementIcon, {})
|
|
60
|
+
]
|
|
61
|
+
})
|
|
62
|
+
}));
|
|
63
|
+
const ConsentCustomizationCard = ({ noStyle })=>{
|
|
64
|
+
const translations = (0, __WEBPACK_EXTERNAL_MODULE__common_store_use_translations_js_31056175__.useTranslations)();
|
|
65
|
+
return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsxs)(DialogCard, {
|
|
66
|
+
children: [
|
|
67
|
+
/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsxs)(DialogHeader, {
|
|
68
|
+
children: [
|
|
69
|
+
/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(DialogHeaderTitle, {
|
|
70
|
+
children: translations.consentManagerDialog.title
|
|
71
|
+
}),
|
|
72
|
+
/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(DialogHeaderDescription, {
|
|
73
|
+
children: translations.consentManagerDialog.description
|
|
74
|
+
})
|
|
75
|
+
]
|
|
76
|
+
}),
|
|
77
|
+
/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(DialogContent, {
|
|
78
|
+
children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__consent_manager_widget_consent_manager_widget_js_3e4fb923__.ConsentManagerWidget, {
|
|
79
|
+
hideBrading: true,
|
|
80
|
+
noStyle: noStyle,
|
|
81
|
+
useProvider: false
|
|
82
|
+
})
|
|
83
|
+
}),
|
|
84
|
+
/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(DialogFooter, {})
|
|
85
|
+
]
|
|
86
|
+
});
|
|
87
|
+
};
|
|
88
|
+
const Card = DialogCard;
|
|
89
|
+
const Header = DialogHeader;
|
|
90
|
+
const HeaderTitle = DialogHeaderTitle;
|
|
91
|
+
const HeaderDescription = DialogHeaderDescription;
|
|
92
|
+
const Content = DialogContent;
|
|
93
|
+
const Footer = DialogFooter;
|
|
94
|
+
export { Card, ConsentCustomizationCard, Content, DialogContent, DialogFooter, DialogHeader, DialogHeaderDescription, DialogHeaderTitle, Footer, Header, HeaderDescription, HeaderTitle };
|