@stackshift-ui/cookies 7.0.0-beta.0 → 7.0.0-beta.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.
@@ -0,0 +1,93 @@
1
+ import {
2
+ extractLink
3
+ } from "./chunk-XM5H43VR.mjs";
4
+
5
+ // src/cookies_a.tsx
6
+ import { useEffect } from "react";
7
+ import * as CookieConsent from "vanilla-cookieconsent";
8
+ import { jsx } from "react/jsx-runtime";
9
+ function Cookies_A({
10
+ title,
11
+ description,
12
+ allowCookieBtn,
13
+ denyCookieBtn,
14
+ config,
15
+ contactLink,
16
+ ...props
17
+ }) {
18
+ var _a, _b, _c, _d;
19
+ const siteName = (_a = config == null ? void 0 : config.cookiePolicy) == null ? void 0 : _a.siteName;
20
+ const cookieConfigLink = (_b = config == null ? void 0 : config.cookiePolicy) == null ? void 0 : _b.cookiePolicyPage;
21
+ const cookieModalPosition = ((_d = (_c = config == null ? void 0 : config.cookiePolicy) == null ? void 0 : _c.consentModal) == null ? void 0 : _d.position) || "bottom right";
22
+ useEffect(() => {
23
+ var _a2, _b2;
24
+ const cookieConfigOptions = {
25
+ categories: {
26
+ necessary: {
27
+ enabled: true,
28
+ readOnly: true
29
+ },
30
+ analytics: {
31
+ enabled: config == null ? void 0 : config.enableAnalytics
32
+ }
33
+ },
34
+ guiOptions: {
35
+ consentModal: {
36
+ position: cookieModalPosition
37
+ }
38
+ },
39
+ language: {
40
+ default: "en",
41
+ translations: {
42
+ en: {
43
+ consentModal: {
44
+ title,
45
+ description: "Cookies help us deliver our services. By using our services, you agree to our use of cookies.",
46
+ acceptAllBtn: allowCookieBtn,
47
+ acceptNecessaryBtn: denyCookieBtn || "Reject all",
48
+ showPreferencesBtn: "Manage Individual preferences"
49
+ },
50
+ preferencesModal: {
51
+ title: "Cookie Preferences",
52
+ acceptAllBtn: allowCookieBtn,
53
+ acceptNecessaryBtn: denyCookieBtn || "Reject all",
54
+ savePreferencesBtn: "Accept current selection",
55
+ closeIconLabel: "Close",
56
+ sections: [
57
+ {
58
+ title,
59
+ description
60
+ },
61
+ {
62
+ title: "Strictly Necessary cookies",
63
+ description: `These cookies are essential for the proper functioning of this website. <a href=${extractLink(
64
+ cookieConfigLink
65
+ )} target=${cookieConfigLink == null ? void 0 : cookieConfigLink.linkTarget} rel=${(cookieConfigLink == null ? void 0 : cookieConfigLink.linkTarget) === "_blank" ? "noopener noreferrer" : ""}>${(_b2 = (_a2 = config == null ? void 0 : config.cookiePolicy) == null ? void 0 : _a2.cookiePolicyPage) == null ? void 0 : _b2.label}</a>.`,
66
+ linkedCategory: "necessary"
67
+ },
68
+ {
69
+ title: "Analytics",
70
+ description: "These cookies are used to track and measure the use of this website.",
71
+ linkedCategory: "analytics"
72
+ },
73
+ {
74
+ title: "More information",
75
+ description: `For any queries in relation to ${siteName}'s policy on cookies and your choices, please <a href=${extractLink(
76
+ contactLink
77
+ )} target=${contactLink == null ? void 0 : contactLink.linkTarget} rel=${(contactLink == null ? void 0 : contactLink.linkTarget) === "_blank" ? "noopener noreferrer" : ""}>${contactLink == null ? void 0 : contactLink.label}</a>.`
78
+ }
79
+ ]
80
+ }
81
+ }
82
+ }
83
+ },
84
+ hideFromBots: false
85
+ };
86
+ CookieConsent.run(cookieConfigOptions);
87
+ }, []);
88
+ return /* @__PURE__ */ jsx("div", { ...props });
89
+ }
90
+
91
+ export {
92
+ Cookies_A
93
+ };
@@ -0,0 +1 @@
1
+ import{a as m}from"./chunk-UMU577IJ.mjs";import{jsx as L}from"react/jsx-runtime";var v={variant_a:m},P="Cookies",B=({data:n})=>{var e,s,r,c,t,l,p,f,k,y,C,g;let o=n==null?void 0:n.variant,i=o&&v[o],u={title:(s=(e=n==null?void 0:n.variants)==null?void 0:e.heading)!=null?s:void 0,description:(c=(r=n==null?void 0:n.variants)==null?void 0:r.description)!=null?c:void 0,allowCookieBtn:(l=(t=n==null?void 0:n.variants)==null?void 0:t.acceptButtonLabel)!=null?l:void 0,denyCookieBtn:(f=(p=n==null?void 0:n.variants)==null?void 0:p.declineButtonLabel)!=null?f:void 0,config:(y=(k=n==null?void 0:n.variants)==null?void 0:k.config)!=null?y:void 0,contactLink:(g=(C=n==null?void 0:n.variants)==null?void 0:C.contactLink)!=null?g:void 0};return i?L(i,{...u}):null};B.displayName=P;export{B as a};
@@ -0,0 +1,29 @@
1
+ import {
2
+ Cookies_A
3
+ } from "./chunk-5UBVCBHM.mjs";
4
+
5
+ // src/cookies.tsx
6
+ import { jsx } from "react/jsx-runtime";
7
+ var Variants = {
8
+ variant_a: Cookies_A
9
+ };
10
+ var displayName = "Cookies";
11
+ var Cookies = ({ data }) => {
12
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
13
+ const variant = data == null ? void 0 : data.variant;
14
+ const Variant = variant && Variants[variant];
15
+ const props = {
16
+ title: (_b = (_a = data == null ? void 0 : data.variants) == null ? void 0 : _a.heading) != null ? _b : void 0,
17
+ description: (_d = (_c = data == null ? void 0 : data.variants) == null ? void 0 : _c.description) != null ? _d : void 0,
18
+ allowCookieBtn: (_f = (_e = data == null ? void 0 : data.variants) == null ? void 0 : _e.acceptButtonLabel) != null ? _f : void 0,
19
+ denyCookieBtn: (_h = (_g = data == null ? void 0 : data.variants) == null ? void 0 : _g.declineButtonLabel) != null ? _h : void 0,
20
+ config: (_j = (_i = data == null ? void 0 : data.variants) == null ? void 0 : _i.config) != null ? _j : void 0,
21
+ contactLink: (_l = (_k = data == null ? void 0 : data.variants) == null ? void 0 : _k.contactLink) != null ? _l : void 0
22
+ };
23
+ return Variant ? /* @__PURE__ */ jsx(Variant, { ...props }) : null;
24
+ };
25
+ Cookies.displayName = displayName;
26
+
27
+ export {
28
+ Cookies
29
+ };
@@ -0,0 +1,21 @@
1
+ // src/helper/index.tsx
2
+ var extractLink = (link) => {
3
+ var _a, _b;
4
+ if (!(link == null ? void 0 : link.internalLink) && !(link == null ? void 0 : link.externalLink)) {
5
+ return "/page-not-found";
6
+ }
7
+ if ((link == null ? void 0 : link.type) === "linkInternal" && ((_b = (_a = link == null ? void 0 : link.internalLink) == null ? void 0 : _a.toLowerCase()) == null ? void 0 : _b.includes("home"))) {
8
+ return "/";
9
+ }
10
+ if ((link == null ? void 0 : link.type) === "linkInternal") {
11
+ return `/${link == null ? void 0 : link.internalLink}`;
12
+ }
13
+ if ((link == null ? void 0 : link.type) === "linkExternal") {
14
+ return `${link == null ? void 0 : link.externalLink}`;
15
+ }
16
+ return "/";
17
+ };
18
+
19
+ export {
20
+ extractLink
21
+ };
package/dist/cookies.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import React from "react";
1
2
  import { ConsentModalPosition } from "vanilla-cookieconsent";
