@lotte-innovate/ui-component-test 0.2.67 → 0.2.68
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/lib/components/Tree/index.js +1 -1
- package/dist/lib/components/Tree/index.mjs +1 -1
- package/dist/lib/components/Tree/index.mjs.map +1 -1
- package/dist/lib/tsconfig.tsbuildinfo +1 -1
- package/dist/lib/utils/useDarkMode.js +10 -12
- package/dist/lib/utils/useDarkMode.mjs +1 -1
- package/dist/lib/utils/useWindowSize.js +1 -3
- package/dist/lib/utils/useWindowSize.mjs +1 -1
- package/dist/lib/utils/useWindowSize.mjs.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
@@ -23,30 +23,28 @@ export var useDarkMode = function (isRAxes) {
|
|
23
23
|
y: { grid: { color: slateDarkA[8] } },
|
24
24
|
};
|
25
25
|
}
|
26
|
-
var _a = useState(
|
26
|
+
var _a = useState(checkDarkMode()), isDarkMode = _a[0], setIsDarkMode = _a[1];
|
27
27
|
var _b = useState({
|
28
28
|
linescale: {},
|
29
29
|
}), defaultOptions = _b[0], setDefaultOptions = _b[1];
|
30
|
+
function checkDarkMode() {
|
31
|
+
return document.body.classList.contains('dark');
|
32
|
+
}
|
30
33
|
useEffect(function () {
|
31
|
-
|
32
|
-
|
33
|
-
setDefaultOptions({
|
34
|
-
linescale: !((_b = document === null || document === void 0 ? void 0 : document.body) === null || _b === void 0 ? void 0 : _b.classList.contains('dark')) ? lightmode : darkmode,
|
35
|
-
});
|
34
|
+
setIsDarkMode(checkDarkMode());
|
35
|
+
setDefaultOptions({ linescale: !checkDarkMode() ? lightmode : darkmode });
|
36
36
|
var mutationObserver = new MutationObserver(function (mutations) {
|
37
37
|
mutations.forEach(function (mutation) {
|
38
38
|
if (mutation.attributeName === 'class') {
|
39
|
-
setIsDarkMode(
|
40
|
-
setDefaultOptions({
|
41
|
-
linescale: !(document === null || document === void 0 ? void 0 : document.body.classList.contains('dark')) ? lightmode : darkmode,
|
42
|
-
});
|
39
|
+
setIsDarkMode(checkDarkMode());
|
40
|
+
setDefaultOptions({ linescale: !checkDarkMode() ? lightmode : darkmode });
|
43
41
|
}
|
44
42
|
});
|
45
43
|
});
|
46
|
-
|
44
|
+
mutationObserver.observe(document.body, { attributes: true });
|
47
45
|
return function () {
|
48
46
|
mutationObserver.disconnect();
|
49
47
|
};
|
50
|
-
}, [
|
48
|
+
}, []);
|
51
49
|
return [isDarkMode, defaultOptions];
|
52
50
|
};
|
@@ -1,3 +1,3 @@
|
|
1
1
|
"use client";
|
2
|
-
import{slateA as
|
2
|
+
import{slateA as r,slateDarkA as o}from"../color/alpha.mjs";import{useState as c,useEffect as t}from"react";var n=function(n){void 0===n&&(n=!1);var i={},e={};!0===n?(i={r:{grid:{color:r[8]}}},e={r:{grid:{color:o[8]},ticks:{backdropColor:"rgba(0, 0, 0, 0)"}}}):(i={x:{grid:{color:r[8]}},y:{grid:{color:r[8]}}},e={x:{grid:{color:o[8]}},y:{grid:{color:o[8]}}});var a=c(b()),l=a[0],s=a[1],d=c({linescale:{}}),u=d[0],f=d[1];function b(){return document.body.classList.contains("dark")}return t((function(){s(b()),f({linescale:b()?e:i});var r=new MutationObserver((function(r){r.forEach((function(r){"class"===r.attributeName&&(s(b()),f({linescale:b()?e:i}))}))}));return r.observe(document.body,{attributes:!0}),function(){r.disconnect()}}),[]),[l,u]};export{n as useDarkMode};
|
3
3
|
//# sourceMappingURL=useDarkMode.mjs.map
|
@@ -4,8 +4,6 @@ export function useWindowSize() {
|
|
4
4
|
var _a = useState(MIN_SIZE), size = _a[0], setSize = _a[1];
|
5
5
|
useEffect(function () {
|
6
6
|
function handleResize() {
|
7
|
-
if (!window)
|
8
|
-
return;
|
9
7
|
var width = 130 + window.innerWidth * 0.15;
|
10
8
|
width = Math.max(width, MIN_SIZE);
|
11
9
|
width = Math.min(width, 300);
|
@@ -14,6 +12,6 @@ export function useWindowSize() {
|
|
14
12
|
window.addEventListener('resize', handleResize);
|
15
13
|
handleResize();
|
16
14
|
return function () { return window.removeEventListener('resize', handleResize); };
|
17
|
-
}, [
|
15
|
+
}, []);
|
18
16
|
return size;
|
19
17
|
}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{useState as n,useEffect as e}from"react";function
|
1
|
+
import{useState as n,useEffect as e}from"react";function r(){var r=n(250),t=r[0],i=r[1];return e((function(){function n(){var n=130+.15*window.innerWidth;n=Math.max(n,250),n=Math.min(n,300),i(n)}return window.addEventListener("resize",n),n(),function(){return window.removeEventListener("resize",n)}}),[]),t}export{r as useWindowSize};
|
2
2
|
//# sourceMappingURL=useWindowSize.mjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useWindowSize.mjs","sources":["../../lib/utils/useWindowSize.js"],"sourcesContent":["import { useState, useEffect } from 'react';\nvar MIN_SIZE = 250;\nexport function useWindowSize() {\n var _a = useState(MIN_SIZE), size = _a[0], setSize = _a[1];\n useEffect(function () {\n function handleResize() {\n
|
1
|
+
{"version":3,"file":"useWindowSize.mjs","sources":["../../lib/utils/useWindowSize.js"],"sourcesContent":["import { useState, useEffect } from 'react';\nvar MIN_SIZE = 250;\nexport function useWindowSize() {\n var _a = useState(MIN_SIZE), size = _a[0], setSize = _a[1];\n useEffect(function () {\n function handleResize() {\n var width = 130 + window.innerWidth * 0.15;\n width = Math.max(width, MIN_SIZE);\n width = Math.min(width, 300);\n setSize(width);\n }\n window.addEventListener('resize', handleResize);\n handleResize();\n return function () { return window.removeEventListener('resize', handleResize); };\n }, []);\n return size;\n}\n"],"names":["useWindowSize","_a","useState","size","setSize","useEffect","handleResize","width","window","innerWidth","Math","max","min","addEventListener","removeEventListener"],"mappings":"gDAEO,SAASA,IACZ,IAAIC,EAAKC,EAFE,KAEkBC,EAAOF,EAAG,GAAIG,EAAUH,EAAG,GAYxD,OAXAI,GAAU,WACN,SAASC,IACL,IAAIC,EAAQ,IAA0B,IAApBC,OAAOC,WACzBF,EAAQG,KAAKC,IAAIJ,EANd,KAOHA,EAAQG,KAAKE,IAAIL,EAAO,KACxBH,EAAQG,EACX,CAGD,OAFAC,OAAOK,iBAAiB,SAAUP,GAClCA,IACO,WAAc,OAAOE,OAAOM,oBAAoB,SAAUR,GACpE,GAAE,IACIH,CACX"}
|