Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

nextjs-darkmode

Package Overview
Dependencies
Maintainers
0
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nextjs-darkmode - npm Package Compare versions

Comparing version 1.0.4 to 1.0.5

dist/chunk-CGEMVPIM.mjs

5

dist/client/core/core.d.ts

@@ -13,3 +13,2 @@ export interface CoreProps {

* The Core component wich applies classes and transitions.
* Cookies are set only if corresponding ServerTarget is detected.
*

@@ -20,5 +19,3 @@ * @example

* ```
*
* @source - Source code
*/
export declare const Core: ({ t, nonce, k }: CoreProps) => import("react/jsx-runtime").JSX.Element;
export declare const Core: (props: CoreProps) => import("react/jsx-runtime").JSX.Element;

2

dist/client/core/core.js

@@ -1,1 +0,1 @@

"use strict";var l=Object.defineProperty;var x=Object.getOwnPropertyDescriptor;var E=Object.getOwnPropertyNames;var M=Object.prototype.hasOwnProperty;var T=(t,e)=>{for(var o in e)l(t,o,{get:e[o],enumerable:!0})},w=(t,e,o,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of E(e))!M.call(t,r)&&r!==o&&l(t,r,{get:()=>e[r],enumerable:!(n=x(e,r))||n.enumerable});return t};var L=t=>w(l({},"__esModule",{value:!0}),t);var D={};T(D,{Core:()=>k});module.exports=L(D);var S="system",a="dark",v="";var C=require("r18gs");var g=()=>(0,C.useRGS)("ndm",()=>{var e;if(typeof document=="undefined")return{m:S,s:a};let t=document.documentElement;return{m:(e=t.getAttribute("data-m"))!=null?e:S,s:t.getAttribute("data-sm")}});var i=require("react");var p=t=>{var n;let[e,o]=["system","dark"];window.u=(r,c)=>{let s=r===e?c:r,d=document.documentElement;s===o?d.classList.add(o):d.classList.remove(o),[["sm",c],["rm",s],["m",r]].forEach(([P,R])=>d.setAttribute(`data-${P}`,R)),localStorage.setItem(t,r)},window.m=matchMedia(`(prefers-color-scheme: ${o})`),u((n=localStorage.getItem(t))!=null?n:e,m.matches?o:"")};var h=require("react/jsx-runtime"),f,y,A=(0,i.memo)(({n:t,k:e})=>(0,h.jsx)("script",{suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${p.toString()})('${e}')`},nonce:t}),()=>!1),b=(t="none",e="")=>{let o=document.createElement("style");return o.textContent=`*,*:after,*:before{transition:${t.split(";")[0]} !important;}`,e&&o.setAttribute("nonce",e),document.head.appendChild(o),()=>{getComputedStyle(document.body),setTimeout(()=>document.head.removeChild(o),1)}},k=({t,nonce:e,k:o="o"})=>{typeof window!="undefined"&&!window.m&&p(o);let[{m:n,s:r},c]=g();return(0,i.useEffect)(()=>{[f,y]=[m,u],f.addEventListener("change",()=>c(s=>({...s,s:f.matches?a:v}))),addEventListener("storage",s=>{s.key===o&&c(d=>({...d,m:s.newValue}))})},[]),(0,i.useEffect)(()=>{let s=b(t,e);y(n,r),s()},[r,n,t,e]),(0,h.jsx)(A,{n:e,k:o})};0&&(module.exports={Core});
"use strict";var a=Object.defineProperty;var x=Object.getOwnPropertyDescriptor;var E=Object.getOwnPropertyNames;var M=Object.prototype.hasOwnProperty;var T=(o,e)=>{for(var t in e)a(o,t,{get:e[t],enumerable:!0})},w=(o,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of E(e))!M.call(o,r)&&r!==t&&a(o,r,{get:()=>e[r],enumerable:!(n=x(e,r))||n.enumerable});return o};var L=o=>w(a({},"__esModule",{value:!0}),o);var I={};T(I,{Core:()=>D});module.exports=L(I);var S="system",l="dark",C="";var v=require("r18gs");var P=()=>(0,v.useRGS)("ndm",()=>{var e;if(typeof document=="undefined")return{m:S,s:l};let o=document.documentElement;return{m:(e=o.getAttribute("data-m"))!=null?e:S,s:o.getAttribute("data-sm")}});var f=require("react");var p=o=>{var n;let[e,t]=["system","dark"];window.u=(r,d)=>{let s=r===e?d:r,i=document.documentElement;s===t?i.classList.add(t):i.classList.remove(t),[["sm",d],["rm",s],["m",r]].forEach(([R,g])=>i.setAttribute(`data-${R}`,g)),localStorage.setItem(o,r)},window.m=matchMedia(`(prefers-color-scheme: ${t})`),u((n=localStorage.getItem(o))!=null?n:e,m.matches?t:"")};var c=require("react/jsx-runtime"),h,y,A=({nonce:o,k:e})=>(0,c.jsx)("script",{dangerouslySetInnerHTML:{__html:`(${p})('${e}')`},nonce:o}),b=(o="none",e)=>{let t=document.createElement("style");return t.textContent=`*,*:after,*:before{transition:${o.split(";")[0]} !important;}`,e&&t.setAttribute("nonce",e),document.head.appendChild(t),()=>{getComputedStyle(document.body),setTimeout(()=>document.head.removeChild(t),1)}},k=({t:o,nonce:e,k:t})=>{typeof window!="undefined"&&!window.m&&p(t);let[{m:n,s:r},d]=P();return(0,f.useEffect)(()=>{[h,y]=[m,u],h.addEventListener("change",()=>d(s=>({...s,s:h.matches?l:C}))),addEventListener("storage",s=>{s.key===t&&d(i=>({...i,m:s.newValue}))})},[]),(0,f.useEffect)(()=>{let s=b(o,e);y(n,r),s()},[r,n,o,e]),null},D=o=>{let e={...o,k:"o"};return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(k,{...e}),(0,c.jsx)(A,{...e})]})};0&&(module.exports={Core});
"use client";
"use strict";var l=Object.defineProperty;var x=Object.getOwnPropertyDescriptor;var E=Object.getOwnPropertyNames;var M=Object.prototype.hasOwnProperty;var T=(t,e)=>{for(var o in e)l(t,o,{get:e[o],enumerable:!0})},w=(t,e,o,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of E(e))!M.call(t,r)&&r!==o&&l(t,r,{get:()=>e[r],enumerable:!(n=x(e,r))||n.enumerable});return t};var L=t=>w(l({},"__esModule",{value:!0}),t);var D={};T(D,{Core:()=>k});module.exports=L(D);var S="system",a="dark",v="";var C=require("r18gs");var g=()=>(0,C.useRGS)("ndm",()=>{var e;if(typeof document=="undefined")return{m:S,s:a};let t=document.documentElement;return{m:(e=t.getAttribute("data-m"))!=null?e:S,s:t.getAttribute("data-sm")}});var i=require("react");var p=t=>{var n;let[e,o]=["system","dark"];window.u=(r,c)=>{let s=r===e?c:r,d=document.documentElement;s===o?d.classList.add(o):d.classList.remove(o),[["sm",c],["rm",s],["m",r]].forEach(([P,R])=>d.setAttribute(`data-${P}`,R)),localStorage.setItem(t,r)},window.m=matchMedia(`(prefers-color-scheme: ${o})`),u((n=localStorage.getItem(t))!=null?n:e,m.matches?o:"")};var h=require("react/jsx-runtime"),f,y,A=(0,i.memo)(({n:t,k:e})=>(0,h.jsx)("script",{suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${p.toString()})('${e}')`},nonce:t}),()=>!1),b=(t="none",e="")=>{let o=document.createElement("style");return o.textContent=`*,*:after,*:before{transition:${t.split(";")[0]} !important;}`,e&&o.setAttribute("nonce",e),document.head.appendChild(o),()=>{getComputedStyle(document.body),setTimeout(()=>document.head.removeChild(o),1)}},k=({t,nonce:e,k:o="o"})=>{typeof window!="undefined"&&!window.m&&p(o);let[{m:n,s:r},c]=g();return(0,i.useEffect)(()=>{[f,y]=[m,u],f.addEventListener("change",()=>c(s=>({...s,s:f.matches?a:v}))),addEventListener("storage",s=>{s.key===o&&c(d=>({...d,m:s.newValue}))})},[]),(0,i.useEffect)(()=>{let s=b(t,e);y(n,r),s()},[r,n,t,e]),(0,h.jsx)(A,{n:e,k:o})};0&&(module.exports={Core});
"use strict";var a=Object.defineProperty;var x=Object.getOwnPropertyDescriptor;var E=Object.getOwnPropertyNames;var M=Object.prototype.hasOwnProperty;var T=(o,e)=>{for(var t in e)a(o,t,{get:e[t],enumerable:!0})},w=(o,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of E(e))!M.call(o,r)&&r!==t&&a(o,r,{get:()=>e[r],enumerable:!(n=x(e,r))||n.enumerable});return o};var L=o=>w(a({},"__esModule",{value:!0}),o);var I={};T(I,{Core:()=>D});module.exports=L(I);var S="system",l="dark",C="";var v=require("r18gs");var P=()=>(0,v.useRGS)("ndm",()=>{var e;if(typeof document=="undefined")return{m:S,s:l};let o=document.documentElement;return{m:(e=o.getAttribute("data-m"))!=null?e:S,s:o.getAttribute("data-sm")}});var h=require("react");var p=o=>{var n;let[e,t]=["system","dark"];window.u=(r,d)=>{let s=r===e?d:r,i=document.documentElement;s===t?i.classList.add(t):i.classList.remove(t),[["sm",d],["rm",s],["m",r]].forEach(([R,g])=>i.setAttribute(`data-${R}`,g)),localStorage.setItem(o,r)},window.m=matchMedia(`(prefers-color-scheme: ${t})`),u((n=localStorage.getItem(o))!=null?n:e,m.matches?t:"")};var c=require("react/jsx-runtime"),f,y,A=({nonce:o,k:e})=>(0,c.jsx)("script",{dangerouslySetInnerHTML:{__html:`(${p})('${e}')`},nonce:o}),b=(o="none",e)=>{let t=document.createElement("style");return t.textContent=`*,*:after,*:before{transition:${o.split(";")[0]} !important;}`,e&&t.setAttribute("nonce",e),document.head.appendChild(t),()=>{getComputedStyle(document.body),setTimeout(()=>document.head.removeChild(t),1)}},k=({t:o,nonce:e,k:t})=>{typeof window!="undefined"&&!window.m&&p(t);let[{m:n,s:r},d]=P();return(0,h.useEffect)(()=>{[f,y]=[m,u],f.addEventListener("change",()=>d(s=>({...s,s:f.matches?l:C}))),addEventListener("storage",s=>{s.key===t&&d(i=>({...i,m:s.newValue}))})},[]),(0,h.useEffect)(()=>{let s=b(o,e);y(n,r),s()},[r,n,o,e]),null},D=o=>{let e={...o,k:"o"};return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(k,{...e}),(0,c.jsx)(A,{...e})]})};0&&(module.exports={Core});
"use client";
"use strict";var l=Object.defineProperty;var x=Object.getOwnPropertyDescriptor;var E=Object.getOwnPropertyNames;var M=Object.prototype.hasOwnProperty;var T=(t,e)=>{for(var o in e)l(t,o,{get:e[o],enumerable:!0})},w=(t,e,o,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of E(e))!M.call(t,r)&&r!==o&&l(t,r,{get:()=>e[r],enumerable:!(n=x(e,r))||n.enumerable});return t};var L=t=>w(l({},"__esModule",{value:!0}),t);var D={};T(D,{Core:()=>k});module.exports=L(D);var S="system",a="dark",v="";var C=require("r18gs");var g=()=>(0,C.useRGS)("ndm",()=>{var e;if(typeof document=="undefined")return{m:S,s:a};let t=document.documentElement;return{m:(e=t.getAttribute("data-m"))!=null?e:S,s:t.getAttribute("data-sm")}});var i=require("react");var p=t=>{var n;let[e,o]=["system","dark"];window.u=(r,c)=>{let s=r===e?c:r,d=document.documentElement;s===o?d.classList.add(o):d.classList.remove(o),[["sm",c],["rm",s],["m",r]].forEach(([P,R])=>d.setAttribute(`data-${P}`,R)),localStorage.setItem(t,r)},window.m=matchMedia(`(prefers-color-scheme: ${o})`),u((n=localStorage.getItem(t))!=null?n:e,m.matches?o:"")};var h=require("react/jsx-runtime"),f,y,A=(0,i.memo)(({n:t,k:e})=>(0,h.jsx)("script",{suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${p.toString()})('${e}')`},nonce:t}),()=>!1),b=(t="none",e="")=>{let o=document.createElement("style");return o.textContent=`*,*:after,*:before{transition:${t.split(";")[0]} !important;}`,e&&o.setAttribute("nonce",e),document.head.appendChild(o),()=>{getComputedStyle(document.body),setTimeout(()=>document.head.removeChild(o),1)}},k=({t,nonce:e,k:o="o"})=>{typeof window!="undefined"&&!window.m&&p(o);let[{m:n,s:r},c]=g();return(0,i.useEffect)(()=>{[f,y]=[m,u],f.addEventListener("change",()=>c(s=>({...s,s:f.matches?a:v}))),addEventListener("storage",s=>{s.key===o&&c(d=>({...d,m:s.newValue}))})},[]),(0,i.useEffect)(()=>{let s=b(t,e);y(n,r),s()},[r,n,t,e]),(0,h.jsx)(A,{n:e,k:o})};0&&(module.exports={Core});
"use strict";var a=Object.defineProperty;var x=Object.getOwnPropertyDescriptor;var E=Object.getOwnPropertyNames;var M=Object.prototype.hasOwnProperty;var T=(o,e)=>{for(var t in e)a(o,t,{get:e[t],enumerable:!0})},w=(o,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of E(e))!M.call(o,r)&&r!==t&&a(o,r,{get:()=>e[r],enumerable:!(n=x(e,r))||n.enumerable});return o};var L=o=>w(a({},"__esModule",{value:!0}),o);var I={};T(I,{Core:()=>D});module.exports=L(I);var S="system",l="dark",C="";var v=require("r18gs");var P=()=>(0,v.useRGS)("ndm",()=>{var e;if(typeof document=="undefined")return{m:S,s:l};let o=document.documentElement;return{m:(e=o.getAttribute("data-m"))!=null?e:S,s:o.getAttribute("data-sm")}});var h=require("react");var p=o=>{var n;let[e,t]=["system","dark"];window.u=(r,d)=>{let s=r===e?d:r,i=document.documentElement;s===t?i.classList.add(t):i.classList.remove(t),[["sm",d],["rm",s],["m",r]].forEach(([R,g])=>i.setAttribute(`data-${R}`,g)),localStorage.setItem(o,r)},window.m=matchMedia(`(prefers-color-scheme: ${t})`),u((n=localStorage.getItem(o))!=null?n:e,m.matches?t:"")};var c=require("react/jsx-runtime"),f,y,A=({nonce:o,k:e})=>(0,c.jsx)("script",{dangerouslySetInnerHTML:{__html:`(${p})('${e}')`},nonce:o}),b=(o="none",e)=>{let t=document.createElement("style");return t.textContent=`*,*:after,*:before{transition:${o.split(";")[0]} !important;}`,e&&t.setAttribute("nonce",e),document.head.appendChild(t),()=>{getComputedStyle(document.body),setTimeout(()=>document.head.removeChild(t),1)}},k=({t:o,nonce:e,k:t})=>{typeof window!="undefined"&&!window.m&&p(t);let[{m:n,s:r},d]=P();return(0,h.useEffect)(()=>{[f,y]=[m,u],f.addEventListener("change",()=>d(s=>({...s,s:f.matches?l:C}))),addEventListener("storage",s=>{s.key===t&&d(i=>({...i,m:s.newValue}))})},[]),(0,h.useEffect)(()=>{let s=b(o,e);y(n,r),s()},[r,n,o,e]),null},D=o=>{let e={...o,k:"o"};return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(k,{...e}),(0,c.jsx)(A,{...e})]})};0&&(module.exports={Core});
"use client";
"use strict";var l=Object.defineProperty;var x=Object.getOwnPropertyDescriptor;var E=Object.getOwnPropertyNames;var M=Object.prototype.hasOwnProperty;var T=(o,e)=>{for(var t in e)l(o,t,{get:e[t],enumerable:!0})},w=(o,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of E(e))!M.call(o,r)&&r!==t&&l(o,r,{get:()=>e[r],enumerable:!(n=x(e,r))||n.enumerable});return o};var L=o=>w(l({},"__esModule",{value:!0}),o);var D={};T(D,{Core:()=>k});module.exports=L(D);var S="system",a="dark",v="";var C=require("r18gs");var g=()=>(0,C.useRGS)("ndm",()=>{var e;if(typeof document=="undefined")return{m:S,s:a};let o=document.documentElement;return{m:(e=o.getAttribute("data-m"))!=null?e:S,s:o.getAttribute("data-sm")}});var i=require("react");var p=o=>{var n;let[e,t]=["system","dark"];window.u=(r,c)=>{let s=r===e?c:r,d=document.documentElement;s===t?d.classList.add(t):d.classList.remove(t),[["sm",c],["rm",s],["m",r]].forEach(([P,R])=>d.setAttribute(`data-${P}`,R)),localStorage.setItem(o,r)},window.m=matchMedia(`(prefers-color-scheme: ${t})`),u((n=localStorage.getItem(o))!=null?n:e,m.matches?t:"")};var h=require("react/jsx-runtime"),f,y,A=(0,i.memo)(({n:o,k:e})=>(0,h.jsx)("script",{suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${p.toString()})('${e}')`},nonce:o}),()=>!1),b=(o="none",e="")=>{let t=document.createElement("style");return t.textContent=`*,*:after,*:before{transition:${o.split(";")[0]} !important;}`,e&&t.setAttribute("nonce",e),document.head.appendChild(t),()=>{getComputedStyle(document.body),setTimeout(()=>document.head.removeChild(t),1)}},k=({t:o,nonce:e,k:t="o"})=>{typeof window!="undefined"&&!window.m&&p(t);let[{m:n,s:r},c]=g();return(0,i.useEffect)(()=>{[f,y]=[m,u],f.addEventListener("change",()=>c(s=>({...s,s:f.matches?a:v}))),addEventListener("storage",s=>{s.key===t&&c(d=>({...d,m:s.newValue}))})},[]),(0,i.useEffect)(()=>{let s=b(o,e);y(n,r),s()},[r,n,o,e]),(0,h.jsx)(A,{n:e,k:t})};0&&(module.exports={Core});
"use strict";var a=Object.defineProperty;var x=Object.getOwnPropertyDescriptor;var E=Object.getOwnPropertyNames;var M=Object.prototype.hasOwnProperty;var T=(o,e)=>{for(var t in e)a(o,t,{get:e[t],enumerable:!0})},w=(o,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of E(e))!M.call(o,r)&&r!==t&&a(o,r,{get:()=>e[r],enumerable:!(n=x(e,r))||n.enumerable});return o};var L=o=>w(a({},"__esModule",{value:!0}),o);var I={};T(I,{Core:()=>D});module.exports=L(I);var S="system",l="dark",C="";var v=require("r18gs");var P=()=>(0,v.useRGS)("ndm",()=>{var e;if(typeof document=="undefined")return{m:S,s:l};let o=document.documentElement;return{m:(e=o.getAttribute("data-m"))!=null?e:S,s:o.getAttribute("data-sm")}});var h=require("react");var p=o=>{var n;let[e,t]=["system","dark"];window.u=(r,d)=>{let s=r===e?d:r,i=document.documentElement;s===t?i.classList.add(t):i.classList.remove(t),[["sm",d],["rm",s],["m",r]].forEach(([R,g])=>i.setAttribute(`data-${R}`,g)),localStorage.setItem(o,r)},window.m=matchMedia(`(prefers-color-scheme: ${t})`),u((n=localStorage.getItem(o))!=null?n:e,m.matches?t:"")};var c=require("react/jsx-runtime"),f,y,A=({nonce:o,k:e})=>(0,c.jsx)("script",{dangerouslySetInnerHTML:{__html:`(${p})('${e}')`},nonce:o}),b=(o="none",e)=>{let t=document.createElement("style");return t.textContent=`*,*:after,*:before{transition:${o.split(";")[0]} !important;}`,e&&t.setAttribute("nonce",e),document.head.appendChild(t),()=>{getComputedStyle(document.body),setTimeout(()=>document.head.removeChild(t),1)}},k=({t:o,nonce:e,k:t})=>{typeof window!="undefined"&&!window.m&&p(t);let[{m:n,s:r},d]=P();return(0,h.useEffect)(()=>{[f,y]=[m,u],f.addEventListener("change",()=>d(s=>({...s,s:f.matches?l:C}))),addEventListener("storage",s=>{s.key===t&&d(i=>({...i,m:s.newValue}))})},[]),(0,h.useEffect)(()=>{let s=b(o,e);y(n,r),s()},[r,n,o,e]),null},D=o=>{let e={...o,k:"o"};return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(k,{...e}),(0,c.jsx)(A,{...e})]})};0&&(module.exports={Core});

@@ -5,3 +5,3 @@ {

"private": false,
"version": "1.0.4",
"version": "1.0.5",
"description": "Unleash the Power of React Server Components! Use dark/light mode on your site with confidence, without losing any advantages of React Server Components",

@@ -61,3 +61,3 @@ "license": "MPL-2.0",

"@testing-library/react": "^16.0.0",
"@types/node": "^20.14.7",
"@types/node": "^20.14.8",
"@types/react": "^18.3.3",

@@ -64,0 +64,0 @@ "@types/react-dom": "^18.3.0",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc