@c15t/react 1.0.5 → 1.1.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 (153) hide show
  1. package/dist/components/consent-manager-dialog/__tests__/styles.spec.cjs +1 -239
  2. package/dist/components/consent-manager-dialog/__tests__/styles.spec.js +1 -211
  3. package/dist/components/consent-manager-dialog/atoms/dialog-card.cjs +1 -188
  4. package/dist/components/consent-manager-dialog/atoms/dialog-card.js +1 -108
  5. package/dist/components/consent-manager-dialog/atoms/overlay.cjs +1 -84
  6. package/dist/components/consent-manager-dialog/atoms/overlay.d.ts +1 -1
  7. package/dist/components/consent-manager-dialog/atoms/overlay.d.ts.map +1 -1
  8. package/dist/components/consent-manager-dialog/atoms/overlay.js +1 -37
  9. package/dist/components/consent-manager-dialog/consent-manager-dialog.cjs +1 -143
  10. package/dist/components/consent-manager-dialog/consent-manager-dialog.d.ts +5 -0
  11. package/dist/components/consent-manager-dialog/consent-manager-dialog.d.ts.map +1 -1
  12. package/dist/components/consent-manager-dialog/consent-manager-dialog.js +1 -99
  13. package/dist/components/consent-manager-dialog/consent-manager-dialog.module.cjs +1 -52
  14. package/dist/components/consent-manager-dialog/consent-manager-dialog.module.js +1 -18
  15. package/dist/components/consent-manager-dialog/consent-manager-dialog_module.css +1 -217
  16. package/dist/components/consent-manager-dialog/index.cjs +1 -76
  17. package/dist/components/consent-manager-dialog/index.js +1 -17
  18. package/dist/components/consent-manager-dialog/theme.cjs +1 -18
  19. package/dist/components/consent-manager-widget/__tests__/styles.spec.cjs +1 -249
  20. package/dist/components/consent-manager-widget/__tests__/styles.spec.js +1 -221
  21. package/dist/components/consent-manager-widget/atoms/accordion.cjs +1 -195
  22. package/dist/components/consent-manager-widget/atoms/accordion.js +1 -106
  23. package/dist/components/consent-manager-widget/atoms/button.cjs +1 -107
  24. package/dist/components/consent-manager-widget/atoms/button.js +1 -52
  25. package/dist/components/consent-manager-widget/atoms/footer.cjs +1 -76
  26. package/dist/components/consent-manager-widget/atoms/footer.js +1 -23
  27. package/dist/components/consent-manager-widget/atoms/root.cjs +1 -61
  28. package/dist/components/consent-manager-widget/atoms/root.js +1 -24
  29. package/dist/components/consent-manager-widget/consent-manager-widget.cjs +1 -84
  30. package/dist/components/consent-manager-widget/consent-manager-widget.js +1 -50
  31. package/dist/components/consent-manager-widget/consent-manager-widget.module.cjs +1 -60
  32. package/dist/components/consent-manager-widget/consent-manager-widget.module.js +1 -26
  33. package/dist/components/consent-manager-widget/consent-manager-widget_module.css +1 -332
  34. package/dist/components/consent-manager-widget/index.cjs +1 -126
  35. package/dist/components/consent-manager-widget/index.js +1 -35
  36. package/dist/components/consent-manager-widget/theme.cjs +1 -18
  37. package/dist/components/consent-manager-widget/types.cjs +1 -18
  38. package/dist/components/cookie-banner/__tests__/cookie-banner.e2e.test.cjs +1 -189
  39. package/dist/components/cookie-banner/__tests__/cookie-banner.e2e.test.js +1 -183
  40. package/dist/components/cookie-banner/__tests__/styles.spec.cjs +1 -251
  41. package/dist/components/cookie-banner/__tests__/styles.spec.js +1 -223
  42. package/dist/components/cookie-banner/atoms/overlay.cjs +1 -87
  43. package/dist/components/cookie-banner/atoms/overlay.d.ts.map +1 -1
  44. package/dist/components/cookie-banner/atoms/overlay.js +1 -40
  45. package/dist/components/cookie-banner/atoms/root.cjs +1 -129
  46. package/dist/components/cookie-banner/atoms/root.d.ts.map +1 -1
  47. package/dist/components/cookie-banner/atoms/root.js +1 -82
  48. package/dist/components/cookie-banner/components.cjs +1 -216
  49. package/dist/components/cookie-banner/components.js +1 -121
  50. package/dist/components/cookie-banner/cookie-banner.cjs +1 -99
  51. package/dist/components/cookie-banner/cookie-banner.js +1 -65
  52. package/dist/components/cookie-banner/cookie-banner.module.cjs +1 -55
  53. package/dist/components/cookie-banner/cookie-banner.module.js +1 -21
  54. package/dist/components/cookie-banner/cookie-banner_module.css +1 -224
  55. package/dist/components/cookie-banner/error-boundary.cjs +1 -66
  56. package/dist/components/cookie-banner/error-boundary.js +1 -32
  57. package/dist/components/cookie-banner/index.cjs +1 -101
  58. package/dist/components/cookie-banner/index.js +1 -26
  59. package/dist/components/cookie-banner/theme.cjs +1 -18
  60. package/dist/components/shared/libs/polymorphic.cjs +1 -18
  61. package/dist/components/shared/libs/recursive-clone-children.cjs +1 -49
  62. package/dist/components/shared/libs/recursive-clone-children.js +1 -15
  63. package/dist/components/shared/primitives/box.cjs +1 -53
  64. package/dist/components/shared/primitives/box.js +1 -19
  65. package/dist/components/shared/primitives/button.cjs +1 -96
  66. package/dist/components/shared/primitives/button.d.ts +2 -86
  67. package/dist/components/shared/primitives/button.d.ts.map +1 -1
  68. package/dist/components/shared/primitives/button.js +1 -62
  69. package/dist/components/shared/primitives/button.types.cjs +1 -18
  70. package/dist/components/shared/ui/accordion/accordion.cjs +1 -226
  71. package/dist/components/shared/ui/accordion/accordion.js +1 -164
  72. package/dist/components/shared/ui/accordion/accordion.module.cjs +1 -49
  73. package/dist/components/shared/ui/accordion/accordion.module.js +1 -15
  74. package/dist/components/shared/ui/accordion/accordion.types.cjs +1 -18
  75. package/dist/components/shared/ui/accordion/accordion_module.css +1 -216
  76. package/dist/components/shared/ui/accordion/index.cjs +1 -69
  77. package/dist/components/shared/ui/accordion/index.js +1 -2
  78. package/dist/components/shared/ui/button/button.cjs +1 -199
  79. package/dist/components/shared/ui/button/button.d.ts +36 -182
  80. package/dist/components/shared/ui/button/button.d.ts.map +1 -1
  81. package/dist/components/shared/ui/button/button.js +1 -149
  82. package/dist/components/shared/ui/button/button.module.cjs +1 -65
  83. package/dist/components/shared/ui/button/button.module.js +1 -31
  84. package/dist/components/shared/ui/button/button.types.cjs +1 -18
  85. package/dist/components/shared/ui/button/button.types.d.ts +2 -0
  86. package/dist/components/shared/ui/button/button.types.d.ts.map +1 -1
  87. package/dist/components/shared/ui/button/button_module.css +1 -268
  88. package/dist/components/shared/ui/button/index.cjs +1 -69
  89. package/dist/components/shared/ui/button/index.js +1 -2
  90. package/dist/components/shared/ui/icon.cjs +1 -57
  91. package/dist/components/shared/ui/icon.js +1 -23
  92. package/dist/components/shared/ui/logo.cjs +1 -90
  93. package/dist/components/shared/ui/logo.js +1 -53
  94. package/dist/components/shared/ui/switch/index.cjs +1 -69
  95. package/dist/components/shared/ui/switch/index.js +1 -2
  96. package/dist/components/shared/ui/switch/switch.cjs +1 -91
  97. package/dist/components/shared/ui/switch/switch.js +1 -47
  98. package/dist/components/shared/ui/switch/switch.module.cjs +1 -45
  99. package/dist/components/shared/ui/switch/switch.module.js +1 -11
  100. package/dist/components/shared/ui/switch/switch.types.cjs +1 -18
  101. package/dist/components/shared/ui/switch/switch_module.css +1 -197
  102. package/dist/context/consent-manager-context.cjs +1 -37
  103. package/dist/context/consent-manager-context.js +1 -3
  104. package/dist/context/theme-context.cjs +1 -47
  105. package/dist/context/theme-context.js +1 -10
  106. package/dist/hooks/__tests__/use-consent-manager.test.cjs +1 -76
  107. package/dist/hooks/__tests__/use-consent-manager.test.js +1 -70
  108. package/dist/hooks/__tests__/use-styles.test.cjs +1 -76
  109. package/dist/hooks/__tests__/use-styles.test.js +1 -70
  110. package/dist/hooks/__tests__/use-theme.test.cjs +1 -86
  111. package/dist/hooks/__tests__/use-theme.test.js +1 -80
  112. package/dist/hooks/index.cjs +1 -87
  113. package/dist/hooks/index.js +1 -20
  114. package/dist/hooks/use-color-scheme.cjs +1 -66
  115. package/dist/hooks/use-color-scheme.js +1 -32
  116. package/dist/hooks/use-consent-manager.cjs +1 -49
  117. package/dist/hooks/use-consent-manager.js +1 -15
  118. package/dist/hooks/use-focus-trap.cjs +1 -76
  119. package/dist/hooks/use-focus-trap.js +1 -42
  120. package/dist/hooks/use-scroll-lock.cjs +1 -55
  121. package/dist/hooks/use-scroll-lock.js +1 -21
  122. package/dist/hooks/use-styles.cjs +1 -94
  123. package/dist/hooks/use-styles.js +1 -60
  124. package/dist/hooks/use-theme.cjs +1 -53
  125. package/dist/hooks/use-theme.js +1 -19
  126. package/dist/hooks/use-translations.cjs +1 -57
  127. package/dist/hooks/use-translations.js +1 -23
  128. package/dist/index.cjs +1 -137
  129. package/dist/index.js +1 -20
  130. package/dist/providers/__tests__/provider-basic.test.cjs +1 -127
  131. package/dist/providers/__tests__/provider-basic.test.js +1 -121
  132. package/dist/providers/__tests__/provider-context.test.cjs +1 -139
  133. package/dist/providers/__tests__/provider-context.test.js +1 -133
  134. package/dist/providers/__tests__/provider-errors.test.cjs +1 -98
  135. package/dist/providers/__tests__/provider-errors.test.js +1 -92
  136. package/dist/providers/__tests__/test-helpers.cjs +1 -171
  137. package/dist/providers/__tests__/test-helpers.js +1 -134
  138. package/dist/providers/consent-manager-provider.cjs +1 -162
  139. package/dist/providers/consent-manager-provider.js +1 -128
  140. package/dist/types/consent-manager.cjs +1 -18
  141. package/dist/types/theme/index.cjs +1 -69
  142. package/dist/types/theme/index.js +1 -2
  143. package/dist/types/theme/style-keys.cjs +1 -18
  144. package/dist/types/theme/style-types.cjs +1 -18
  145. package/dist/utils/cn.cjs +1 -49
  146. package/dist/utils/cn.js +1 -5
  147. package/dist/utils/merge-styles.cjs +1 -62
  148. package/dist/utils/merge-styles.js +1 -28
  149. package/dist/utils/test-helpers.cjs +1 -70
  150. package/dist/utils/test-helpers.js +1 -33
  151. package/dist/utils/translations.cjs +1 -89
  152. package/dist/utils/translations.js +1 -49
  153. package/package.json +4 -6
