@c15t/react 1.4.2 → 1.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/consent-manager-dialog/consent-manager-dialog.cjs +1 -1
- package/dist/components/consent-manager-dialog/consent-manager-dialog.d.ts.map +1 -1
- package/dist/components/consent-manager-dialog/consent-manager-dialog.js +1 -1
- package/dist/components/consent-manager-widget/consent-manager-widget.cjs +1 -1
- package/dist/components/consent-manager-widget/consent-manager-widget.d.ts +1 -1
- package/dist/components/consent-manager-widget/consent-manager-widget.d.ts.map +1 -1
- package/dist/components/consent-manager-widget/consent-manager-widget.js +1 -1
- package/dist/components/cookie-banner/cookie-banner.cjs +1 -1
- package/dist/components/cookie-banner/cookie-banner.d.ts +7 -1
- package/dist/components/cookie-banner/cookie-banner.d.ts.map +1 -1
- package/dist/components/cookie-banner/cookie-banner.js +1 -1
- package/package.json +3 -3
|
@@ -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 _ in a)__webpack_require__.o(a,_)&&!__webpack_require__.o(e,_)&&Object.defineProperty(e,_,{enumerable:!0,get:a[_]})},__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__,{ConsentManagerDialog:()=>ConsentManagerDialog});let jsx_runtime_namespaceObject=require("react/jsx-runtime"),external_react_namespaceObject=require("react"),external_react_dom_namespaceObject=require("react-dom"),theme_context_cjs_namespaceObject=require("../../context/theme-context.cjs"),use_consent_manager_cjs_namespaceObject=require("../../hooks/use-consent-manager.cjs"),dialog_card_cjs_namespaceObject=require("./atoms/dialog-card.cjs"),overlay_cjs_namespaceObject=require("./atoms/overlay.cjs"),external_clsx_namespaceObject=require("clsx");var external_clsx_default=__webpack_require__.n(external_clsx_namespaceObject);let use_focus_trap_cjs_namespaceObject=require("../../hooks/use-focus-trap.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 ConsentManagerDialog=({theme:e,disableAnimation:a,noStyle:_,open:t=!1,scrollLock:r=!0,trapFocus:
|
|
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 _ in a)__webpack_require__.o(a,_)&&!__webpack_require__.o(e,_)&&Object.defineProperty(e,_,{enumerable:!0,get:a[_]})},__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__,{ConsentManagerDialog:()=>ConsentManagerDialog});let jsx_runtime_namespaceObject=require("react/jsx-runtime"),external_react_namespaceObject=require("react"),external_react_dom_namespaceObject=require("react-dom"),theme_context_cjs_namespaceObject=require("../../context/theme-context.cjs"),use_consent_manager_cjs_namespaceObject=require("../../hooks/use-consent-manager.cjs"),use_theme_cjs_namespaceObject=require("../../hooks/use-theme.cjs"),dialog_card_cjs_namespaceObject=require("./atoms/dialog-card.cjs"),overlay_cjs_namespaceObject=require("./atoms/overlay.cjs"),external_clsx_namespaceObject=require("clsx");var external_clsx_default=__webpack_require__.n(external_clsx_namespaceObject);let use_focus_trap_cjs_namespaceObject=require("../../hooks/use-focus-trap.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 ConsentManagerDialog=({theme:e,disableAnimation:a,noStyle:_,open:t=!1,scrollLock:r=!0,trapFocus:c=!0})=>{let n=(0,use_consent_manager_cjs_namespaceObject.useConsentManager)(),s=(0,use_theme_cjs_namespaceObject.useTheme)(),o={...s.theme,...e},l=a??s.disableAnimation,i=_??s.noStyle,u=r??s.scrollLock,m=c??s.trapFocus,[p,d]=(0,external_react_namespaceObject.useState)(!1),[j,b]=(0,external_react_namespaceObject.useState)(!1),x=(0,external_react_namespaceObject.useRef)(null),g=(0,external_react_namespaceObject.useRef)(null);(0,external_react_namespaceObject.useEffect)(()=>(d(!0),()=>d(!1)),[]),(0,external_react_namespaceObject.useEffect)(()=>{if(t||n.isPrivacyDialogOpen)b(!0);else if(l)b(!1);else{let e=setTimeout(()=>{b(!1)},Number.parseInt(getComputedStyle(document.documentElement).getPropertyValue("--dialog-animation-duration")||"200",10));return()=>clearTimeout(e)}},[t,n.isPrivacyDialogOpen,l]);let O=g&&"object"==typeof g&&"current"in g;(0,use_focus_trap_cjs_namespaceObject.useFocusTrap)((t||n.isPrivacyDialogOpen)&&m,O?g:null);let f=(0,jsx_runtime_namespaceObject.jsx)(theme_context_cjs_namespaceObject.LocalThemeContext.Provider,{value:{theme:o,noStyle:i,disableAnimation:l,scrollLock:u,trapFocus:m},children:(t||n.isPrivacyDialogOpen)&&(0,jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment,{children:[(0,jsx_runtime_namespaceObject.jsx)(overlay_cjs_namespaceObject.Overlay,{open:t||n.isPrivacyDialogOpen}),(0,jsx_runtime_namespaceObject.jsx)("dialog",{ref:g,className:external_clsx_default()(external_consent_manager_dialog_module_cjs_default().root,!l&&(j?external_consent_manager_dialog_module_cjs_default().dialogVisible:external_consent_manager_dialog_module_cjs_default().dialogHidden)),"aria-labelledby":"privacy-settings-title",tabIndex:-1,children:(0,jsx_runtime_namespaceObject.jsx)("div",{ref:x,className:external_clsx_default()(external_consent_manager_dialog_module_cjs_default().container,!l&&j?external_consent_manager_dialog_module_cjs_default().contentVisible:external_consent_manager_dialog_module_cjs_default().contentHidden),children:(0,jsx_runtime_namespaceObject.jsx)(dialog_card_cjs_namespaceObject.ConsentCustomizationCard,{noStyle:i})})})]})});return p&&(0,external_react_dom_namespaceObject.createPortal)(f,document.body)};for(var __webpack_i__ in exports.ConsentManagerDialog=__webpack_exports__.ConsentManagerDialog,__webpack_exports__)-1===["ConsentManagerDialog"].indexOf(__webpack_i__)&&(exports[__webpack_i__]=__webpack_exports__[__webpack_i__]);Object.defineProperty(exports,"__esModule",{value:!0});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"consent-manager-dialog.d.ts","sourceRoot":"","sources":["../../../src/components/consent-manager-dialog/consent-manager-dialog.tsx"],"names":[],"mappings":"AAEA;;;;GAIG;AAEH,OAAO,EAAE,KAAK,EAAE,EAA+C,MAAM,OAAO,CAAC;AAE7E,OAAO,EAEN,KAAK,iBAAiB,EACtB,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"consent-manager-dialog.d.ts","sourceRoot":"","sources":["../../../src/components/consent-manager-dialog/consent-manager-dialog.tsx"],"names":[],"mappings":"AAEA;;;;GAIG;AAEH,OAAO,EAAE,KAAK,EAAE,EAA+C,MAAM,OAAO,CAAC;AAE7E,OAAO,EAEN,KAAK,iBAAiB,EACtB,MAAM,yBAAyB,CAAC;AAKjC,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAC;AAMzD;;;;;;GAMG;AACH,MAAM,WAAW,yBAChB,SAAQ,iBAAiB,CAAC,yBAAyB,CAAC;IACpD,mCAAmC;IACnC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAE3B,iCAAiC;IACjC,IAAI,CAAC,EAAE,OAAO,CAAC;CACf;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,oBAAoB,EAAE,EAAE,CAAC,yBAAyB,CA+G9D,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import*as e from"react/jsx-runtime";import*as t from"react";import*as
|
|
2
|
+
import*as e from"react/jsx-runtime";import*as t from"react";import*as o from"react-dom";import*as a from"../../context/theme-context.js";import*as s from"../../hooks/use-consent-manager.js";import*as r from"../../hooks/use-theme.js";import*as i from"./atoms/dialog-card.js";import*as l from"./atoms/overlay.js";import*as n from"clsx";import*as m from"../../hooks/use-focus-trap.js";import*as u from"./consent-manager-dialog.module.js";let c=({theme:c,disableAnimation:d,noStyle:f,open:p=!1,scrollLock:g=!0,trapFocus:y=!0})=>{let j=(0,s.useConsentManager)(),h=(0,r.useTheme)(),x={...h.theme,...c},v=d??h.disableAnimation,b=f??h.noStyle,P=g??h.scrollLock,C=y??h.trapFocus,[D,O]=(0,t.useState)(!1),[S,k]=(0,t.useState)(!1),T=(0,t.useRef)(null),F=(0,t.useRef)(null);(0,t.useEffect)(()=>(O(!0),()=>O(!1)),[]),(0,t.useEffect)(()=>{if(p||j.isPrivacyDialogOpen)k(!0);else if(v)k(!1);else{let e=setTimeout(()=>{k(!1)},Number.parseInt(getComputedStyle(document.documentElement).getPropertyValue("--dialog-animation-duration")||"200",10));return()=>clearTimeout(e)}},[p,j.isPrivacyDialogOpen,v]);let E=F&&"object"==typeof F&&"current"in F;(0,m.useFocusTrap)((p||j.isPrivacyDialogOpen)&&C,E?F:null);let L=(0,e.jsx)(a.LocalThemeContext.Provider,{value:{theme:x,noStyle:b,disableAnimation:v,scrollLock:P,trapFocus:C},children:(p||j.isPrivacyDialogOpen)&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(l.Overlay,{open:p||j.isPrivacyDialogOpen}),(0,e.jsx)("dialog",{ref:F,className:(0,n.default)(u.default.root,!v&&(S?u.default.dialogVisible:u.default.dialogHidden)),"aria-labelledby":"privacy-settings-title",tabIndex:-1,children:(0,e.jsx)("div",{ref:T,className:(0,n.default)(u.default.container,!v&&S?u.default.contentVisible:u.default.contentHidden),children:(0,e.jsx)(i.ConsentCustomizationCard,{noStyle:b})})})]})});return D&&(0,o.createPortal)(L,document.body)};export{c as ConsentManagerDialog};
|
|
@@ -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,...
|
|
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_theme_cjs_namespaceObject=require("../../hooks/use-theme.cjs"),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,theme:t,noStyle:a,disableAnimation:c,scrollLock:_,trapFocus:n,...r})=>{let[s,o]=(0,external_react_namespaceObject.useState)([]),{common:i}=(0,use_translations_cjs_namespaceObject.useTranslations)(),j=(0,use_theme_cjs_namespaceObject.useTheme)(),m={theme:{...j.theme,...t},noStyle:a??j.noStyle,disableAnimation:c??j.disableAnimation,scrollLock:_??j.scrollLock,trapFocus:n??j.trapFocus,...r};return(0,jsx_runtime_namespaceObject.jsxs)(root_cjs_namespaceObject.ConsentManagerWidgetRoot,{...m,children:[(0,jsx_runtime_namespaceObject.jsx)(accordion_cjs_namespaceObject.ConsentManagerWidgetAccordion,{themeKey:"widget.accordion",type:"multiple",value:s,onValueChange:o,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:i.rejectAll}),(0,jsx_runtime_namespaceObject.jsx)(button_cjs_namespaceObject.ConsentManagerWidgetAcceptAllButton,{themeKey:"widget.footer.accept-button",children:i.acceptAll})]}),(0,jsx_runtime_namespaceObject.jsx)(button_cjs_namespaceObject.ConsentManagerWidgetSaveButton,{themeKey:"widget.footer.save-button",children:i.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});
|
|
@@ -40,5 +40,5 @@ import type { ConsentManagerWidgetProps } from './types';
|
|
|
40
40
|
* />
|
|
41
41
|
* ```
|
|
42
42
|
*/
|
|
43
|
-
export declare const ConsentManagerWidget: ({ hideBrading, ...props }: ConsentManagerWidgetProps) => import("react/jsx-runtime").JSX.Element;
|
|
43
|
+
export declare const ConsentManagerWidget: ({ hideBrading, theme: localTheme, noStyle: localNoStyle, disableAnimation: localDisableAnimation, scrollLock: localScrollLock, trapFocus: localTrapFocus, ...props }: ConsentManagerWidgetProps) => import("react/jsx-runtime").JSX.Element;
|
|
44
44
|
//# sourceMappingURL=consent-manager-widget.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"consent-manager-widget.d.ts","sourceRoot":"","sources":["../../../src/components/consent-manager-widget/consent-manager-widget.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"consent-manager-widget.d.ts","sourceRoot":"","sources":["../../../src/components/consent-manager-widget/consent-manager-widget.tsx"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAC;AAEzD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,eAAO,MAAM,oBAAoB,GAAI,sKAQlC,yBAAyB,4CAoD3B,CAAC"}
|
|
@@ -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
|
|
2
|
+
import*as e from"react/jsx-runtime";import*as t from"react";import*as o from"../../hooks/use-theme.js";import*as n from"../../hooks/use-translations.js";import*as r from"../consent-manager-dialog/atoms/dialog-card.js";import*as s from"./atoms/accordion.js";import*as a from"./atoms/button.js";import*as i from"./atoms/footer.js";import*as m from"./atoms/root.js";let c=({hideBrading:c,theme:l,noStyle:d,disableAnimation:g,scrollLock:u,trapFocus:h,...j})=>{let[p,f]=(0,t.useState)([]),{common:x}=(0,n.useTranslations)(),b=(0,o.useTheme)(),y={theme:{...b.theme,...l},noStyle:d??b.noStyle,disableAnimation:g??b.disableAnimation,scrollLock:u??b.scrollLock,trapFocus:h??b.trapFocus,...j};return(0,e.jsxs)(m.ConsentManagerWidgetRoot,{...y,children:[(0,e.jsx)(s.ConsentManagerWidgetAccordion,{themeKey:"widget.accordion",type:"multiple",value:p,onValueChange:f,children:(0,e.jsx)(s.ConsentManagerWidgetAccordionItems,{})}),(0,e.jsxs)(i.ConsentManagerWidgetFooter,{children:[(0,e.jsxs)(i.ConsentManagerWidgetFooterSubGroup,{themeKey:"widget.footer.sub-group",children:[(0,e.jsx)(a.ConsentManagerWidgetRejectButton,{themeKey:"widget.footer.reject-button",children:x.rejectAll}),(0,e.jsx)(a.ConsentManagerWidgetAcceptAllButton,{themeKey:"widget.footer.accept-button",children:x.acceptAll})]}),(0,e.jsx)(a.ConsentManagerWidgetSaveButton,{themeKey:"widget.footer.save-button",children:x.save})]}),!c&&(0,e.jsx)(r.DialogFooter,{themeKey:"widget.branding",children:(0,e.jsx)(r.BrandingFooter,{})})]})};export{c as ConsentManagerWidget};
|
|
@@ -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,
|
|
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 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),__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_theme_cjs_namespaceObject=require("../../hooks/use-theme.cjs"),use_translations_cjs_namespaceObject=require("../../hooks/use-translations.cjs"),CookieBanner=({theme:e,noStyle:t,disableAnimation:n,scrollLock:r,trapFocus:c=!0,title:_,description:a,rejectButtonText:o,customizeButtonText:s,acceptButtonText:i})=>{let{cookieBanner:j,common:p}=(0,use_translations_cjs_namespaceObject.useTranslations)(),b=(0,use_theme_cjs_namespaceObject.useTheme)(),m={theme:{...b.theme,...e},noStyle:t??b.noStyle,disableAnimation:n??b.disableAnimation,scrollLock:r??b.scrollLock,trapFocus:c??b.trapFocus};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,{...m,children:(0,jsx_runtime_namespaceObject.jsxs)(external_components_cjs_namespaceObject.CookieBannerCard,{"aria-label":j.title,children:[(0,jsx_runtime_namespaceObject.jsxs)(external_components_cjs_namespaceObject.CookieBannerHeader,{children:[(0,jsx_runtime_namespaceObject.jsx)(external_components_cjs_namespaceObject.CookieBannerTitle,{children:_||j.title}),(0,jsx_runtime_namespaceObject.jsx)(external_components_cjs_namespaceObject.CookieBannerDescription,{children:a||j.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:o||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:s||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:i||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});
|
|
@@ -7,7 +7,7 @@ import type { FC, ReactNode } from 'react';
|
|
|
7
7
|
import type { CookieBannerTheme } from './theme';
|
|
8
8
|
/**
|
|
9
9
|
* Props for configuring and customizing the CookieBanner component.
|
|
10
|
-
*
|
|
10
|
+
*
|
|
11
11
|
* @remarks
|
|
12
12
|
* Provides comprehensive customization options for the cookie banner's appearance
|
|
13
13
|
* and behavior while maintaining compliance with privacy regulations.
|
|
@@ -69,6 +69,12 @@ export interface CookieBannerProps {
|
|
|
69
69
|
* @default true
|
|
70
70
|
*/
|
|
71
71
|
trapFocus?: boolean;
|
|
72
|
+
/**
|
|
73
|
+
* When true, disables the entrance/exit animations
|
|
74
|
+
* @remarks Useful for environments where animations are not desired
|
|
75
|
+
* @default false
|
|
76
|
+
*/
|
|
77
|
+
disableAnimation?: boolean;
|
|
72
78
|
}
|
|
73
79
|
/**
|
|
74
80
|
* A customizable cookie consent banner component.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cookie-banner.d.ts","sourceRoot":"","sources":["../../../src/components/cookie-banner/cookie-banner.tsx"],"names":[],"mappings":"AAEA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAG3C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"cookie-banner.d.ts","sourceRoot":"","sources":["../../../src/components/cookie-banner/cookie-banner.tsx"],"names":[],"mappings":"AAEA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAG3C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAgBjD;;;;;;;;GAQG;AACH,MAAM,WAAW,iBAAiB;IACjC;;;;OAIG;IACH,KAAK,CAAC,EAAE,iBAAiB,CAAC;IAE1B;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;;;OAIG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAElB;;;;OAIG;IACH,WAAW,CAAC,EAAE,SAAS,CAAC;IAExB;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,SAAS,CAAC;IAE7B;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,SAAS,CAAC;IAEhC;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,SAAS,CAAC;IAE7B;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2DG;AACH,eAAO,MAAM,YAAY,EAAE,EAAE,CAAC,iBAAiB,CA4E9C,CAAC;AAEF;;;;;;;;;GASG"}
|
|
@@ -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 t from"../shared/primitives/button.js";import*as n from"./atoms/root.js";import*as r from"./components.js";import*as i from"../../hooks/use-translations.js";let a=({theme:a,noStyle:
|
|
2
|
+
import*as e from"react/jsx-runtime";import*as o from"./error-boundary.js";import*as t from"../shared/primitives/button.js";import*as n from"./atoms/root.js";import*as r from"./components.js";import*as i from"../../hooks/use-theme.js";import*as s from"../../hooks/use-translations.js";let a=({theme:a,noStyle:c,disableAnimation:l,scrollLock:m,trapFocus:d=!0,title:h,description:u,rejectButtonText:j,customizeButtonText:p,acceptButtonText:k})=>{let{cookieBanner:b,common:B}=(0,s.useTranslations)(),C=(0,i.useTheme)(),x={theme:{...C.theme,...a},noStyle:c??C.noStyle,disableAnimation:l??C.disableAnimation,scrollLock:m??C.scrollLock,trapFocus:d??C.trapFocus};return(0,e.jsx)(o.ErrorBoundary,{fallback:(0,e.jsx)("div",{children:"Something went wrong with the Cookie Banner."}),children:(0,e.jsx)(n.CookieBannerRoot,{...x,children:(0,e.jsxs)(r.CookieBannerCard,{"aria-label":b.title,children:[(0,e.jsxs)(r.CookieBannerHeader,{children:[(0,e.jsx)(r.CookieBannerTitle,{children:h||b.title}),(0,e.jsx)(r.CookieBannerDescription,{children:u||b.description})]}),(0,e.jsxs)(r.CookieBannerFooter,{children:[(0,e.jsxs)(r.CookieBannerFooterSubGroup,{children:[(0,e.jsx)(t.ConsentButton,{action:"reject-consent",closeCookieBanner:!0,themeKey:"banner.footer.reject-button","data-testid":"cookie-banner-reject-button",children:j||B.rejectAll}),(0,e.jsx)(t.ConsentButton,{action:"open-consent-dialog",closeCookieBanner:!0,themeKey:"banner.footer.customize-button","data-testid":"cookie-banner-customize-button",children:p||B.customize})]}),(0,e.jsx)(t.ConsentButton,{action:"accept-consent",variant:"primary",closeCookieBanner:!0,themeKey:"banner.footer.accept-button","data-testid":"cookie-banner-accept-button",children:k||B.acceptAll})]})]})})})};export{a as CookieBanner};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@c15t/react",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.3",
|
|
4
4
|
"license": "GPL-3.0-only",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"type": "module",
|
|
@@ -68,8 +68,8 @@
|
|
|
68
68
|
"@radix-ui/react-switch": "1.1.4",
|
|
69
69
|
"clsx": "2.1.1",
|
|
70
70
|
"zustand": "^5.0.3",
|
|
71
|
-
"c15t": "1.4.2",
|
|
72
|
-
"
|
|
71
|
+
"@c15t/node-sdk": "1.4.2",
|
|
72
|
+
"c15t": "1.4.2"
|
|
73
73
|
},
|
|
74
74
|
"devDependencies": {
|
|
75
75
|
"@c15t/backend": "1.4.2",
|