2
3
  import { SectionsProps } from "./types";
3
4
  export interface CookiesProps {
package/dist/cookies.js CHANGED
@@ -1 +1 @@
1
- "use strict";var F=Object.create;var f=Object.defineProperty;var O=Object.getOwnPropertyDescriptor;var S=Object.getOwnPropertyNames;var V=Object.getPrototypeOf,E=Object.prototype.hasOwnProperty;var h=(e,r)=>()=>(e&&(r=e(e=0)),r);var v=(e,r)=>{for(var s in r)f(e,s,{get:r[s],enumerable:!0})},B=(e,r,s,i)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of S(r))!E.call(e,o)&&o!==s&&f(e,o,{get:()=>r[o],enumerable:!(i=O(r,o))||i.enumerable});return e};var q=(e,r,s)=>(s=e!=null?F(V(e)):{},B(r||!e||!e.__esModule?f(s,"default",{value:e,enumerable:!0}):s,e)),z=e=>B(f({},"__esModule",{value:!0}),e);var d,$=h(()=>{"use strict";d=e=>{var r,s;return!(e!=null&&e.internalLink)&&!(e!=null&&e.externalLink)?"/page-not-found":(e==null?void 0:e.type)==="linkInternal"&&((s=(r=e==null?void 0:e.internalLink)==null?void 0:r.toLowerCase())!=null&&s.includes("home"))?"/":(e==null?void 0:e.type)==="linkInternal"?`/${e==null?void 0:e.internalLink}`:(e==null?void 0:e.type)==="linkExternal"?`${e==null?void 0:e.externalLink}`:"/"}});var A={};v(A,{Cookies_A:()=>N,default:()=>N});function N({title:e,description:r,allowCookieBtn:s,denyCookieBtn:i,config:o,contactLink:t,...y}){var l,p,a,c;let m=(l=o==null?void 0:o.cookiePolicy)==null?void 0:l.siteName,n=(p=o==null?void 0:o.cookiePolicy)==null?void 0:p.cookiePolicyPage,C=((c=(a=o==null?void 0:o.cookiePolicy)==null?void 0:a.consentModal)==null?void 0:c.position)||"bottom right";return(0,M.useEffect)(()=>{var u,b;let P={categories:{necessary:{enabled:!0,readOnly:!0},analytics:{enabled:o==null?void 0:o.enableAnalytics}},guiOptions:{consentModal:{position:C}},language:{default:"en",translations:{en:{consentModal:{title:e,description:"Cookies help us deliver our services. By using our services, you agree to our use of cookies.",acceptAllBtn:s,acceptNecessaryBtn:i||"Reject all",showPreferencesBtn:"Manage Individual preferences"},preferencesModal:{title:"Cookie Preferences",acceptAllBtn:s,acceptNecessaryBtn:i||"Reject all",savePreferencesBtn:"Accept current selection",closeIconLabel:"Close",sections:[{title:e,description:r},{title:"Strictly Necessary cookies",description:`These cookies are essential for the proper functioning of this website. <a href=${d(n)} target=${n==null?void 0:n.linkTarget} rel=${(n==null?void 0:n.linkTarget)==="_blank"?"noopener noreferrer":""}>${(b=(u=o==null?void 0:o.cookiePolicy)==null?void 0:u.cookiePolicyPage)==null?void 0:b.label}</a>.`,linkedCategory:"necessary"},{title:"Analytics",description:"These cookies are used to track and measure the use of this website.",linkedCategory:"analytics"},{title:"More information",description:`For any queries in relation to ${m}'s policy on cookies and your choices, please <a href=${d(t)} target=${t==null?void 0:t.linkTarget} rel=${(t==null?void 0:t.linkTarget)==="_blank"?"noopener noreferrer":""}>${t==null?void 0:t.label}</a>.`}]}}}},hideFromBots:!1};x.run(P)},[]),(0,g.jsx)("div",{...y})}var M,x,g,T=h(()=>{"use strict";M=require("react"),x=q(require("vanilla-cookieconsent"));$();g=require("react/jsx-runtime")});var D={};v(D,{Cookies:()=>I});module.exports=z(D);var w=require("react"),_=require("react/jsx-runtime"),j={variant_a:(0,w.lazy)(()=>Promise.resolve().then(()=>(T(),A)))},R="Cookies",I=({data:e})=>{var o,t,y,m,n,C,l,p,a,c,P,u;let r=e==null?void 0:e.variant,s=r&&j[r],i={title:(t=(o=e==null?void 0:e.variants)==null?void 0:o.heading)!=null?t:void 0,description:(m=(y=e==null?void 0:e.variants)==null?void 0:y.description)!=null?m:void 0,allowCookieBtn:(C=(n=e==null?void 0:e.variants)==null?void 0:n.acceptButtonLabel)!=null?C:void 0,denyCookieBtn:(p=(l=e==null?void 0:e.variants)==null?void 0:l.declineButtonLabel)!=null?p:void 0,config:(c=(a=e==null?void 0:e.variants)==null?void 0:a.config)!=null?c:void 0,contactLink:(u=(P=e==null?void 0:e.variants)==null?void 0:P.contactLink)!=null?u:void 0};return s?(0,_.jsx)(s,{...i,"data-testid":R}):null};I.displayName=R;0&&(module.exports={Cookies});
1
+ "use strict";var N=Object.create;var P=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var R=Object.getOwnPropertyNames;var T=Object.getPrototypeOf,w=Object.prototype.hasOwnProperty;var I=(e,r)=>{for(var s in r)P(e,s,{get:r[s],enumerable:!0})},v=(e,r,s,i)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of R(r))!w.call(e,o)&&o!==s&&P(e,o,{get:()=>r[o],enumerable:!(i=g(r,o))||i.enumerable});return e};var _=(e,r,s)=>(s=e!=null?N(T(e)):{},v(r||!e||!e.__esModule?P(s,"default",{value:e,enumerable:!0}):s,e)),F=e=>v(P({},"__esModule",{value:!0}),e);var V={};I(V,{Cookies:()=>x});module.exports=F(V);var B=require("react"),$=_(require("vanilla-cookieconsent"));var b=e=>{var r,s;return!(e!=null&&e.internalLink)&&!(e!=null&&e.externalLink)?"/page-not-found":(e==null?void 0:e.type)==="linkInternal"&&((s=(r=e==null?void 0:e.internalLink)==null?void 0:r.toLowerCase())!=null&&s.includes("home"))?"/":(e==null?void 0:e.type)==="linkInternal"?`/${e==null?void 0:e.internalLink}`:(e==null?void 0:e.type)==="linkExternal"?`${e==null?void 0:e.externalLink}`:"/"};var M=require("react/jsx-runtime");function d({title:e,description:r,allowCookieBtn:s,denyCookieBtn:i,config:o,contactLink:t,...y}){var l,p,a,c;let m=(l=o==null?void 0:o.cookiePolicy)==null?void 0:l.siteName,n=(p=o==null?void 0:o.cookiePolicy)==null?void 0:p.cookiePolicyPage,C=((c=(a=o==null?void 0:o.cookiePolicy)==null?void 0:a.consentModal)==null?void 0:c.position)||"bottom right";return(0,B.useEffect)(()=>{var u,h;let f={categories:{necessary:{enabled:!0,readOnly:!0},analytics:{enabled:o==null?void 0:o.enableAnalytics}},guiOptions:{consentModal:{position:C}},language:{default:"en",translations:{en:{consentModal:{title:e,description:"Cookies help us deliver our services. By using our services, you agree to our use of cookies.",acceptAllBtn:s,acceptNecessaryBtn:i||"Reject all",showPreferencesBtn:"Manage Individual preferences"},preferencesModal:{title:"Cookie Preferences",acceptAllBtn:s,acceptNecessaryBtn:i||"Reject all",savePreferencesBtn:"Accept current selection",closeIconLabel:"Close",sections:[{title:e,description:r},{title:"Strictly Necessary cookies",description:`These cookies are essential for the proper functioning of this website. <a href=${b(n)} target=${n==null?void 0:n.linkTarget} rel=${(n==null?void 0:n.linkTarget)==="_blank"?"noopener noreferrer":""}>${(h=(u=o==null?void 0:o.cookiePolicy)==null?void 0:u.cookiePolicyPage)==null?void 0:h.label}</a>.`,linkedCategory:"necessary"},{title:"Analytics",description:"These cookies are used to track and measure the use of this website.",linkedCategory:"analytics"},{title:"More information",description:`For any queries in relation to ${m}'s policy on cookies and your choices, please <a href=${b(t)} target=${t==null?void 0:t.linkTarget} rel=${(t==null?void 0:t.linkTarget)==="_blank"?"noopener noreferrer":""}>${t==null?void 0:t.label}</a>.`}]}}}},hideFromBots:!1};$.run(f)},[]),(0,M.jsx)("div",{...y})}var O={variant_a:d},S="Cookies",x=({data:e})=>{var o,t,y,m,n,C,l,p,a,c,f,u;let r=e==null?void 0:e.variant,s=r&&O[r],i={title:(t=(o=e==null?void 0:e.variants)==null?void 0:o.heading)!=null?t:void 0,description:(m=(y=e==null?void 0:e.variants)==null?void 0:y.description)!=null?m:void 0,allowCookieBtn:(C=(n=e==null?void 0:e.variants)==null?void 0:n.acceptButtonLabel)!=null?C:void 0,denyCookieBtn:(p=(l=e==null?void 0:e.variants)==null?void 0:l.declineButtonLabel)!=null?p:void 0,config:(c=(a=e==null?void 0:e.variants)==null?void 0:a.config)!=null?c:void 0,contactLink:(u=(f=e==null?void 0:e.variants)==null?void 0:f.contactLink)!=null?u:void 0};return s?(0,M.jsx)(s,{...i}):null};x.displayName=S;0&&(module.exports={Cookies});
package/dist/cookies.mjs CHANGED
@@ -1 +1 @@
1
- import{a}from"./chunk-KWVTDBZB.mjs";export{a as Cookies};
1
+ import{a}from"./chunk-SPFCV7XJ.mjs";import"./chunk-UMU577IJ.mjs";import"./chunk-RHBXK4UI.mjs";export{a as Cookies};
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- "use strict";var F=Object.create;var P=Object.defineProperty;var O=Object.getOwnPropertyDescriptor;var S=Object.getOwnPropertyNames;var V=Object.getPrototypeOf,E=Object.prototype.hasOwnProperty;var B=(e,r)=>()=>(e&&(r=e(e=0)),r);var $=(e,r)=>{for(var s in r)P(e,s,{get:r[s],enumerable:!0})},x=(e,r,s,i)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of S(r))!E.call(e,o)&&o!==s&&P(e,o,{get:()=>r[o],enumerable:!(i=O(r,o))||i.enumerable});return e};var q=(e,r,s)=>(s=e!=null?F(V(e)):{},x(r||!e||!e.__esModule?P(s,"default",{value:e,enumerable:!0}):s,e)),z=e=>x(P({},"__esModule",{value:!0}),e);var d,M=B(()=>{"use strict";d=e=>{var r,s;return!(e!=null&&e.internalLink)&&!(e!=null&&e.externalLink)?"/page-not-found":(e==null?void 0:e.type)==="linkInternal"&&((s=(r=e==null?void 0:e.internalLink)==null?void 0:r.toLowerCase())!=null&&s.includes("home"))?"/":(e==null?void 0:e.type)==="linkInternal"?`/${e==null?void 0:e.internalLink}`:(e==null?void 0:e.type)==="linkExternal"?`${e==null?void 0:e.externalLink}`:"/"}});var g={};$(g,{Cookies_A:()=>b,default:()=>b});function b({title:e,description:r,allowCookieBtn:s,denyCookieBtn:i,config:o,contactLink:t,...y}){var l,p,a,c;let m=(l=o==null?void 0:o.cookiePolicy)==null?void 0:l.siteName,n=(p=o==null?void 0:o.cookiePolicy)==null?void 0:p.cookiePolicyPage,C=((c=(a=o==null?void 0:o.cookiePolicy)==null?void 0:a.consentModal)==null?void 0:c.position)||"bottom right";return(0,N.useEffect)(()=>{var u,v;let f={categories:{necessary:{enabled:!0,readOnly:!0},analytics:{enabled:o==null?void 0:o.enableAnalytics}},guiOptions:{consentModal:{position:C}},language:{default:"en",translations:{en:{consentModal:{title:e,description:"Cookies help us deliver our services. By using our services, you agree to our use of cookies.",acceptAllBtn:s,acceptNecessaryBtn:i||"Reject all",showPreferencesBtn:"Manage Individual preferences"},preferencesModal:{title:"Cookie Preferences",acceptAllBtn:s,acceptNecessaryBtn:i||"Reject all",savePreferencesBtn:"Accept current selection",closeIconLabel:"Close",sections:[{title:e,description:r},{title:"Strictly Necessary cookies",description:`These cookies are essential for the proper functioning of this website. <a href=${d(n)} target=${n==null?void 0:n.linkTarget} rel=${(n==null?void 0:n.linkTarget)==="_blank"?"noopener noreferrer":""}>${(v=(u=o==null?void 0:o.cookiePolicy)==null?void 0:u.cookiePolicyPage)==null?void 0:v.label}</a>.`,linkedCategory:"necessary"},{title:"Analytics",description:"These cookies are used to track and measure the use of this website.",linkedCategory:"analytics"},{title:"More information",description:`For any queries in relation to ${m}'s policy on cookies and your choices, please <a href=${d(t)} target=${t==null?void 0:t.linkTarget} rel=${(t==null?void 0:t.linkTarget)==="_blank"?"noopener noreferrer":""}>${t==null?void 0:t.label}</a>.`}]}}}},hideFromBots:!1};A.run(f)},[]),(0,T.jsx)("div",{...y})}var N,A,T,h=B(()=>{"use strict";N=require("react"),A=q(require("vanilla-cookieconsent"));M();T=require("react/jsx-runtime")});var D={};$(D,{Cookies:()=>I,Cookies_A:()=>b});module.exports=z(D);var w=require("react"),_=require("react/jsx-runtime"),j={variant_a:(0,w.lazy)(()=>Promise.resolve().then(()=>(h(),g)))},R="Cookies",I=({data:e})=>{var o,t,y,m,n,C,l,p,a,c,f,u;let r=e==null?void 0:e.variant,s=r&&j[r],i={title:(t=(o=e==null?void 0:e.variants)==null?void 0:o.heading)!=null?t:void 0,description:(m=(y=e==null?void 0:e.variants)==null?void 0:y.description)!=null?m:void 0,allowCookieBtn:(C=(n=e==null?void 0:e.variants)==null?void 0:n.acceptButtonLabel)!=null?C:void 0,denyCookieBtn:(p=(l=e==null?void 0:e.variants)==null?void 0:l.declineButtonLabel)!=null?p:void 0,config:(c=(a=e==null?void 0:e.variants)==null?void 0:a.config)!=null?c:void 0,contactLink:(u=(f=e==null?void 0:e.variants)==null?void 0:f.contactLink)!=null?u:void 0};return s?(0,_.jsx)(s,{...i,"data-testid":R}):null};I.displayName=R;h();0&&(module.exports={Cookies,Cookies_A});
2
+ "use strict";var N=Object.create;var P=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var R=Object.getOwnPropertyNames;var T=Object.getPrototypeOf,w=Object.prototype.hasOwnProperty;var I=(e,r)=>{for(var s in r)P(e,s,{get:r[s],enumerable:!0})},v=(e,r,s,i)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of R(r))!w.call(e,o)&&o!==s&&P(e,o,{get:()=>r[o],enumerable:!(i=g(r,o))||i.enumerable});return e};var _=(e,r,s)=>(s=e!=null?N(T(e)):{},v(r||!e||!e.__esModule?P(s,"default",{value:e,enumerable:!0}):s,e)),F=e=>v(P({},"__esModule",{value:!0}),e);var V={};I(V,{Cookies:()=>M,Cookies_A:()=>b});module.exports=F(V);var B=require("react"),$=_(require("vanilla-cookieconsent"));var d=e=>{var r,s;return!(e!=null&&e.internalLink)&&!(e!=null&&e.externalLink)?"/page-not-found":(e==null?void 0:e.type)==="linkInternal"&&((s=(r=e==null?void 0:e.internalLink)==null?void 0:r.toLowerCase())!=null&&s.includes("home"))?"/":(e==null?void 0:e.type)==="linkInternal"?`/${e==null?void 0:e.internalLink}`:(e==null?void 0:e.type)==="linkExternal"?`${e==null?void 0:e.externalLink}`:"/"};var x=require("react/jsx-runtime");function b({title:e,description:r,allowCookieBtn:s,denyCookieBtn:i,config:o,contactLink:t,...y}){var p,l,a,c;let m=(p=o==null?void 0:o.cookiePolicy)==null?void 0:p.siteName,n=(l=o==null?void 0:o.cookiePolicy)==null?void 0:l.cookiePolicyPage,C=((c=(a=o==null?void 0:o.cookiePolicy)==null?void 0:a.consentModal)==null?void 0:c.position)||"bottom right";return(0,B.useEffect)(()=>{var u,h;let f={categories:{necessary:{enabled:!0,readOnly:!0},analytics:{enabled:o==null?void 0:o.enableAnalytics}},guiOptions:{consentModal:{position:C}},language:{default:"en",translations:{en:{consentModal:{title:e,description:"Cookies help us deliver our services. By using our services, you agree to our use of cookies.",acceptAllBtn:s,acceptNecessaryBtn:i||"Reject all",showPreferencesBtn:"Manage Individual preferences"},preferencesModal:{title:"Cookie Preferences",acceptAllBtn:s,acceptNecessaryBtn:i||"Reject all",savePreferencesBtn:"Accept current selection",closeIconLabel:"Close",sections:[{title:e,description:r},{title:"Strictly Necessary cookies",description:`These cookies are essential for the proper functioning of this website. <a href=${d(n)} target=${n==null?void 0:n.linkTarget} rel=${(n==null?void 0:n.linkTarget)==="_blank"?"noopener noreferrer":""}>${(h=(u=o==null?void 0:o.cookiePolicy)==null?void 0:u.cookiePolicyPage)==null?void 0:h.label}</a>.`,linkedCategory:"necessary"},{title:"Analytics",description:"These cookies are used to track and measure the use of this website.",linkedCategory:"analytics"},{title:"More information",description:`For any queries in relation to ${m}'s policy on cookies and your choices, please <a href=${d(t)} target=${t==null?void 0:t.linkTarget} rel=${(t==null?void 0:t.linkTarget)==="_blank"?"noopener noreferrer":""}>${t==null?void 0:t.label}</a>.`}]}}}},hideFromBots:!1};$.run(f)},[]),(0,x.jsx)("div",{...y})}var O={variant_a:b},S="Cookies",M=({data:e})=>{var o,t,y,m,n,C,p,l,a,c,f,u;let r=e==null?void 0:e.variant,s=r&&O[r],i={title:(t=(o=e==null?void 0:e.variants)==null?void 0:o.heading)!=null?t:void 0,description:(m=(y=e==null?void 0:e.variants)==null?void 0:y.description)!=null?m:void 0,allowCookieBtn:(C=(n=e==null?void 0:e.variants)==null?void 0:n.acceptButtonLabel)!=null?C:void 0,denyCookieBtn:(l=(p=e==null?void 0:e.variants)==null?void 0:p.declineButtonLabel)!=null?l:void 0,config:(c=(a=e==null?void 0:e.variants)==null?void 0:a.config)!=null?c:void 0,contactLink:(u=(f=e==null?void 0:e.variants)==null?void 0:f.contactLink)!=null?u:void 0};return s?(0,x.jsx)(s,{...i}):null};M.displayName=S;0&&(module.exports={Cookies,Cookies_A});
package/dist/index.mjs CHANGED
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- "use strict";import{a as o}from"./chunk-KWVTDBZB.mjs";import{a as e}from"./chunk-UMU577IJ.mjs";import"./chunk-RHBXK4UI.mjs";export{o as Cookies,e as Cookies_A};
2
+ "use strict";import{a as o}from"./chunk-SPFCV7XJ.mjs";import{a as e}from"./chunk-UMU577IJ.mjs";import"./chunk-RHBXK4UI.mjs";export{o as Cookies,e as Cookies_A};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stackshift-ui/cookies",
3
3
  "description": "",
