@c15t/react
Version:
Developer-first CMP for React: cookie banner, consent manager, preferences centre. GDPR ready with minimal setup and rich customization
2 lines • 2.59 kB
JavaScript
'use client';
import*as e from"react/jsx-runtime";import*as a from"react";import*as t from"../../consent-manager-widget/consent-manager-widget.js";import*as o 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,...t},r)=>(0,e.jsx)(o.Box,{ref:r,className:i.default.card,...t,themeKey:"dialog.root","data-testid":"consent-manager-dialog-root",children:a})),l=(0,a.forwardRef)(({children:a,...t},r)=>(0,e.jsx)(o.Box,{ref:r,className:i.default.header,...t,themeKey:"dialog.header","data-testid":"consent-manager-dialog-header",children:a})),c=(0,a.forwardRef)(({children:a,...t},r)=>(0,e.jsx)(o.Box,{ref:r,className:i.default.title,themeKey:"dialog.title",...t,"data-testid":"consent-manager-dialog-title",children:a})),m=(0,a.forwardRef)(({children:a,...t},r)=>(0,e.jsx)(o.Box,{ref:r,className:i.default.description,themeKey:"dialog.description",...t,"data-testid":"consent-manager-dialog-description",children:a})),f=(0,a.forwardRef)(({children:a,...t},r)=>(0,e.jsx)(o.Box,{ref:r,className:i.default.content,themeKey:"dialog.content","data-testid":"consent-manager-dialog-content",...t,children:a})),g=(0,a.forwardRef)(({children:a,themeKey:t,...r},n)=>(0,e.jsx)(o.Box,{ref:n,className:i.default.footer,themeKey:t||"dialog.footer",...r,"data-testid":"consent-manager-dialog-footer",children:a})),h=()=>{let{branding:a}=(0,n.useConsentManager)();if("none"===a)return null;let t="undefined"!=typeof window?`?ref=${window.location.hostname}`:"";return(0,e.jsxs)("a",{dir:"ltr",className:i.default.branding,href:"consent"===a?`https://consent.io${t}`:`https://c15t.com${t}`,children:["Secured by"," ","consent"===a?(0,e.jsx)(r.ConsentLogo,{className:i.default.brandingConsent}):(0,e.jsx)(r.C15TIcon,{className:i.default.brandingC15T})]})},x=({noStyle:a})=>{let{consentManagerDialog:o}=(0,s.useTranslations)();return(0,e.jsxs)(d,{children:[(0,e.jsxs)(l,{children:[(0,e.jsx)(c,{children:o.title}),(0,e.jsx)(m,{children:o.description})]}),(0,e.jsx)(f,{children:(0,e.jsx)(t.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,w=m,C=f,y=g;export{h as BrandingFooter,j as Card,x as ConsentCustomizationCard,C as Content,f as DialogContent,g as DialogFooter,l as DialogHeader,m as DialogHeaderDescription,c as DialogHeaderTitle,y as Footer,u as Header,w as HeaderDescription,p as HeaderTitle};