ldc-ker-chant/resources/ts/front/Components/cookie/constants.tsx
2026-07-10 11:32:24 +02:00

108 lines
2.5 KiB
TypeScript

import { type AnimationClasses, type CookieName } from "@/front/types/cookie";
export const animations = {
FADE: "fade",
SCALE: "scale",
TRANSLATEX: "translateX",
TRANSLATEY: "translateY",
} as const;
export const animationDuration = {
SHORT: "duration-300",
NORMAL: "duration-500",
LONG: "duration-700",
EXTRALONG: "duration-1000",
};
export const COOKIE_NAMES: CookieName[] = [
"recaptcha",
"youtube",
"vimeo",
"matomo",
"analytics",
];
export const videoCookieProvider = {
YOUTUBE: "youtube",
VIMEO: "vimeo",
} as const;
export const cnServices = {
...videoCookieProvider,
RECAPTCHA: "recaptcha",
MATOMO: "matomo",
ANALYTICS: "analytics",
} as const;
/** Nom du cookie unique regroupant tous les consentements */
export const CN_INIT_COOKIE = "cn-init";
/** Clé sous laquelle la date d'expiration est stockée dans le cookie cn-init */
export const CN_EXPIRATION_KEY = "_expiration";
/** Durée de validité du consentement (CNIL : 6 mois max recommandé, 13 mois maxi) */
export const CONSENT_DURATION_DAYS = 180;
export const animationClasses: {
open: AnimationClasses;
close: AnimationClasses;
} = {
open: {
scale: "opacity-100 scale-100",
translateY: "translate-y-0 opacity-100",
translateX: "translate-x-0 opacity-100",
fade: "opacity-100",
},
close: {
scale: "opacity-0 scale-75 pointer-events-none",
translateY: "translate-y-full opacity-0 pointer-events-none",
translateX: "-translate-x-full opacity-0 pointer-events-none",
fade: "opacity-0 pointer-events-none",
},
};
export const mappingTextSize = {
large: {
lg: "text-xl",
sm: "text-md",
xs: "text-sm",
},
normal: {
lg: "text-lg",
sm: "text-sm",
xs: "text-xs",
},
small: {
lg: "text-md",
sm: "text-xs",
xs: "text-xs",
},
};
export const mappingBtnSize = {
large: {
icon: "sm",
sm: "default",
md: "lg",
},
normal: {
icon: "icon",
sm: "sm",
md: "default",
},
small: {
icon: "icon",
sm: "icon",
md: "sm",
},
};
export const positionBannerButton = {
aside: {
left: "h-fit left-0 bottom-12 -translate-y-1/2 px-3 py-4 [writing-mode:vertical-rl] rounded-r-lg rounded-l-none",
right:
"h-fit right-0 top-1/2 -translate-y-1/2 px-3 py-4 [writing-mode:vertical-lr] rotate-180 rounded-r-lg rounded-l-none",
},
bottom: {
left: "bottom-4 left-4 z-50 py-0.5 px-4 w-fit rounded-full",
right: "bottom-4 right-4 z-50 py-0.5 px-4 w-fit rounded-full",
},
};