4
- "version": "7.0.0-beta.0",
4
+ "version": "7.0.0-beta.3",
5
5
  "private": false,
6
6
  "sideEffects": false,
7
7
  "main": "./dist/index.js",
@@ -29,16 +29,16 @@
29
29
  "typescript": "^5.6.2",
30
30
  "vite-tsconfig-paths": "^5.0.1",
31
31
  "vitest": "^2.1.1",
32
- "@stackshift-ui/eslint-config": "6.0.10",
33
- "@stackshift-ui/typescript-config": "6.0.10"
32
+ "@stackshift-ui/typescript-config": "6.0.10",
33
+ "@stackshift-ui/eslint-config": "6.0.10"
34
34
  },
35
35
  "dependencies": {
36
36
  "vanilla-cookieconsent": "3.0.1",
37
- "@stackshift-ui/scripts": "6.1.0-beta.0",
38
- "@stackshift-ui/system": "6.1.0-beta.0"
37
+ "@stackshift-ui/system": "6.1.0-beta.3",
38
+ "@stackshift-ui/scripts": "6.1.0-beta.2"
39
39
  },
40
40
  "peerDependencies": {
41
- "@stackshift-ui/system": ">=6.1.0-beta.0",
41
+ "@stackshift-ui/system": ">=6.1.0-beta.3",
42
42
  "@types/react": "16.8 - 19",
43
43
  "next": "10 - 14",
44
44
  "react": "16.8 - 19",
package/src/cookies.tsx CHANGED
@@ -1,13 +1,13 @@
1
1
  // Cookie Consent for GDPR (using Orestbida)
2
2
  // https://cookieconsent.orestbida.com/
3
3
 
4
- import { lazy } from "react";
5
-
4
+ import React from "react";
6
5
  import { ConsentModalPosition } from "vanilla-cookieconsent";
6
+ import CookiesA from "./cookies_a";
7
7
  import { SectionsProps } from "./types";
8
8
 
9
9
  const Variants = {
10
- variant_a: lazy(() => import("./cookies_a")),
10
+ variant_a: CookiesA,
11
11
  };
12
12
 
13
13
  export interface CookiesProps {
@@ -1 +0,0 @@
1
- import{lazy as v}from"react";import{jsx as L}from"react/jsx-runtime";var P={variant_a:v(()=>import("./cookies_a.mjs"))},m="Cookies",B=({data:n})=>{var e,s,r,t,c,l,p,f,k,y,g,C;let o=n==null?void 0:n.variant,i=o&&P[o],u={title:(s=(e=n==null?void 0:n.variants)==null?void 0:e.heading)!=null?s:void 0,description:(t=(r=n==null?void 0:n.variants)==null?void 0:r.description)!=null?t:void 0,allowCookieBtn:(l=(c=n==null?void 0:n.variants)==null?void 0:c.acceptButtonLabel)!=null?l:void 0,denyCookieBtn:(f=(p=n==null?void 0:n.variants)==null?void 0:p.declineButtonLabel)!=null?f:void 0,config:(y=(k=n==null?void 0:n.variants)==null?void 0:k.config)!=null?y:void 0,contactLink:(C=(g=n==null?void 0:n.variants)==null?void 0:g.contactLink)!=null?C:void 0};return i?L(i,{...u,"data-testid":m}):null};B.displayName=m;export{B as a};