@@ -1,251 +1 @@
1
- "use strict";
2
- var __webpack_require__ = {};
3
- (()=>{
4
- __webpack_require__.n = (module)=>{
5
- var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
6
- __webpack_require__.d(getter, {
7
- a: getter
8
- });
9
- return getter;
10
- };
11
- })();
12
- (()=>{
13
- __webpack_require__.d = (exports1, definition)=>{
14
- for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
15
- enumerable: true,
16
- get: definition[key]
17
- });
18
- };
19
- })();
20
- (()=>{
21
- __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
22
- })();
23
- var __webpack_exports__ = {};
24
- const jsx_runtime_namespaceObject = require("react/jsx-runtime");
25
- const external_vitest_namespaceObject = require("vitest");
26
- const external_cookie_banner_cjs_namespaceObject = require("../cookie-banner.cjs");
27
- const test_helpers_cjs_namespaceObject = require("../../../utils/test-helpers.cjs");
28
- var test_helpers_cjs_default = /*#__PURE__*/ __webpack_require__.n(test_helpers_cjs_namespaceObject);
29
- external_vitest_namespaceObject.vi.mock('~/hooks/use-consent-manager', ()=>({
30
- useConsentManager: ()=>({
31
- showPopup: true,
32
- ...external_vitest_namespaceObject.vi.fn()
33
- })
34
- }));
35
- external_vitest_namespaceObject.vi.mock('~/hooks/use-translations', ()=>({
36
- useTranslations: ()=>({
37
- cookieBanner: {
38
- title: 'Cookie Settings',
39
- description: 'We use cookies to enhance your experience',
40
- acceptAll: 'Accept All',
41
- rejectAll: 'Reject All',
42
- customize: 'Customize'
43
- }
44
- })
45
- }));
46
- const ALL_COMPONENTS = [
47
- {
48
- testId: 'cookie-banner-root',
49
- themeKey: 'banner.root',
50
- styles: 'custom-root'
51
- },
52
- {
53
- testId: 'cookie-banner-card',
54
- themeKey: 'banner.card',
55
- styles: 'custom-card'
56
- },
57
- {
58
- testId: 'cookie-banner-header',
59
- themeKey: 'banner.header.root',
60
- styles: 'custom-header'
61
- },
62
- {
63
- testId: 'cookie-banner-title',
64
- themeKey: 'banner.header.title',
65
- styles: 'custom-title'
66
- },
67
- {
68
- testId: "cookie-banner-description",
69
- themeKey: "banner.header.description",
70
- styles: "custom-description"
71
- },
72
- {
73
- testId: 'cookie-banner-footer',
74
- themeKey: 'banner.footer',
75
- styles: 'custom-footer'
76
- },
77
- {
78
- testId: 'cookie-banner-footer-sub-group',
79
- themeKey: 'banner.footer.sub-group',
80
- styles: 'custom-footer-sub-group'
81
- },
82
- {
83
- testId: 'cookie-banner-overlay',
84
- themeKey: 'banner.overlay',
85
- styles: 'custom-overlay'
86
- },
87
- {
88
- testId: 'cookie-banner-reject-button',
89
- themeKey: 'banner.footer.reject-button',
90
- styles: 'custom-reject-button'
91
- },
92
- {
93
- testId: 'cookie-banner-customize-button',
94
- themeKey: 'banner.footer.customize-button',
95
- styles: 'custom-customize-button'
96
- },
97
- {
98
- testId: 'cookie-banner-accept-button',
99
- themeKey: 'banner.footer.accept-button',
100
- styles: 'custom-accept-button'
101
- }
102
- ];
103
- (0, external_vitest_namespaceObject.test)('Theme prop applies string classnames to all components', async ()=>{
104
- const test = /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_cookie_banner_cjs_namespaceObject.CookieBanner, {
105
- scrollLock: true,
106
- theme: ALL_COMPONENTS.reduce((acc, { themeKey, styles })=>{
107
- acc[themeKey] = styles;
108
- return acc;
109
- }, {})
110
- });
111
- await test_helpers_cjs_default()({
112
- component: test,
113
- testCases: ALL_COMPONENTS.map(({ testId, styles })=>({
114
- testId,
115
- styles
116
- }))
117
- });
118
- });
119
- (0, external_vitest_namespaceObject.test)('Theme prop supports object format with className and style for all components', async ()=>{
120
- const style = {
121
- backgroundColor: '#ffffff',
122
- padding: '20px',
123
- border: '1px solid #000000'
124
- };
125
- const testCases = ALL_COMPONENTS.map(({ testId, themeKey, styles })=>({
126
- testId,
127
- themeKey,
128
- className: styles,
129
- style
130
- }));
131
- const test = /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_cookie_banner_cjs_namespaceObject.CookieBanner, {
132
- scrollLock: true,
133
- theme: testCases.reduce((acc, { themeKey, className, style })=>{
134
- acc[themeKey] = {
135
- className,
136
- style
137
- };
138
- return acc;
139
- }, {})
140
- });
141
- await test_helpers_cjs_default()({
142
- component: test,
143
- testCases: testCases.map(({ testId, className, style })=>({
144
- testId,
145
- styles: {
146
- className,
147
- style
148
- }
149
- }))
150
- });
151
- });
152
- (0, external_vitest_namespaceObject.test)('No style prop removes default styles but keeps custom classNames', async ()=>{
153
- const test = /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_cookie_banner_cjs_namespaceObject.CookieBanner, {
154
- scrollLock: true,
155
- noStyle: true,
156
- theme: ALL_COMPONENTS.reduce((acc, { themeKey, styles })=>{
157
- acc[themeKey] = styles;
158
- return acc;
159
- }, {})
160
- });
161
- await test_helpers_cjs_default()({
162
- component: test,
163
- testCases: ALL_COMPONENTS.map(({ testId, styles })=>({
164
- testId,
165
- styles
166
- })),
167
- noStyle: true
168
- });
169
- });
170
- (0, external_vitest_namespaceObject.test)('Theme prop handles mixed format (string and object) correctly', async ()=>{
171
- const mixedTheme = {
172
- 'banner.root': {
173
- className: 'custom-root',
174
- style: {
175
- backgroundColor: 'rgb(255, 255, 255)',
176
- padding: '16px'
177
- }
178
- },
179
- 'banner.header.title': 'custom-title'
180
- };
181
- const test = /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_cookie_banner_cjs_namespaceObject.CookieBanner, {
182
- scrollLock: true,
183
- theme: mixedTheme
184
- });
185
- await test_helpers_cjs_default()({
186
- component: test,
187
- testCases: [
188
- {
189
- testId: 'cookie-banner-root',
190
- styles: {
191
- className: 'custom-root',
192
- style: {
193
- backgroundColor: 'rgb(255, 255, 255)',
194
- padding: '16px'
195
- }
196
- }
197
- },
198
- {
199
- testId: 'cookie-banner-title',
200
- styles: 'custom-title'
201
- }
202
- ]
203
- });
204
- });
205
- (0, external_vitest_namespaceObject.test)('Theme prop handles edge cases gracefully', async ()=>{
206
- const edgeCaseTheme = {
207
- 'banner.root': '',
208
- 'banner.card': '',
209
- 'banner.header.root': '',
210
- 'banner.header.title': '',
211
- "banner.header.description": '',
212
- 'banner.footer': {
213
- className: '',
214
- style: {
215
- margin: '0',
216
- padding: '0'
217
- }
218
- }
219
- };
220
- const test = /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_cookie_banner_cjs_namespaceObject.CookieBanner, {
221
- scrollLock: true,
222
- theme: edgeCaseTheme
223
- });
224
- await test_helpers_cjs_default()({
225
- component: test,
226
- testCases: [
227
- {
228
- testId: 'cookie-banner-root',
229
- styles: ''
230
- },
231
- {
232
- testId: 'cookie-banner-title',
233
- styles: ''
234
- },
235
- {
236
- testId: 'cookie-banner-footer',
237
- styles: {
238
- className: '',
239
- style: {
240
- margin: '0',
241
- padding: '0'
242
- }
243
- }
244
- }
245
- ]
246
- });
247
- });
248
- for(var __webpack_i__ in __webpack_exports__)exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
249
- Object.defineProperty(exports, '__esModule', {
250
- value: true
251
- });
1
+ "use strict";let __rslib_import_meta_url__="undefined"==typeof document?new(require("url".replace("",""))).URL("file:"+__filename).href:document.currentScript&&document.currentScript.src||new URL("main.js",document.baseURI).href;var __webpack_require__={};__webpack_require__.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},__webpack_require__.d=(e,t)=>{for(var s in t)__webpack_require__.o(t,s)&&!__webpack_require__.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var __webpack_exports__={};let jsx_runtime_namespaceObject=require("react/jsx-runtime"),external_vitest_namespaceObject=require("vitest"),external_cookie_banner_cjs_namespaceObject=require("../cookie-banner.cjs"),test_helpers_cjs_namespaceObject=require("../../../utils/test-helpers.cjs");var test_helpers_cjs_default=__webpack_require__.n(test_helpers_cjs_namespaceObject);external_vitest_namespaceObject.vi.mock("~/hooks/use-consent-manager",()=>({useConsentManager:()=>({showPopup:!0,...external_vitest_namespaceObject.vi.fn()})})),external_vitest_namespaceObject.vi.mock("~/hooks/use-translations",()=>({useTranslations:()=>({cookieBanner:{title:"Cookie Settings",description:"We use cookies to enhance your experience",acceptAll:"Accept All",rejectAll:"Reject All",customize:"Customize"}})}));let ALL_COMPONENTS=[{testId:"cookie-banner-root",themeKey:"banner.root",styles:"custom-root"},{testId:"cookie-banner-card",themeKey:"banner.card",styles:"custom-card"},{testId:"cookie-banner-header",themeKey:"banner.header.root",styles:"custom-header"},{testId:"cookie-banner-title",themeKey:"banner.header.title",styles:"custom-title"},{testId:"cookie-banner-description",themeKey:"banner.header.description",styles:"custom-description"},{testId:"cookie-banner-footer",themeKey:"banner.footer",styles:"custom-footer"},{testId:"cookie-banner-footer-sub-group",themeKey:"banner.footer.sub-group",styles:"custom-footer-sub-group"},{testId:"cookie-banner-overlay",themeKey:"banner.overlay",styles:"custom-overlay"},{testId:"cookie-banner-reject-button",themeKey:"banner.footer.reject-button",styles:"custom-reject-button"},{testId:"cookie-banner-customize-button",themeKey:"banner.footer.customize-button",styles:"custom-customize-button"},{testId:"cookie-banner-accept-button",themeKey:"banner.footer.accept-button",styles:"custom-accept-button"}];for(var __webpack_i__ in(0,external_vitest_namespaceObject.test)("Theme prop applies string classnames to all components",async()=>{let e=(0,jsx_runtime_namespaceObject.jsx)(external_cookie_banner_cjs_namespaceObject.CookieBanner,{scrollLock:!0,theme:ALL_COMPONENTS.reduce((e,{themeKey:t,styles:s})=>(e[t]=s,e),{})});await test_helpers_cjs_default()({component:e,testCases:ALL_COMPONENTS.map(({testId:e,styles:t})=>({testId:e,styles:t}))})}),(0,external_vitest_namespaceObject.test)("Theme prop supports object format with className and style for all components",async()=>{let e={backgroundColor:"#ffffff",padding:"20px",border:"1px solid #000000"},t=ALL_COMPONENTS.map(({testId:t,themeKey:s,styles:a})=>({testId:t,themeKey:s,className:a,style:e})),s=(0,jsx_runtime_namespaceObject.jsx)(external_cookie_banner_cjs_namespaceObject.CookieBanner,{scrollLock:!0,theme:t.reduce((e,{themeKey:t,className:s,style:a})=>(e[t]={className:s,style:a},e),{})});await test_helpers_cjs_default()({component:s,testCases:t.map(({testId:e,className:t,style:s})=>({testId:e,styles:{className:t,style:s}}))})}),(0,external_vitest_namespaceObject.test)("No style prop removes default styles but keeps custom classNames",async()=>{let e=(0,jsx_runtime_namespaceObject.jsx)(external_cookie_banner_cjs_namespaceObject.CookieBanner,{scrollLock:!0,noStyle:!0,theme:ALL_COMPONENTS.reduce((e,{themeKey:t,styles:s})=>(e[t]=s,e),{})});await test_helpers_cjs_default()({component:e,testCases:ALL_COMPONENTS.map(({testId:e,styles:t})=>({testId:e,styles:t})),noStyle:!0})}),(0,external_vitest_namespaceObject.test)("Theme prop handles mixed format (string and object) correctly",async()=>{let e=(0,jsx_runtime_namespaceObject.jsx)(external_cookie_banner_cjs_namespaceObject.CookieBanner,{scrollLock:!0,theme:{"banner.root":{className:"custom-root",style:{backgroundColor:"rgb(255, 255, 255)",padding:"16px"}},"banner.header.title":"custom-title"}});await test_helpers_cjs_default()({component:e,testCases:[{testId:"cookie-banner-root",styles:{className:"custom-root",style:{backgroundColor:"rgb(255, 255, 255)",padding:"16px"}}},{testId:"cookie-banner-title",styles:"custom-title"}]})}),(0,external_vitest_namespaceObject.test)("Theme prop handles edge cases gracefully",async()=>{let e=(0,jsx_runtime_namespaceObject.jsx)(external_cookie_banner_cjs_namespaceObject.CookieBanner,{scrollLock:!0,theme:{"banner.root":"","banner.card":"","banner.header.root":"","banner.header.title":"","banner.header.description":"","banner.footer":{className:"",style:{margin:"0",padding:"0"}}}});await test_helpers_cjs_default()({component:e,testCases:[{testId:"cookie-banner-root",styles:""},{testId:"cookie-banner-title",styles:""},{testId:"cookie-banner-footer",styles:{className:"",style:{margin:"0",padding:"0"}}}]})}),__webpack_exports__)exports[__webpack_i__]=__webpack_exports__[__webpack_i__];Object.defineProperty(exports,"__esModule",{value:!0});
@@ -1,223 +1 @@
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__cookie_banner_js_0a2d98b7__ from "../cookie-banner.js";
4
- import * as __WEBPACK_EXTERNAL_MODULE__utils_test_helpers_js_1e3d26b6__ from "../../../utils/test-helpers.js";
5
- __WEBPACK_EXTERNAL_MODULE_vitest__.vi.mock('~/hooks/use-consent-manager', ()=>({
6
- useConsentManager: ()=>({
7
- showPopup: true,
8
- ...__WEBPACK_EXTERNAL_MODULE_vitest__.vi.fn()
9
- })
10
- }));
11
- __WEBPACK_EXTERNAL_MODULE_vitest__.vi.mock('~/hooks/use-translations', ()=>({
12
- useTranslations: ()=>({
13
- cookieBanner: {
14
- title: 'Cookie Settings',
15
- description: 'We use cookies to enhance your experience',
16
- acceptAll: 'Accept All',
17
- rejectAll: 'Reject All',
18
- customize: 'Customize'
19
- }
20
- })
21
- }));
22
- const ALL_COMPONENTS = [
23
- {
24
- testId: 'cookie-banner-root',
25
- themeKey: 'banner.root',
26
- styles: 'custom-root'
27
- },
28
- {
29
- testId: 'cookie-banner-card',
30
- themeKey: 'banner.card',
31
- styles: 'custom-card'
32
- },
33
- {
34
- testId: 'cookie-banner-header',
35
- themeKey: 'banner.header.root',
36
- styles: 'custom-header'
37
- },
38
- {
39
- testId: 'cookie-banner-title',
40
- themeKey: 'banner.header.title',
41
- styles: 'custom-title'
42
- },
43
- {
44
- testId: "cookie-banner-description",
45
- themeKey: "banner.header.description",
46
- styles: "custom-description"
47
- },
48
- {
49
- testId: 'cookie-banner-footer',
50
- themeKey: 'banner.footer',
51
- styles: 'custom-footer'
52
- },
53
- {
54
- testId: 'cookie-banner-footer-sub-group',
55
- themeKey: 'banner.footer.sub-group',
56
- styles: 'custom-footer-sub-group'
57
- },
58
- {
59
- testId: 'cookie-banner-overlay',
60
- themeKey: 'banner.overlay',
61
- styles: 'custom-overlay'
62
- },
63
- {
64
- testId: 'cookie-banner-reject-button',
65
- themeKey: 'banner.footer.reject-button',
66
- styles: 'custom-reject-button'
67
- },
68
- {
69
- testId: 'cookie-banner-customize-button',
70
- themeKey: 'banner.footer.customize-button',
71
- styles: 'custom-customize-button'
72
- },
73
- {
74
- testId: 'cookie-banner-accept-button',
75
- themeKey: 'banner.footer.accept-button',
76
- styles: 'custom-accept-button'
77
- }
78
- ];
79
- (0, __WEBPACK_EXTERNAL_MODULE_vitest__.test)('Theme prop applies string classnames to all components', async ()=>{
80
- const test = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__cookie_banner_js_0a2d98b7__.CookieBanner, {
81
- scrollLock: true,
82
- theme: ALL_COMPONENTS.reduce((acc, { themeKey, styles })=>{
83
- acc[themeKey] = styles;
84
- return acc;
85
- }, {})
86
- });
87
- await (0, __WEBPACK_EXTERNAL_MODULE__utils_test_helpers_js_1e3d26b6__["default"])({
88
- component: test,
89
- testCases: ALL_COMPONENTS.map(({ testId, styles })=>({
90
- testId,
91
- styles
92
- }))
93
- });
94
- });
95
- (0, __WEBPACK_EXTERNAL_MODULE_vitest__.test)('Theme prop supports object format with className and style for all components', async ()=>{
96
- const style = {
97
- backgroundColor: '#ffffff',
98
- padding: '20px',
99
- border: '1px solid #000000'
100
- };
101
- const testCases = ALL_COMPONENTS.map(({ testId, themeKey, styles })=>({
102
- testId,
103
- themeKey,
104
- className: styles,
105
- style
106
- }));
107
- const test = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__cookie_banner_js_0a2d98b7__.CookieBanner, {
108
- scrollLock: true,
109
- theme: testCases.reduce((acc, { themeKey, className, style })=>{
110
- acc[themeKey] = {
111
- className,
112
- style
113
- };
114
- return acc;
115
- }, {})
116
- });
117
- await (0, __WEBPACK_EXTERNAL_MODULE__utils_test_helpers_js_1e3d26b6__["default"])({
118
- component: test,
119
- testCases: testCases.map(({ testId, className, style })=>({
120
- testId,
121
- styles: {
122
- className,
123
- style
124
- }
125
- }))
126
- });
127
- });
128
- (0, __WEBPACK_EXTERNAL_MODULE_vitest__.test)('No style prop removes default styles but keeps custom classNames', async ()=>{
129
- const test = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__cookie_banner_js_0a2d98b7__.CookieBanner, {
130
- scrollLock: true,
131
- noStyle: true,
132
- theme: ALL_COMPONENTS.reduce((acc, { themeKey, styles })=>{
133
- acc[themeKey] = styles;
134
- return acc;
135
- }, {})
136
- });
137
- await (0, __WEBPACK_EXTERNAL_MODULE__utils_test_helpers_js_1e3d26b6__["default"])({
138
- component: test,
139
- testCases: ALL_COMPONENTS.map(({ testId, styles })=>({
140
- testId,
141
- styles
142
- })),
143
- noStyle: true
144
- });
145
- });
146
- (0, __WEBPACK_EXTERNAL_MODULE_vitest__.test)('Theme prop handles mixed format (string and object) correctly', async ()=>{
147
- const mixedTheme = {
148
- 'banner.root': {
149
- className: 'custom-root',
150
- style: {
151
- backgroundColor: 'rgb(255, 255, 255)',
152
- padding: '16px'
153
- }
154
- },
155
- 'banner.header.title': 'custom-title'
156
- };
157
- const test = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__cookie_banner_js_0a2d98b7__.CookieBanner, {
158
- scrollLock: true,
159
- theme: mixedTheme
160
- });
161
- await (0, __WEBPACK_EXTERNAL_MODULE__utils_test_helpers_js_1e3d26b6__["default"])({
162
- component: test,
163
- testCases: [
164
- {
165
- testId: 'cookie-banner-root',
166
- styles: {
167
- className: 'custom-root',
168
- style: {
169
- backgroundColor: 'rgb(255, 255, 255)',
170
- padding: '16px'
171
- }
172
- }
173
- },
174
- {
175
- testId: 'cookie-banner-title',
176
- styles: 'custom-title'
177
- }
178
- ]
179
- });
180
- });
181
- (0, __WEBPACK_EXTERNAL_MODULE_vitest__.test)('Theme prop handles edge cases gracefully', async ()=>{
182
- const edgeCaseTheme = {
183
- 'banner.root': '',
184
- 'banner.card': '',
185
- 'banner.header.root': '',
186
- 'banner.header.title': '',
187
- "banner.header.description": '',
188
- 'banner.footer': {
189
- className: '',
190
- style: {
191
- margin: '0',
192
- padding: '0'
193
- }
194
- }
195
- };
196
- const test = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__cookie_banner_js_0a2d98b7__.CookieBanner, {
197
- scrollLock: true,
198
- theme: edgeCaseTheme
199
- });
200
- await (0, __WEBPACK_EXTERNAL_MODULE__utils_test_helpers_js_1e3d26b6__["default"])({
201
- component: test,
202
- testCases: [
203
- {
204
- testId: 'cookie-banner-root',
205
- styles: ''
206
- },
207
- {
208
- testId: 'cookie-banner-title',
209
- styles: ''
210
- },
211
- {
212
- testId: 'cookie-banner-footer',
213
- styles: {
214
- className: '',
215
- style: {
216
- margin: '0',
217
- padding: '0'
218
- }
219
- }
220
- }
221
- ]
222
- });
223
- });
1
+ import*as e from"react/jsx-runtime";import*as t from"vitest";import*as o from"../cookie-banner.js";import*as s from"../../../utils/test-helpers.js";t.vi.mock("~/hooks/use-consent-manager",()=>({useConsentManager:()=>({showPopup:!0,...t.vi.fn()})})),t.vi.mock("~/hooks/use-translations",()=>({useTranslations:()=>({cookieBanner:{title:"Cookie Settings",description:"We use cookies to enhance your experience",acceptAll:"Accept All",rejectAll:"Reject All",customize:"Customize"}})}));let n=[{testId:"cookie-banner-root",themeKey:"banner.root",styles:"custom-root"},{testId:"cookie-banner-card",themeKey:"banner.card",styles:"custom-card"},{testId:"cookie-banner-header",themeKey:"banner.header.root",styles:"custom-header"},{testId:"cookie-banner-title",themeKey:"banner.header.title",styles:"custom-title"},{testId:"cookie-banner-description",themeKey:"banner.header.description",styles:"custom-description"},{testId:"cookie-banner-footer",themeKey:"banner.footer",styles:"custom-footer"},{testId:"cookie-banner-footer-sub-group",themeKey:"banner.footer.sub-group",styles:"custom-footer-sub-group"},{testId:"cookie-banner-overlay",themeKey:"banner.overlay",styles:"custom-overlay"},{testId:"cookie-banner-reject-button",themeKey:"banner.footer.reject-button",styles:"custom-reject-button"},{testId:"cookie-banner-customize-button",themeKey:"banner.footer.customize-button",styles:"custom-customize-button"},{testId:"cookie-banner-accept-button",themeKey:"banner.footer.accept-button",styles:"custom-accept-button"}];(0,t.test)("Theme prop applies string classnames to all components",async()=>{let t=(0,e.jsx)(o.CookieBanner,{scrollLock:!0,theme:n.reduce((e,{themeKey:t,styles:o})=>(e[t]=o,e),{})});await (0,s.default)({component:t,testCases:n.map(({testId:e,styles:t})=>({testId:e,styles:t}))})}),(0,t.test)("Theme prop supports object format with className and style for all components",async()=>{let t={backgroundColor:"#ffffff",padding:"20px",border:"1px solid #000000"},r=n.map(({testId:e,themeKey:o,styles:s})=>({testId:e,themeKey:o,className:s,style:t})),a=(0,e.jsx)(o.CookieBanner,{scrollLock:!0,theme:r.reduce((e,{themeKey:t,className:o,style:s})=>(e[t]={className:o,style:s},e),{})});await (0,s.default)({component:a,testCases:r.map(({testId:e,className:t,style:o})=>({testId:e,styles:{className:t,style:o}}))})}),(0,t.test)("No style prop removes default styles but keeps custom classNames",async()=>{let t=(0,e.jsx)(o.CookieBanner,{scrollLock:!0,noStyle:!0,theme:n.reduce((e,{themeKey:t,styles:o})=>(e[t]=o,e),{})});await (0,s.default)({component:t,testCases:n.map(({testId:e,styles:t})=>({testId:e,styles:t})),noStyle:!0})}),(0,t.test)("Theme prop handles mixed format (string and object) correctly",async()=>{let t=(0,e.jsx)(o.CookieBanner,{scrollLock:!0,theme:{"banner.root":{className:"custom-root",style:{backgroundColor:"rgb(255, 255, 255)",padding:"16px"}},"banner.header.title":"custom-title"}});await (0,s.default)({component:t,testCases:[{testId:"cookie-banner-root",styles:{className:"custom-root",style:{backgroundColor:"rgb(255, 255, 255)",padding:"16px"}}},{testId:"cookie-banner-title",styles:"custom-title"}]})}),(0,t.test)("Theme prop handles edge cases gracefully",async()=>{let t=(0,e.jsx)(o.CookieBanner,{scrollLock:!0,theme:{"banner.root":"","banner.card":"","banner.header.root":"","banner.header.title":"","banner.header.description":"","banner.footer":{className:"",style:{margin:"0",padding:"0"}}}});await (0,s.default)({component:t,testCases:[{testId:"cookie-banner-root",styles:""},{testId:"cookie-banner-title",styles:""},{testId:"cookie-banner-footer",styles:{className:"",style:{margin:"0",padding:"0"}}}]})});
@@ -1,87 +1 @@
1
- "use strict";
2
- var __webpack_require__ = {};
3
- (()=>{
4
- __webpack_require__.n = (module)=>{
5
- var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
6
- __webpack_require__.d(getter, {
7
- a: getter
8
- });
9
- return getter;
10
- };
11
- })();
12
- (()=>{
13
- __webpack_require__.d = (exports1, definition)=>{
14
- for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
15
- enumerable: true,
16
- get: definition[key]
17
- });
18
- };
19
- })();
20
- (()=>{
21
- __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
22
- })();
23
- (()=>{
24
- __webpack_require__.r = (exports1)=>{
25
- if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
26
- value: 'Module'
27
- });
28
- Object.defineProperty(exports1, '__esModule', {
29
- value: true
30
- });
31
- };
32
- })();
33
- var __webpack_exports__ = {};
34
- __webpack_require__.r(__webpack_exports__);
35
- __webpack_require__.d(__webpack_exports__, {
36
- CookieBannerOverlay: ()=>CookieBannerOverlay,
37
- Overlay: ()=>Overlay
38
- });
39
- const jsx_runtime_namespaceObject = require("react/jsx-runtime");
40
- const react_namespaceObject = require("motion/react");
41
- const external_react_namespaceObject = require("react");
42
- const use_consent_manager_cjs_namespaceObject = require("../../../hooks/use-consent-manager.cjs");
43
- const use_scroll_lock_cjs_namespaceObject = require("../../../hooks/use-scroll-lock.cjs");
44
- const use_styles_cjs_namespaceObject = require("../../../hooks/use-styles.cjs");
45
- const use_theme_cjs_namespaceObject = require("../../../hooks/use-theme.cjs");
46
- const external_cookie_banner_module_cjs_namespaceObject = require("../cookie-banner.module.cjs");
47
- var external_cookie_banner_module_cjs_default = /*#__PURE__*/ __webpack_require__.n(external_cookie_banner_module_cjs_namespaceObject);
48
- const CookieBannerOverlay = /*#__PURE__*/ (0, external_react_namespaceObject.forwardRef)(({ className, style, noStyle, asChild, ...props }, ref)=>{
49
- const { showPopup } = (0, use_consent_manager_cjs_namespaceObject.useConsentManager)();
50
- const { disableAnimation, noStyle: contextNoStyle, scrollLock } = (0, use_theme_cjs_namespaceObject.useTheme)();
51
- const theme = (0, use_styles_cjs_namespaceObject.useStyles)('banner.overlay', {
52
- baseClassName: !(contextNoStyle || noStyle) && external_cookie_banner_module_cjs_default().overlay,
53
- noStyle
54
- });
55
- (0, use_scroll_lock_cjs_namespaceObject.useScrollLock)(!!(showPopup && scrollLock));
56
- return showPopup && scrollLock ? disableAnimation ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
57
- ref: ref,
58
- ...props,
59
- ...theme,
60
- "data-testid": "cookie-banner-overlay"
61
- }) : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_namespaceObject.AnimatePresence, {
62
- children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_namespaceObject.motion.div, {
63
- ref: ref,
64
- ...theme,
65
- initial: {
66
- opacity: 0
67
- },
68
- animate: {
69
- opacity: 1
70
- },
71
- exit: {
72
- opacity: 0
73
- },
74
- "data-testid": "cookie-banner-overlay"
75
- })
76
- }) : null;
77
- });
78
- const Overlay = CookieBannerOverlay;
79
- exports.CookieBannerOverlay = __webpack_exports__.CookieBannerOverlay;
80
- exports.Overlay = __webpack_exports__.Overlay;
81
- for(var __webpack_i__ in __webpack_exports__)if (-1 === [
82
- "CookieBannerOverlay",
83
- "Overlay"
84
- ].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
85
- Object.defineProperty(exports, '__esModule', {
86
- value: true
87
- });
1
+ "use strict";let __rslib_import_meta_url__="undefined"==typeof document?new(require("url".replace("",""))).URL("file:"+__filename).href:document.currentScript&&document.currentScript.src||new URL("main.js",document.baseURI).href;var __webpack_require__={};__webpack_require__.n=e=>{var _=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(_,{a:_}),_},__webpack_require__.d=(e,_)=>{for(var r in _)__webpack_require__.o(_,r)&&!__webpack_require__.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:_[r]})},__webpack_require__.o=(e,_)=>Object.prototype.hasOwnProperty.call(e,_),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__={};__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{CookieBannerOverlay:()=>CookieBannerOverlay,Overlay:()=>Overlay});let jsx_runtime_namespaceObject=require("react/jsx-runtime"),external_react_namespaceObject=require("react"),use_consent_manager_cjs_namespaceObject=require("../../../hooks/use-consent-manager.cjs"),use_scroll_lock_cjs_namespaceObject=require("../../../hooks/use-scroll-lock.cjs"),use_styles_cjs_namespaceObject=require("../../../hooks/use-styles.cjs"),use_theme_cjs_namespaceObject=require("../../../hooks/use-theme.cjs"),external_clsx_namespaceObject=require("clsx");var external_clsx_default=__webpack_require__.n(external_clsx_namespaceObject);let external_cookie_banner_module_cjs_namespaceObject=require("../cookie-banner.module.cjs");var external_cookie_banner_module_cjs_default=__webpack_require__.n(external_cookie_banner_module_cjs_namespaceObject);let CookieBannerOverlay=(0,external_react_namespaceObject.forwardRef)(({className:e,style:_,noStyle:r,asChild:a,...t},c)=>{let n,{showPopup:s}=(0,use_consent_manager_cjs_namespaceObject.useConsentManager)(),{disableAnimation:o,noStyle:l,scrollLock:u}=(0,use_theme_cjs_namespaceObject.useTheme)(),[i,p]=(0,external_react_namespaceObject.useState)(!1);(0,external_react_namespaceObject.useEffect)(()=>{if(s)p(!0);else if(o)p(!1);else{let e=setTimeout(()=>{p(!1)},Number.parseInt(getComputedStyle(document.documentElement).getPropertyValue("--banner-animation-duration")||"200",10));return()=>clearTimeout(e)}},[s,o]);let b=(0,use_styles_cjs_namespaceObject.useStyles)("banner.overlay",{baseClassName:!(l||r)&&external_cookie_banner_module_cjs_default().overlay,className:e,noStyle:l||r});n=l||r||o?void 0:i?external_cookie_banner_module_cjs_default().overlayVisible:external_cookie_banner_module_cjs_default().overlayHidden;let m=external_clsx_default()(b.className,n);return(0,use_scroll_lock_cjs_namespaceObject.useScrollLock)(!!(s&&u)),s&&u?(0,jsx_runtime_namespaceObject.jsx)("div",{ref:c,...t,className:m,style:{...b.style,..._},"data-testid":"cookie-banner-overlay"}):null}),Overlay=CookieBannerOverlay;for(var __webpack_i__ in exports.CookieBannerOverlay=__webpack_exports__.CookieBannerOverlay,exports.Overlay=__webpack_exports__.Overlay,__webpack_exports__)-1===["CookieBannerOverlay","Overlay"].indexOf(__webpack_i__)&&(exports[__webpack_i__]=__webpack_exports__[__webpack_i__]);Object.defineProperty(exports,"__esModule",{value:!0});
@@ -1 +1 @@
1
- {"version":3,"file":"overlay.d.ts","sourceRoot":"","sources":["../../../../src/components/cookie-banner/atoms/overlay.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,KAAK,cAAc,EAAc,MAAM,OAAO,CAAC;AASxD;;;;;;;;GAQG;AACH,UAAU,YAAa,SAAQ,cAAc,CAAC,cAAc,CAAC;IAC5D;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;;;;;;;;;;;;;GAcG;AACH,QAAA,MAAM,mBAAmB,yGAqCxB,CAAC;AAEF,QAAA,MAAM,OAAO,yGAAsB,CAAC;AAEpC,OAAO,EAAE,OAAO,EAAE,mBAAmB,EAAE,CAAC"}
1
+ {"version":3,"file":"overlay.d.ts","sourceRoot":"","sources":["../../../../src/components/cookie-banner/atoms/overlay.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,KAAK,cAAc,EAAmC,MAAM,OAAO,CAAC;AAU7E;;;;;;;;GAQG;AACH,UAAU,YAAa,SAAQ,cAAc,CAAC,cAAc,CAAC;IAC5D;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;;;;;;;;;;;;;GAcG;AACH,QAAA,MAAM,mBAAmB,yGAgExB,CAAC;AAEF,QAAA,MAAM,OAAO,yGAAsB,CAAC;AAEpC,OAAO,EAAE,OAAO,EAAE,mBAAmB,EAAE,CAAC"}
@@ -1,40 +1 @@
1
- import * as __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__ from "react/jsx-runtime";
2
- import * as __WEBPACK_EXTERNAL_MODULE_motion_react_9decfa63__ from "motion/react";
3
- import * as __WEBPACK_EXTERNAL_MODULE_react__ from "react";
4
- import * as __WEBPACK_EXTERNAL_MODULE__hooks_use_consent_manager_js_8a30bd26__ from "../../../hooks/use-consent-manager.js";
5
- import * as __WEBPACK_EXTERNAL_MODULE__hooks_use_scroll_lock_js_ebd470d2__ from "../../../hooks/use-scroll-lock.js";
6
- import * as __WEBPACK_EXTERNAL_MODULE__hooks_use_styles_js_ffc85ca5__ from "../../../hooks/use-styles.js";
7
- import * as __WEBPACK_EXTERNAL_MODULE__hooks_use_theme_js_3abff3d7__ from "../../../hooks/use-theme.js";
8
- import * as __WEBPACK_EXTERNAL_MODULE__cookie_banner_module_js_af314f6d__ from "../cookie-banner.module.js";
9
- const CookieBannerOverlay = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react__.forwardRef)(({ className, style, noStyle, asChild, ...props }, ref)=>{
10
- const { showPopup } = (0, __WEBPACK_EXTERNAL_MODULE__hooks_use_consent_manager_js_8a30bd26__.useConsentManager)();
11
- const { disableAnimation, noStyle: contextNoStyle, scrollLock } = (0, __WEBPACK_EXTERNAL_MODULE__hooks_use_theme_js_3abff3d7__.useTheme)();
12
- const theme = (0, __WEBPACK_EXTERNAL_MODULE__hooks_use_styles_js_ffc85ca5__.useStyles)('banner.overlay', {
13
- baseClassName: !(contextNoStyle || noStyle) && __WEBPACK_EXTERNAL_MODULE__cookie_banner_module_js_af314f6d__["default"].overlay,
14
- noStyle
15
- });
16
- (0, __WEBPACK_EXTERNAL_MODULE__hooks_use_scroll_lock_js_ebd470d2__.useScrollLock)(!!(showPopup && scrollLock));
17
- return showPopup && scrollLock ? disableAnimation ? /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("div", {
18
- ref: ref,
19
- ...props,
20
- ...theme,
21
- "data-testid": "cookie-banner-overlay"
22
- }) : /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE_motion_react_9decfa63__.AnimatePresence, {
23
- children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE_motion_react_9decfa63__.motion.div, {
24
- ref: ref,
25
- ...theme,
26
- initial: {
27
- opacity: 0
28
- },
29
- animate: {
30
- opacity: 1
31
- },
32
- exit: {
33
- opacity: 0
34
- },
35
- "data-testid": "cookie-banner-overlay"
36
- })
37
- }) : null;
38
- });
39
- const Overlay = CookieBannerOverlay;
40
- export { CookieBannerOverlay, Overlay };
1
+ import*as e from"react/jsx-runtime";import*as o from"react";import*as t from"../../../hooks/use-consent-manager.js";import*as s from"../../../hooks/use-scroll-lock.js";import*as r from"../../../hooks/use-styles.js";import*as a from"../../../hooks/use-theme.js";import*as l from"clsx";import*as m from"../cookie-banner.module.js";let n=(0,o.forwardRef)(({className:n,style:u,noStyle:i,asChild:f,...c},d)=>{let y,{showPopup:p}=(0,t.useConsentManager)(),{disableAnimation:k,noStyle:v,scrollLock:b}=(0,a.useTheme)(),[j,h]=(0,o.useState)(!1);(0,o.useEffect)(()=>{if(p)h(!0);else if(k)h(!1);else{let e=setTimeout(()=>{h(!1)},Number.parseInt(getComputedStyle(document.documentElement).getPropertyValue("--banner-animation-duration")||"200",10));return()=>clearTimeout(e)}},[p,k]);let S=(0,r.useStyles)("banner.overlay",{baseClassName:!(v||i)&&m.default.overlay,className:n,noStyle:v||i});y=v||i||k?void 0:j?m.default.overlayVisible:m.default.overlayHidden;let g=(0,l.default)(S.className,y);return(0,s.useScrollLock)(!!(p&&b)),p&&b?(0,e.jsx)("div",{ref:d,...c,className:g,style:{...S.style,...u},"data-testid":"cookie-banner-overlay"}):null}),u=n;export{n as CookieBannerOverlay,u as Overlay};