xtreme-ui 0.0.91 → 0.0.92
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/base/Avatar/Avatar.d.ts.map +1 -1
- package/dist/components/base/Avatar/Avatar.js +34 -28
- package/dist/index.js +95 -93
- package/dist/utils/constants/iconCollection.d.ts +5 -0
- package/dist/utils/constants/iconCollection.d.ts.map +1 -0
- package/dist/utils/constants/iconCollection.js +109 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Avatar.d.ts","sourceRoot":"","sources":["../../../../src/components/base/Avatar/Avatar.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Avatar.d.ts","sourceRoot":"","sources":["../../../../src/components/base/Avatar/Avatar.tsx"],"names":[],"mappings":"AASA,OAAO,eAAe,CAAC;AACvB,OAAO,EAAe,YAAY,EAAE,MAAM,SAAS,CAAC;AAIpD,eAAO,MAAM,MAAM,yGAwEjB,CAAC"}
|
|
@@ -1,46 +1,52 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import { forwardRef as
|
|
2
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
3
|
+
import { forwardRef as x, useState as c, useEffect as E } from "react";
|
|
4
4
|
import S from "clsx";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { FACE_ICONS as d } from "../../../utils/constants/iconCollection.js";
|
|
6
|
+
import { readImageFile as z, readImageSrc as C } from "../../../utils/helper/imageHelper.js";
|
|
7
|
+
import { Icon as F } from "../Icon/Icon.js";
|
|
7
8
|
/* empty css */
|
|
8
|
-
import { EAvatarSize as
|
|
9
|
-
const
|
|
10
|
-
const { className: u, src: a, file:
|
|
9
|
+
import { EAvatarSize as L } from "./types.js";
|
|
10
|
+
const M = d.happy[Math.floor(Math.random() * d.happy.length)], _ = x((g, h) => {
|
|
11
|
+
const { className: u, src: a, file: r, alt: v, placeholderIcon: A = M, size: l = "default", onClick: I } = g, [m, n] = c(), [y, t] = c(!!a || !!r), [f, o] = c(!1), p = typeof l == "number" ? l : L[l], N = S(
|
|
11
12
|
"xtrAvatar",
|
|
12
13
|
u,
|
|
13
|
-
|
|
14
|
+
y && "loading",
|
|
14
15
|
f && "error"
|
|
15
|
-
),
|
|
16
|
-
e && setTimeout(() =>
|
|
16
|
+
), s = (e) => {
|
|
17
|
+
e && setTimeout(() => n(e), 300), setTimeout(() => t(!1), 1e3);
|
|
17
18
|
};
|
|
18
|
-
return
|
|
19
|
+
return E(() => {
|
|
19
20
|
try {
|
|
20
|
-
|
|
21
|
-
console.log(e),
|
|
22
|
-
})) : a ? (
|
|
23
|
-
console.log(e, a),
|
|
24
|
-
})) : (
|
|
21
|
+
r ? (t(!0), o(!1), z(r).then((e) => s(e)).catch((e) => {
|
|
22
|
+
console.log(e), t(!1), o(!0);
|
|
23
|
+
})) : a ? (t(!0), o(!1), C(a).then((e) => s(e)).catch((e) => {
|
|
24
|
+
console.log(e, a), t(!1), o(!0);
|
|
25
|
+
})) : (n(void 0), s());
|
|
25
26
|
} catch {
|
|
26
|
-
|
|
27
|
+
s();
|
|
27
28
|
}
|
|
28
|
-
}, [a,
|
|
29
|
+
}, [a, r]), /* @__PURE__ */ i(
|
|
29
30
|
"div",
|
|
30
31
|
{
|
|
31
|
-
ref:
|
|
32
|
-
className:
|
|
33
|
-
style: { "--avatarSize":
|
|
34
|
-
onClick:
|
|
32
|
+
ref: h,
|
|
33
|
+
className: N,
|
|
34
|
+
style: { "--avatarSize": p + "px" },
|
|
35
|
+
onClick: I,
|
|
35
36
|
role: "img",
|
|
36
|
-
children:
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
children: m ? /* @__PURE__ */ i("img", { className: "image", src: m, alt: v }) : /* @__PURE__ */ i(
|
|
38
|
+
F,
|
|
39
|
+
{
|
|
40
|
+
className: "placeholder",
|
|
41
|
+
type: "solid",
|
|
42
|
+
size: 8 + p / 4,
|
|
43
|
+
code: f ? "e1b7" : A
|
|
44
|
+
}
|
|
45
|
+
)
|
|
40
46
|
}
|
|
41
47
|
);
|
|
42
48
|
});
|
|
43
|
-
|
|
49
|
+
_.displayName = "Avatar";
|
|
44
50
|
export {
|
|
45
|
-
|
|
51
|
+
_ as Avatar
|
|
46
52
|
};
|
package/dist/index.js
CHANGED
|
@@ -1,100 +1,102 @@
|
|
|
1
1
|
/* empty css */
|
|
2
2
|
import { STORAGE as t, THEME_SCHEME as p } from "./utils/constants/commons.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
3
|
+
import { FACE_ICONS as f } from "./utils/constants/iconCollection.js";
|
|
4
|
+
import { getLocalState as x, setLocalState as a } from "./utils/function/localStorage.js";
|
|
5
|
+
import { assignRef as n, mergeRefs as c } from "./utils/function/mergeRefs.js";
|
|
6
|
+
import { capitalizeFirstLetter as g, safeStringFromCodePoint as l, unicodeToString as d } from "./utils/function/string.js";
|
|
7
|
+
import { doc as P, elementObserver as C, getCssProperty as I, getCssPropertyPx as T, getCssPropertyVh as u, getCssPropertyVw as y, isClient as z, localStore as A, setCssProperty as F, waitForElement as h, win as k } from "./utils/helper/domHelper.js";
|
|
8
|
+
import { createImage as L, getCroppedImg as w, getImageSize as D, getRadianAngle as R, readImageFile as B, readImageSrc as M } from "./utils/helper/imageHelper.js";
|
|
9
|
+
import { themeController as X } from "./utils/helper/themeController.js";
|
|
10
|
+
import { XProvider as H } from "./components/context/index.js";
|
|
11
|
+
import { useXData as V, useXTheme as _ } from "./components/context/useContext.js";
|
|
12
|
+
import { ActionCard as j } from "./components/base/ActionCard/ActionCard.js";
|
|
13
|
+
import { EActionCardSize as J } from "./components/base/ActionCard/types.js";
|
|
14
|
+
import { Avatar as Q } from "./components/base/Avatar/Avatar.js";
|
|
15
|
+
import { EAvatarSize as W } from "./components/base/Avatar/types.js";
|
|
16
|
+
import { Button as Z } from "./components/base/Button/Button.js";
|
|
17
|
+
import { EButtonTypes as ee } from "./components/base/Button/types.js";
|
|
18
|
+
import { Icon as oe } from "./components/base/Icon/Icon.js";
|
|
19
|
+
import { EIconSize as pe } from "./components/base/Icon/types.js";
|
|
20
|
+
import { Lottie as fe } from "./components/base/Lottie/Lottie.js";
|
|
21
|
+
import { ELottieSize as xe } from "./components/base/Lottie/types.js";
|
|
22
|
+
import { ProgressBar as se } from "./components/base/ProgressBar/ProgressBar.js";
|
|
23
|
+
import { Spinner as ce } from "./components/base/Spinner/Spinner.js";
|
|
24
|
+
import { ESpinnerSize as ge } from "./components/base/Spinner/types.js";
|
|
25
|
+
import { Textfield as de } from "./components/base/Textfield/Textfield.js";
|
|
26
|
+
import { DatePicker as Pe } from "./components/base/DatePicker/DatePicker.js";
|
|
27
|
+
import { EDatePickerTypes as Ie } from "./components/base/DatePicker/types.js";
|
|
28
|
+
import { FilePicker as ue } from "./components/base/FilePicker/FilePicker.js";
|
|
29
|
+
import { FilePickerIcon as ze } from "./components/base/FilePicker/types.js";
|
|
30
|
+
import { Select as Fe } from "./components/base/Select/Select.js";
|
|
31
|
+
import { ColorPopper as ke } from "./components/base/ColorPopper/ColorPopper.js";
|
|
32
|
+
import { Sider as Le } from "./components/layout/Sider/Sider.js";
|
|
33
|
+
import { SiderModal as De } from "./components/layout/SiderModal/SiderModal.js";
|
|
34
|
+
import { Navigation as Be } from "./components/layout/Navigation/Navigation.js";
|
|
35
|
+
import { ThemePicker as Oe } from "./components/layout/ThemePicker/ThemePicker.js";
|
|
36
|
+
import { ThemeSwitch as be } from "./components/layout/ThemeSwitch/ThemeSwitch.js";
|
|
37
|
+
import { ImageEditor as Ne } from "./components/layout/ImageEditor/ImageEditor.js";
|
|
38
|
+
import { useScreenType as _e } from "./components/hooks/useScreen.js";
|
|
39
|
+
import { usePersistingState as je } from "./components/hooks/usePersistingState.js";
|
|
40
|
+
import { useDebouncedEffect as Je } from "./components/hooks/useDebouncedEffect.js";
|
|
40
41
|
export {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
42
|
+
j as ActionCard,
|
|
43
|
+
Q as Avatar,
|
|
44
|
+
Z as Button,
|
|
45
|
+
ke as ColorPopper,
|
|
46
|
+
Pe as DatePicker,
|
|
47
|
+
J as EActionCardSize,
|
|
48
|
+
W as EAvatarSize,
|
|
49
|
+
ee as EButtonTypes,
|
|
50
|
+
Ie as EDatePickerTypes,
|
|
51
|
+
pe as EIconSize,
|
|
52
|
+
xe as ELottieSize,
|
|
53
|
+
ge as ESpinnerSize,
|
|
54
|
+
f as FACE_ICONS,
|
|
55
|
+
ue as FilePicker,
|
|
56
|
+
ze as FilePickerIcon,
|
|
57
|
+
oe as Icon,
|
|
58
|
+
Ne as ImageEditor,
|
|
59
|
+
fe as Lottie,
|
|
60
|
+
Be as Navigation,
|
|
61
|
+
se as ProgressBar,
|
|
60
62
|
t as STORAGE,
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
63
|
+
Fe as Select,
|
|
64
|
+
Le as Sider,
|
|
65
|
+
De as SiderModal,
|
|
66
|
+
ce as Spinner,
|
|
65
67
|
p as THEME_SCHEME,
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
68
|
+
de as Textfield,
|
|
69
|
+
Oe as ThemePicker,
|
|
70
|
+
be as ThemeSwitch,
|
|
71
|
+
H as XProvider,
|
|
72
|
+
n as assignRef,
|
|
73
|
+
g as capitalizeFirstLetter,
|
|
74
|
+
L as createImage,
|
|
75
|
+
P as doc,
|
|
76
|
+
C as elementObserver,
|
|
77
|
+
w as getCroppedImg,
|
|
78
|
+
I as getCssProperty,
|
|
79
|
+
T as getCssPropertyPx,
|
|
80
|
+
u as getCssPropertyVh,
|
|
81
|
+
y as getCssPropertyVw,
|
|
82
|
+
D as getImageSize,
|
|
83
|
+
x as getLocalState,
|
|
84
|
+
R as getRadianAngle,
|
|
85
|
+
z as isClient,
|
|
86
|
+
A as localStore,
|
|
87
|
+
c as mergeRefs,
|
|
88
|
+
B as readImageFile,
|
|
89
|
+
M as readImageSrc,
|
|
90
|
+
l as safeStringFromCodePoint,
|
|
91
|
+
F as setCssProperty,
|
|
92
|
+
a as setLocalState,
|
|
93
|
+
X as themeController,
|
|
94
|
+
d as unicodeToString,
|
|
95
|
+
Je as useDebouncedEffect,
|
|
96
|
+
je as usePersistingState,
|
|
97
|
+
_e as useScreenType,
|
|
98
|
+
V as useXData,
|
|
99
|
+
_ as useXTheme,
|
|
98
100
|
h as waitForElement,
|
|
99
|
-
|
|
101
|
+
k as win
|
|
100
102
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"iconCollection.d.ts","sourceRoot":"","sources":["../../../src/utils/constants/iconCollection.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU;;;CAyGtB,CAAC"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
const e = {
|
|
2
|
+
happy: [
|
|
3
|
+
"f118",
|
|
4
|
+
"e392",
|
|
5
|
+
"f580",
|
|
6
|
+
"f5b8",
|
|
7
|
+
"e409",
|
|
8
|
+
"e3a4",
|
|
9
|
+
"e39d",
|
|
10
|
+
"f5c2",
|
|
11
|
+
"e398",
|
|
12
|
+
"e396",
|
|
13
|
+
"f4da",
|
|
14
|
+
"e391",
|
|
15
|
+
"e390",
|
|
16
|
+
"e38f",
|
|
17
|
+
"e38d",
|
|
18
|
+
"e389",
|
|
19
|
+
"e383",
|
|
20
|
+
"f59c",
|
|
21
|
+
"f59b",
|
|
22
|
+
"f59a",
|
|
23
|
+
"f599",
|
|
24
|
+
"f598",
|
|
25
|
+
"e37d",
|
|
26
|
+
"f597",
|
|
27
|
+
"f596",
|
|
28
|
+
"e379",
|
|
29
|
+
"f58c",
|
|
30
|
+
"f581",
|
|
31
|
+
"f58b",
|
|
32
|
+
"f58a",
|
|
33
|
+
"f589",
|
|
34
|
+
"f588",
|
|
35
|
+
"f587",
|
|
36
|
+
"f586",
|
|
37
|
+
"f585",
|
|
38
|
+
"f584",
|
|
39
|
+
"f583",
|
|
40
|
+
"f582",
|
|
41
|
+
"e377",
|
|
42
|
+
"f579",
|
|
43
|
+
"e2fe",
|
|
44
|
+
"e372",
|
|
45
|
+
"e36e",
|
|
46
|
+
"e47c",
|
|
47
|
+
"e36b",
|
|
48
|
+
"e368",
|
|
49
|
+
"f2fe"
|
|
50
|
+
],
|
|
51
|
+
sad: [
|
|
52
|
+
"e3a0",
|
|
53
|
+
"e3a5",
|
|
54
|
+
"e3a3",
|
|
55
|
+
"e3a2",
|
|
56
|
+
"e3a1",
|
|
57
|
+
"e39f",
|
|
58
|
+
"f5c8",
|
|
59
|
+
"e485",
|
|
60
|
+
"e397",
|
|
61
|
+
"e395",
|
|
62
|
+
"e394",
|
|
63
|
+
"e393",
|
|
64
|
+
"e38b",
|
|
65
|
+
"f5b4",
|
|
66
|
+
"e38a",
|
|
67
|
+
"f5b3",
|
|
68
|
+
"f5a5",
|
|
69
|
+
"e388",
|
|
70
|
+
"e387",
|
|
71
|
+
"e386",
|
|
72
|
+
"e385",
|
|
73
|
+
"e384",
|
|
74
|
+
"e382",
|
|
75
|
+
"e380",
|
|
76
|
+
"e483",
|
|
77
|
+
"f5a4",
|
|
78
|
+
"f11a",
|
|
79
|
+
"e37c",
|
|
80
|
+
"e37b",
|
|
81
|
+
"e37a",
|
|
82
|
+
"e378",
|
|
83
|
+
"f57f",
|
|
84
|
+
"e376",
|
|
85
|
+
"f57a",
|
|
86
|
+
"f119",
|
|
87
|
+
"e375",
|
|
88
|
+
"e374",
|
|
89
|
+
"e373",
|
|
90
|
+
"e480",
|
|
91
|
+
"e371",
|
|
92
|
+
"e47f",
|
|
93
|
+
"f567",
|
|
94
|
+
"e36f",
|
|
95
|
+
"e47e",
|
|
96
|
+
"e36d",
|
|
97
|
+
"e36c",
|
|
98
|
+
"e47d",
|
|
99
|
+
"e36a",
|
|
100
|
+
"e369",
|
|
101
|
+
"f556",
|
|
102
|
+
"f6e2",
|
|
103
|
+
"f8f6",
|
|
104
|
+
"f54c"
|
|
105
|
+
]
|
|
106
|
+
};
|
|
107
|
+
export {
|
|
108
|
+
e as FACE_ICONS
|
|
109
|
+
};
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,0BAA0B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,0BAA0B,CAAC"}
|