@shipsite.dev/components 0.2.10 → 0.2.12
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeProvider.d.ts","sourceRoot":"","sources":["../../src/context/ThemeProvider.tsx"],"names":[],"mappings":"AAEA,OAAO,
|
|
1
|
+
{"version":3,"file":"ThemeProvider.d.ts","sourceRoot":"","sources":["../../src/context/ThemeProvider.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,wBAAgB,aAAa,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,2CAUxE"}
|
|
@@ -1,15 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import {
|
|
3
|
-
import { useEffect, useState } from 'react';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
3
|
import { ThemeProvider as NextThemeProvider } from 'next-themes';
|
|
5
4
|
export function ThemeProvider({ children }) {
|
|
6
|
-
|
|
7
|
-
useEffect(() => {
|
|
8
|
-
setMounted(true);
|
|
9
|
-
}, []);
|
|
10
|
-
if (!mounted) {
|
|
11
|
-
return _jsx(_Fragment, { children: children });
|
|
12
|
-
}
|
|
13
|
-
return (_jsx(NextThemeProvider, { attribute: "class", defaultTheme: "dark", enableSystem: true, children: children }));
|
|
5
|
+
return (_jsx(NextThemeProvider, { attribute: "class", defaultTheme: "system", enableSystem: true, children: children }));
|
|
14
6
|
}
|
|
15
7
|
//# sourceMappingURL=ThemeProvider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeProvider.js","sourceRoot":"","sources":["../../src/context/ThemeProvider.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;
|
|
1
|
+
{"version":3,"file":"ThemeProvider.js","sourceRoot":"","sources":["../../src/context/ThemeProvider.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAGb,OAAO,EAAE,aAAa,IAAI,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEjE,MAAM,UAAU,aAAa,CAAC,EAAE,QAAQ,EAAiC;IACvE,OAAO,CACL,KAAC,iBAAiB,IAChB,SAAS,EAAC,OAAO,EACjB,YAAY,EAAC,QAAQ,EACrB,YAAY,kBAEX,QAAQ,GACS,CACrB,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,23 +1,13 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import React
|
|
3
|
+
import React from 'react';
|
|
4
4
|
import { ThemeProvider as NextThemeProvider } from 'next-themes';
|
|
5
5
|
|
|
6
6
|
export function ThemeProvider({ children }: { children: React.ReactNode }) {
|
|
7
|
-
const [mounted, setMounted] = useState(false);
|
|
8
|
-
|
|
9
|
-
useEffect(() => {
|
|
10
|
-
setMounted(true);
|
|
11
|
-
}, []);
|
|
12
|
-
|
|
13
|
-
if (!mounted) {
|
|
14
|
-
return <>{children}</>;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
7
|
return (
|
|
18
8
|
<NextThemeProvider
|
|
19
9
|
attribute="class"
|
|
20
|
-
defaultTheme="
|
|
10
|
+
defaultTheme="system"
|
|
21
11
|
enableSystem
|
|
22
12
|
>
|
|
23
13
|
{children}
|