xtreme-ui 0.0.30 → 0.0.31
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.
- package/dist/components/hooks/useTheme.d.ts.map +1 -1
- package/dist/components/hooks/useTheme.js +15 -13
- package/dist/index.js +42 -40
- package/dist/utils/function/localStorage.d.ts.map +1 -1
- package/dist/utils/function/localStorage.js +11 -8
- package/dist/utils/helper/domHelper.d.ts +3 -1
- package/dist/utils/helper/domHelper.d.ts.map +1 -1
- package/dist/utils/helper/domHelper.js +27 -25
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTheme.d.ts","sourceRoot":"","sources":["../../../src/components/hooks/useTheme.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useTheme.d.ts","sourceRoot":"","sources":["../../../src/components/hooks/useTheme.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAGpC,eAAO,MAAM,UAAU,UAAW,MAAM,SAGvC,CAAC;AACF,eAAO,MAAM,QAAQ,iBAAkB,MAAM,uBAQ5C,CAAC;AAEF,aAAK,OAAO;IACX,KAAK,UAAU;IACf,IAAI,SAAS;IACb,MAAM,WAAW;CACjB;AACD,MAAM,MAAM,OAAO,GAAG,MAAM,OAAO,OAAO,CAAC;AAC3C,oBAAY,MAAM;IACjB,GAAG,QAAQ;IACX,IAAI,SAAS;IACb,MAAM,WAAW;IACjB,IAAI,SAAS;IACb,MAAM,WAAW;IACjB,KAAK,UAAU;CACf;AACD,MAAM,MAAM,MAAM,GAAG,MAAM,OAAO,MAAM,CAAC;AAEzC,MAAM,MAAM,MAAM,GAAG;IACpB,MAAM,EAAE,OAAO,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;CACd,CAAA;AACD,eAAO,MAAM,YAAY;;;CAGxB,CAAC"}
|
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { useEffect as
|
|
3
|
-
import { STORAGE as
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
2
|
+
import { useEffect as m } from "react";
|
|
3
|
+
import { STORAGE as n } from "../../utils/constants/commons.js";
|
|
4
|
+
import { doc as c } from "../../utils/helper/domHelper.js";
|
|
5
|
+
import { usePersistingState as u } from "./usePersistingState.js";
|
|
6
|
+
const i = (e) => {
|
|
7
|
+
var t, o, r, s;
|
|
8
|
+
(o = (t = c) == null ? void 0 : t.documentElement) == null || o.setAttribute("data-theme-scheme", e == null ? void 0 : e.scheme), (s = (r = c) == null ? void 0 : r.documentElement) == null || s.setAttribute("data-theme-color", e == null ? void 0 : e.color);
|
|
9
|
+
}, p = (e) => {
|
|
10
|
+
const [t, o] = u(n.theme, e);
|
|
11
|
+
return m(() => {
|
|
12
|
+
i(t);
|
|
11
13
|
}, [t]), [t, o];
|
|
12
|
-
},
|
|
14
|
+
}, T = {
|
|
13
15
|
scheme: "system",
|
|
14
16
|
color: "red"
|
|
15
17
|
/* red */
|
|
16
18
|
};
|
|
17
19
|
export {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
20
|
+
i as applyTheme,
|
|
21
|
+
T as defaultTheme,
|
|
22
|
+
p as useTheme
|
|
21
23
|
};
|
package/dist/index.js
CHANGED
|
@@ -1,52 +1,54 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import "./styles/index.scss.js";
|
|
3
|
-
import {
|
|
4
|
-
import { mergeRefs as
|
|
5
|
-
import { capitalizeFirstLetter as C, safeStringFromCodePoint as d, unicodeToString as
|
|
6
|
-
import { XProvider as
|
|
7
|
-
import { useXData as
|
|
8
|
-
import { Avatar as
|
|
9
|
-
import { EAvatarSize as
|
|
10
|
-
import { Button as
|
|
11
|
-
import { EButtonTypes as
|
|
12
|
-
import { Icon as
|
|
13
|
-
import { EIconSize as
|
|
14
|
-
import { Lottie as
|
|
15
|
-
import { ELottieSize as
|
|
16
|
-
import { ProgressBar as
|
|
17
|
-
import { Spinner as
|
|
18
|
-
import { ESpinnerSize as
|
|
19
|
-
import { Textfield as
|
|
20
|
-
import { Sider as
|
|
21
|
-
import { Navigation as
|
|
3
|
+
import { doc as t, elementObserver as p, getCssProperty as i, getCssPropertyPx as m, getCssPropertyVh as f, getCssPropertyVw as s, isClient as x, localStore as n, setCssProperty as a, waitForElement as S, win as g } from "./utils/helper/domHelper.js";
|
|
4
|
+
import { mergeRefs as l } from "./utils/function/mergeRefs.js";
|
|
5
|
+
import { capitalizeFirstLetter as C, safeStringFromCodePoint as d, unicodeToString as y } from "./utils/function/string.js";
|
|
6
|
+
import { XProvider as u } from "./components/context/index.js";
|
|
7
|
+
import { useXData as z } from "./components/context/useContext.js";
|
|
8
|
+
import { Avatar as B } from "./components/base/Avatar/Avatar.js";
|
|
9
|
+
import { EAvatarSize as L } from "./components/base/Avatar/types.js";
|
|
10
|
+
import { Button as A } from "./components/base/Button/Button.js";
|
|
11
|
+
import { EButtonTypes as V } from "./components/base/Button/types.js";
|
|
12
|
+
import { Icon as b } from "./components/base/Icon/Icon.js";
|
|
13
|
+
import { EIconSize as D } from "./components/base/Icon/types.js";
|
|
14
|
+
import { Lottie as O } from "./components/base/Lottie/Lottie.js";
|
|
15
|
+
import { ELottieSize as j } from "./components/base/Lottie/types.js";
|
|
16
|
+
import { ProgressBar as q } from "./components/base/ProgressBar/ProgressBar.js";
|
|
17
|
+
import { Spinner as H } from "./components/base/Spinner/Spinner.js";
|
|
18
|
+
import { ESpinnerSize as K } from "./components/base/Spinner/types.js";
|
|
19
|
+
import { Textfield as Q } from "./components/base/Textfield/Textfield.js";
|
|
20
|
+
import { Sider as W } from "./components/layout/Sider/Sider.js";
|
|
21
|
+
import { Navigation as Z } from "./components/layout/Navigation/Navigation.js";
|
|
22
22
|
export {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
23
|
+
B as Avatar,
|
|
24
|
+
A as Button,
|
|
25
|
+
L as EAvatarSize,
|
|
26
|
+
V as EButtonTypes,
|
|
27
|
+
D as EIconSize,
|
|
28
|
+
j as ELottieSize,
|
|
29
|
+
K as ESpinnerSize,
|
|
30
|
+
b as Icon,
|
|
31
|
+
O as Lottie,
|
|
32
|
+
Z as Navigation,
|
|
33
|
+
q as ProgressBar,
|
|
34
|
+
W as Sider,
|
|
35
|
+
H as Spinner,
|
|
36
|
+
Q as Textfield,
|
|
37
|
+
u as XProvider,
|
|
38
38
|
C as capitalizeFirstLetter,
|
|
39
|
-
t as
|
|
39
|
+
t as doc,
|
|
40
40
|
p as elementObserver,
|
|
41
41
|
i as getCssProperty,
|
|
42
42
|
m as getCssPropertyPx,
|
|
43
43
|
f as getCssPropertyVh,
|
|
44
44
|
s as getCssPropertyVw,
|
|
45
45
|
x as isClient,
|
|
46
|
-
|
|
46
|
+
n as localStore,
|
|
47
|
+
l as mergeRefs,
|
|
47
48
|
d as safeStringFromCodePoint,
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
49
|
+
a as setCssProperty,
|
|
50
|
+
y as unicodeToString,
|
|
51
|
+
z as useXData,
|
|
52
|
+
S as waitForElement,
|
|
53
|
+
g as win
|
|
52
54
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"localStorage.d.ts","sourceRoot":"","sources":["../../../src/utils/function/localStorage.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"localStorage.d.ts","sourceRoot":"","sources":["../../../src/utils/function/localStorage.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,aAAa,WAAY,MAAM,gCAS3C,CAAC;AAEF,eAAO,MAAM,aAAa,WAAY,MAAM,mBAO3C,CAAC"}
|
|
@@ -1,19 +1,22 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
2
|
+
import { localStore as r } from "../helper/domHelper.js";
|
|
3
|
+
const n = (c, o) => {
|
|
4
|
+
var e;
|
|
3
5
|
try {
|
|
4
|
-
const t =
|
|
5
|
-
return t ? JSON.parse(t) :
|
|
6
|
+
const t = (e = r) == null ? void 0 : e.getItem(c);
|
|
7
|
+
return t ? JSON.parse(t) : o ?? "";
|
|
6
8
|
} catch (t) {
|
|
7
|
-
return console.log(t),
|
|
9
|
+
return console.log(t), o ?? "";
|
|
8
10
|
}
|
|
9
|
-
},
|
|
11
|
+
}, l = (c, o) => {
|
|
12
|
+
var e;
|
|
10
13
|
try {
|
|
11
|
-
|
|
14
|
+
(e = r) == null || e.setItem(c, JSON.stringify(o));
|
|
12
15
|
} catch (t) {
|
|
13
16
|
console.log(t);
|
|
14
17
|
}
|
|
15
18
|
};
|
|
16
19
|
export {
|
|
17
|
-
|
|
18
|
-
|
|
20
|
+
n as getLocalState,
|
|
21
|
+
l as setLocalState
|
|
19
22
|
};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { RefObject } from 'react';
|
|
2
2
|
export declare const isClient: boolean;
|
|
3
|
-
export declare const
|
|
3
|
+
export declare const win: (Window & typeof globalThis) | undefined;
|
|
4
|
+
export declare const doc: Document | undefined;
|
|
5
|
+
export declare const localStore: Storage | undefined;
|
|
4
6
|
export declare const getCssProperty: (property: string, element: RefObject<HTMLElement>) => string;
|
|
5
7
|
export declare const getCssPropertyPx: (property: string, element: RefObject<HTMLElement>) => number;
|
|
6
8
|
export declare const getCssPropertyVh: (property: string, element: RefObject<HTMLElement>) => number[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"domHelper.d.ts","sourceRoot":"","sources":["../../../src/utils/helper/domHelper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,eAAO,MAAM,QAAQ,SAAgC,CAAC;AACtD,eAAO,MAAM,GAAG,0CAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"domHelper.d.ts","sourceRoot":"","sources":["../../../src/utils/helper/domHelper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,eAAO,MAAM,QAAQ,SAAgC,CAAC;AACtD,eAAO,MAAM,GAAG,0CAAgC,CAAC;AACjD,eAAO,MAAM,GAAG,sBAAkC,CAAC;AACnD,eAAO,MAAM,UAAU,qBAAsC,CAAC;AAE9D,eAAO,MAAM,cAAc,aAAc,MAAM,WAAW,UAAU,WAAW,CAAC,WAE/E,CAAC;AAEF,eAAO,MAAM,gBAAgB,aAAc,MAAM,WAAW,UAAU,WAAW,CAAC,WAEjF,CAAC;AAEF,eAAO,MAAM,gBAAgB,aAAc,MAAM,WAAW,UAAU,WAAW,CAAC,aAGjF,CAAC;AAEF,eAAO,MAAM,gBAAgB,aAAc,MAAM,WAAW,UAAU,WAAW,CAAC,aAGjF,CAAC;AAEF,eAAO,MAAM,cAAc,aAAc,MAAM,SAAS,MAAM,WAAW,UAAU,WAAW,CAAC,cAE9F,CAAC;AAEF,eAAO,MAAM,cAAc,aAAc,MAAM,yBAc9C,CAAC;AAEF,eAAO,MAAM,eAAe,OAAQ,uBAAuB,aAAa,MAAM,EAAE,SAkB/E,CAAC;AAEF,KAAK,uBAAuB,GAAG,CAAC,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,OAAO,qBAAqB,EAAE,MAAM,EAAE,cAAc,KAAK,IAAI,CAAA;AAChI,aAAK,qBAAqB;IACzB,KAAK,UAAU;IACf,OAAO,YAAY;CACnB"}
|
|
@@ -1,38 +1,40 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
const
|
|
3
|
-
const t = parseInt(
|
|
4
|
-
return [((
|
|
5
|
-
},
|
|
6
|
-
const t = parseInt(
|
|
7
|
-
return [((
|
|
8
|
-
},
|
|
2
|
+
const c = typeof window < "u", o = c ? window : void 0, f = c ? document : void 0, g = c ? localStorage : void 0, s = (n, e) => c ? getComputedStyle((e == null ? void 0 : e.current) || document.documentElement).getPropertyValue(n) : "", h = (n, e) => parseInt(s(n, e).replace(/px/g, "")), b = (n, e) => {
|
|
3
|
+
const t = parseInt(s(n, e).replace(/vh/g, ""));
|
|
4
|
+
return [((o == null ? void 0 : o.innerHeight) ?? 0) * t / 100, t];
|
|
5
|
+
}, l = (n, e) => {
|
|
6
|
+
const t = parseInt(s(n, e).replace(/vw/g, ""));
|
|
7
|
+
return [((o == null ? void 0 : o.innerWidth) ?? 0) * t / 100, t];
|
|
8
|
+
}, P = (n, e, t) => c ? ((t == null ? void 0 : t.current) || document.documentElement).style.setProperty(n, e) : "", w = (n) => new Promise((e) => {
|
|
9
9
|
let t = document.querySelector(n);
|
|
10
10
|
if (t)
|
|
11
11
|
return e(t);
|
|
12
|
-
const
|
|
13
|
-
t = document.querySelector(n), t && (e(t),
|
|
12
|
+
const r = new MutationObserver(() => {
|
|
13
|
+
t = document.querySelector(n), t && (e(t), r.disconnect());
|
|
14
14
|
});
|
|
15
|
-
|
|
16
|
-
}),
|
|
15
|
+
r.observe(document.body, { childList: !0, subtree: !0 });
|
|
16
|
+
}), C = (n, e) => {
|
|
17
17
|
var t;
|
|
18
|
-
(t = e == null ? void 0 : e.forEach) == null || t.call(e, (
|
|
19
|
-
let
|
|
20
|
-
new MutationObserver((
|
|
18
|
+
(t = e == null ? void 0 : e.forEach) == null || t.call(e, (r) => {
|
|
19
|
+
let d;
|
|
20
|
+
new MutationObserver((u) => {
|
|
21
21
|
var a;
|
|
22
|
-
document.querySelector(
|
|
23
|
-
|
|
22
|
+
document.querySelector(r) && (d = document.querySelector(r)), (a = u == null ? void 0 : u.forEach) == null || a.call(u, (i) => {
|
|
23
|
+
i.type === "childList" && (Array.from(i.addedNodes).indexOf(d) > -1 && n(d, "added", i), Array.from(i.removedNodes).indexOf(d) > -1 && n(d, "removed", i));
|
|
24
24
|
});
|
|
25
25
|
}).observe(document.body, { childList: !0, subtree: !0 });
|
|
26
26
|
});
|
|
27
27
|
};
|
|
28
28
|
export {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
29
|
+
f as doc,
|
|
30
|
+
C as elementObserver,
|
|
31
|
+
s as getCssProperty,
|
|
32
|
+
h as getCssPropertyPx,
|
|
33
|
+
b as getCssPropertyVh,
|
|
34
|
+
l as getCssPropertyVw,
|
|
35
|
+
c as isClient,
|
|
36
|
+
g as localStore,
|
|
37
|
+
P as setCssProperty,
|
|
38
|
+
w as waitForElement,
|
|
39
|
+
o as win
|
|
38
40
|
};
|