@c15t/react 1.2.0-canary.9 → 1.2.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.
@@ -1,4 +1,4 @@
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 a in t)__webpack_require__.o(t,a)&&!__webpack_require__.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},__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_consent_manager_dialog_cjs_namespaceObject=require("../consent-manager-dialog.cjs"),test_helpers_cjs_namespaceObject=require("../../../utils/test-helpers.cjs");var test_helpers_cjs_default=__webpack_require__.n(test_helpers_cjs_namespaceObject);let external_consent_manager_dialog_module_cjs_namespaceObject=require("../consent-manager-dialog.module.cjs");var external_consent_manager_dialog_module_cjs_default=__webpack_require__.n(external_consent_manager_dialog_module_cjs_namespaceObject);let ALL_COMPONENTS=[{testId:"consent-manager-dialog-root",themeKey:"dialog.root",styles:"custom-dialog-root"},{testId:"consent-manager-dialog-overlay",themeKey:"dialog.overlay",styles:"custom-dialog-overlay"},{testId:"consent-manager-dialog-header",themeKey:"dialog.header",styles:"custom-dialog-header"},{testId:"consent-manager-dialog-title",themeKey:"dialog.title",styles:"custom-dialog-title"},{testId:"consent-manager-dialog-description",themeKey:"dialog.description",styles:"custom-dialog-description"},{testId:"consent-manager-dialog-content",themeKey:"dialog.content",styles:"custom-dialog-content"},{testId:"consent-manager-dialog-footer",themeKey:"dialog.footer",styles:"custom-dialog-footer"}];for(var __webpack_i__ in external_vitest_namespaceObject.vi.mock("~/hooks/use-consent-manager",()=>({useConsentManager:()=>({isPrivacyDialogOpen:!0,getDisplayedConsents:external_vitest_namespaceObject.vi.fn(()=>[]),saveConsents:external_vitest_namespaceObject.vi.fn(),setShowPopup:external_vitest_namespaceObject.vi.fn(),setIsPrivacyDialogOpen:external_vitest_namespaceObject.vi.fn()})})),external_vitest_namespaceObject.vi.mock("~/hooks/use-translations",()=>({useTranslations:()=>({consentManagerDialog:{title:"Dialog Title",description:"Dialog Description",saveButton:"Save",rejectAllButton:"Reject All",acceptAllButton:"Accept All"},consentManagerWidget:{},cookieBanner:{},general:{}})})),(0,external_vitest_namespaceObject.test)("should apply string classNames from theme prop to all dialog elements",async()=>{let e=(0,jsx_runtime_namespaceObject.jsx)(external_consent_manager_dialog_cjs_namespaceObject.ConsentManagerDialog,{open:!0,scrollLock:!0,theme:ALL_COMPONENTS.reduce((e,{themeKey:t,styles:a})=>(e[t]=a,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)("should apply className and style objects from theme prop to all dialog elements",async()=>{let e={backgroundColor:"#ffffff",padding:"20px",border:"1px solid #000000"},t=ALL_COMPONENTS.map(({testId:t,themeKey:a,styles:s})=>({testId:t,themeKey:a,className:s,style:e})),a=(0,jsx_runtime_namespaceObject.jsx)(external_consent_manager_dialog_cjs_namespaceObject.ConsentManagerDialog,{open:!0,scrollLock:!0,theme:t.reduce((e,{themeKey:t,className:a,style:s})=>(e[t]={className:a,style:s},e),{})});await test_helpers_cjs_default()({component:a,testCases:t.map(({testId:e,className:t,style:a})=>({testId:e,styles:{className:t,style:a}}))})}),(0,external_vitest_namespaceObject.test)("should remove default styles but keep custom classNames when top-level noStyle prop is true",async()=>{let e=(0,jsx_runtime_namespaceObject.jsx)(external_consent_manager_dialog_cjs_namespaceObject.ConsentManagerDialog,{scrollLock:!0,noStyle:!0,open:!0,theme:ALL_COMPONENTS.reduce((e,{themeKey:t,styles:a})=>(e[t]=a,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)("should remove default styles but keep custom classNames when theme object provides noStyle: true",async()=>{let e=ALL_COMPONENTS.reduce((e,{themeKey:t,styles:a})=>(e[t]={className:a,noStyle:!0},e),{}),t=(0,jsx_runtime_namespaceObject.jsx)(external_consent_manager_dialog_cjs_namespaceObject.ConsentManagerDialog,{scrollLock:!0,open:!0,theme:e});await test_helpers_cjs_default()({component:t,testCases:ALL_COMPONENTS.map(({testId:e,styles:t})=>({testId:e,styles:{className:t}}))})}),(0,external_vitest_namespaceObject.test)("should correctly apply styles when theme prop uses mixed string and object formats",async()=>{let e=(0,jsx_runtime_namespaceObject.jsx)(external_consent_manager_dialog_cjs_namespaceObject.ConsentManagerDialog,{scrollLock:!0,theme:{"dialog.root":{className:"custom-dialog-root",style:{backgroundColor:"rgb(255, 255, 255)",padding:"16px"}},"dialog.overlay":"custom-dialog-overlay"},open:!0});await test_helpers_cjs_default()({component:e,testCases:[{testId:"consent-manager-dialog-root",styles:{className:"custom-dialog-root",style:{backgroundColor:"rgb(255, 255, 255)",padding:"16px"}}},{testId:"consent-manager-dialog-overlay",styles:"custom-dialog-overlay"}]})}),(0,external_vitest_namespaceObject.test)("should handle empty strings and empty style objects in theme prop gracefully",async()=>{let e=(0,jsx_runtime_namespaceObject.jsx)(external_consent_manager_dialog_cjs_namespaceObject.ConsentManagerDialog,{scrollLock:!0,open:!0,theme:{"dialog.root":"","dialog.overlay":"","dialog.content":{className:"",style:{margin:"0",padding:"0"}}}});await test_helpers_cjs_default()({component:e,testCases:[{testId:"consent-manager-dialog-root",styles:""},{testId:"consent-manager-dialog-overlay",styles:""},{testId:"consent-manager-dialog-content",styles:{className:"",style:{margin:"0",padding:"0"}}}]})}),(0,external_vitest_namespaceObject.test)("should override base layer styles",async()=>{let e=document.createElement("style");e.textContent=`
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 a in t)__webpack_require__.o(t,a)&&!__webpack_require__.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var __webpack_exports__={};let jsx_runtime_namespaceObject=require("react/jsx-runtime"),external_c15t_namespaceObject=require("c15t"),external_vitest_namespaceObject=require("vitest"),external_consent_manager_dialog_cjs_namespaceObject=require("../consent-manager-dialog.cjs"),test_helpers_cjs_namespaceObject=require("../../../utils/test-helpers.cjs");var test_helpers_cjs_default=__webpack_require__.n(test_helpers_cjs_namespaceObject);let external_consent_manager_dialog_module_cjs_namespaceObject=require("../consent-manager-dialog.module.cjs");var external_consent_manager_dialog_module_cjs_default=__webpack_require__.n(external_consent_manager_dialog_module_cjs_namespaceObject);let ALL_COMPONENTS=[{testId:"consent-manager-dialog-root",themeKey:"dialog.root",styles:"custom-dialog-root"},{testId:"consent-manager-dialog-overlay",themeKey:"dialog.overlay",styles:"custom-dialog-overlay"},{testId:"consent-manager-dialog-header",themeKey:"dialog.header",styles:"custom-dialog-header"},{testId:"consent-manager-dialog-title",themeKey:"dialog.title",styles:"custom-dialog-title"},{testId:"consent-manager-dialog-description",themeKey:"dialog.description",styles:"custom-dialog-description"},{testId:"consent-manager-dialog-content",themeKey:"dialog.content",styles:"custom-dialog-content"},{testId:"consent-manager-dialog-footer",themeKey:"dialog.footer",styles:"custom-dialog-footer"}];for(var __webpack_i__ in external_vitest_namespaceObject.vi.mock("~/hooks/use-consent-manager",()=>({useConsentManager:()=>({isPrivacyDialogOpen:!0,getDisplayedConsents:external_vitest_namespaceObject.vi.fn(()=>[]),saveConsents:external_vitest_namespaceObject.vi.fn(),setShowPopup:external_vitest_namespaceObject.vi.fn(),setIsPrivacyDialogOpen:external_vitest_namespaceObject.vi.fn()})})),external_vitest_namespaceObject.vi.mock("~/hooks/use-translations",()=>({useTranslations:()=>external_c15t_namespaceObject.defaultTranslationConfig.translations.en})),(0,external_vitest_namespaceObject.test)("should apply string classNames from theme prop to all dialog elements",async()=>{let e=(0,jsx_runtime_namespaceObject.jsx)(external_consent_manager_dialog_cjs_namespaceObject.ConsentManagerDialog,{open:!0,scrollLock:!0,theme:ALL_COMPONENTS.reduce((e,{themeKey:t,styles:a})=>(e[t]=a,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)("should apply className and style objects from theme prop to all dialog elements",async()=>{let e={backgroundColor:"#ffffff",padding:"20px",border:"1px solid #000000"},t=ALL_COMPONENTS.map(({testId:t,themeKey:a,styles:s})=>({testId:t,themeKey:a,className:s,style:e})),a=(0,jsx_runtime_namespaceObject.jsx)(external_consent_manager_dialog_cjs_namespaceObject.ConsentManagerDialog,{open:!0,scrollLock:!0,theme:t.reduce((e,{themeKey:t,className:a,style:s})=>(e[t]={className:a,style:s},e),{})});await test_helpers_cjs_default()({component:a,testCases:t.map(({testId:e,className:t,style:a})=>({testId:e,styles:{className:t,style:a}}))})}),(0,external_vitest_namespaceObject.test)("should remove default styles but keep custom classNames when top-level noStyle prop is true",async()=>{let e=(0,jsx_runtime_namespaceObject.jsx)(external_consent_manager_dialog_cjs_namespaceObject.ConsentManagerDialog,{scrollLock:!0,noStyle:!0,open:!0,theme:ALL_COMPONENTS.reduce((e,{themeKey:t,styles:a})=>(e[t]=a,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)("should remove default styles but keep custom classNames when theme object provides noStyle: true",async()=>{let e=ALL_COMPONENTS.reduce((e,{themeKey:t,styles:a})=>(e[t]={className:a,noStyle:!0},e),{}),t=(0,jsx_runtime_namespaceObject.jsx)(external_consent_manager_dialog_cjs_namespaceObject.ConsentManagerDialog,{scrollLock:!0,open:!0,theme:e});await test_helpers_cjs_default()({component:t,testCases:ALL_COMPONENTS.map(({testId:e,styles:t})=>({testId:e,styles:{className:t}}))})}),(0,external_vitest_namespaceObject.test)("should correctly apply styles when theme prop uses mixed string and object formats",async()=>{let e=(0,jsx_runtime_namespaceObject.jsx)(external_consent_manager_dialog_cjs_namespaceObject.ConsentManagerDialog,{scrollLock:!0,theme:{"dialog.root":{className:"custom-dialog-root",style:{backgroundColor:"rgb(255, 255, 255)",padding:"16px"}},"dialog.overlay":"custom-dialog-overlay"},open:!0});await test_helpers_cjs_default()({component:e,testCases:[{testId:"consent-manager-dialog-root",styles:{className:"custom-dialog-root",style:{backgroundColor:"rgb(255, 255, 255)",padding:"16px"}}},{testId:"consent-manager-dialog-overlay",styles:"custom-dialog-overlay"}]})}),(0,external_vitest_namespaceObject.test)("should handle empty strings and empty style objects in theme prop gracefully",async()=>{let e=(0,jsx_runtime_namespaceObject.jsx)(external_consent_manager_dialog_cjs_namespaceObject.ConsentManagerDialog,{scrollLock:!0,open:!0,theme:{"dialog.root":"","dialog.overlay":"","dialog.content":{className:"",style:{margin:"0",padding:"0"}}}});await test_helpers_cjs_default()({component:e,testCases:[{testId:"consent-manager-dialog-root",styles:""},{testId:"consent-manager-dialog-overlay",styles:""},{testId:"consent-manager-dialog-content",styles:{className:"",style:{margin:"0",padding:"0"}}}]})}),(0,external_vitest_namespaceObject.test)("should override base layer styles",async()=>{let e=document.createElement("style");e.textContent=`
2
2
  .custom-dialog-background {
3
3
  background-color: rgb(255, 0, 0) !important;
4
4
  }
@@ -1,15 +1,15 @@
1
- import*as e from"react/jsx-runtime";import*as t from"vitest";import*as o from"../consent-manager-dialog.js";import*as a from"../../../utils/test-helpers.js";import*as s from"../consent-manager-dialog.module.js";let n=[{testId:"consent-manager-dialog-root",themeKey:"dialog.root",styles:"custom-dialog-root"},{testId:"consent-manager-dialog-overlay",themeKey:"dialog.overlay",styles:"custom-dialog-overlay"},{testId:"consent-manager-dialog-header",themeKey:"dialog.header",styles:"custom-dialog-header"},{testId:"consent-manager-dialog-title",themeKey:"dialog.title",styles:"custom-dialog-title"},{testId:"consent-manager-dialog-description",themeKey:"dialog.description",styles:"custom-dialog-description"},{testId:"consent-manager-dialog-content",themeKey:"dialog.content",styles:"custom-dialog-content"},{testId:"consent-manager-dialog-footer",themeKey:"dialog.footer",styles:"custom-dialog-footer"}];t.vi.mock("~/hooks/use-consent-manager",()=>({useConsentManager:()=>({isPrivacyDialogOpen:!0,getDisplayedConsents:t.vi.fn(()=>[]),saveConsents:t.vi.fn(),setShowPopup:t.vi.fn(),setIsPrivacyDialogOpen:t.vi.fn()})})),t.vi.mock("~/hooks/use-translations",()=>({useTranslations:()=>({consentManagerDialog:{title:"Dialog Title",description:"Dialog Description",saveButton:"Save",rejectAllButton:"Reject All",acceptAllButton:"Accept All"},consentManagerWidget:{},cookieBanner:{},general:{}})})),(0,t.test)("should apply string classNames from theme prop to all dialog elements",async()=>{let t=(0,e.jsx)(o.ConsentManagerDialog,{open:!0,scrollLock:!0,theme:n.reduce((e,{themeKey:t,styles:o})=>(e[t]=o,e),{})});await (0,a.default)({component:t,testCases:n.map(({testId:e,styles:t})=>({testId:e,styles:t}))})}),(0,t.test)("should apply className and style objects from theme prop to all dialog elements",async()=>{let t={backgroundColor:"#ffffff",padding:"20px",border:"1px solid #000000"},s=n.map(({testId:e,themeKey:o,styles:a})=>({testId:e,themeKey:o,className:a,style:t})),l=(0,e.jsx)(o.ConsentManagerDialog,{open:!0,scrollLock:!0,theme:s.reduce((e,{themeKey:t,className:o,style:a})=>(e[t]={className:o,style:a},e),{})});await (0,a.default)({component:l,testCases:s.map(({testId:e,className:t,style:o})=>({testId:e,styles:{className:t,style:o}}))})}),(0,t.test)("should remove default styles but keep custom classNames when top-level noStyle prop is true",async()=>{let t=(0,e.jsx)(o.ConsentManagerDialog,{scrollLock:!0,noStyle:!0,open:!0,theme:n.reduce((e,{themeKey:t,styles:o})=>(e[t]=o,e),{})});await (0,a.default)({component:t,testCases:n.map(({testId:e,styles:t})=>({testId:e,styles:t})),noStyle:!0})}),(0,t.test)("should remove default styles but keep custom classNames when theme object provides noStyle: true",async()=>{let t=n.reduce((e,{themeKey:t,styles:o})=>(e[t]={className:o,noStyle:!0},e),{}),s=(0,e.jsx)(o.ConsentManagerDialog,{scrollLock:!0,open:!0,theme:t});await (0,a.default)({component:s,testCases:n.map(({testId:e,styles:t})=>({testId:e,styles:{className:t}}))})}),(0,t.test)("should correctly apply styles when theme prop uses mixed string and object formats",async()=>{let t=(0,e.jsx)(o.ConsentManagerDialog,{scrollLock:!0,theme:{"dialog.root":{className:"custom-dialog-root",style:{backgroundColor:"rgb(255, 255, 255)",padding:"16px"}},"dialog.overlay":"custom-dialog-overlay"},open:!0});await (0,a.default)({component:t,testCases:[{testId:"consent-manager-dialog-root",styles:{className:"custom-dialog-root",style:{backgroundColor:"rgb(255, 255, 255)",padding:"16px"}}},{testId:"consent-manager-dialog-overlay",styles:"custom-dialog-overlay"}]})}),(0,t.test)("should handle empty strings and empty style objects in theme prop gracefully",async()=>{let t=(0,e.jsx)(o.ConsentManagerDialog,{scrollLock:!0,open:!0,theme:{"dialog.root":"","dialog.overlay":"","dialog.content":{className:"",style:{margin:"0",padding:"0"}}}});await (0,a.default)({component:t,testCases:[{testId:"consent-manager-dialog-root",styles:""},{testId:"consent-manager-dialog-overlay",styles:""},{testId:"consent-manager-dialog-content",styles:{className:"",style:{margin:"0",padding:"0"}}}]})}),(0,t.test)("should override base layer styles",async()=>{let s=document.createElement("style");s.textContent=`
1
+ import*as e from"react/jsx-runtime";import*as t from"c15t";import*as o from"vitest";import*as a from"../consent-manager-dialog.js";import*as s from"../../../utils/test-helpers.js";import*as n from"../consent-manager-dialog.module.js";let l=[{testId:"consent-manager-dialog-root",themeKey:"dialog.root",styles:"custom-dialog-root"},{testId:"consent-manager-dialog-overlay",themeKey:"dialog.overlay",styles:"custom-dialog-overlay"},{testId:"consent-manager-dialog-header",themeKey:"dialog.header",styles:"custom-dialog-header"},{testId:"consent-manager-dialog-title",themeKey:"dialog.title",styles:"custom-dialog-title"},{testId:"consent-manager-dialog-description",themeKey:"dialog.description",styles:"custom-dialog-description"},{testId:"consent-manager-dialog-content",themeKey:"dialog.content",styles:"custom-dialog-content"},{testId:"consent-manager-dialog-footer",themeKey:"dialog.footer",styles:"custom-dialog-footer"}];o.vi.mock("~/hooks/use-consent-manager",()=>({useConsentManager:()=>({isPrivacyDialogOpen:!0,getDisplayedConsents:o.vi.fn(()=>[]),saveConsents:o.vi.fn(),setShowPopup:o.vi.fn(),setIsPrivacyDialogOpen:o.vi.fn()})})),o.vi.mock("~/hooks/use-translations",()=>({useTranslations:()=>t.defaultTranslationConfig.translations.en})),(0,o.test)("should apply string classNames from theme prop to all dialog elements",async()=>{let t=(0,e.jsx)(a.ConsentManagerDialog,{open:!0,scrollLock:!0,theme:l.reduce((e,{themeKey:t,styles:o})=>(e[t]=o,e),{})});await (0,s.default)({component:t,testCases:l.map(({testId:e,styles:t})=>({testId:e,styles:t}))})}),(0,o.test)("should apply className and style objects from theme prop to all dialog elements",async()=>{let t={backgroundColor:"#ffffff",padding:"20px",border:"1px solid #000000"},o=l.map(({testId:e,themeKey:o,styles:a})=>({testId:e,themeKey:o,className:a,style:t})),n=(0,e.jsx)(a.ConsentManagerDialog,{open:!0,scrollLock:!0,theme:o.reduce((e,{themeKey:t,className:o,style:a})=>(e[t]={className:o,style:a},e),{})});await (0,s.default)({component:n,testCases:o.map(({testId:e,className:t,style:o})=>({testId:e,styles:{className:t,style:o}}))})}),(0,o.test)("should remove default styles but keep custom classNames when top-level noStyle prop is true",async()=>{let t=(0,e.jsx)(a.ConsentManagerDialog,{scrollLock:!0,noStyle:!0,open:!0,theme:l.reduce((e,{themeKey:t,styles:o})=>(e[t]=o,e),{})});await (0,s.default)({component:t,testCases:l.map(({testId:e,styles:t})=>({testId:e,styles:t})),noStyle:!0})}),(0,o.test)("should remove default styles but keep custom classNames when theme object provides noStyle: true",async()=>{let t=l.reduce((e,{themeKey:t,styles:o})=>(e[t]={className:o,noStyle:!0},e),{}),o=(0,e.jsx)(a.ConsentManagerDialog,{scrollLock:!0,open:!0,theme:t});await (0,s.default)({component:o,testCases:l.map(({testId:e,styles:t})=>({testId:e,styles:{className:t}}))})}),(0,o.test)("should correctly apply styles when theme prop uses mixed string and object formats",async()=>{let t=(0,e.jsx)(a.ConsentManagerDialog,{scrollLock:!0,theme:{"dialog.root":{className:"custom-dialog-root",style:{backgroundColor:"rgb(255, 255, 255)",padding:"16px"}},"dialog.overlay":"custom-dialog-overlay"},open:!0});await (0,s.default)({component:t,testCases:[{testId:"consent-manager-dialog-root",styles:{className:"custom-dialog-root",style:{backgroundColor:"rgb(255, 255, 255)",padding:"16px"}}},{testId:"consent-manager-dialog-overlay",styles:"custom-dialog-overlay"}]})}),(0,o.test)("should handle empty strings and empty style objects in theme prop gracefully",async()=>{let t=(0,e.jsx)(a.ConsentManagerDialog,{scrollLock:!0,open:!0,theme:{"dialog.root":"","dialog.overlay":"","dialog.content":{className:"",style:{margin:"0",padding:"0"}}}});await (0,s.default)({component:t,testCases:[{testId:"consent-manager-dialog-root",styles:""},{testId:"consent-manager-dialog-overlay",styles:""},{testId:"consent-manager-dialog-content",styles:{className:"",style:{margin:"0",padding:"0"}}}]})}),(0,o.test)("should override base layer styles",async()=>{let t=document.createElement("style");t.textContent=`
2
2
  .custom-dialog-background {
3
3
  background-color: rgb(255, 0, 0) !important;
4
4
  }
5
5
  .custom-dialog-text {
6
6
  color: rgb(0, 255, 0) !important;
7
7
  }
8
- `,document.head.appendChild(s);let n=(0,e.jsx)(o.ConsentManagerDialog,{theme:{"dialog.root":"custom-dialog-background","dialog.title":"custom-dialog-text"}});await (0,a.default)({component:n,testCases:[{testId:"consent-manager-dialog-root",styles:"custom-dialog-background"},{testId:"consent-manager-dialog-title",styles:"custom-dialog-text"}]});let l=document.querySelector('[data-testid="consent-manager-dialog-root"]'),d=document.querySelector('[data-testid="consent-manager-dialog-title"]');if(!l||!d)throw Error("Required elements not found in the document");(0,t.expect)(getComputedStyle(l).backgroundColor).toBe("rgb(255, 0, 0)"),(0,t.expect)(getComputedStyle(d).color).toBe("rgb(0, 255, 0)"),document.head.removeChild(s)}),(0,t.test)("Base layer styles are applied when no custom classes are provided",async()=>{let s=(0,e.jsx)(o.ConsentManagerDialog,{});await (0,a.default)({component:s,testCases:[]});let n=document.querySelector('[data-testid="consent-manager-dialog-root"]'),l=document.querySelector('[data-testid="consent-manager-dialog-title"]');if(!n||!l)throw Error("Required elements not found in the document");(0,t.expect)(getComputedStyle(n).backgroundColor).toBe("rgb(255, 255, 255)"),(0,t.expect)(getComputedStyle(l).color).toBe("rgb(23, 23, 23)")}),(0,t.test)("Multiple custom classes can be applied and override base layer",async()=>{let s=document.createElement("style");s.textContent=`
8
+ `,document.head.appendChild(t);let n=(0,e.jsx)(a.ConsentManagerDialog,{theme:{"dialog.root":"custom-dialog-background","dialog.title":"custom-dialog-text"}});await (0,s.default)({component:n,testCases:[{testId:"consent-manager-dialog-root",styles:"custom-dialog-background"},{testId:"consent-manager-dialog-title",styles:"custom-dialog-text"}]});let l=document.querySelector('[data-testid="consent-manager-dialog-root"]'),d=document.querySelector('[data-testid="consent-manager-dialog-title"]');if(!l||!d)throw Error("Required elements not found in the document");(0,o.expect)(getComputedStyle(l).backgroundColor).toBe("rgb(255, 0, 0)"),(0,o.expect)(getComputedStyle(d).color).toBe("rgb(0, 255, 0)"),document.head.removeChild(t)}),(0,o.test)("Base layer styles are applied when no custom classes are provided",async()=>{let t=(0,e.jsx)(a.ConsentManagerDialog,{});await (0,s.default)({component:t,testCases:[]});let n=document.querySelector('[data-testid="consent-manager-dialog-root"]'),l=document.querySelector('[data-testid="consent-manager-dialog-title"]');if(!n||!l)throw Error("Required elements not found in the document");(0,o.expect)(getComputedStyle(n).backgroundColor).toBe("rgb(255, 255, 255)"),(0,o.expect)(getComputedStyle(l).color).toBe("rgb(23, 23, 23)")}),(0,o.test)("Multiple custom classes can be applied and override base layer",async()=>{let t=document.createElement("style");t.textContent=`
9
9
  .custom-padding {
10
10
  padding: 32px !important;
11
11
  }
12
12
  .custom-border {
13
13
  border: 2px solid rgb(0, 0, 255) !important;
14
14
  }
15
- `,document.head.appendChild(s);let n=(0,e.jsx)(o.ConsentManagerDialog,{theme:{"dialog.root":"custom-padding custom-border"}});await (0,a.default)({component:n,testCases:[{testId:"consent-manager-dialog-root",styles:"custom-padding custom-border"}]});let l=document.querySelector('[data-testid="consent-manager-dialog-root"]');if(!l)throw Error("Required elements not found in the document");(0,t.expect)(getComputedStyle(l).padding).toBe("32px"),(0,t.expect)(getComputedStyle(l).border).toBe("2px solid rgb(0, 0, 255)"),document.head.removeChild(s)}),(0,t.test)("All consent manager dialog components should have their base classes applied",async()=>{let n=(0,e.jsx)(o.ConsentManagerDialog,{open:!0}),l={root:s.default.root||"",card:s.default.card||"",header:s.default.header||"",title:s.default.title||"",description:s.default.description||"",content:s.default.content||"",footer:s.default.footer||"",overlay:s.default.overlay||""};for(let[e,o]of(await (0,a.default)({component:n,testCases:[{testId:"consent-manager-dialog-root",styles:`${s.default.card} ${s.default.card} ${s.default.card}`},{testId:"consent-manager-dialog-card",styles:l.card},{testId:"consent-manager-dialog-header",styles:l.header},{testId:"consent-manager-dialog-title",styles:l.title},{testId:"consent-manager-dialog-description",styles:l.description},{testId:"consent-manager-dialog-content",styles:l.content},{testId:"consent-manager-dialog-footer",styles:l.footer},{testId:"consent-manager-dialog-overlay",styles:l.overlay}]}),Object.entries(l)))(0,t.expect)(o,`Base class for ${e} should not be empty`).not.toBe("")});
15
+ `,document.head.appendChild(t);let n=(0,e.jsx)(a.ConsentManagerDialog,{theme:{"dialog.root":"custom-padding custom-border"}});await (0,s.default)({component:n,testCases:[{testId:"consent-manager-dialog-root",styles:"custom-padding custom-border"}]});let l=document.querySelector('[data-testid="consent-manager-dialog-root"]');if(!l)throw Error("Required elements not found in the document");(0,o.expect)(getComputedStyle(l).padding).toBe("32px"),(0,o.expect)(getComputedStyle(l).border).toBe("2px solid rgb(0, 0, 255)"),document.head.removeChild(t)}),(0,o.test)("All consent manager dialog components should have their base classes applied",async()=>{let t=(0,e.jsx)(a.ConsentManagerDialog,{open:!0}),l={root:n.default.root||"",card:n.default.card||"",header:n.default.header||"",title:n.default.title||"",description:n.default.description||"",content:n.default.content||"",footer:n.default.footer||"",overlay:n.default.overlay||""};for(let[e,a]of(await (0,s.default)({component:t,testCases:[{testId:"consent-manager-dialog-root",styles:`${n.default.card} ${n.default.card} ${n.default.card}`},{testId:"consent-manager-dialog-card",styles:l.card},{testId:"consent-manager-dialog-header",styles:l.header},{testId:"consent-manager-dialog-title",styles:l.title},{testId:"consent-manager-dialog-description",styles:l.description},{testId:"consent-manager-dialog-content",styles:l.content},{testId:"consent-manager-dialog-footer",styles:l.footer},{testId:"consent-manager-dialog-overlay",styles:l.overlay}]}),Object.entries(l)))(0,o.expect)(a,`Base class for ${e} should not be empty`).not.toBe("")});
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- "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 a=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(a,{a:a}),a},__webpack_require__.d=(e,a)=>{for(var t in a)__webpack_require__.o(a,t)&&!__webpack_require__.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:a[t]})},__webpack_require__.o=(e,a)=>Object.prototype.hasOwnProperty.call(e,a),__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__,{DialogHeader:()=>DialogHeader,Content:()=>Content,Footer:()=>Footer,DialogFooter:()=>DialogFooter,ConsentCustomizationCard:()=>ConsentCustomizationCard,Card:()=>Card,DialogContent:()=>DialogContent,Header:()=>Header,DialogHeaderTitle:()=>DialogHeaderTitle,HeaderTitle:()=>HeaderTitle,HeaderDescription:()=>HeaderDescription,DialogHeaderDescription:()=>DialogHeaderDescription,BrandingFooter:()=>BrandingFooter});let jsx_runtime_namespaceObject=require("react/jsx-runtime"),external_react_namespaceObject=require("react"),consent_manager_widget_cjs_namespaceObject=require("../../consent-manager-widget/consent-manager-widget.cjs"),box_cjs_namespaceObject=require("../../shared/primitives/box.cjs"),logo_cjs_namespaceObject=require("../../shared/ui/logo.cjs"),index_cjs_namespaceObject=require("../../../hooks/index.cjs"),use_translations_cjs_namespaceObject=require("../../../hooks/use-translations.cjs"),external_consent_manager_dialog_module_cjs_namespaceObject=require("../consent-manager-dialog.module.cjs");var external_consent_manager_dialog_module_cjs_default=__webpack_require__.n(external_consent_manager_dialog_module_cjs_namespaceObject);let DialogCard=(0,external_react_namespaceObject.forwardRef)(({children:e,...a},t)=>(0,jsx_runtime_namespaceObject.jsx)(box_cjs_namespaceObject.Box,{ref:t,className:external_consent_manager_dialog_module_cjs_default().card,...a,themeKey:"dialog.root","data-testid":"consent-manager-dialog-root",children:e})),DialogHeader=(0,external_react_namespaceObject.forwardRef)(({children:e,...a},t)=>(0,jsx_runtime_namespaceObject.jsx)(box_cjs_namespaceObject.Box,{ref:t,className:external_consent_manager_dialog_module_cjs_default().header,...a,themeKey:"dialog.header","data-testid":"consent-manager-dialog-header",children:e})),DialogHeaderTitle=(0,external_react_namespaceObject.forwardRef)(({children:e,...a},t)=>(0,jsx_runtime_namespaceObject.jsx)(box_cjs_namespaceObject.Box,{ref:t,className:external_consent_manager_dialog_module_cjs_default().title,themeKey:"dialog.title",...a,"data-testid":"consent-manager-dialog-title",children:e})),DialogHeaderDescription=(0,external_react_namespaceObject.forwardRef)(({children:e,...a},t)=>(0,jsx_runtime_namespaceObject.jsx)(box_cjs_namespaceObject.Box,{ref:t,className:external_consent_manager_dialog_module_cjs_default().description,themeKey:"dialog.description",...a,"data-testid":"consent-manager-dialog-description",children:e})),DialogContent=(0,external_react_namespaceObject.forwardRef)(({children:e,...a},t)=>(0,jsx_runtime_namespaceObject.jsx)(box_cjs_namespaceObject.Box,{ref:t,className:external_consent_manager_dialog_module_cjs_default().content,themeKey:"dialog.content","data-testid":"consent-manager-dialog-content",...a,children:e})),DialogFooter=(0,external_react_namespaceObject.forwardRef)(({children:e,themeKey:a,...t},r)=>(0,jsx_runtime_namespaceObject.jsx)(box_cjs_namespaceObject.Box,{ref:r,className:external_consent_manager_dialog_module_cjs_default().footer,themeKey:a||"dialog.footer",...t,"data-testid":"consent-manager-dialog-footer",children:e})),BrandingFooter=()=>{let e=(0,index_cjs_namespaceObject.useConsentManager)(),a="undefined"!=typeof window?`?ref=${window.location.hostname}`:"";return(0,jsx_runtime_namespaceObject.jsxs)("a",{className:external_consent_manager_dialog_module_cjs_default().branding,href:e.isConsentDomain?`https://consent.io${a}`:`https://c15t.com${a}`,children:["Secured by"," ",e.isConsentDomain?(0,jsx_runtime_namespaceObject.jsx)(logo_cjs_namespaceObject.ConsentLogo,{className:external_consent_manager_dialog_module_cjs_default().brandingConsent}):(0,jsx_runtime_namespaceObject.jsx)(logo_cjs_namespaceObject.C15TIcon,{className:external_consent_manager_dialog_module_cjs_default().brandingC15T})]})},ConsentCustomizationCard=({noStyle:e})=>{let a=(0,use_translations_cjs_namespaceObject.useTranslations)();return(0,jsx_runtime_namespaceObject.jsxs)(DialogCard,{children:[(0,jsx_runtime_namespaceObject.jsxs)(DialogHeader,{children:[(0,jsx_runtime_namespaceObject.jsx)(DialogHeaderTitle,{children:a.consentManagerDialog.title}),(0,jsx_runtime_namespaceObject.jsx)(DialogHeaderDescription,{children:a.consentManagerDialog.description})]}),(0,jsx_runtime_namespaceObject.jsx)(DialogContent,{children:(0,jsx_runtime_namespaceObject.jsx)(consent_manager_widget_cjs_namespaceObject.ConsentManagerWidget,{hideBrading:!0,noStyle:e,useProvider:!1})}),(0,jsx_runtime_namespaceObject.jsx)(DialogFooter,{themeKey:"dialog.footer",children:(0,jsx_runtime_namespaceObject.jsx)(BrandingFooter,{})})]})},Card=DialogCard,Header=DialogHeader,HeaderTitle=DialogHeaderTitle,HeaderDescription=DialogHeaderDescription,Content=DialogContent,Footer=DialogFooter;for(var __webpack_i__ in exports.BrandingFooter=__webpack_exports__.BrandingFooter,exports.Card=__webpack_exports__.Card,exports.ConsentCustomizationCard=__webpack_exports__.ConsentCustomizationCard,exports.Content=__webpack_exports__.Content,exports.DialogContent=__webpack_exports__.DialogContent,exports.DialogFooter=__webpack_exports__.DialogFooter,exports.DialogHeader=__webpack_exports__.DialogHeader,exports.DialogHeaderDescription=__webpack_exports__.DialogHeaderDescription,exports.DialogHeaderTitle=__webpack_exports__.DialogHeaderTitle,exports.Footer=__webpack_exports__.Footer,exports.Header=__webpack_exports__.Header,exports.HeaderDescription=__webpack_exports__.HeaderDescription,exports.HeaderTitle=__webpack_exports__.HeaderTitle,__webpack_exports__)-1===["BrandingFooter","Card","ConsentCustomizationCard","Content","DialogContent","DialogFooter","DialogHeader","DialogHeaderDescription","DialogHeaderTitle","Footer","Header","HeaderDescription","HeaderTitle"].indexOf(__webpack_i__)&&(exports[__webpack_i__]=__webpack_exports__[__webpack_i__]);Object.defineProperty(exports,"__esModule",{value:!0});
2
+ "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 a=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(a,{a:a}),a},__webpack_require__.d=(e,a)=>{for(var t in a)__webpack_require__.o(a,t)&&!__webpack_require__.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:a[t]})},__webpack_require__.o=(e,a)=>Object.prototype.hasOwnProperty.call(e,a),__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__,{DialogHeader:()=>DialogHeader,Content:()=>Content,Footer:()=>Footer,DialogFooter:()=>DialogFooter,ConsentCustomizationCard:()=>ConsentCustomizationCard,Card:()=>Card,DialogContent:()=>DialogContent,Header:()=>Header,DialogHeaderTitle:()=>DialogHeaderTitle,HeaderTitle:()=>HeaderTitle,HeaderDescription:()=>HeaderDescription,DialogHeaderDescription:()=>DialogHeaderDescription,BrandingFooter:()=>BrandingFooter});let jsx_runtime_namespaceObject=require("react/jsx-runtime"),external_react_namespaceObject=require("react"),consent_manager_widget_cjs_namespaceObject=require("../../consent-manager-widget/consent-manager-widget.cjs"),box_cjs_namespaceObject=require("../../shared/primitives/box.cjs"),logo_cjs_namespaceObject=require("../../shared/ui/logo.cjs"),index_cjs_namespaceObject=require("../../../hooks/index.cjs"),use_translations_cjs_namespaceObject=require("../../../hooks/use-translations.cjs"),external_consent_manager_dialog_module_cjs_namespaceObject=require("../consent-manager-dialog.module.cjs");var external_consent_manager_dialog_module_cjs_default=__webpack_require__.n(external_consent_manager_dialog_module_cjs_namespaceObject);let DialogCard=(0,external_react_namespaceObject.forwardRef)(({children:e,...a},t)=>(0,jsx_runtime_namespaceObject.jsx)(box_cjs_namespaceObject.Box,{ref:t,className:external_consent_manager_dialog_module_cjs_default().card,...a,themeKey:"dialog.root","data-testid":"consent-manager-dialog-root",children:e})),DialogHeader=(0,external_react_namespaceObject.forwardRef)(({children:e,...a},t)=>(0,jsx_runtime_namespaceObject.jsx)(box_cjs_namespaceObject.Box,{ref:t,className:external_consent_manager_dialog_module_cjs_default().header,...a,themeKey:"dialog.header","data-testid":"consent-manager-dialog-header",children:e})),DialogHeaderTitle=(0,external_react_namespaceObject.forwardRef)(({children:e,...a},t)=>(0,jsx_runtime_namespaceObject.jsx)(box_cjs_namespaceObject.Box,{ref:t,className:external_consent_manager_dialog_module_cjs_default().title,themeKey:"dialog.title",...a,"data-testid":"consent-manager-dialog-title",children:e})),DialogHeaderDescription=(0,external_react_namespaceObject.forwardRef)(({children:e,...a},t)=>(0,jsx_runtime_namespaceObject.jsx)(box_cjs_namespaceObject.Box,{ref:t,className:external_consent_manager_dialog_module_cjs_default().description,themeKey:"dialog.description",...a,"data-testid":"consent-manager-dialog-description",children:e})),DialogContent=(0,external_react_namespaceObject.forwardRef)(({children:e,...a},t)=>(0,jsx_runtime_namespaceObject.jsx)(box_cjs_namespaceObject.Box,{ref:t,className:external_consent_manager_dialog_module_cjs_default().content,themeKey:"dialog.content","data-testid":"consent-manager-dialog-content",...a,children:e})),DialogFooter=(0,external_react_namespaceObject.forwardRef)(({children:e,themeKey:a,...t},r)=>(0,jsx_runtime_namespaceObject.jsx)(box_cjs_namespaceObject.Box,{ref:r,className:external_consent_manager_dialog_module_cjs_default().footer,themeKey:a||"dialog.footer",...t,"data-testid":"consent-manager-dialog-footer",children:e})),BrandingFooter=()=>{let e=(0,index_cjs_namespaceObject.useConsentManager)(),a="undefined"!=typeof window?`?ref=${window.location.hostname}`:"";return(0,jsx_runtime_namespaceObject.jsxs)("a",{className:external_consent_manager_dialog_module_cjs_default().branding,href:e.isConsentDomain?`https://consent.io${a}`:`https://c15t.com${a}`,children:["Secured by"," ",e.isConsentDomain?(0,jsx_runtime_namespaceObject.jsx)(logo_cjs_namespaceObject.ConsentLogo,{className:external_consent_manager_dialog_module_cjs_default().brandingConsent}):(0,jsx_runtime_namespaceObject.jsx)(logo_cjs_namespaceObject.C15TIcon,{className:external_consent_manager_dialog_module_cjs_default().brandingC15T})]})},ConsentCustomizationCard=({noStyle:e})=>{let{consentManagerDialog:a}=(0,use_translations_cjs_namespaceObject.useTranslations)();return(0,jsx_runtime_namespaceObject.jsxs)(DialogCard,{children:[(0,jsx_runtime_namespaceObject.jsxs)(DialogHeader,{children:[(0,jsx_runtime_namespaceObject.jsx)(DialogHeaderTitle,{children:a.title}),(0,jsx_runtime_namespaceObject.jsx)(DialogHeaderDescription,{children:a.description})]}),(0,jsx_runtime_namespaceObject.jsx)(DialogContent,{children:(0,jsx_runtime_namespaceObject.jsx)(consent_manager_widget_cjs_namespaceObject.ConsentManagerWidget,{hideBrading:!0,noStyle:e,useProvider:!0})}),(0,jsx_runtime_namespaceObject.jsx)(DialogFooter,{themeKey:"dialog.footer",children:(0,jsx_runtime_namespaceObject.jsx)(BrandingFooter,{})})]})},Card=DialogCard,Header=DialogHeader,HeaderTitle=DialogHeaderTitle,HeaderDescription=DialogHeaderDescription,Content=DialogContent,Footer=DialogFooter;for(var __webpack_i__ in exports.BrandingFooter=__webpack_exports__.BrandingFooter,exports.Card=__webpack_exports__.Card,exports.ConsentCustomizationCard=__webpack_exports__.ConsentCustomizationCard,exports.Content=__webpack_exports__.Content,exports.DialogContent=__webpack_exports__.DialogContent,exports.DialogFooter=__webpack_exports__.DialogFooter,exports.DialogHeader=__webpack_exports__.DialogHeader,exports.DialogHeaderDescription=__webpack_exports__.DialogHeaderDescription,exports.DialogHeaderTitle=__webpack_exports__.DialogHeaderTitle,exports.Footer=__webpack_exports__.Footer,exports.Header=__webpack_exports__.Header,exports.HeaderDescription=__webpack_exports__.HeaderDescription,exports.HeaderTitle=__webpack_exports__.HeaderTitle,__webpack_exports__)-1===["BrandingFooter","Card","ConsentCustomizationCard","Content","DialogContent","DialogFooter","DialogHeader","DialogHeaderDescription","DialogHeaderTitle","Footer","Header","HeaderDescription","HeaderTitle"].indexOf(__webpack_i__)&&(exports[__webpack_i__]=__webpack_exports__[__webpack_i__]);Object.defineProperty(exports,"__esModule",{value:!0});
@@ -1 +1 @@
1
- {"version":3,"file":"dialog-card.d.ts","sourceRoot":"","sources":["../../../../src/components/consent-manager-dialog/atoms/dialog-card.tsx"],"names":[],"mappings":"AAEA;;;;GAIG;AAEH,OAAO,EAAE,KAAK,SAAS,EAAwB,MAAM,OAAO,CAAC;AAG7D,OAAO,EAAO,KAAK,QAAQ,EAAE,MAAM,oCAAoC,CAAC;AAIxE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AA4CpD;;;;;;;;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,qGAcjB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,cAAc,+CAuB1B,CAAC;AAEF;;;;;;;;;;;;;;;;;;GAkBG;AACH,QAAA,MAAM,wBAAwB,GAAI,cAE/B;IACF,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,cAAc,CAAC,EAAE,OAAO,CAAC;CACzB,4CAyBA,CAAC;AAEF,QAAA,MAAM,IAAI;IAlPT,wDAAwD;eAC7C,SAAS;mEAiPE,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,qGAAe,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"}
1
+ {"version":3,"file":"dialog-card.d.ts","sourceRoot":"","sources":["../../../../src/components/consent-manager-dialog/atoms/dialog-card.tsx"],"names":[],"mappings":"AAEA;;;;GAIG;AAEH,OAAO,EAAE,KAAK,SAAS,EAAwB,MAAM,OAAO,CAAC;AAG7D,OAAO,EAAO,KAAK,QAAQ,EAAE,MAAM,oCAAoC,CAAC;AAIxE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AA4CpD;;;;;;;;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,qGAcjB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,cAAc,+CAuB1B,CAAC;AAEF;;;;;;;;;;;;;;;;;;GAkBG;AACH,QAAA,MAAM,wBAAwB,GAAI,cAE/B;IACF,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,cAAc,CAAC,EAAE,OAAO,CAAC;CACzB,4CAuBA,CAAC;AAEF,QAAA,MAAM,IAAI;IAhPT,wDAAwD;eAC7C,SAAS;mEA+OE,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,qGAAe,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"}
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- import*as e from"react/jsx-runtime";import*as a from"react";import*as o from"../../consent-manager-widget/consent-manager-widget.js";import*as t from"../../shared/primitives/box.js";import*as r from"../../shared/ui/logo.js";import*as n from"../../../hooks/index.js";import*as s from"../../../hooks/use-translations.js";import*as i from"../consent-manager-dialog.module.js";let d=(0,a.forwardRef)(({children:a,...o},r)=>(0,e.jsx)(t.Box,{ref:r,className:i.default.card,...o,themeKey:"dialog.root","data-testid":"consent-manager-dialog-root",children:a})),l=(0,a.forwardRef)(({children:a,...o},r)=>(0,e.jsx)(t.Box,{ref:r,className:i.default.header,...o,themeKey:"dialog.header","data-testid":"consent-manager-dialog-header",children:a})),c=(0,a.forwardRef)(({children:a,...o},r)=>(0,e.jsx)(t.Box,{ref:r,className:i.default.title,themeKey:"dialog.title",...o,"data-testid":"consent-manager-dialog-title",children:a})),m=(0,a.forwardRef)(({children:a,...o},r)=>(0,e.jsx)(t.Box,{ref:r,className:i.default.description,themeKey:"dialog.description",...o,"data-testid":"consent-manager-dialog-description",children:a})),g=(0,a.forwardRef)(({children:a,...o},r)=>(0,e.jsx)(t.Box,{ref:r,className:i.default.content,themeKey:"dialog.content","data-testid":"consent-manager-dialog-content",...o,children:a})),f=(0,a.forwardRef)(({children:a,themeKey:o,...r},n)=>(0,e.jsx)(t.Box,{ref:n,className:i.default.footer,themeKey:o||"dialog.footer",...r,"data-testid":"consent-manager-dialog-footer",children:a})),h=()=>{let a=(0,n.useConsentManager)(),o="undefined"!=typeof window?`?ref=${window.location.hostname}`:"";return(0,e.jsxs)("a",{className:i.default.branding,href:a.isConsentDomain?`https://consent.io${o}`:`https://c15t.com${o}`,children:["Secured by"," ",a.isConsentDomain?(0,e.jsx)(r.ConsentLogo,{className:i.default.brandingConsent}):(0,e.jsx)(r.C15TIcon,{className:i.default.brandingC15T})]})},x=({noStyle:a})=>{let t=(0,s.useTranslations)();return(0,e.jsxs)(d,{children:[(0,e.jsxs)(l,{children:[(0,e.jsx)(c,{children:t.consentManagerDialog.title}),(0,e.jsx)(m,{children:t.consentManagerDialog.description})]}),(0,e.jsx)(g,{children:(0,e.jsx)(o.ConsentManagerWidget,{hideBrading:!0,noStyle:a,useProvider:!1})}),(0,e.jsx)(f,{themeKey:"dialog.footer",children:(0,e.jsx)(h,{})})]})},j=d,u=l,p=c,C=m,w=g,D=f;export{h as BrandingFooter,j as Card,x as ConsentCustomizationCard,w as Content,g as DialogContent,f as DialogFooter,l as DialogHeader,m as DialogHeaderDescription,c as DialogHeaderTitle,D as Footer,u as Header,C as HeaderDescription,p as HeaderTitle};
2
+ import*as e from"react/jsx-runtime";import*as a from"react";import*as o from"../../consent-manager-widget/consent-manager-widget.js";import*as t from"../../shared/primitives/box.js";import*as r from"../../shared/ui/logo.js";import*as n from"../../../hooks/index.js";import*as s from"../../../hooks/use-translations.js";import*as i from"../consent-manager-dialog.module.js";let d=(0,a.forwardRef)(({children:a,...o},r)=>(0,e.jsx)(t.Box,{ref:r,className:i.default.card,...o,themeKey:"dialog.root","data-testid":"consent-manager-dialog-root",children:a})),l=(0,a.forwardRef)(({children:a,...o},r)=>(0,e.jsx)(t.Box,{ref:r,className:i.default.header,...o,themeKey:"dialog.header","data-testid":"consent-manager-dialog-header",children:a})),c=(0,a.forwardRef)(({children:a,...o},r)=>(0,e.jsx)(t.Box,{ref:r,className:i.default.title,themeKey:"dialog.title",...o,"data-testid":"consent-manager-dialog-title",children:a})),m=(0,a.forwardRef)(({children:a,...o},r)=>(0,e.jsx)(t.Box,{ref:r,className:i.default.description,themeKey:"dialog.description",...o,"data-testid":"consent-manager-dialog-description",children:a})),f=(0,a.forwardRef)(({children:a,...o},r)=>(0,e.jsx)(t.Box,{ref:r,className:i.default.content,themeKey:"dialog.content","data-testid":"consent-manager-dialog-content",...o,children:a})),g=(0,a.forwardRef)(({children:a,themeKey:o,...r},n)=>(0,e.jsx)(t.Box,{ref:n,className:i.default.footer,themeKey:o||"dialog.footer",...r,"data-testid":"consent-manager-dialog-footer",children:a})),h=()=>{let a=(0,n.useConsentManager)(),o="undefined"!=typeof window?`?ref=${window.location.hostname}`:"";return(0,e.jsxs)("a",{className:i.default.branding,href:a.isConsentDomain?`https://consent.io${o}`:`https://c15t.com${o}`,children:["Secured by"," ",a.isConsentDomain?(0,e.jsx)(r.ConsentLogo,{className:i.default.brandingConsent}):(0,e.jsx)(r.C15TIcon,{className:i.default.brandingC15T})]})},x=({noStyle:a})=>{let{consentManagerDialog:t}=(0,s.useTranslations)();return(0,e.jsxs)(d,{children:[(0,e.jsxs)(l,{children:[(0,e.jsx)(c,{children:t.title}),(0,e.jsx)(m,{children:t.description})]}),(0,e.jsx)(f,{children:(0,e.jsx)(o.ConsentManagerWidget,{hideBrading:!0,noStyle:a,useProvider:!0})}),(0,e.jsx)(g,{themeKey:"dialog.footer",children:(0,e.jsx)(h,{})})]})},j=d,u=l,p=c,C=m,w=f,y=g;export{h as BrandingFooter,j as Card,x as ConsentCustomizationCard,w as Content,f as DialogContent,g as DialogFooter,l as DialogHeader,m as DialogHeaderDescription,c as DialogHeaderTitle,y as Footer,u as Header,C as HeaderDescription,p as HeaderTitle};
@@ -1,4 +1,4 @@
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 n in t)__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},__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_consent_manager_widget_cjs_namespaceObject=require("../consent-manager-widget.cjs"),test_helpers_cjs_namespaceObject=require("../../../utils/test-helpers.cjs");var test_helpers_cjs_default=__webpack_require__.n(test_helpers_cjs_namespaceObject);let external_consent_manager_widget_module_cjs_namespaceObject=require("../consent-manager-widget.module.cjs");var external_consent_manager_widget_module_cjs_default=__webpack_require__.n(external_consent_manager_widget_module_cjs_namespaceObject);external_vitest_namespaceObject.vi.mock("~/hooks/use-consent-manager",()=>({useConsentManager:()=>({getConsentCategory:external_vitest_namespaceObject.vi.fn(()=>({isEnabled:!0})),updateConsentCategory:external_vitest_namespaceObject.vi.fn(),saveConsents:external_vitest_namespaceObject.vi.fn(),getDisplayedConsents:external_vitest_namespaceObject.vi.fn(()=>[])})})),external_vitest_namespaceObject.vi.mock("~/hooks/use-translations",()=>({useTranslations:()=>({consentManagerWidget:{necessaryCookies:"Necessary",marketingCookies:"Marketing",analyticsCookies:"Analytics",preferencesCookies:"Preferences",unknownIntegration:"Unknown",alwaysActive:"Always Active",rejectAllButton:"Reject All",acceptAllButton:"Accept All",saveButton:"Save Settings"},consentManagerDialog:{},cookieBanner:{},general:{}})}));let ALL_COMPONENTS=[{testId:"consent-manager-widget-root",themeKey:"widget.root",styles:"custom-root"},{testId:"consent-manager-widget-footer",themeKey:"widget.footer",styles:"custom-footer"},{testId:"consent-manager-widget-footer-sub-group",themeKey:"widget.footer.sub-group",styles:"custom-footer-sub-group"},{testId:"consent-manager-widget-reject-button",themeKey:"widget.footer.reject-button",styles:"custom-reject-button"},{testId:"consent-manager-widget-footer-accept-button",themeKey:"widget.footer.accept-button",styles:"custom-accept-button"},{testId:"consent-manager-widget-footer-save-button",themeKey:"widget.footer.save-button",styles:"custom-save-button"},{testId:"consent-manager-widget-accordion-trigger-marketing",themeKey:"widget.accordion.trigger",styles:"custom-accordion-trigger"},{testId:"consent-manager-widget-accordion-trigger-inner-marketing",themeKey:"widget.accordion.trigger-inner",styles:"custom-accordion-trigger-inner"},{testId:"consent-manager-widget-accordion-content-marketing",themeKey:"widget.accordion.content",styles:"custom-accordion-content"},{testId:"consent-manager-widget-switch-marketing",themeKey:"widget.switch",styles:"custom-switch"}];for(var __webpack_i__ in(0,external_vitest_namespaceObject.test)("should apply string classNames from theme prop to all widget elements",async()=>{let e=(0,jsx_runtime_namespaceObject.jsx)(external_consent_manager_widget_cjs_namespaceObject.ConsentManagerWidget,{theme:ALL_COMPONENTS.reduce((e,{themeKey:t,styles:n})=>(e[t]=n,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)("should apply className and style objects from theme prop to all widget elements",async()=>{let e={backgroundColor:"#ffffff",padding:"20px",border:"1px solid #000000"},t=ALL_COMPONENTS.map(({testId:t,themeKey:n,styles:a})=>({testId:t,themeKey:n,className:a,style:e})),n=(0,jsx_runtime_namespaceObject.jsx)(external_consent_manager_widget_cjs_namespaceObject.ConsentManagerWidget,{theme:t.reduce((e,{themeKey:t,className:n,style:a})=>(e[t]={className:n,style:a},e),{})});await test_helpers_cjs_default()({component:n,testCases:t.map(({testId:e,className:t,style:n})=>({testId:e,styles:{className:t,style:n}}))})}),(0,external_vitest_namespaceObject.test)("should remove default styles but keep custom classNames when top-level noStyle prop is true",async()=>{let e=(0,jsx_runtime_namespaceObject.jsx)(external_consent_manager_widget_cjs_namespaceObject.ConsentManagerWidget,{noStyle:!0,theme:ALL_COMPONENTS.reduce((e,{themeKey:t,styles:n})=>(e[t]=n,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)("should remove default styles but keep custom classNames when theme object provides noStyle: true",async()=>{let e=ALL_COMPONENTS.reduce((e,{themeKey:t,styles:n})=>(e[t]={className:n,noStyle:!0},e),{}),t=(0,jsx_runtime_namespaceObject.jsx)(external_consent_manager_widget_cjs_namespaceObject.ConsentManagerWidget,{theme:e});await test_helpers_cjs_default()({component:t,testCases:ALL_COMPONENTS.map(({testId:e,styles:t})=>({testId:e,styles:{className:t}}))})}),(0,external_vitest_namespaceObject.test)("should correctly apply styles when theme prop uses mixed string and object formats",async()=>{let e=(0,jsx_runtime_namespaceObject.jsx)(external_consent_manager_widget_cjs_namespaceObject.ConsentManagerWidget,{theme:{"widget.root":{className:"custom-root",style:{backgroundColor:"rgb(255, 255, 255)",padding:"16px"}},"widget.accordion.trigger":"custom-accordion-trigger"}});await test_helpers_cjs_default()({component:e,testCases:[{testId:"consent-manager-widget-root",styles:{className:"custom-root",style:{backgroundColor:"rgb(255, 255, 255)",padding:"16px"}}},{testId:"consent-manager-widget-accordion-trigger-marketing",styles:"custom-accordion-trigger"}]})}),(0,external_vitest_namespaceObject.test)("should handle empty strings and empty style objects in theme prop gracefully",async()=>{let e=(0,jsx_runtime_namespaceObject.jsx)(external_consent_manager_widget_cjs_namespaceObject.ConsentManagerWidget,{theme:{"widget.root":"","widget.accordion":"","widget.footer":{className:"",style:{margin:"0",padding:"0"}}}});await test_helpers_cjs_default()({component:e,testCases:[{testId:"consent-manager-widget-root",styles:""},{testId:"consent-manager-widget-accordion",styles:""},{testId:"consent-manager-widget-footer",styles:{className:"",style:{margin:"0",padding:"0"}}}]})}),(0,external_vitest_namespaceObject.test)("Custom classes override base layer styles",async()=>{let e=document.createElement("style");e.textContent=`
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 n in t)__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var __webpack_exports__={};let jsx_runtime_namespaceObject=require("react/jsx-runtime"),external_c15t_namespaceObject=require("c15t"),external_vitest_namespaceObject=require("vitest"),external_consent_manager_widget_cjs_namespaceObject=require("../consent-manager-widget.cjs"),test_helpers_cjs_namespaceObject=require("../../../utils/test-helpers.cjs");var test_helpers_cjs_default=__webpack_require__.n(test_helpers_cjs_namespaceObject);let external_consent_manager_widget_module_cjs_namespaceObject=require("../consent-manager-widget.module.cjs");var external_consent_manager_widget_module_cjs_default=__webpack_require__.n(external_consent_manager_widget_module_cjs_namespaceObject);external_vitest_namespaceObject.vi.mock("~/hooks/use-consent-manager",()=>({useConsentManager:()=>({getConsentCategory:external_vitest_namespaceObject.vi.fn(()=>({isEnabled:!0})),updateConsentCategory:external_vitest_namespaceObject.vi.fn(),saveConsents:external_vitest_namespaceObject.vi.fn(),getDisplayedConsents:external_vitest_namespaceObject.vi.fn(()=>[])})})),external_vitest_namespaceObject.vi.mock("~/hooks/use-translations",()=>({useTranslations:()=>external_c15t_namespaceObject.defaultTranslationConfig.translations.en}));let ALL_COMPONENTS=[{testId:"consent-manager-widget-root",themeKey:"widget.root",styles:"custom-root"},{testId:"consent-manager-widget-footer",themeKey:"widget.footer",styles:"custom-footer"},{testId:"consent-manager-widget-footer-sub-group",themeKey:"widget.footer.sub-group",styles:"custom-footer-sub-group"},{testId:"consent-manager-widget-reject-button",themeKey:"widget.footer.reject-button",styles:"custom-reject-button"},{testId:"consent-manager-widget-footer-accept-button",themeKey:"widget.footer.accept-button",styles:"custom-accept-button"},{testId:"consent-manager-widget-footer-save-button",themeKey:"widget.footer.save-button",styles:"custom-save-button"},{testId:"consent-manager-widget-accordion-trigger-marketing",themeKey:"widget.accordion.trigger",styles:"custom-accordion-trigger"},{testId:"consent-manager-widget-accordion-trigger-inner-marketing",themeKey:"widget.accordion.trigger-inner",styles:"custom-accordion-trigger-inner"},{testId:"consent-manager-widget-accordion-content-marketing",themeKey:"widget.accordion.content",styles:"custom-accordion-content"},{testId:"consent-manager-widget-switch-marketing",themeKey:"widget.switch",styles:"custom-switch"}];for(var __webpack_i__ in(0,external_vitest_namespaceObject.test)("should apply string classNames from theme prop to all widget elements",async()=>{let e=(0,jsx_runtime_namespaceObject.jsx)(external_consent_manager_widget_cjs_namespaceObject.ConsentManagerWidget,{theme:ALL_COMPONENTS.reduce((e,{themeKey:t,styles:n})=>(e[t]=n,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)("should apply className and style objects from theme prop to all widget elements",async()=>{let e={backgroundColor:"#ffffff",padding:"20px",border:"1px solid #000000"},t=ALL_COMPONENTS.map(({testId:t,themeKey:n,styles:a})=>({testId:t,themeKey:n,className:a,style:e})),n=(0,jsx_runtime_namespaceObject.jsx)(external_consent_manager_widget_cjs_namespaceObject.ConsentManagerWidget,{theme:t.reduce((e,{themeKey:t,className:n,style:a})=>(e[t]={className:n,style:a},e),{})});await test_helpers_cjs_default()({component:n,testCases:t.map(({testId:e,className:t,style:n})=>({testId:e,styles:{className:t,style:n}}))})}),(0,external_vitest_namespaceObject.test)("should remove default styles but keep custom classNames when top-level noStyle prop is true",async()=>{let e=(0,jsx_runtime_namespaceObject.jsx)(external_consent_manager_widget_cjs_namespaceObject.ConsentManagerWidget,{noStyle:!0,theme:ALL_COMPONENTS.reduce((e,{themeKey:t,styles:n})=>(e[t]=n,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)("should remove default styles but keep custom classNames when theme object provides noStyle: true",async()=>{let e=ALL_COMPONENTS.reduce((e,{themeKey:t,styles:n})=>(e[t]={className:n,noStyle:!0},e),{}),t=(0,jsx_runtime_namespaceObject.jsx)(external_consent_manager_widget_cjs_namespaceObject.ConsentManagerWidget,{theme:e});await test_helpers_cjs_default()({component:t,testCases:ALL_COMPONENTS.map(({testId:e,styles:t})=>({testId:e,styles:{className:t}}))})}),(0,external_vitest_namespaceObject.test)("should correctly apply styles when theme prop uses mixed string and object formats",async()=>{let e=(0,jsx_runtime_namespaceObject.jsx)(external_consent_manager_widget_cjs_namespaceObject.ConsentManagerWidget,{theme:{"widget.root":{className:"custom-root",style:{backgroundColor:"rgb(255, 255, 255)",padding:"16px"}},"widget.accordion.trigger":"custom-accordion-trigger"}});await test_helpers_cjs_default()({component:e,testCases:[{testId:"consent-manager-widget-root",styles:{className:"custom-root",style:{backgroundColor:"rgb(255, 255, 255)",padding:"16px"}}},{testId:"consent-manager-widget-accordion-trigger-marketing",styles:"custom-accordion-trigger"}]})}),(0,external_vitest_namespaceObject.test)("should handle empty strings and empty style objects in theme prop gracefully",async()=>{let e=(0,jsx_runtime_namespaceObject.jsx)(external_consent_manager_widget_cjs_namespaceObject.ConsentManagerWidget,{theme:{"widget.root":"","widget.accordion":"","widget.footer":{className:"",style:{margin:"0",padding:"0"}}}});await test_helpers_cjs_default()({component:e,testCases:[{testId:"consent-manager-widget-root",styles:""},{testId:"consent-manager-widget-accordion",styles:""},{testId:"consent-manager-widget-footer",styles:{className:"",style:{margin:"0",padding:"0"}}}]})}),(0,external_vitest_namespaceObject.test)("Custom classes override base layer styles",async()=>{let e=document.createElement("style");e.textContent=`
2
2
  .custom-widget-background {
3
3
  background-color: rgb(255, 0, 0) !important;
4
4
  }
@@ -1,15 +1,15 @@
1
- import*as e from"react/jsx-runtime";import*as t from"vitest";import*as o from"../consent-manager-widget.js";import*as n from"../../../utils/test-helpers.js";import*as s from"../consent-manager-widget.module.js";t.vi.mock("~/hooks/use-consent-manager",()=>({useConsentManager:()=>({getConsentCategory:t.vi.fn(()=>({isEnabled:!0})),updateConsentCategory:t.vi.fn(),saveConsents:t.vi.fn(),getDisplayedConsents:t.vi.fn(()=>[])})})),t.vi.mock("~/hooks/use-translations",()=>({useTranslations:()=>({consentManagerWidget:{necessaryCookies:"Necessary",marketingCookies:"Marketing",analyticsCookies:"Analytics",preferencesCookies:"Preferences",unknownIntegration:"Unknown",alwaysActive:"Always Active",rejectAllButton:"Reject All",acceptAllButton:"Accept All",saveButton:"Save Settings"},consentManagerDialog:{},cookieBanner:{},general:{}})}));let a=[{testId:"consent-manager-widget-root",themeKey:"widget.root",styles:"custom-root"},{testId:"consent-manager-widget-footer",themeKey:"widget.footer",styles:"custom-footer"},{testId:"consent-manager-widget-footer-sub-group",themeKey:"widget.footer.sub-group",styles:"custom-footer-sub-group"},{testId:"consent-manager-widget-reject-button",themeKey:"widget.footer.reject-button",styles:"custom-reject-button"},{testId:"consent-manager-widget-footer-accept-button",themeKey:"widget.footer.accept-button",styles:"custom-accept-button"},{testId:"consent-manager-widget-footer-save-button",themeKey:"widget.footer.save-button",styles:"custom-save-button"},{testId:"consent-manager-widget-accordion-trigger-marketing",themeKey:"widget.accordion.trigger",styles:"custom-accordion-trigger"},{testId:"consent-manager-widget-accordion-trigger-inner-marketing",themeKey:"widget.accordion.trigger-inner",styles:"custom-accordion-trigger-inner"},{testId:"consent-manager-widget-accordion-content-marketing",themeKey:"widget.accordion.content",styles:"custom-accordion-content"},{testId:"consent-manager-widget-switch-marketing",themeKey:"widget.switch",styles:"custom-switch"}];(0,t.test)("should apply string classNames from theme prop to all widget elements",async()=>{let t=(0,e.jsx)(o.ConsentManagerWidget,{theme:a.reduce((e,{themeKey:t,styles:o})=>(e[t]=o,e),{})});await (0,n.default)({component:t,testCases:a.map(({testId:e,styles:t})=>({testId:e,styles:t}))})}),(0,t.test)("should apply className and style objects from theme prop to all widget elements",async()=>{let t={backgroundColor:"#ffffff",padding:"20px",border:"1px solid #000000"},s=a.map(({testId:e,themeKey:o,styles:n})=>({testId:e,themeKey:o,className:n,style:t})),r=(0,e.jsx)(o.ConsentManagerWidget,{theme:s.reduce((e,{themeKey:t,className:o,style:n})=>(e[t]={className:o,style:n},e),{})});await (0,n.default)({component:r,testCases:s.map(({testId:e,className:t,style:o})=>({testId:e,styles:{className:t,style:o}}))})}),(0,t.test)("should remove default styles but keep custom classNames when top-level noStyle prop is true",async()=>{let t=(0,e.jsx)(o.ConsentManagerWidget,{noStyle:!0,theme:a.reduce((e,{themeKey:t,styles:o})=>(e[t]=o,e),{})});await (0,n.default)({component:t,testCases:a.map(({testId:e,styles:t})=>({testId:e,styles:t})),noStyle:!0})}),(0,t.test)("should remove default styles but keep custom classNames when theme object provides noStyle: true",async()=>{let t=a.reduce((e,{themeKey:t,styles:o})=>(e[t]={className:o,noStyle:!0},e),{}),s=(0,e.jsx)(o.ConsentManagerWidget,{theme:t});await (0,n.default)({component:s,testCases:a.map(({testId:e,styles:t})=>({testId:e,styles:{className:t}}))})}),(0,t.test)("should correctly apply styles when theme prop uses mixed string and object formats",async()=>{let t=(0,e.jsx)(o.ConsentManagerWidget,{theme:{"widget.root":{className:"custom-root",style:{backgroundColor:"rgb(255, 255, 255)",padding:"16px"}},"widget.accordion.trigger":"custom-accordion-trigger"}});await (0,n.default)({component:t,testCases:[{testId:"consent-manager-widget-root",styles:{className:"custom-root",style:{backgroundColor:"rgb(255, 255, 255)",padding:"16px"}}},{testId:"consent-manager-widget-accordion-trigger-marketing",styles:"custom-accordion-trigger"}]})}),(0,t.test)("should handle empty strings and empty style objects in theme prop gracefully",async()=>{let t=(0,e.jsx)(o.ConsentManagerWidget,{theme:{"widget.root":"","widget.accordion":"","widget.footer":{className:"",style:{margin:"0",padding:"0"}}}});await (0,n.default)({component:t,testCases:[{testId:"consent-manager-widget-root",styles:""},{testId:"consent-manager-widget-accordion",styles:""},{testId:"consent-manager-widget-footer",styles:{className:"",style:{margin:"0",padding:"0"}}}]})}),(0,t.test)("Custom classes override base layer styles",async()=>{let s=document.createElement("style");s.textContent=`
1
+ import*as e from"react/jsx-runtime";import*as t from"c15t";import*as o from"vitest";import*as s from"../consent-manager-widget.js";import*as n from"../../../utils/test-helpers.js";import*as a from"../consent-manager-widget.module.js";o.vi.mock("~/hooks/use-consent-manager",()=>({useConsentManager:()=>({getConsentCategory:o.vi.fn(()=>({isEnabled:!0})),updateConsentCategory:o.vi.fn(),saveConsents:o.vi.fn(),getDisplayedConsents:o.vi.fn(()=>[])})})),o.vi.mock("~/hooks/use-translations",()=>({useTranslations:()=>t.defaultTranslationConfig.translations.en}));let r=[{testId:"consent-manager-widget-root",themeKey:"widget.root",styles:"custom-root"},{testId:"consent-manager-widget-footer",themeKey:"widget.footer",styles:"custom-footer"},{testId:"consent-manager-widget-footer-sub-group",themeKey:"widget.footer.sub-group",styles:"custom-footer-sub-group"},{testId:"consent-manager-widget-reject-button",themeKey:"widget.footer.reject-button",styles:"custom-reject-button"},{testId:"consent-manager-widget-footer-accept-button",themeKey:"widget.footer.accept-button",styles:"custom-accept-button"},{testId:"consent-manager-widget-footer-save-button",themeKey:"widget.footer.save-button",styles:"custom-save-button"},{testId:"consent-manager-widget-accordion-trigger-marketing",themeKey:"widget.accordion.trigger",styles:"custom-accordion-trigger"},{testId:"consent-manager-widget-accordion-trigger-inner-marketing",themeKey:"widget.accordion.trigger-inner",styles:"custom-accordion-trigger-inner"},{testId:"consent-manager-widget-accordion-content-marketing",themeKey:"widget.accordion.content",styles:"custom-accordion-content"},{testId:"consent-manager-widget-switch-marketing",themeKey:"widget.switch",styles:"custom-switch"}];(0,o.test)("should apply string classNames from theme prop to all widget elements",async()=>{let t=(0,e.jsx)(s.ConsentManagerWidget,{theme:r.reduce((e,{themeKey:t,styles:o})=>(e[t]=o,e),{})});await (0,n.default)({component:t,testCases:r.map(({testId:e,styles:t})=>({testId:e,styles:t}))})}),(0,o.test)("should apply className and style objects from theme prop to all widget elements",async()=>{let t={backgroundColor:"#ffffff",padding:"20px",border:"1px solid #000000"},o=r.map(({testId:e,themeKey:o,styles:s})=>({testId:e,themeKey:o,className:s,style:t})),a=(0,e.jsx)(s.ConsentManagerWidget,{theme:o.reduce((e,{themeKey:t,className:o,style:s})=>(e[t]={className:o,style:s},e),{})});await (0,n.default)({component:a,testCases:o.map(({testId:e,className:t,style:o})=>({testId:e,styles:{className:t,style:o}}))})}),(0,o.test)("should remove default styles but keep custom classNames when top-level noStyle prop is true",async()=>{let t=(0,e.jsx)(s.ConsentManagerWidget,{noStyle:!0,theme:r.reduce((e,{themeKey:t,styles:o})=>(e[t]=o,e),{})});await (0,n.default)({component:t,testCases:r.map(({testId:e,styles:t})=>({testId:e,styles:t})),noStyle:!0})}),(0,o.test)("should remove default styles but keep custom classNames when theme object provides noStyle: true",async()=>{let t=r.reduce((e,{themeKey:t,styles:o})=>(e[t]={className:o,noStyle:!0},e),{}),o=(0,e.jsx)(s.ConsentManagerWidget,{theme:t});await (0,n.default)({component:o,testCases:r.map(({testId:e,styles:t})=>({testId:e,styles:{className:t}}))})}),(0,o.test)("should correctly apply styles when theme prop uses mixed string and object formats",async()=>{let t=(0,e.jsx)(s.ConsentManagerWidget,{theme:{"widget.root":{className:"custom-root",style:{backgroundColor:"rgb(255, 255, 255)",padding:"16px"}},"widget.accordion.trigger":"custom-accordion-trigger"}});await (0,n.default)({component:t,testCases:[{testId:"consent-manager-widget-root",styles:{className:"custom-root",style:{backgroundColor:"rgb(255, 255, 255)",padding:"16px"}}},{testId:"consent-manager-widget-accordion-trigger-marketing",styles:"custom-accordion-trigger"}]})}),(0,o.test)("should handle empty strings and empty style objects in theme prop gracefully",async()=>{let t=(0,e.jsx)(s.ConsentManagerWidget,{theme:{"widget.root":"","widget.accordion":"","widget.footer":{className:"",style:{margin:"0",padding:"0"}}}});await (0,n.default)({component:t,testCases:[{testId:"consent-manager-widget-root",styles:""},{testId:"consent-manager-widget-accordion",styles:""},{testId:"consent-manager-widget-footer",styles:{className:"",style:{margin:"0",padding:"0"}}}]})}),(0,o.test)("Custom classes override base layer styles",async()=>{let t=document.createElement("style");t.textContent=`
2
2
  .custom-widget-background {
3
3
  background-color: rgb(255, 0, 0) !important;
4
4
  }
5
5
  .custom-widget-foooter {
6
6
  color: rgb(0, 255, 0) !important;
7
7
  }
8
- `,document.head.appendChild(s);let a=(0,e.jsx)(o.ConsentManagerWidget,{theme:{"widget.root":"custom-widget-background","widget.footer":"custom-widget-foooter"}});await (0,n.default)({component:a,testCases:[{testId:"consent-manager-widget-root",styles:"custom-widget-background"},{testId:"consent-manager-widget-footer",styles:"custom-widget-foooter"}]});let r=document.querySelector('[data-testid="consent-manager-widget-root"]'),d=document.querySelector('[data-testid="consent-manager-widget-footer"]');if(!r||!d)throw Error("Required elements not found in the document");(0,t.expect)(getComputedStyle(r).backgroundColor).toBe("rgb(255, 0, 0)"),(0,t.expect)(getComputedStyle(d).color).toBe("rgb(0, 255, 0)"),document.head.removeChild(s)}),(0,t.test)("Base layer styles are applied when no custom classes are provided",async()=>{await (0,n.default)({component:(0,e.jsx)(o.ConsentManagerWidget,{}),testCases:[]});let s=document.querySelector('[data-testid="consent-manager-widget-root"]'),a=document.querySelector('[data-testid="consent-manager-widget-footer"]');if(!s||!a)throw Error("Required elements not found in the document");(0,t.expect)(getComputedStyle(s).backgroundColor).toBe("rgba(0, 0, 0, 0)"),(0,t.expect)(getComputedStyle(a).color).toBe("rgb(0, 0, 0)")}),(0,t.test)("Multiple custom classes can be applied and override base layer",async()=>{let s=document.createElement("style");s.textContent=`
8
+ `,document.head.appendChild(t);let a=(0,e.jsx)(s.ConsentManagerWidget,{theme:{"widget.root":"custom-widget-background","widget.footer":"custom-widget-foooter"}});await (0,n.default)({component:a,testCases:[{testId:"consent-manager-widget-root",styles:"custom-widget-background"},{testId:"consent-manager-widget-footer",styles:"custom-widget-foooter"}]});let r=document.querySelector('[data-testid="consent-manager-widget-root"]'),d=document.querySelector('[data-testid="consent-manager-widget-footer"]');if(!r||!d)throw Error("Required elements not found in the document");(0,o.expect)(getComputedStyle(r).backgroundColor).toBe("rgb(255, 0, 0)"),(0,o.expect)(getComputedStyle(d).color).toBe("rgb(0, 255, 0)"),document.head.removeChild(t)}),(0,o.test)("Base layer styles are applied when no custom classes are provided",async()=>{await (0,n.default)({component:(0,e.jsx)(s.ConsentManagerWidget,{}),testCases:[]});let t=document.querySelector('[data-testid="consent-manager-widget-root"]'),a=document.querySelector('[data-testid="consent-manager-widget-footer"]');if(!t||!a)throw Error("Required elements not found in the document");(0,o.expect)(getComputedStyle(t).backgroundColor).toBe("rgba(0, 0, 0, 0)"),(0,o.expect)(getComputedStyle(a).color).toBe("rgb(0, 0, 0)")}),(0,o.test)("Multiple custom classes can be applied and override base layer",async()=>{let t=document.createElement("style");t.textContent=`
9
9
  .custom-padding {
10
10
  padding: 32px !important;
11
11
  }
12
12
  .custom-border {
13
13
  border: 2px solid rgb(0, 0, 255) !important;
14
14
  }
15
- `,document.head.appendChild(s);let a=(0,e.jsx)(o.ConsentManagerWidget,{theme:{"widget.root":"custom-padding custom-border"}});await (0,n.default)({component:a,testCases:[{testId:"consent-manager-widget-root",styles:"custom-padding custom-border"}]});let r=document.querySelector('[data-testid="consent-manager-widget-root"]');if(!r)throw Error("Required elements not found in the document");(0,t.expect)(getComputedStyle(r).padding).toBe("32px"),(0,t.expect)(getComputedStyle(r).border).toBe("2px solid rgb(0, 0, 255)"),document.head.removeChild(s)}),(0,t.test)("All consent manager widget components should have their base classes applied",async()=>{let a=(0,e.jsx)(o.ConsentManagerWidget,{}),r={card:s.default.card||"",header:s.default.header||"",title:s.default.title||"",description:s.default.description||"",content:s.default.content||"",footer:s.default.footer||"",footerGroup:s.default.footerGroup||"",accordionItem:s.default.accordionItem||"",accordionTrigger:s.default.accordionTrigger||"",accordionTriggerInner:s.default.accordionTriggerInner||"",accordionContent:s.default.accordionContent||"",accordionArrow:s.default.accordionArrow||"",switch:s.default.switch||""};for(let[e,o]of(await (0,n.default)({component:a,testCases:[{testId:"consent-manager-widget-footer",styles:r.footer},{testId:"consent-manager-widget-footer-sub-group",styles:r.footerGroup},{testId:"consent-manager-widget-accordion-trigger-marketing",styles:r.accordionTrigger},{testId:"consent-manager-widget-accordion-trigger-inner-marketing",styles:r.accordionTriggerInner},{testId:"consent-manager-widget-accordion-content-marketing",styles:r.accordionContent},{testId:"consent-manager-widget-switch-marketing",styles:r.switch}]}),Object.entries(r)))(0,t.expect)(o,`Base class for ${e} should not be empty`).not.toBe("")});
15
+ `,document.head.appendChild(t);let a=(0,e.jsx)(s.ConsentManagerWidget,{theme:{"widget.root":"custom-padding custom-border"}});await (0,n.default)({component:a,testCases:[{testId:"consent-manager-widget-root",styles:"custom-padding custom-border"}]});let r=document.querySelector('[data-testid="consent-manager-widget-root"]');if(!r)throw Error("Required elements not found in the document");(0,o.expect)(getComputedStyle(r).padding).toBe("32px"),(0,o.expect)(getComputedStyle(r).border).toBe("2px solid rgb(0, 0, 255)"),document.head.removeChild(t)}),(0,o.test)("All consent manager widget components should have their base classes applied",async()=>{let t=(0,e.jsx)(s.ConsentManagerWidget,{}),r={card:a.default.card||"",header:a.default.header||"",title:a.default.title||"",description:a.default.description||"",content:a.default.content||"",footer:a.default.footer||"",footerGroup:a.default.footerGroup||"",accordionItem:a.default.accordionItem||"",accordionTrigger:a.default.accordionTrigger||"",accordionTriggerInner:a.default.accordionTriggerInner||"",accordionContent:a.default.accordionContent||"",accordionArrow:a.default.accordionArrow||"",switch:a.default.switch||""};for(let[e,s]of(await (0,n.default)({component:t,testCases:[{testId:"consent-manager-widget-footer",styles:r.footer},{testId:"consent-manager-widget-footer-sub-group",styles:r.footerGroup},{testId:"consent-manager-widget-accordion-trigger-marketing",styles:r.accordionTrigger},{testId:"consent-manager-widget-accordion-trigger-inner-marketing",styles:r.accordionTriggerInner},{testId:"consent-manager-widget-accordion-content-marketing",styles:r.accordionContent},{testId:"consent-manager-widget-switch-marketing",styles:r.switch}]}),Object.entries(r)))(0,o.expect)(s,`Base class for ${e} should not be empty`).not.toBe("")});
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- "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__.d=(e,t)=>{for(var a in t)__webpack_require__.o(t,a)&&!__webpack_require__.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__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__,{ConsentManagerWidget:()=>ConsentManagerWidget});let jsx_runtime_namespaceObject=require("react/jsx-runtime"),external_react_namespaceObject=require("react"),use_translations_cjs_namespaceObject=require("../../hooks/use-translations.cjs"),dialog_card_cjs_namespaceObject=require("../consent-manager-dialog/atoms/dialog-card.cjs"),accordion_cjs_namespaceObject=require("./atoms/accordion.cjs"),button_cjs_namespaceObject=require("./atoms/button.cjs"),footer_cjs_namespaceObject=require("./atoms/footer.cjs"),root_cjs_namespaceObject=require("./atoms/root.cjs"),ConsentManagerWidget=({hideBrading:e,...t})=>{let[a,_]=(0,external_react_namespaceObject.useState)([]),{consentManagerWidget:r}=(0,use_translations_cjs_namespaceObject.useTranslations)();return(0,jsx_runtime_namespaceObject.jsxs)(root_cjs_namespaceObject.ConsentManagerWidgetRoot,{...t,children:[(0,jsx_runtime_namespaceObject.jsx)(accordion_cjs_namespaceObject.ConsentManagerWidgetAccordion,{themeKey:"widget.accordion",type:"multiple",value:a,onValueChange:_,children:(0,jsx_runtime_namespaceObject.jsx)(accordion_cjs_namespaceObject.ConsentManagerWidgetAccordionItems,{})}),(0,jsx_runtime_namespaceObject.jsxs)(footer_cjs_namespaceObject.ConsentManagerWidgetFooter,{children:[(0,jsx_runtime_namespaceObject.jsxs)(footer_cjs_namespaceObject.ConsentManagerWidgetFooterSubGroup,{themeKey:"widget.footer.sub-group",children:[(0,jsx_runtime_namespaceObject.jsx)(button_cjs_namespaceObject.ConsentManagerWidgetRejectButton,{themeKey:"widget.footer.reject-button",children:r.rejectAll}),(0,jsx_runtime_namespaceObject.jsx)(button_cjs_namespaceObject.ConsentManagerWidgetAcceptAllButton,{themeKey:"widget.footer.accept-button",children:r.acceptAll})]}),(0,jsx_runtime_namespaceObject.jsx)(button_cjs_namespaceObject.ConsentManagerWidgetSaveButton,{themeKey:"widget.footer.save-button",children:r.save})]}),!e&&(0,jsx_runtime_namespaceObject.jsx)(dialog_card_cjs_namespaceObject.DialogFooter,{themeKey:"widget.branding",children:(0,jsx_runtime_namespaceObject.jsx)(dialog_card_cjs_namespaceObject.BrandingFooter,{})})]})};for(var __webpack_i__ in exports.ConsentManagerWidget=__webpack_exports__.ConsentManagerWidget,__webpack_exports__)-1===["ConsentManagerWidget"].indexOf(__webpack_i__)&&(exports[__webpack_i__]=__webpack_exports__[__webpack_i__]);Object.defineProperty(exports,"__esModule",{value:!0});
2
+ "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__.d=(e,t)=>{for(var a in t)__webpack_require__.o(t,a)&&!__webpack_require__.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__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__,{ConsentManagerWidget:()=>ConsentManagerWidget});let jsx_runtime_namespaceObject=require("react/jsx-runtime"),external_react_namespaceObject=require("react"),use_translations_cjs_namespaceObject=require("../../hooks/use-translations.cjs"),dialog_card_cjs_namespaceObject=require("../consent-manager-dialog/atoms/dialog-card.cjs"),accordion_cjs_namespaceObject=require("./atoms/accordion.cjs"),button_cjs_namespaceObject=require("./atoms/button.cjs"),footer_cjs_namespaceObject=require("./atoms/footer.cjs"),root_cjs_namespaceObject=require("./atoms/root.cjs"),ConsentManagerWidget=({hideBrading:e,...t})=>{let[a,_]=(0,external_react_namespaceObject.useState)([]),{common:c}=(0,use_translations_cjs_namespaceObject.useTranslations)();return(0,jsx_runtime_namespaceObject.jsxs)(root_cjs_namespaceObject.ConsentManagerWidgetRoot,{...t,children:[(0,jsx_runtime_namespaceObject.jsx)(accordion_cjs_namespaceObject.ConsentManagerWidgetAccordion,{themeKey:"widget.accordion",type:"multiple",value:a,onValueChange:_,children:(0,jsx_runtime_namespaceObject.jsx)(accordion_cjs_namespaceObject.ConsentManagerWidgetAccordionItems,{})}),(0,jsx_runtime_namespaceObject.jsxs)(footer_cjs_namespaceObject.ConsentManagerWidgetFooter,{children:[(0,jsx_runtime_namespaceObject.jsxs)(footer_cjs_namespaceObject.ConsentManagerWidgetFooterSubGroup,{themeKey:"widget.footer.sub-group",children:[(0,jsx_runtime_namespaceObject.jsx)(button_cjs_namespaceObject.ConsentManagerWidgetRejectButton,{themeKey:"widget.footer.reject-button",children:c.rejectAll}),(0,jsx_runtime_namespaceObject.jsx)(button_cjs_namespaceObject.ConsentManagerWidgetAcceptAllButton,{themeKey:"widget.footer.accept-button",children:c.acceptAll})]}),(0,jsx_runtime_namespaceObject.jsx)(button_cjs_namespaceObject.ConsentManagerWidgetSaveButton,{themeKey:"widget.footer.save-button",children:c.save})]}),!e&&(0,jsx_runtime_namespaceObject.jsx)(dialog_card_cjs_namespaceObject.DialogFooter,{themeKey:"widget.branding",children:(0,jsx_runtime_namespaceObject.jsx)(dialog_card_cjs_namespaceObject.BrandingFooter,{})})]})};for(var __webpack_i__ in exports.ConsentManagerWidget=__webpack_exports__.ConsentManagerWidget,__webpack_exports__)-1===["ConsentManagerWidget"].indexOf(__webpack_i__)&&(exports[__webpack_i__]=__webpack_exports__[__webpack_i__]);Object.defineProperty(exports,"__esModule",{value:!0});
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- import*as e from"react/jsx-runtime";import*as t from"react";import*as o from"../../hooks/use-translations.js";import*as r from"../consent-manager-dialog/atoms/dialog-card.js";import*as n from"./atoms/accordion.js";import*as a from"./atoms/button.js";import*as s from"./atoms/footer.js";import*as i from"./atoms/root.js";let d=({hideBrading:d,...g})=>{let[m,c]=(0,t.useState)([]),{consentManagerWidget:l}=(0,o.useTranslations)();return(0,e.jsxs)(i.ConsentManagerWidgetRoot,{...g,children:[(0,e.jsx)(n.ConsentManagerWidgetAccordion,{themeKey:"widget.accordion",type:"multiple",value:m,onValueChange:c,children:(0,e.jsx)(n.ConsentManagerWidgetAccordionItems,{})}),(0,e.jsxs)(s.ConsentManagerWidgetFooter,{children:[(0,e.jsxs)(s.ConsentManagerWidgetFooterSubGroup,{themeKey:"widget.footer.sub-group",children:[(0,e.jsx)(a.ConsentManagerWidgetRejectButton,{themeKey:"widget.footer.reject-button",children:l.rejectAll}),(0,e.jsx)(a.ConsentManagerWidgetAcceptAllButton,{themeKey:"widget.footer.accept-button",children:l.acceptAll})]}),(0,e.jsx)(a.ConsentManagerWidgetSaveButton,{themeKey:"widget.footer.save-button",children:l.save})]}),!d&&(0,e.jsx)(r.DialogFooter,{themeKey:"widget.branding",children:(0,e.jsx)(r.BrandingFooter,{})})]})};export{d as ConsentManagerWidget};
2
+ import*as e from"react/jsx-runtime";import*as t from"react";import*as o from"../../hooks/use-translations.js";import*as r from"../consent-manager-dialog/atoms/dialog-card.js";import*as n from"./atoms/accordion.js";import*as a from"./atoms/button.js";import*as s from"./atoms/footer.js";import*as i from"./atoms/root.js";let m=({hideBrading:m,...d})=>{let[g,c]=(0,t.useState)([]),{common:l}=(0,o.useTranslations)();return(0,e.jsxs)(i.ConsentManagerWidgetRoot,{...d,children:[(0,e.jsx)(n.ConsentManagerWidgetAccordion,{themeKey:"widget.accordion",type:"multiple",value:g,onValueChange:c,children:(0,e.jsx)(n.ConsentManagerWidgetAccordionItems,{})}),(0,e.jsxs)(s.ConsentManagerWidgetFooter,{children:[(0,e.jsxs)(s.ConsentManagerWidgetFooterSubGroup,{themeKey:"widget.footer.sub-group",children:[(0,e.jsx)(a.ConsentManagerWidgetRejectButton,{themeKey:"widget.footer.reject-button",children:l.rejectAll}),(0,e.jsx)(a.ConsentManagerWidgetAcceptAllButton,{themeKey:"widget.footer.accept-button",children:l.acceptAll})]}),(0,e.jsx)(a.ConsentManagerWidgetSaveButton,{themeKey:"widget.footer.save-button",children:l.save})]}),!m&&(0,e.jsx)(r.DialogFooter,{themeKey:"widget.branding",children:(0,e.jsx)(r.BrandingFooter,{})})]})};export{m as ConsentManagerWidget};
@@ -1,15 +1,15 @@
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 o in t)__webpack_require__.o(t,o)&&!__webpack_require__.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},__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);let button_module_cjs_namespaceObject=require("../../shared/ui/button/button.module.cjs");var button_module_cjs_default=__webpack_require__.n(button_module_cjs_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);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)("should apply string classNames from theme prop to all banner elements",async()=>{let e=(0,jsx_runtime_namespaceObject.jsx)(external_cookie_banner_cjs_namespaceObject.CookieBanner,{scrollLock:!0,theme:ALL_COMPONENTS.reduce((e,{themeKey:t,styles:o})=>(e[t]=o,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)("should apply className and style objects from theme prop to all banner elements",async()=>{let e={backgroundColor:"#ffffff",padding:"20px",border:"1px solid #000000"},t=ALL_COMPONENTS.map(({testId:t,themeKey:o,styles:n})=>({testId:t,themeKey:o,className:n,style:e})),o=(0,jsx_runtime_namespaceObject.jsx)(external_cookie_banner_cjs_namespaceObject.CookieBanner,{scrollLock:!0,theme:t.reduce((e,{themeKey:t,className:o,style:n})=>(e[t]={className:o,style:n},e),{})});await test_helpers_cjs_default()({component:o,testCases:t.map(({testId:e,className:t,style:o})=>({testId:e,styles:{className:t,style:o}}))})}),(0,external_vitest_namespaceObject.test)("should remove default styles but keep custom classNames when top-level noStyle prop is true",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:o})=>(e[t]=o,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)("should remove default styles but keep custom classNames when theme object provides noStyle: true",async()=>{let e=ALL_COMPONENTS.reduce((e,{themeKey:t,styles:o})=>(e[t]={className:o,noStyle:!0},e),{}),t=(0,jsx_runtime_namespaceObject.jsx)(external_cookie_banner_cjs_namespaceObject.CookieBanner,{scrollLock:!0,theme:e});await test_helpers_cjs_default()({component:t,testCases:ALL_COMPONENTS.map(({testId:e,styles:t})=>({testId:e,styles:{className:t}}))})}),(0,external_vitest_namespaceObject.test)("should correctly apply styles when theme prop uses mixed string and object formats",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)("should handle empty strings and empty style objects in theme prop 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"}}}]})}),(0,external_vitest_namespaceObject.test)("Custom classes override base layer styles",async()=>{let e=document.createElement("style");e.textContent=`
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 o in t)__webpack_require__.o(t,o)&&!__webpack_require__.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var __webpack_exports__={};let jsx_runtime_namespaceObject=require("react/jsx-runtime"),external_c15t_namespaceObject=require("c15t"),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);let button_module_cjs_namespaceObject=require("../../shared/ui/button/button.module.cjs");var button_module_cjs_default=__webpack_require__.n(button_module_cjs_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);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:()=>external_c15t_namespaceObject.defaultTranslationConfig.translations.en}));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)("should apply string classNames from theme prop to all banner elements",async()=>{let e=(0,jsx_runtime_namespaceObject.jsx)(external_cookie_banner_cjs_namespaceObject.CookieBanner,{scrollLock:!0,theme:ALL_COMPONENTS.reduce((e,{themeKey:t,styles:o})=>(e[t]=o,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)("should apply className and style objects from theme prop to all banner elements",async()=>{let e={backgroundColor:"#ffffff",padding:"20px",border:"1px solid #000000"},t=ALL_COMPONENTS.map(({testId:t,themeKey:o,styles:a})=>({testId:t,themeKey:o,className:a,style:e})),o=(0,jsx_runtime_namespaceObject.jsx)(external_cookie_banner_cjs_namespaceObject.CookieBanner,{scrollLock:!0,theme:t.reduce((e,{themeKey:t,className:o,style:a})=>(e[t]={className:o,style:a},e),{})});await test_helpers_cjs_default()({component:o,testCases:t.map(({testId:e,className:t,style:o})=>({testId:e,styles:{className:t,style:o}}))})}),(0,external_vitest_namespaceObject.test)("should remove default styles but keep custom classNames when top-level noStyle prop is true",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:o})=>(e[t]=o,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)("should remove default styles but keep custom classNames when theme object provides noStyle: true",async()=>{let e=ALL_COMPONENTS.reduce((e,{themeKey:t,styles:o})=>(e[t]={className:o,noStyle:!0},e),{}),t=(0,jsx_runtime_namespaceObject.jsx)(external_cookie_banner_cjs_namespaceObject.CookieBanner,{scrollLock:!0,theme:e});await test_helpers_cjs_default()({component:t,testCases:ALL_COMPONENTS.map(({testId:e,styles:t})=>({testId:e,styles:{className:t}}))})}),(0,external_vitest_namespaceObject.test)("should correctly apply styles when theme prop uses mixed string and object formats",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)("should handle empty strings and empty style objects in theme prop 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"}}}]})}),(0,external_vitest_namespaceObject.test)("Custom classes override base layer styles",async()=>{let e=document.createElement("style");e.textContent=`
2
2
  .custom-banner-background {
3
3
  background-color: rgb(255, 0, 0) !important;
4
4
  }
5
5
  .custom-banner-text {
6
6
  color: rgb(0, 255, 0) !important;
7
7
  }
8
- `,document.head.appendChild(e);let t=(0,jsx_runtime_namespaceObject.jsx)(external_cookie_banner_cjs_namespaceObject.CookieBanner,{theme:{"banner.card":"custom-banner-background","banner.header.title":"custom-banner-text"}});await test_helpers_cjs_default()({component:t,testCases:[{testId:"cookie-banner-card",styles:"custom-banner-background"},{testId:"cookie-banner-title",styles:"custom-banner-text"}]});let o=document.querySelector('[data-testid="cookie-banner-card"]'),n=document.querySelector('[data-testid="cookie-banner-title"]');if(!o||!n)throw Error("Required elements not found in the document");(0,external_vitest_namespaceObject.expect)(getComputedStyle(o).backgroundColor).toBe("rgb(255, 0, 0)"),(0,external_vitest_namespaceObject.expect)(getComputedStyle(n).color).toBe("rgb(0, 255, 0)"),document.head.removeChild(e)}),(0,external_vitest_namespaceObject.test)("Base layer styles are applied when no custom classes are provided",async()=>{let e=(0,jsx_runtime_namespaceObject.jsx)(external_cookie_banner_cjs_namespaceObject.CookieBanner,{});await test_helpers_cjs_default()({component:e,testCases:[]});let t=document.querySelector('[data-testid="cookie-banner-card"]'),o=document.querySelector('[data-testid="cookie-banner-title"]');if(!t||!o)throw Error("Required elements not found in the document");(0,external_vitest_namespaceObject.expect)(getComputedStyle(t).backgroundColor).toBe("rgb(255, 255, 255)"),(0,external_vitest_namespaceObject.expect)(getComputedStyle(o).color).toBe("rgb(23, 23, 23)")}),(0,external_vitest_namespaceObject.test)("Multiple custom classes can be applied and override base layer",async()=>{let e=document.createElement("style");e.textContent=`
8
+ `,document.head.appendChild(e);let t=(0,jsx_runtime_namespaceObject.jsx)(external_cookie_banner_cjs_namespaceObject.CookieBanner,{theme:{"banner.card":"custom-banner-background","banner.header.title":"custom-banner-text"}});await test_helpers_cjs_default()({component:t,testCases:[{testId:"cookie-banner-card",styles:"custom-banner-background"},{testId:"cookie-banner-title",styles:"custom-banner-text"}]});let o=document.querySelector('[data-testid="cookie-banner-card"]'),a=document.querySelector('[data-testid="cookie-banner-title"]');if(!o||!a)throw Error("Required elements not found in the document");(0,external_vitest_namespaceObject.expect)(getComputedStyle(o).backgroundColor).toBe("rgb(255, 0, 0)"),(0,external_vitest_namespaceObject.expect)(getComputedStyle(a).color).toBe("rgb(0, 255, 0)"),document.head.removeChild(e)}),(0,external_vitest_namespaceObject.test)("Base layer styles are applied when no custom classes are provided",async()=>{let e=(0,jsx_runtime_namespaceObject.jsx)(external_cookie_banner_cjs_namespaceObject.CookieBanner,{});await test_helpers_cjs_default()({component:e,testCases:[]});let t=document.querySelector('[data-testid="cookie-banner-card"]'),o=document.querySelector('[data-testid="cookie-banner-title"]');if(!t||!o)throw Error("Required elements not found in the document");(0,external_vitest_namespaceObject.expect)(getComputedStyle(t).backgroundColor).toBe("rgb(255, 255, 255)"),(0,external_vitest_namespaceObject.expect)(getComputedStyle(o).color).toBe("rgb(23, 23, 23)")}),(0,external_vitest_namespaceObject.test)("Multiple custom classes can be applied and override base layer",async()=>{let e=document.createElement("style");e.textContent=`
9
9
  .custom-padding {
10
10
  padding: 32px !important;
11
11
  }
12
12
  .custom-border {
13
13
  border: 2px solid rgb(0, 0, 255) !important;
14
14
  }
15
- `,document.head.appendChild(e);let t=(0,jsx_runtime_namespaceObject.jsx)(external_cookie_banner_cjs_namespaceObject.CookieBanner,{theme:{"banner.card":"custom-padding custom-border"}});await test_helpers_cjs_default()({component:t,testCases:[{testId:"cookie-banner-card",styles:"custom-padding custom-border"}]});let o=document.querySelector('[data-testid="cookie-banner-card"]');if(!o)throw Error("Required elements not found in the document");(0,external_vitest_namespaceObject.expect)(getComputedStyle(o).padding).toBe("32px"),(0,external_vitest_namespaceObject.expect)(getComputedStyle(o).border).toBe("2px solid rgb(0, 0, 255)"),document.head.removeChild(e)}),(0,external_vitest_namespaceObject.test)("All cookie banner components should have their base classes applied",async()=>{let e=(0,jsx_runtime_namespaceObject.jsx)(external_cookie_banner_cjs_namespaceObject.CookieBanner,{}),t={root:external_cookie_banner_module_cjs_default().root||"",card:external_cookie_banner_module_cjs_default().card||"",header:external_cookie_banner_module_cjs_default().header||"",title:external_cookie_banner_module_cjs_default().title||"",description:external_cookie_banner_module_cjs_default().description||"",footer:external_cookie_banner_module_cjs_default().footer||"",footerSubGroup:external_cookie_banner_module_cjs_default().footerSubGroup||"",rejectButton:`${button_module_cjs_default().button} ${button_module_cjs_default()["button-small"]} ${button_module_cjs_default()["button-neutral-stroke"]}`,customizeButton:`${button_module_cjs_default().button} ${button_module_cjs_default()["button-small"]} ${button_module_cjs_default()["button-neutral-stroke"]}`,acceptButton:`${button_module_cjs_default().button} ${button_module_cjs_default()["button-small"]} ${button_module_cjs_default()["button-primary-stroke"]}`};for(let[o,n]of(await test_helpers_cjs_default()({component:e,testCases:[{testId:"cookie-banner-root",styles:t.root},{testId:"cookie-banner-card",styles:t.card},{testId:"cookie-banner-header",styles:t.header},{testId:"cookie-banner-title",styles:t.title},{testId:"cookie-banner-description",styles:t.description},{testId:"cookie-banner-footer",styles:t.footer},{testId:"cookie-banner-footer-sub-group",styles:t.footerSubGroup},{testId:"cookie-banner-reject-button",styles:t.rejectButton},{testId:"cookie-banner-customize-button",styles:t.customizeButton},{testId:"cookie-banner-accept-button",styles:t.acceptButton}]}),Object.entries(t)))(0,external_vitest_namespaceObject.expect)(n,`Base class for ${o} should not be empty`).not.toBe("")}),__webpack_exports__)exports[__webpack_i__]=__webpack_exports__[__webpack_i__];Object.defineProperty(exports,"__esModule",{value:!0});
15
+ `,document.head.appendChild(e);let t=(0,jsx_runtime_namespaceObject.jsx)(external_cookie_banner_cjs_namespaceObject.CookieBanner,{theme:{"banner.card":"custom-padding custom-border"}});await test_helpers_cjs_default()({component:t,testCases:[{testId:"cookie-banner-card",styles:"custom-padding custom-border"}]});let o=document.querySelector('[data-testid="cookie-banner-card"]');if(!o)throw Error("Required elements not found in the document");(0,external_vitest_namespaceObject.expect)(getComputedStyle(o).padding).toBe("32px"),(0,external_vitest_namespaceObject.expect)(getComputedStyle(o).border).toBe("2px solid rgb(0, 0, 255)"),document.head.removeChild(e)}),(0,external_vitest_namespaceObject.test)("All cookie banner components should have their base classes applied",async()=>{let e=(0,jsx_runtime_namespaceObject.jsx)(external_cookie_banner_cjs_namespaceObject.CookieBanner,{}),t={root:external_cookie_banner_module_cjs_default().root||"",card:external_cookie_banner_module_cjs_default().card||"",header:external_cookie_banner_module_cjs_default().header||"",title:external_cookie_banner_module_cjs_default().title||"",description:external_cookie_banner_module_cjs_default().description||"",footer:external_cookie_banner_module_cjs_default().footer||"",footerSubGroup:external_cookie_banner_module_cjs_default().footerSubGroup||"",rejectButton:`${button_module_cjs_default().button} ${button_module_cjs_default()["button-small"]} ${button_module_cjs_default()["button-neutral-stroke"]}`,customizeButton:`${button_module_cjs_default().button} ${button_module_cjs_default()["button-small"]} ${button_module_cjs_default()["button-neutral-stroke"]}`,acceptButton:`${button_module_cjs_default().button} ${button_module_cjs_default()["button-small"]} ${button_module_cjs_default()["button-primary-stroke"]}`};for(let[o,a]of(await test_helpers_cjs_default()({component:e,testCases:[{testId:"cookie-banner-root",styles:t.root},{testId:"cookie-banner-card",styles:t.card},{testId:"cookie-banner-header",styles:t.header},{testId:"cookie-banner-title",styles:t.title},{testId:"cookie-banner-description",styles:t.description},{testId:"cookie-banner-footer",styles:t.footer},{testId:"cookie-banner-footer-sub-group",styles:t.footerSubGroup},{testId:"cookie-banner-reject-button",styles:t.rejectButton},{testId:"cookie-banner-customize-button",styles:t.customizeButton},{testId:"cookie-banner-accept-button",styles:t.acceptButton}]}),Object.entries(t)))(0,external_vitest_namespaceObject.expect)(a,`Base class for ${o} should not be empty`).not.toBe("")}),__webpack_exports__)exports[__webpack_i__]=__webpack_exports__[__webpack_i__];Object.defineProperty(exports,"__esModule",{value:!0});
@@ -1,15 +1,15 @@
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";import*as n from"../../shared/ui/button/button.module.js";import*as r from"../cookie-banner.module.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 a=[{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)("should apply string classNames from theme prop to all banner elements",async()=>{let t=(0,e.jsx)(o.CookieBanner,{scrollLock:!0,theme:a.reduce((e,{themeKey:t,styles:o})=>(e[t]=o,e),{})});await (0,s.default)({component:t,testCases:a.map(({testId:e,styles:t})=>({testId:e,styles:t}))})}),(0,t.test)("should apply className and style objects from theme prop to all banner elements",async()=>{let t={backgroundColor:"#ffffff",padding:"20px",border:"1px solid #000000"},n=a.map(({testId:e,themeKey:o,styles:s})=>({testId:e,themeKey:o,className:s,style:t})),r=(0,e.jsx)(o.CookieBanner,{scrollLock:!0,theme:n.reduce((e,{themeKey:t,className:o,style:s})=>(e[t]={className:o,style:s},e),{})});await (0,s.default)({component:r,testCases:n.map(({testId:e,className:t,style:o})=>({testId:e,styles:{className:t,style:o}}))})}),(0,t.test)("should remove default styles but keep custom classNames when top-level noStyle prop is true",async()=>{let t=(0,e.jsx)(o.CookieBanner,{scrollLock:!0,noStyle:!0,theme:a.reduce((e,{themeKey:t,styles:o})=>(e[t]=o,e),{})});await (0,s.default)({component:t,testCases:a.map(({testId:e,styles:t})=>({testId:e,styles:t})),noStyle:!0})}),(0,t.test)("should remove default styles but keep custom classNames when theme object provides noStyle: true",async()=>{let t=a.reduce((e,{themeKey:t,styles:o})=>(e[t]={className:o,noStyle:!0},e),{}),n=(0,e.jsx)(o.CookieBanner,{scrollLock:!0,theme:t});await (0,s.default)({component:n,testCases:a.map(({testId:e,styles:t})=>({testId:e,styles:{className:t}}))})}),(0,t.test)("should correctly apply styles when theme prop uses mixed string and object formats",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)("should handle empty strings and empty style objects in theme prop 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"}}}]})}),(0,t.test)("Custom classes override base layer styles",async()=>{let n=document.createElement("style");n.textContent=`
1
+ import*as e from"react/jsx-runtime";import*as t from"c15t";import*as o from"vitest";import*as s from"../cookie-banner.js";import*as n from"../../../utils/test-helpers.js";import*as a from"../../shared/ui/button/button.module.js";import*as r from"../cookie-banner.module.js";o.vi.mock("~/hooks/use-consent-manager",()=>({useConsentManager:()=>({showPopup:!0,...o.vi.fn()})})),o.vi.mock("~/hooks/use-translations",()=>({useTranslations:()=>t.defaultTranslationConfig.translations.en}));let l=[{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,o.test)("should apply string classNames from theme prop to all banner elements",async()=>{let t=(0,e.jsx)(s.CookieBanner,{scrollLock:!0,theme:l.reduce((e,{themeKey:t,styles:o})=>(e[t]=o,e),{})});await (0,n.default)({component:t,testCases:l.map(({testId:e,styles:t})=>({testId:e,styles:t}))})}),(0,o.test)("should apply className and style objects from theme prop to all banner elements",async()=>{let t={backgroundColor:"#ffffff",padding:"20px",border:"1px solid #000000"},o=l.map(({testId:e,themeKey:o,styles:s})=>({testId:e,themeKey:o,className:s,style:t})),a=(0,e.jsx)(s.CookieBanner,{scrollLock:!0,theme:o.reduce((e,{themeKey:t,className:o,style:s})=>(e[t]={className:o,style:s},e),{})});await (0,n.default)({component:a,testCases:o.map(({testId:e,className:t,style:o})=>({testId:e,styles:{className:t,style:o}}))})}),(0,o.test)("should remove default styles but keep custom classNames when top-level noStyle prop is true",async()=>{let t=(0,e.jsx)(s.CookieBanner,{scrollLock:!0,noStyle:!0,theme:l.reduce((e,{themeKey:t,styles:o})=>(e[t]=o,e),{})});await (0,n.default)({component:t,testCases:l.map(({testId:e,styles:t})=>({testId:e,styles:t})),noStyle:!0})}),(0,o.test)("should remove default styles but keep custom classNames when theme object provides noStyle: true",async()=>{let t=l.reduce((e,{themeKey:t,styles:o})=>(e[t]={className:o,noStyle:!0},e),{}),o=(0,e.jsx)(s.CookieBanner,{scrollLock:!0,theme:t});await (0,n.default)({component:o,testCases:l.map(({testId:e,styles:t})=>({testId:e,styles:{className:t}}))})}),(0,o.test)("should correctly apply styles when theme prop uses mixed string and object formats",async()=>{let t=(0,e.jsx)(s.CookieBanner,{scrollLock:!0,theme:{"banner.root":{className:"custom-root",style:{backgroundColor:"rgb(255, 255, 255)",padding:"16px"}},"banner.header.title":"custom-title"}});await (0,n.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,o.test)("should handle empty strings and empty style objects in theme prop gracefully",async()=>{let t=(0,e.jsx)(s.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,n.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"}}}]})}),(0,o.test)("Custom classes override base layer styles",async()=>{let t=document.createElement("style");t.textContent=`
2
2
  .custom-banner-background {
3
3
  background-color: rgb(255, 0, 0) !important;
4
4
  }
5
5
  .custom-banner-text {
6
6
  color: rgb(0, 255, 0) !important;
7
7
  }
8
- `,document.head.appendChild(n);let r=(0,e.jsx)(o.CookieBanner,{theme:{"banner.card":"custom-banner-background","banner.header.title":"custom-banner-text"}});await (0,s.default)({component:r,testCases:[{testId:"cookie-banner-card",styles:"custom-banner-background"},{testId:"cookie-banner-title",styles:"custom-banner-text"}]});let a=document.querySelector('[data-testid="cookie-banner-card"]'),c=document.querySelector('[data-testid="cookie-banner-title"]');if(!a||!c)throw Error("Required elements not found in the document");(0,t.expect)(getComputedStyle(a).backgroundColor).toBe("rgb(255, 0, 0)"),(0,t.expect)(getComputedStyle(c).color).toBe("rgb(0, 255, 0)"),document.head.removeChild(n)}),(0,t.test)("Base layer styles are applied when no custom classes are provided",async()=>{let n=(0,e.jsx)(o.CookieBanner,{});await (0,s.default)({component:n,testCases:[]});let r=document.querySelector('[data-testid="cookie-banner-card"]'),a=document.querySelector('[data-testid="cookie-banner-title"]');if(!r||!a)throw Error("Required elements not found in the document");(0,t.expect)(getComputedStyle(r).backgroundColor).toBe("rgb(255, 255, 255)"),(0,t.expect)(getComputedStyle(a).color).toBe("rgb(23, 23, 23)")}),(0,t.test)("Multiple custom classes can be applied and override base layer",async()=>{let n=document.createElement("style");n.textContent=`
8
+ `,document.head.appendChild(t);let a=(0,e.jsx)(s.CookieBanner,{theme:{"banner.card":"custom-banner-background","banner.header.title":"custom-banner-text"}});await (0,n.default)({component:a,testCases:[{testId:"cookie-banner-card",styles:"custom-banner-background"},{testId:"cookie-banner-title",styles:"custom-banner-text"}]});let r=document.querySelector('[data-testid="cookie-banner-card"]'),l=document.querySelector('[data-testid="cookie-banner-title"]');if(!r||!l)throw Error("Required elements not found in the document");(0,o.expect)(getComputedStyle(r).backgroundColor).toBe("rgb(255, 0, 0)"),(0,o.expect)(getComputedStyle(l).color).toBe("rgb(0, 255, 0)"),document.head.removeChild(t)}),(0,o.test)("Base layer styles are applied when no custom classes are provided",async()=>{let t=(0,e.jsx)(s.CookieBanner,{});await (0,n.default)({component:t,testCases:[]});let a=document.querySelector('[data-testid="cookie-banner-card"]'),r=document.querySelector('[data-testid="cookie-banner-title"]');if(!a||!r)throw Error("Required elements not found in the document");(0,o.expect)(getComputedStyle(a).backgroundColor).toBe("rgb(255, 255, 255)"),(0,o.expect)(getComputedStyle(r).color).toBe("rgb(23, 23, 23)")}),(0,o.test)("Multiple custom classes can be applied and override base layer",async()=>{let t=document.createElement("style");t.textContent=`
9
9
  .custom-padding {
10
10
  padding: 32px !important;
11
11
  }
12
12
  .custom-border {
13
13
  border: 2px solid rgb(0, 0, 255) !important;
14
14
  }
15
- `,document.head.appendChild(n);let r=(0,e.jsx)(o.CookieBanner,{theme:{"banner.card":"custom-padding custom-border"}});await (0,s.default)({component:r,testCases:[{testId:"cookie-banner-card",styles:"custom-padding custom-border"}]});let a=document.querySelector('[data-testid="cookie-banner-card"]');if(!a)throw Error("Required elements not found in the document");(0,t.expect)(getComputedStyle(a).padding).toBe("32px"),(0,t.expect)(getComputedStyle(a).border).toBe("2px solid rgb(0, 0, 255)"),document.head.removeChild(n)}),(0,t.test)("All cookie banner components should have their base classes applied",async()=>{let a=(0,e.jsx)(o.CookieBanner,{}),c={root:r.default.root||"",card:r.default.card||"",header:r.default.header||"",title:r.default.title||"",description:r.default.description||"",footer:r.default.footer||"",footerSubGroup:r.default.footerSubGroup||"",rejectButton:`${n.default.button} ${n.default["button-small"]} ${n.default["button-neutral-stroke"]}`,customizeButton:`${n.default.button} ${n.default["button-small"]} ${n.default["button-neutral-stroke"]}`,acceptButton:`${n.default.button} ${n.default["button-small"]} ${n.default["button-primary-stroke"]}`};for(let[e,o]of(await (0,s.default)({component:a,testCases:[{testId:"cookie-banner-root",styles:c.root},{testId:"cookie-banner-card",styles:c.card},{testId:"cookie-banner-header",styles:c.header},{testId:"cookie-banner-title",styles:c.title},{testId:"cookie-banner-description",styles:c.description},{testId:"cookie-banner-footer",styles:c.footer},{testId:"cookie-banner-footer-sub-group",styles:c.footerSubGroup},{testId:"cookie-banner-reject-button",styles:c.rejectButton},{testId:"cookie-banner-customize-button",styles:c.customizeButton},{testId:"cookie-banner-accept-button",styles:c.acceptButton}]}),Object.entries(c)))(0,t.expect)(o,`Base class for ${e} should not be empty`).not.toBe("")});
15
+ `,document.head.appendChild(t);let a=(0,e.jsx)(s.CookieBanner,{theme:{"banner.card":"custom-padding custom-border"}});await (0,n.default)({component:a,testCases:[{testId:"cookie-banner-card",styles:"custom-padding custom-border"}]});let r=document.querySelector('[data-testid="cookie-banner-card"]');if(!r)throw Error("Required elements not found in the document");(0,o.expect)(getComputedStyle(r).padding).toBe("32px"),(0,o.expect)(getComputedStyle(r).border).toBe("2px solid rgb(0, 0, 255)"),document.head.removeChild(t)}),(0,o.test)("All cookie banner components should have their base classes applied",async()=>{let t=(0,e.jsx)(s.CookieBanner,{}),l={root:r.default.root||"",card:r.default.card||"",header:r.default.header||"",title:r.default.title||"",description:r.default.description||"",footer:r.default.footer||"",footerSubGroup:r.default.footerSubGroup||"",rejectButton:`${a.default.button} ${a.default["button-small"]} ${a.default["button-neutral-stroke"]}`,customizeButton:`${a.default.button} ${a.default["button-small"]} ${a.default["button-neutral-stroke"]}`,acceptButton:`${a.default.button} ${a.default["button-small"]} ${a.default["button-primary-stroke"]}`};for(let[e,s]of(await (0,n.default)({component:t,testCases:[{testId:"cookie-banner-root",styles:l.root},{testId:"cookie-banner-card",styles:l.card},{testId:"cookie-banner-header",styles:l.header},{testId:"cookie-banner-title",styles:l.title},{testId:"cookie-banner-description",styles:l.description},{testId:"cookie-banner-footer",styles:l.footer},{testId:"cookie-banner-footer-sub-group",styles:l.footerSubGroup},{testId:"cookie-banner-reject-button",styles:l.rejectButton},{testId:"cookie-banner-customize-button",styles:l.customizeButton},{testId:"cookie-banner-accept-button",styles:l.acceptButton}]}),Object.entries(l)))(0,o.expect)(s,`Base class for ${e} should not be empty`).not.toBe("")});
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- "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__.d=(e,n)=>{for(var t in n)__webpack_require__.o(n,t)&&!__webpack_require__.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:n[t]})},__webpack_require__.o=(e,n)=>Object.prototype.hasOwnProperty.call(e,n),__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__,{CookieBanner:()=>CookieBanner});let jsx_runtime_namespaceObject=require("react/jsx-runtime"),external_error_boundary_cjs_namespaceObject=require("./error-boundary.cjs"),button_cjs_namespaceObject=require("../shared/primitives/button.cjs"),root_cjs_namespaceObject=require("./atoms/root.cjs"),external_components_cjs_namespaceObject=require("./components.cjs"),use_translations_cjs_namespaceObject=require("../../hooks/use-translations.cjs"),CookieBanner=({theme:e,noStyle:n,title:t,description:r,rejectButtonText:_,customizeButtonText:c,acceptButtonText:o,scrollLock:a,trapFocus:s=!0})=>{let{cookieBanner:i}=(0,use_translations_cjs_namespaceObject.useTranslations)();return(0,jsx_runtime_namespaceObject.jsx)(external_error_boundary_cjs_namespaceObject.ErrorBoundary,{fallback:(0,jsx_runtime_namespaceObject.jsx)("div",{children:"Something went wrong with the Cookie Banner."}),children:(0,jsx_runtime_namespaceObject.jsx)(root_cjs_namespaceObject.CookieBannerRoot,{theme:e,noStyle:n,scrollLock:a,trapFocus:s,children:(0,jsx_runtime_namespaceObject.jsxs)(external_components_cjs_namespaceObject.CookieBannerCard,{children:[(0,jsx_runtime_namespaceObject.jsxs)(external_components_cjs_namespaceObject.CookieBannerHeader,{children:[(0,jsx_runtime_namespaceObject.jsx)(external_components_cjs_namespaceObject.CookieBannerTitle,{children:t||i.title}),(0,jsx_runtime_namespaceObject.jsx)(external_components_cjs_namespaceObject.CookieBannerDescription,{children:r||i.description})]}),(0,jsx_runtime_namespaceObject.jsxs)(external_components_cjs_namespaceObject.CookieBannerFooter,{children:[(0,jsx_runtime_namespaceObject.jsxs)(external_components_cjs_namespaceObject.CookieBannerFooterSubGroup,{children:[(0,jsx_runtime_namespaceObject.jsx)(button_cjs_namespaceObject.ConsentButton,{action:"reject-consent",closeCookieBanner:!0,themeKey:"banner.footer.reject-button","data-testid":"cookie-banner-reject-button",children:_||i.rejectAll}),(0,jsx_runtime_namespaceObject.jsx)(button_cjs_namespaceObject.ConsentButton,{action:"open-consent-dialog",closeCookieBanner:!0,themeKey:"banner.footer.customize-button","data-testid":"cookie-banner-customize-button",children:c||i.customize})]}),(0,jsx_runtime_namespaceObject.jsx)(button_cjs_namespaceObject.ConsentButton,{action:"accept-consent",variant:"primary",closeCookieBanner:!0,themeKey:"banner.footer.accept-button","data-testid":"cookie-banner-accept-button",children:o||i.acceptAll})]})]})})})};for(var __webpack_i__ in exports.CookieBanner=__webpack_exports__.CookieBanner,__webpack_exports__)-1===["CookieBanner"].indexOf(__webpack_i__)&&(exports[__webpack_i__]=__webpack_exports__[__webpack_i__]);Object.defineProperty(exports,"__esModule",{value:!0});
2
+ "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__.d=(e,n)=>{for(var t in n)__webpack_require__.o(n,t)&&!__webpack_require__.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:n[t]})},__webpack_require__.o=(e,n)=>Object.prototype.hasOwnProperty.call(e,n),__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__,{CookieBanner:()=>CookieBanner});let jsx_runtime_namespaceObject=require("react/jsx-runtime"),external_error_boundary_cjs_namespaceObject=require("./error-boundary.cjs"),button_cjs_namespaceObject=require("../shared/primitives/button.cjs"),root_cjs_namespaceObject=require("./atoms/root.cjs"),external_components_cjs_namespaceObject=require("./components.cjs"),use_translations_cjs_namespaceObject=require("../../hooks/use-translations.cjs"),CookieBanner=({theme:e,noStyle:n,title:t,description:r,rejectButtonText:_,customizeButtonText:c,acceptButtonText:o,scrollLock:a,trapFocus:s=!0})=>{let{cookieBanner:i,common:p}=(0,use_translations_cjs_namespaceObject.useTranslations)();return(0,jsx_runtime_namespaceObject.jsx)(external_error_boundary_cjs_namespaceObject.ErrorBoundary,{fallback:(0,jsx_runtime_namespaceObject.jsx)("div",{children:"Something went wrong with the Cookie Banner."}),children:(0,jsx_runtime_namespaceObject.jsx)(root_cjs_namespaceObject.CookieBannerRoot,{theme:e,noStyle:n,scrollLock:a,trapFocus:s,children:(0,jsx_runtime_namespaceObject.jsxs)(external_components_cjs_namespaceObject.CookieBannerCard,{children:[(0,jsx_runtime_namespaceObject.jsxs)(external_components_cjs_namespaceObject.CookieBannerHeader,{children:[(0,jsx_runtime_namespaceObject.jsx)(external_components_cjs_namespaceObject.CookieBannerTitle,{children:t||i.title}),(0,jsx_runtime_namespaceObject.jsx)(external_components_cjs_namespaceObject.CookieBannerDescription,{children:r||i.description})]}),(0,jsx_runtime_namespaceObject.jsxs)(external_components_cjs_namespaceObject.CookieBannerFooter,{children:[(0,jsx_runtime_namespaceObject.jsxs)(external_components_cjs_namespaceObject.CookieBannerFooterSubGroup,{children:[(0,jsx_runtime_namespaceObject.jsx)(button_cjs_namespaceObject.ConsentButton,{action:"reject-consent",closeCookieBanner:!0,themeKey:"banner.footer.reject-button","data-testid":"cookie-banner-reject-button",children:_||p.rejectAll}),(0,jsx_runtime_namespaceObject.jsx)(button_cjs_namespaceObject.ConsentButton,{action:"open-consent-dialog",closeCookieBanner:!0,themeKey:"banner.footer.customize-button","data-testid":"cookie-banner-customize-button",children:c||p.customize})]}),(0,jsx_runtime_namespaceObject.jsx)(button_cjs_namespaceObject.ConsentButton,{action:"accept-consent",variant:"primary",closeCookieBanner:!0,themeKey:"banner.footer.accept-button","data-testid":"cookie-banner-accept-button",children:o||p.acceptAll})]})]})})})};for(var __webpack_i__ in exports.CookieBanner=__webpack_exports__.CookieBanner,__webpack_exports__)-1===["CookieBanner"].indexOf(__webpack_i__)&&(exports[__webpack_i__]=__webpack_exports__[__webpack_i__]);Object.defineProperty(exports,"__esModule",{value:!0});
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- import*as e from"react/jsx-runtime";import*as o from"./error-boundary.js";import*as n from"../shared/primitives/button.js";import*as t from"./atoms/root.js";import*as r from"./components.js";import*as i from"../../hooks/use-translations.js";let s=({theme:s,noStyle:a,title:c,description:l,rejectButtonText:d,customizeButtonText:m,acceptButtonText:j,scrollLock:u,trapFocus:h=!0})=>{let{cookieBanner:p}=(0,i.useTranslations)();return(0,e.jsx)(o.ErrorBoundary,{fallback:(0,e.jsx)("div",{children:"Something went wrong with the Cookie Banner."}),children:(0,e.jsx)(t.CookieBannerRoot,{theme:s,noStyle:a,scrollLock:u,trapFocus:h,children:(0,e.jsxs)(r.CookieBannerCard,{children:[(0,e.jsxs)(r.CookieBannerHeader,{children:[(0,e.jsx)(r.CookieBannerTitle,{children:c||p.title}),(0,e.jsx)(r.CookieBannerDescription,{children:l||p.description})]}),(0,e.jsxs)(r.CookieBannerFooter,{children:[(0,e.jsxs)(r.CookieBannerFooterSubGroup,{children:[(0,e.jsx)(n.ConsentButton,{action:"reject-consent",closeCookieBanner:!0,themeKey:"banner.footer.reject-button","data-testid":"cookie-banner-reject-button",children:d||p.rejectAll}),(0,e.jsx)(n.ConsentButton,{action:"open-consent-dialog",closeCookieBanner:!0,themeKey:"banner.footer.customize-button","data-testid":"cookie-banner-customize-button",children:m||p.customize})]}),(0,e.jsx)(n.ConsentButton,{action:"accept-consent",variant:"primary",closeCookieBanner:!0,themeKey:"banner.footer.accept-button","data-testid":"cookie-banner-accept-button",children:j||p.acceptAll})]})]})})})};export{s as CookieBanner};
2
+ import*as e from"react/jsx-runtime";import*as o from"./error-boundary.js";import*as n from"../shared/primitives/button.js";import*as t from"./atoms/root.js";import*as r from"./components.js";import*as i from"../../hooks/use-translations.js";let s=({theme:s,noStyle:a,title:c,description:l,rejectButtonText:d,customizeButtonText:m,acceptButtonText:j,scrollLock:u,trapFocus:h=!0})=>{let{cookieBanner:p,common:k}=(0,i.useTranslations)();return(0,e.jsx)(o.ErrorBoundary,{fallback:(0,e.jsx)("div",{children:"Something went wrong with the Cookie Banner."}),children:(0,e.jsx)(t.CookieBannerRoot,{theme:s,noStyle:a,scrollLock:u,trapFocus:h,children:(0,e.jsxs)(r.CookieBannerCard,{children:[(0,e.jsxs)(r.CookieBannerHeader,{children:[(0,e.jsx)(r.CookieBannerTitle,{children:c||p.title}),(0,e.jsx)(r.CookieBannerDescription,{children:l||p.description})]}),(0,e.jsxs)(r.CookieBannerFooter,{children:[(0,e.jsxs)(r.CookieBannerFooterSubGroup,{children:[(0,e.jsx)(n.ConsentButton,{action:"reject-consent",closeCookieBanner:!0,themeKey:"banner.footer.reject-button","data-testid":"cookie-banner-reject-button",children:d||k.rejectAll}),(0,e.jsx)(n.ConsentButton,{action:"open-consent-dialog",closeCookieBanner:!0,themeKey:"banner.footer.customize-button","data-testid":"cookie-banner-customize-button",children:m||k.customize})]}),(0,e.jsx)(n.ConsentButton,{action:"accept-consent",variant:"primary",closeCookieBanner:!0,themeKey:"banner.footer.accept-button","data-testid":"cookie-banner-accept-button",children:j||k.acceptAll})]})]})})})};export{s as CookieBanner};
@@ -1 +1 @@
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_exports__={};let jsx_runtime_namespaceObject=require("react/jsx-runtime"),external_vitest_namespaceObject=require("vitest"),external_vitest_browser_react_namespaceObject=require("vitest-browser-react"),consent_manager_provider_cjs_namespaceObject=require("../../providers/consent-manager-provider.cjs"),external_use_translations_cjs_namespaceObject=require("../use-translations.cjs");for(var __webpack_i__ in(0,external_vitest_namespaceObject.describe)("useTranslations",()=>{(0,external_vitest_namespaceObject.test)("returns English translations by default",()=>{let{result:e}=(0,external_vitest_browser_react_namespaceObject.renderHook)(()=>(0,external_use_translations_cjs_namespaceObject.useTranslations)(),{wrapper:({children:e})=>(0,jsx_runtime_namespaceObject.jsx)(consent_manager_provider_cjs_namespaceObject.ConsentManagerProvider,{options:{mode:"offline",react:{noStyle:!1}},children:e})});(0,external_vitest_namespaceObject.expect)(e.current.cookieBanner.title).toBe("We value your privacy"),(0,external_vitest_namespaceObject.expect)(e.current.cookieBanner.description).toBe("This site uses cookies to improve your browsing experience, analyze site traffic, and show personalized content."),(0,external_vitest_namespaceObject.expect)(e.current.consentManagerDialog.title).toBe("Privacy Settings"),(0,external_vitest_namespaceObject.expect)(e.current.consentManagerWidget.title).toBe("Privacy Preferences"),(0,external_vitest_namespaceObject.expect)(e.current.consentTypes?.necessary?.title).toBe("Strictly Necessary")}),(0,external_vitest_namespaceObject.test)("returns German translations instead of English when German is selected",()=>{let{result:e}=(0,external_vitest_browser_react_namespaceObject.renderHook)(()=>(0,external_use_translations_cjs_namespaceObject.useTranslations)(),{wrapper:({children:e})=>(0,jsx_runtime_namespaceObject.jsx)(consent_manager_provider_cjs_namespaceObject.ConsentManagerProvider,{options:{mode:"offline",react:{noStyle:!1},translations:{defaultLanguage:"de",disableAutoLanguageSwitch:!0,translations:{de:{cookieBanner:{title:"German Title",description:"German Description"},consentManagerDialog:{title:"German Dialog Title"},consentManagerWidget:{title:"German Widget Title"},consentTypes:{necessary:{title:"German Necessary",description:"German Necessary Description"}}}}}},children:e})});(0,external_vitest_namespaceObject.expect)(e.current.cookieBanner.title).toBe("German Title"),(0,external_vitest_namespaceObject.expect)(e.current.cookieBanner.description).toBe("German Description"),(0,external_vitest_namespaceObject.expect)(e.current.consentManagerDialog.title).toBe("German Dialog Title"),(0,external_vitest_namespaceObject.expect)(e.current.consentManagerWidget.title).toBe("German Widget Title"),(0,external_vitest_namespaceObject.expect)(e.current.consentTypes?.necessary?.title).toBe("German Necessary")}),(0,external_vitest_namespaceObject.test)("merges custom translations with defaults",()=>{let e={translations:{en:{cookieBanner:{title:"Custom Cookie Settings",description:"Custom Description"}}}},{result:t}=(0,external_vitest_browser_react_namespaceObject.renderHook)(()=>(0,external_use_translations_cjs_namespaceObject.useTranslations)(),{wrapper:({children:t})=>(0,jsx_runtime_namespaceObject.jsx)(consent_manager_provider_cjs_namespaceObject.ConsentManagerProvider,{options:{mode:"offline",react:{noStyle:!1},translations:e},children:t})});(0,external_vitest_namespaceObject.expect)(t.current.cookieBanner.title).toBe("Custom Cookie Settings"),(0,external_vitest_namespaceObject.expect)(t.current.cookieBanner.description).toBe("Custom Description"),(0,external_vitest_namespaceObject.expect)(t.current.consentManagerDialog.title).toBe("Privacy Settings"),(0,external_vitest_namespaceObject.expect)(t.current.consentManagerWidget.title).toBe("Privacy Preferences")}),(0,external_vitest_namespaceObject.test)("falls back to English when selected language is not available",()=>{let{result:e}=(0,external_vitest_browser_react_namespaceObject.renderHook)(()=>(0,external_use_translations_cjs_namespaceObject.useTranslations)(),{wrapper:({children:e})=>(0,jsx_runtime_namespaceObject.jsx)(consent_manager_provider_cjs_namespaceObject.ConsentManagerProvider,{options:{mode:"offline",react:{noStyle:!1},translations:{defaultLanguage:"fr"}},children:e})});(0,external_vitest_namespaceObject.expect)(e.current.cookieBanner.title).toBe("We value your privacy"),(0,external_vitest_namespaceObject.expect)(e.current.cookieBanner.description).toBe("This site uses cookies to improve your browsing experience, analyze site traffic, and show personalized content."),(0,external_vitest_namespaceObject.expect)(e.current.consentManagerDialog.title).toBe("Privacy Settings"),(0,external_vitest_namespaceObject.expect)(e.current.consentManagerWidget.title).toBe("Privacy Preferences")}),(0,external_vitest_namespaceObject.test)("Custom English instead of English when German is selected",()=>{let{result:e}=(0,external_vitest_browser_react_namespaceObject.renderHook)(()=>(0,external_use_translations_cjs_namespaceObject.useTranslations)(),{wrapper:({children:e})=>(0,jsx_runtime_namespaceObject.jsx)(consent_manager_provider_cjs_namespaceObject.ConsentManagerProvider,{options:{mode:"offline",react:{noStyle:!1},translations:{defaultLanguage:"en",disableAutoLanguageSwitch:!0,translations:{en:{cookieBanner:{title:"Custom English Title",description:"Custom English Description"},consentManagerDialog:{title:"Custom English Dialog Title"},consentManagerWidget:{title:"Custom English Widget Title"},consentTypes:{necessary:{title:"Custom English Necessary",description:"Custom English Necessary Description"}}}}}},children:e})});(0,external_vitest_namespaceObject.expect)(e.current.cookieBanner.title).toBe("Custom English Title"),(0,external_vitest_namespaceObject.expect)(e.current.cookieBanner.description).toBe("Custom English Description"),(0,external_vitest_namespaceObject.expect)(e.current.consentManagerDialog.title).toBe("Custom English Dialog Title"),(0,external_vitest_namespaceObject.expect)(e.current.consentManagerWidget.title).toBe("Custom English Widget Title"),(0,external_vitest_namespaceObject.expect)(e.current.consentTypes?.necessary?.title).toBe("Custom English Necessary")})}),__webpack_exports__)exports[__webpack_i__]=__webpack_exports__[__webpack_i__];Object.defineProperty(exports,"__esModule",{value:!0});
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_exports__={};let jsx_runtime_namespaceObject=require("react/jsx-runtime"),external_vitest_namespaceObject=require("vitest"),external_vitest_browser_react_namespaceObject=require("vitest-browser-react"),consent_manager_provider_cjs_namespaceObject=require("../../providers/consent-manager-provider.cjs"),external_use_translations_cjs_namespaceObject=require("../use-translations.cjs");for(var __webpack_i__ in(0,external_vitest_namespaceObject.describe)("useTranslations",()=>{(0,external_vitest_namespaceObject.test)("returns English translations by default",()=>{let{result:e}=(0,external_vitest_browser_react_namespaceObject.renderHook)(()=>(0,external_use_translations_cjs_namespaceObject.useTranslations)(),{wrapper:({children:e})=>(0,jsx_runtime_namespaceObject.jsx)(consent_manager_provider_cjs_namespaceObject.ConsentManagerProvider,{options:{mode:"offline",react:{noStyle:!1}},children:e})});(0,external_vitest_namespaceObject.expect)(e.current.cookieBanner.title).toBe("We value your privacy"),(0,external_vitest_namespaceObject.expect)(e.current.cookieBanner.description).toBe("This site uses cookies to improve your browsing experience, analyze site traffic, and show personalized content."),(0,external_vitest_namespaceObject.expect)(e.current.consentManagerDialog.title).toBe("Privacy Settings"),(0,external_vitest_namespaceObject.expect)(e.current.common.acceptAll).toBe("Accept All"),(0,external_vitest_namespaceObject.expect)(e.current.common.rejectAll).toBe("Reject All"),(0,external_vitest_namespaceObject.expect)(e.current.common.customize).toBe("Customize"),(0,external_vitest_namespaceObject.expect)(e.current.common.save).toBe("Save Settings"),(0,external_vitest_namespaceObject.expect)(e.current.consentTypes?.necessary?.title).toBe("Strictly Necessary")}),(0,external_vitest_namespaceObject.test)("returns German translations instead of English when German is selected",()=>{let{result:e}=(0,external_vitest_browser_react_namespaceObject.renderHook)(()=>(0,external_use_translations_cjs_namespaceObject.useTranslations)(),{wrapper:({children:e})=>(0,jsx_runtime_namespaceObject.jsx)(consent_manager_provider_cjs_namespaceObject.ConsentManagerProvider,{options:{mode:"offline",react:{noStyle:!1},translations:{defaultLanguage:"de",disableAutoLanguageSwitch:!0,translations:{de:{common:{acceptAll:"German Accept All",rejectAll:"German Reject All",customize:"German Customize",save:"German Save"},cookieBanner:{title:"German Title",description:"German Description"},consentManagerDialog:{title:"German Dialog Title"},consentTypes:{necessary:{title:"German Necessary",description:"German Necessary Description"}}}}}},children:e})});(0,external_vitest_namespaceObject.expect)(e.current.cookieBanner.title).toBe("German Title"),(0,external_vitest_namespaceObject.expect)(e.current.cookieBanner.description).toBe("German Description"),(0,external_vitest_namespaceObject.expect)(e.current.consentManagerDialog.title).toBe("German Dialog Title"),(0,external_vitest_namespaceObject.expect)(e.current.common.acceptAll).toBe("German Accept All"),(0,external_vitest_namespaceObject.expect)(e.current.common.rejectAll).toBe("German Reject All"),(0,external_vitest_namespaceObject.expect)(e.current.common.customize).toBe("German Customize"),(0,external_vitest_namespaceObject.expect)(e.current.common.save).toBe("German Save"),(0,external_vitest_namespaceObject.expect)(e.current.consentTypes?.necessary?.title).toBe("German Necessary")}),(0,external_vitest_namespaceObject.test)("merges custom translations with defaults",()=>{let e={translations:{en:{cookieBanner:{title:"Custom Cookie Settings",description:"Custom Description"}}}},{result:t}=(0,external_vitest_browser_react_namespaceObject.renderHook)(()=>(0,external_use_translations_cjs_namespaceObject.useTranslations)(),{wrapper:({children:t})=>(0,jsx_runtime_namespaceObject.jsx)(consent_manager_provider_cjs_namespaceObject.ConsentManagerProvider,{options:{mode:"offline",react:{noStyle:!1},translations:e},children:t})});(0,external_vitest_namespaceObject.expect)(t.current.cookieBanner.title).toBe("Custom Cookie Settings"),(0,external_vitest_namespaceObject.expect)(t.current.cookieBanner.description).toBe("Custom Description"),(0,external_vitest_namespaceObject.expect)(t.current.consentManagerDialog.title).toBe("Privacy Settings"),(0,external_vitest_namespaceObject.expect)(t.current.common.acceptAll).toBe("Accept All"),(0,external_vitest_namespaceObject.expect)(t.current.common.rejectAll).toBe("Reject All"),(0,external_vitest_namespaceObject.expect)(t.current.common.customize).toBe("Customize"),(0,external_vitest_namespaceObject.expect)(t.current.common.save).toBe("Save Settings")}),(0,external_vitest_namespaceObject.test)("falls back to English when selected language is not available",()=>{let{result:e}=(0,external_vitest_browser_react_namespaceObject.renderHook)(()=>(0,external_use_translations_cjs_namespaceObject.useTranslations)(),{wrapper:({children:e})=>(0,jsx_runtime_namespaceObject.jsx)(consent_manager_provider_cjs_namespaceObject.ConsentManagerProvider,{options:{mode:"offline",react:{noStyle:!1},translations:{defaultLanguage:"fr"}},children:e})});(0,external_vitest_namespaceObject.expect)(e.current.cookieBanner.title).toBe("We value your privacy"),(0,external_vitest_namespaceObject.expect)(e.current.cookieBanner.description).toBe("This site uses cookies to improve your browsing experience, analyze site traffic, and show personalized content."),(0,external_vitest_namespaceObject.expect)(e.current.consentManagerDialog.title).toBe("Privacy Settings"),(0,external_vitest_namespaceObject.expect)(e.current.common.acceptAll).toBe("Accept All"),(0,external_vitest_namespaceObject.expect)(e.current.common.rejectAll).toBe("Reject All"),(0,external_vitest_namespaceObject.expect)(e.current.common.customize).toBe("Customize"),(0,external_vitest_namespaceObject.expect)(e.current.common.save).toBe("Save Settings")}),(0,external_vitest_namespaceObject.test)("Custom English instead of English when German is selected",()=>{let{result:e}=(0,external_vitest_browser_react_namespaceObject.renderHook)(()=>(0,external_use_translations_cjs_namespaceObject.useTranslations)(),{wrapper:({children:e})=>(0,jsx_runtime_namespaceObject.jsx)(consent_manager_provider_cjs_namespaceObject.ConsentManagerProvider,{options:{mode:"offline",react:{noStyle:!1},translations:{defaultLanguage:"en",disableAutoLanguageSwitch:!0,translations:{en:{common:{acceptAll:"Custom English Accept All",rejectAll:"Custom English Reject All",customize:"Custom English Customize",save:"Custom English Save"},cookieBanner:{title:"Custom English Title",description:"Custom English Description"},consentManagerDialog:{title:"Custom English Dialog Title"},consentTypes:{necessary:{title:"Custom English Necessary",description:"Custom English Necessary Description"}}}}}},children:e})});(0,external_vitest_namespaceObject.expect)(e.current.common.acceptAll).toBe("Custom English Accept All"),(0,external_vitest_namespaceObject.expect)(e.current.common.rejectAll).toBe("Custom English Reject All"),(0,external_vitest_namespaceObject.expect)(e.current.common.customize).toBe("Custom English Customize"),(0,external_vitest_namespaceObject.expect)(e.current.common.save).toBe("Custom English Save"),(0,external_vitest_namespaceObject.expect)(e.current.cookieBanner.title).toBe("Custom English Title"),(0,external_vitest_namespaceObject.expect)(e.current.cookieBanner.description).toBe("Custom English Description"),(0,external_vitest_namespaceObject.expect)(e.current.consentManagerDialog.title).toBe("Custom English Dialog Title"),(0,external_vitest_namespaceObject.expect)(e.current.consentTypes?.necessary?.title).toBe("Custom English Necessary")})}),__webpack_exports__)exports[__webpack_i__]=__webpack_exports__[__webpack_i__];Object.defineProperty(exports,"__esModule",{value:!0});
@@ -1 +1 @@
1
- import*as e from"react/jsx-runtime";import*as t from"vitest";import*as n from"vitest-browser-react";import*as r from"../../providers/consent-manager-provider.js";import*as o from"../use-translations.js";(0,t.describe)("useTranslations",()=>{(0,t.test)("returns English translations by default",()=>{let{result:i}=(0,n.renderHook)(()=>(0,o.useTranslations)(),{wrapper:({children:t})=>(0,e.jsx)(r.ConsentManagerProvider,{options:{mode:"offline",react:{noStyle:!1}},children:t})});(0,t.expect)(i.current.cookieBanner.title).toBe("We value your privacy"),(0,t.expect)(i.current.cookieBanner.description).toBe("This site uses cookies to improve your browsing experience, analyze site traffic, and show personalized content."),(0,t.expect)(i.current.consentManagerDialog.title).toBe("Privacy Settings"),(0,t.expect)(i.current.consentManagerWidget.title).toBe("Privacy Preferences"),(0,t.expect)(i.current.consentTypes?.necessary?.title).toBe("Strictly Necessary")}),(0,t.test)("returns German translations instead of English when German is selected",()=>{let{result:i}=(0,n.renderHook)(()=>(0,o.useTranslations)(),{wrapper:({children:t})=>(0,e.jsx)(r.ConsentManagerProvider,{options:{mode:"offline",react:{noStyle:!1},translations:{defaultLanguage:"de",disableAutoLanguageSwitch:!0,translations:{de:{cookieBanner:{title:"German Title",description:"German Description"},consentManagerDialog:{title:"German Dialog Title"},consentManagerWidget:{title:"German Widget Title"},consentTypes:{necessary:{title:"German Necessary",description:"German Necessary Description"}}}}}},children:t})});(0,t.expect)(i.current.cookieBanner.title).toBe("German Title"),(0,t.expect)(i.current.cookieBanner.description).toBe("German Description"),(0,t.expect)(i.current.consentManagerDialog.title).toBe("German Dialog Title"),(0,t.expect)(i.current.consentManagerWidget.title).toBe("German Widget Title"),(0,t.expect)(i.current.consentTypes?.necessary?.title).toBe("German Necessary")}),(0,t.test)("merges custom translations with defaults",()=>{let i={translations:{en:{cookieBanner:{title:"Custom Cookie Settings",description:"Custom Description"}}}},{result:s}=(0,n.renderHook)(()=>(0,o.useTranslations)(),{wrapper:({children:t})=>(0,e.jsx)(r.ConsentManagerProvider,{options:{mode:"offline",react:{noStyle:!1},translations:i},children:t})});(0,t.expect)(s.current.cookieBanner.title).toBe("Custom Cookie Settings"),(0,t.expect)(s.current.cookieBanner.description).toBe("Custom Description"),(0,t.expect)(s.current.consentManagerDialog.title).toBe("Privacy Settings"),(0,t.expect)(s.current.consentManagerWidget.title).toBe("Privacy Preferences")}),(0,t.test)("falls back to English when selected language is not available",()=>{let{result:i}=(0,n.renderHook)(()=>(0,o.useTranslations)(),{wrapper:({children:t})=>(0,e.jsx)(r.ConsentManagerProvider,{options:{mode:"offline",react:{noStyle:!1},translations:{defaultLanguage:"fr"}},children:t})});(0,t.expect)(i.current.cookieBanner.title).toBe("We value your privacy"),(0,t.expect)(i.current.cookieBanner.description).toBe("This site uses cookies to improve your browsing experience, analyze site traffic, and show personalized content."),(0,t.expect)(i.current.consentManagerDialog.title).toBe("Privacy Settings"),(0,t.expect)(i.current.consentManagerWidget.title).toBe("Privacy Preferences")}),(0,t.test)("Custom English instead of English when German is selected",()=>{let{result:i}=(0,n.renderHook)(()=>(0,o.useTranslations)(),{wrapper:({children:t})=>(0,e.jsx)(r.ConsentManagerProvider,{options:{mode:"offline",react:{noStyle:!1},translations:{defaultLanguage:"en",disableAutoLanguageSwitch:!0,translations:{en:{cookieBanner:{title:"Custom English Title",description:"Custom English Description"},consentManagerDialog:{title:"Custom English Dialog Title"},consentManagerWidget:{title:"Custom English Widget Title"},consentTypes:{necessary:{title:"Custom English Necessary",description:"Custom English Necessary Description"}}}}}},children:t})});(0,t.expect)(i.current.cookieBanner.title).toBe("Custom English Title"),(0,t.expect)(i.current.cookieBanner.description).toBe("Custom English Description"),(0,t.expect)(i.current.consentManagerDialog.title).toBe("Custom English Dialog Title"),(0,t.expect)(i.current.consentManagerWidget.title).toBe("Custom English Widget Title"),(0,t.expect)(i.current.consentTypes?.necessary?.title).toBe("Custom English Necessary")})});
1
+ import*as e from"react/jsx-runtime";import*as t from"vitest";import*as n from"vitest-browser-react";import*as o from"../../providers/consent-manager-provider.js";import*as r from"../use-translations.js";(0,t.describe)("useTranslations",()=>{(0,t.test)("returns English translations by default",()=>{let{result:s}=(0,n.renderHook)(()=>(0,r.useTranslations)(),{wrapper:({children:t})=>(0,e.jsx)(o.ConsentManagerProvider,{options:{mode:"offline",react:{noStyle:!1}},children:t})});(0,t.expect)(s.current.cookieBanner.title).toBe("We value your privacy"),(0,t.expect)(s.current.cookieBanner.description).toBe("This site uses cookies to improve your browsing experience, analyze site traffic, and show personalized content."),(0,t.expect)(s.current.consentManagerDialog.title).toBe("Privacy Settings"),(0,t.expect)(s.current.common.acceptAll).toBe("Accept All"),(0,t.expect)(s.current.common.rejectAll).toBe("Reject All"),(0,t.expect)(s.current.common.customize).toBe("Customize"),(0,t.expect)(s.current.common.save).toBe("Save Settings"),(0,t.expect)(s.current.consentTypes?.necessary?.title).toBe("Strictly Necessary")}),(0,t.test)("returns German translations instead of English when German is selected",()=>{let{result:s}=(0,n.renderHook)(()=>(0,r.useTranslations)(),{wrapper:({children:t})=>(0,e.jsx)(o.ConsentManagerProvider,{options:{mode:"offline",react:{noStyle:!1},translations:{defaultLanguage:"de",disableAutoLanguageSwitch:!0,translations:{de:{common:{acceptAll:"German Accept All",rejectAll:"German Reject All",customize:"German Customize",save:"German Save"},cookieBanner:{title:"German Title",description:"German Description"},consentManagerDialog:{title:"German Dialog Title"},consentTypes:{necessary:{title:"German Necessary",description:"German Necessary Description"}}}}}},children:t})});(0,t.expect)(s.current.cookieBanner.title).toBe("German Title"),(0,t.expect)(s.current.cookieBanner.description).toBe("German Description"),(0,t.expect)(s.current.consentManagerDialog.title).toBe("German Dialog Title"),(0,t.expect)(s.current.common.acceptAll).toBe("German Accept All"),(0,t.expect)(s.current.common.rejectAll).toBe("German Reject All"),(0,t.expect)(s.current.common.customize).toBe("German Customize"),(0,t.expect)(s.current.common.save).toBe("German Save"),(0,t.expect)(s.current.consentTypes?.necessary?.title).toBe("German Necessary")}),(0,t.test)("merges custom translations with defaults",()=>{let s={translations:{en:{cookieBanner:{title:"Custom Cookie Settings",description:"Custom Description"}}}},{result:c}=(0,n.renderHook)(()=>(0,r.useTranslations)(),{wrapper:({children:t})=>(0,e.jsx)(o.ConsentManagerProvider,{options:{mode:"offline",react:{noStyle:!1},translations:s},children:t})});(0,t.expect)(c.current.cookieBanner.title).toBe("Custom Cookie Settings"),(0,t.expect)(c.current.cookieBanner.description).toBe("Custom Description"),(0,t.expect)(c.current.consentManagerDialog.title).toBe("Privacy Settings"),(0,t.expect)(c.current.common.acceptAll).toBe("Accept All"),(0,t.expect)(c.current.common.rejectAll).toBe("Reject All"),(0,t.expect)(c.current.common.customize).toBe("Customize"),(0,t.expect)(c.current.common.save).toBe("Save Settings")}),(0,t.test)("falls back to English when selected language is not available",()=>{let{result:s}=(0,n.renderHook)(()=>(0,r.useTranslations)(),{wrapper:({children:t})=>(0,e.jsx)(o.ConsentManagerProvider,{options:{mode:"offline",react:{noStyle:!1},translations:{defaultLanguage:"fr"}},children:t})});(0,t.expect)(s.current.cookieBanner.title).toBe("We value your privacy"),(0,t.expect)(s.current.cookieBanner.description).toBe("This site uses cookies to improve your browsing experience, analyze site traffic, and show personalized content."),(0,t.expect)(s.current.consentManagerDialog.title).toBe("Privacy Settings"),(0,t.expect)(s.current.common.acceptAll).toBe("Accept All"),(0,t.expect)(s.current.common.rejectAll).toBe("Reject All"),(0,t.expect)(s.current.common.customize).toBe("Customize"),(0,t.expect)(s.current.common.save).toBe("Save Settings")}),(0,t.test)("Custom English instead of English when German is selected",()=>{let{result:s}=(0,n.renderHook)(()=>(0,r.useTranslations)(),{wrapper:({children:t})=>(0,e.jsx)(o.ConsentManagerProvider,{options:{mode:"offline",react:{noStyle:!1},translations:{defaultLanguage:"en",disableAutoLanguageSwitch:!0,translations:{en:{common:{acceptAll:"Custom English Accept All",rejectAll:"Custom English Reject All",customize:"Custom English Customize",save:"Custom English Save"},cookieBanner:{title:"Custom English Title",description:"Custom English Description"},consentManagerDialog:{title:"Custom English Dialog Title"},consentTypes:{necessary:{title:"Custom English Necessary",description:"Custom English Necessary Description"}}}}}},children:t})});(0,t.expect)(s.current.common.acceptAll).toBe("Custom English Accept All"),(0,t.expect)(s.current.common.rejectAll).toBe("Custom English Reject All"),(0,t.expect)(s.current.common.customize).toBe("Custom English Customize"),(0,t.expect)(s.current.common.save).toBe("Custom English Save"),(0,t.expect)(s.current.cookieBanner.title).toBe("Custom English Title"),(0,t.expect)(s.current.cookieBanner.description).toBe("Custom English Description"),(0,t.expect)(s.current.consentManagerDialog.title).toBe("Custom English Dialog Title"),(0,t.expect)(s.current.consentTypes?.necessary?.title).toBe("Custom English Necessary")})});
@@ -1 +1 @@
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_modules__={"./use-consent-manager":function(e){e.exports=require("./use-consent-manager.cjs")},"./use-focus-trap":function(e){e.exports=require("./use-focus-trap.cjs")},"~/hooks/use-theme":function(e){e.exports=require("./use-theme.cjs")},"./use-translations":function(e){e.exports=require("./use-translations.cjs")}},__webpack_module_cache__={};function __webpack_require__(e){var _=__webpack_module_cache__[e];if(void 0!==_)return _.exports;var r=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e](r,r.exports,__webpack_require__),r.exports}__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__={};for(var __webpack_i__ in(()=>{__webpack_require__.r(__webpack_exports__);var e=__webpack_require__("./use-consent-manager"),_={};for(var r in e)"default"!==r&&(_[r]=(function(_){return e[_]}).bind(0,r));__webpack_require__.d(__webpack_exports__,_);var a=__webpack_require__("./use-focus-trap"),_={};for(var r in a)"default"!==r&&(_[r]=(function(e){return a[e]}).bind(0,r));__webpack_require__.d(__webpack_exports__,_);var t=__webpack_require__("~/hooks/use-theme"),_={};for(var r in t)"default"!==r&&(_[r]=(function(e){return t[e]}).bind(0,r));__webpack_require__.d(__webpack_exports__,_);var u=__webpack_require__("./use-translations"),_={};for(var r in u)"default"!==r&&(_[r]=(function(e){return u[e]}).bind(0,r));__webpack_require__.d(__webpack_exports__,_)})(),__webpack_exports__)exports[__webpack_i__]=__webpack_exports__[__webpack_i__];Object.defineProperty(exports,"__esModule",{value:!0});
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_modules__={"./use-consent-manager":function(e){e.exports=require("./use-consent-manager.cjs")},"./use-focus-trap":function(e){e.exports=require("./use-focus-trap.cjs")},"./use-theme":function(e){e.exports=require("./use-theme.cjs")},"./use-translations":function(e){e.exports=require("./use-translations.cjs")}},__webpack_module_cache__={};function __webpack_require__(e){var _=__webpack_module_cache__[e];if(void 0!==_)return _.exports;var r=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e](r,r.exports,__webpack_require__),r.exports}__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__={};for(var __webpack_i__ in(()=>{__webpack_require__.r(__webpack_exports__);var e=__webpack_require__("./use-consent-manager"),_={};for(var r in e)"default"!==r&&(_[r]=(function(_){return e[_]}).bind(0,r));__webpack_require__.d(__webpack_exports__,_);var a=__webpack_require__("./use-focus-trap"),_={};for(var r in a)"default"!==r&&(_[r]=(function(e){return a[e]}).bind(0,r));__webpack_require__.d(__webpack_exports__,_);var t=__webpack_require__("./use-theme"),_={};for(var r in t)"default"!==r&&(_[r]=(function(e){return t[e]}).bind(0,r));__webpack_require__.d(__webpack_exports__,_);var u=__webpack_require__("./use-translations"),_={};for(var r in u)"default"!==r&&(_[r]=(function(e){return u[e]}).bind(0,r));__webpack_require__.d(__webpack_exports__,_)})(),__webpack_exports__)exports[__webpack_i__]=__webpack_exports__[__webpack_i__];Object.defineProperty(exports,"__esModule",{value:!0});
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- "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__.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__,{useTranslations:()=>useTranslations});let external_c15t_namespaceObject=require("c15t"),external_react_namespaceObject=require("react"),external_use_consent_manager_cjs_namespaceObject=require("./use-consent-manager.cjs");function useTranslations(){let{translationConfig:e}=(0,external_use_consent_manager_cjs_namespaceObject.useConsentManager)();return(0,external_react_namespaceObject.useMemo)(()=>{let{translations:_={},defaultLanguage:r="en"}=e,n=_[r];if(isTranslations(n))return n;let a=_.en;return isTranslations(a)?a:external_c15t_namespaceObject.defaultTranslationConfig.translations.en},[e])}function isTranslations(e){return!!e&&"object"==typeof e&&"cookieBanner"in e&&"consentManagerDialog"in e&&"consentManagerWidget"in e&&"consentTypes"in e}for(var __webpack_i__ in exports.useTranslations=__webpack_exports__.useTranslations,__webpack_exports__)-1===["useTranslations"].indexOf(__webpack_i__)&&(exports[__webpack_i__]=__webpack_exports__[__webpack_i__]);Object.defineProperty(exports,"__esModule",{value:!0});
2
+ "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__.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__,{useTranslations:()=>useTranslations});let external_c15t_namespaceObject=require("c15t"),external_react_namespaceObject=require("react"),external_use_consent_manager_cjs_namespaceObject=require("./use-consent-manager.cjs");function useTranslations(){let{translationConfig:e}=(0,external_use_consent_manager_cjs_namespaceObject.useConsentManager)();return(0,external_react_namespaceObject.useMemo)(()=>{let{translations:_={},defaultLanguage:r="en"}=e,n=_[r];if(isTranslations(n))return n;let a=_.en;return isTranslations(a)?a:external_c15t_namespaceObject.defaultTranslationConfig.translations.en},[e])}function isTranslations(e){return!!e&&"object"==typeof e&&"cookieBanner"in e&&"consentManagerDialog"in e&&"consentTypes"in e&&"common"in e}for(var __webpack_i__ in exports.useTranslations=__webpack_exports__.useTranslations,__webpack_exports__)-1===["useTranslations"].indexOf(__webpack_i__)&&(exports[__webpack_i__]=__webpack_exports__[__webpack_i__]);Object.defineProperty(exports,"__esModule",{value:!0});
@@ -1 +1 @@
1
- {"version":3,"file":"use-translations.d.ts","sourceRoot":"","sources":["../../src/hooks/use-translations.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,MAAM,CAAC;AAIzC;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,eAAe,IAAI,YAAY,CAoB9C"}
1
+ {"version":3,"file":"use-translations.d.ts","sourceRoot":"","sources":["../../src/hooks/use-translations.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,MAAM,CAAC;AAIzC;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,eAAe,IAAI,YAAY,CAmB9C"}
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- import*as n from"c15t";import*as e from"react";import*as t from"./use-consent-manager.js";function o(){let{translationConfig:o}=(0,t.useConsentManager)();return(0,e.useMemo)(()=>{let{translations:e={},defaultLanguage:t="en"}=o,a=e[t];if(r(a))return a;let s=e.en;return r(s)?s:n.defaultTranslationConfig.translations.en},[o])}function r(n){return!!n&&"object"==typeof n&&"cookieBanner"in n&&"consentManagerDialog"in n&&"consentManagerWidget"in n&&"consentTypes"in n}export{o as useTranslations};
2
+ import*as n from"c15t";import*as e from"react";import*as t from"./use-consent-manager.js";function o(){let{translationConfig:o}=(0,t.useConsentManager)();return(0,e.useMemo)(()=>{let{translations:e={},defaultLanguage:t="en"}=o,a=e[t];if(r(a))return a;let s=e.en;return r(s)?s:n.defaultTranslationConfig.translations.en},[o])}function r(n){return!!n&&"object"==typeof n&&"cookieBanner"in n&&"consentManagerDialog"in n&&"consentTypes"in n&&"common"in n}export{o as useTranslations};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@c15t/react",
3
- "version": "1.2.0-canary.9",
3
+ "version": "1.2.0",
4
4
  "license": "GPL-3.0-only",
5
5
  "sideEffects": false,
6
6
  "type": "module",
@@ -68,11 +68,11 @@
68
68
  "@radix-ui/react-switch": "1.1.4",
69
69
  "clsx": "2.1.1",
70
70
  "zustand": "^5.0.3",
71
- "c15t": "1.2.0-canary.9"
71
+ "c15t": "1.2.0"
72
72
  },
73
73
  "devDependencies": {
74
+ "@c15t/backend": "1.2.0",
74
75
  "@c15t/typescript-config": "0.0.1-beta.1",
75
- "@c15t/backend": "1.2.0-canary.9",
76
76
  "@c15t/vitest-config": "1.0.0"
77
77
  },
78
78
  "peerDependencies": {
@@ -86,7 +86,7 @@
86
86
  "build": "rslib build",
87
87
  "check-types": "tsc --noEmit",
88
88
  "dev": "rslib build --watch",
89
- "fmt": "pnpm biome format --write . && biome check --formatter-enabled=false --linter-enabled=false --organize-imports-enabled=true --write",
89
+ "fmt": "pnpm biome format --write . && pnpm biome check --formatter-enabled=false --linter-enabled=false --organize-imports-enabled=true --write",
90
90
  "lint": "pnpm biome lint ./src",
91
91
  "test": "vitest run",
92
92
  "test:watch": "vitest"