xtreme-ui 0.0.94 → 0.0.96
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/ActionCard/actionCard.module.scss.js +6 -6
- package/dist/components/base/Button/button.module.scss.js +23 -23
- package/dist/components/base/ColorPicker/ColorPicker.d.ts.map +1 -1
- package/dist/components/base/ColorPicker/ColorPicker.js +18 -16
- package/dist/components/base/ColorPicker/colorPicker.module.scss.js +8 -8
- package/dist/components/base/ColorPopper/ColorPopper.d.ts +10 -1
- package/dist/components/base/ColorPopper/ColorPopper.d.ts.map +1 -1
- package/dist/components/base/ColorPopper/ColorPopper.js +168 -67
- package/dist/components/base/ColorPopper/types.d.ts +16 -4
- package/dist/components/base/ColorPopper/types.d.ts.map +1 -1
- package/dist/components/base/Icon/Icon.js +13 -13
- package/dist/components/base/Icon/types.d.ts +2 -0
- package/dist/components/base/Icon/types.d.ts.map +1 -1
- package/dist/components/base/ProgressBar/progressbar.module.scss.js +1 -1
- package/dist/components/base/Select/Select.d.ts.map +1 -1
- package/dist/components/base/Select/Select.js +56 -47
- package/dist/components/base/Select/types.d.ts +9 -4
- package/dist/components/base/Select/types.d.ts.map +1 -1
- package/dist/components/base/Textfield/Textfield.d.ts.map +1 -1
- package/dist/components/base/Textfield/Textfield.js +23 -21
- package/dist/components/base/Textfield/textfield.module.scss.js +22 -20
- package/dist/components/base/Textfield/types.d.ts +1 -0
- package/dist/components/base/Textfield/types.d.ts.map +1 -1
- package/dist/components/context/Theme/ThemeContext.d.ts.map +1 -1
- package/dist/components/context/Theme/ThemeContext.js +19 -14
- package/dist/components/context/Theme/types.d.ts +12 -17
- package/dist/components/context/Theme/types.d.ts.map +1 -1
- package/dist/components/context/Theme/types.js +4 -8
- package/dist/components/layout/Navigation/navigation.module.scss.js +9 -9
- package/dist/components/layout/Sider/sider.module.scss.js +6 -6
- package/dist/components/layout/ThemePicker/ThemePicker.d.ts.map +1 -1
- package/dist/components/layout/ThemePicker/ThemePicker.js +53 -50
- package/dist/components/layout/ThemeSelect/ThemeSelect.d.ts +3 -0
- package/dist/components/layout/ThemeSelect/ThemeSelect.d.ts.map +1 -0
- package/dist/components/layout/ThemeSelect/ThemeSelect.js +37 -0
- package/dist/components/layout/ThemeSelect/types.d.ts +8 -0
- package/dist/components/layout/ThemeSelect/types.d.ts.map +1 -0
- package/dist/components/layout/ThemeSwitch/ThemeSwitch.d.ts.map +1 -1
- package/dist/components/layout/ThemeSwitch/ThemeSwitch.js +40 -40
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +99 -95
- package/dist/utils/constants/theme.d.ts +19 -0
- package/dist/utils/constants/theme.d.ts.map +1 -0
- package/dist/utils/constants/theme.js +27 -0
- package/dist/utils/function/common.d.ts +2 -0
- package/dist/utils/function/common.d.ts.map +1 -0
- package/dist/utils/function/common.js +4 -0
- package/dist/utils/helper/colorHelper.d.ts +5 -0
- package/dist/utils/helper/colorHelper.d.ts.map +1 -0
- package/dist/utils/helper/colorHelper.js +24 -0
- package/dist/utils/helper/themeController.d.ts +2 -1
- package/dist/utils/helper/themeController.d.ts.map +1 -1
- package/dist/utils/helper/themeController.js +32 -13
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/xtreme-ui.css +1 -1
- package/package.json +4 -1
- package/dist/components/base/ColorPopper/colorPopper.module.scss.js +0 -11
- package/dist/components/layout/ThemePicker/themePicker.module.scss.js +0 -39
- package/dist/utils/constants/commons.d.ts +0 -18
- package/dist/utils/constants/commons.d.ts.map +0 -1
- package/dist/utils/constants/commons.js +0 -15
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ThemeSelect.d.ts","sourceRoot":"","sources":["../../../../src/components/layout/ThemeSelect/ThemeSelect.tsx"],"names":[],"mappings":"AAUA,OAAO,oBAAoB,CAAC;AAC5B,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAE5C,eAAO,MAAM,WAAW,8GA4BtB,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
3
|
+
import { forwardRef as p } from "react";
|
|
4
|
+
import n from "clsx";
|
|
5
|
+
import { ColorPopper as f } from "../../base/ColorPopper/ColorPopper.js";
|
|
6
|
+
import { useXTheme as T } from "../../context/useContext.js";
|
|
7
|
+
import { useScreenType as d } from "../../hooks/useScreen.js";
|
|
8
|
+
import { isValidThemeColor as u } from "../../../utils/helper/colorHelper.js";
|
|
9
|
+
import { ThemeColorsPreset as C } from "../../../utils/constants/theme.js";
|
|
10
|
+
/* empty css */
|
|
11
|
+
const S = p((o, m) => {
|
|
12
|
+
const { className: r, withSwatch: t } = o, { themeScheme: s, setThemeScheme: l, themeColor: e, setThemeColor: i } = T(), { isMobile: c } = d(), h = n(
|
|
13
|
+
"xtrThemeSelect",
|
|
14
|
+
r
|
|
15
|
+
);
|
|
16
|
+
return !e || !u(e) ? null : /* @__PURE__ */ a(
|
|
17
|
+
f,
|
|
18
|
+
{
|
|
19
|
+
ref: m,
|
|
20
|
+
className: h,
|
|
21
|
+
placeholder: "Theme",
|
|
22
|
+
alpha: !1,
|
|
23
|
+
swatch: t ? Object.values(C) : void 0,
|
|
24
|
+
colorHeading: "Theme Color",
|
|
25
|
+
schemeHeading: "Theme scheme",
|
|
26
|
+
themeScheme: s,
|
|
27
|
+
size: c ? "mini" : "default",
|
|
28
|
+
setThemeScheme: l,
|
|
29
|
+
color: e,
|
|
30
|
+
setColor: i
|
|
31
|
+
}
|
|
32
|
+
);
|
|
33
|
+
});
|
|
34
|
+
S.displayName = "ThemeSelect";
|
|
35
|
+
export {
|
|
36
|
+
S as ThemeSelect
|
|
37
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/layout/ThemeSelect/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAExD,MAAM,MAAM,iBAAiB,GAAG;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,OAAO,SAAS,CAAC;CAClC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeSwitch.d.ts","sourceRoot":"","sources":["../../../../src/components/layout/ThemeSwitch/ThemeSwitch.tsx"],"names":[],"mappings":"AAWA,OAAO,oBAAoB,CAAC;AAC5B,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"ThemeSwitch.d.ts","sourceRoot":"","sources":["../../../../src/components/layout/ThemeSwitch/ThemeSwitch.tsx"],"names":[],"mappings":"AAWA,OAAO,oBAAoB,CAAC;AAC5B,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAS5C,eAAO,MAAM,WAAW,8GA+DtB,CAAC"}
|
|
@@ -1,67 +1,67 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import
|
|
5
|
-
import { Button as
|
|
6
|
-
import { Select as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { THEME_SCHEME as m } from "../../../utils/constants/
|
|
2
|
+
import { jsxs as O, jsx as c } from "react/jsx-runtime";
|
|
3
|
+
import { forwardRef as v, useMemo as a } from "react";
|
|
4
|
+
import w from "clsx";
|
|
5
|
+
import { Button as d } from "../../base/Button/Button.js";
|
|
6
|
+
import { Select as M } from "../../base/Select/Select.js";
|
|
7
|
+
import { useXTheme as g } from "../../context/useContext.js";
|
|
8
|
+
import { useScreenType as j } from "../../hooks/useScreen.js";
|
|
9
|
+
import { isValidThemeColor as I, getColorLabel as k } from "../../../utils/helper/colorHelper.js";
|
|
10
|
+
import { ThemeColorsPreset as u, THEME_SCHEME as m } from "../../../utils/constants/theme.js";
|
|
11
11
|
/* empty css */
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
})),
|
|
16
|
-
const { className: C, type: x = "secondary", size:
|
|
12
|
+
const H = Object.entries(u).map(([r, n]) => ({
|
|
13
|
+
label: r.charAt(0).toUpperCase() + r.slice(1),
|
|
14
|
+
value: n
|
|
15
|
+
})), h = Object.values(u), L = v((r, n) => {
|
|
16
|
+
const { className: C, type: x = "secondary", size: s = "default", iconType: i = "solid" } = r, { themeScheme: e, setThemeScheme: S, themeColor: t, setThemeColor: p } = g(), { isMobile: l, isDesktop: b } = j(), f = a(() => m[(m.findIndex((o) => o.name === e) + 1) % m.length], [e]), y = a(() => {
|
|
17
17
|
var o;
|
|
18
|
-
return ((o = m.find((
|
|
19
|
-
}, [e]),
|
|
18
|
+
return ((o = m.find((N) => N.name === e)) == null ? void 0 : o.icon) ?? "";
|
|
19
|
+
}, [e]), T = a(() => h[(h.findIndex((o) => o === t) + 1) % h.length], [t]), E = w(
|
|
20
20
|
"xtrThemeSwitch",
|
|
21
21
|
C,
|
|
22
|
-
l && "withLabel"
|
|
22
|
+
!l && "withLabel"
|
|
23
23
|
);
|
|
24
|
-
return !e || !
|
|
25
|
-
/* @__PURE__ */
|
|
26
|
-
|
|
24
|
+
return !e || !I(t) ? null : /* @__PURE__ */ O("div", { ref: n, className: E, children: [
|
|
25
|
+
/* @__PURE__ */ c(
|
|
26
|
+
d,
|
|
27
27
|
{
|
|
28
28
|
className: "xtrThemeScheme",
|
|
29
29
|
type: x,
|
|
30
|
-
size:
|
|
31
|
-
icon:
|
|
32
|
-
iconType:
|
|
33
|
-
label: l ?
|
|
34
|
-
onClick: () =>
|
|
30
|
+
size: s,
|
|
31
|
+
icon: y,
|
|
32
|
+
iconType: i,
|
|
33
|
+
label: l ? void 0 : e,
|
|
34
|
+
onClick: () => f.name && S(f.name)
|
|
35
35
|
}
|
|
36
36
|
),
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
b ? /* @__PURE__ */ c(
|
|
38
|
+
M,
|
|
39
39
|
{
|
|
40
40
|
clearable: !1,
|
|
41
41
|
searchable: !1,
|
|
42
|
-
size:
|
|
43
|
-
options: k,
|
|
42
|
+
size: s,
|
|
44
43
|
icon: "f53f",
|
|
45
|
-
iconType:
|
|
44
|
+
iconType: i,
|
|
46
45
|
placeholder: "Theme",
|
|
47
|
-
|
|
48
|
-
|
|
46
|
+
options: H,
|
|
47
|
+
value: t,
|
|
48
|
+
onChange: p
|
|
49
49
|
}
|
|
50
|
-
) : /* @__PURE__ */
|
|
51
|
-
|
|
50
|
+
) : /* @__PURE__ */ c(
|
|
51
|
+
d,
|
|
52
52
|
{
|
|
53
53
|
className: "xtrThemeColor",
|
|
54
54
|
type: "primary",
|
|
55
|
-
size:
|
|
55
|
+
size: s,
|
|
56
56
|
icon: "f53f",
|
|
57
|
-
iconType:
|
|
58
|
-
label: l ?
|
|
59
|
-
onClick: () =>
|
|
57
|
+
iconType: i,
|
|
58
|
+
label: l ? void 0 : k(t),
|
|
59
|
+
onClick: () => T && p(T)
|
|
60
60
|
}
|
|
61
61
|
)
|
|
62
62
|
] });
|
|
63
63
|
});
|
|
64
|
-
|
|
64
|
+
L.displayName = "ThemeSwitch";
|
|
65
65
|
export {
|
|
66
|
-
|
|
66
|
+
L as ThemeSwitch
|
|
67
67
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -34,6 +34,8 @@ export { Navigation } from './components/layout/Navigation/Navigation';
|
|
|
34
34
|
export { type TNavigationProps, type TNavigationRoute } from './components/layout/Navigation/types';
|
|
35
35
|
export { ThemePicker } from './components/layout/ThemePicker/ThemePicker';
|
|
36
36
|
export { type TThemePickerProps } from './components/layout/ThemePicker/types';
|
|
37
|
+
export { ThemeSelect } from './components/layout/ThemeSelect/ThemeSelect';
|
|
38
|
+
export { type TThemeSelectProps } from './components/layout/ThemeSelect/types';
|
|
37
39
|
export { ThemeSwitch } from './components/layout/ThemeSwitch/ThemeSwitch';
|
|
38
40
|
export { type TThemeSwitchProps } from './components/layout/ThemeSwitch/types';
|
|
39
41
|
export { ImageEditor } from './components/layout/ImageEditor/ImageEditor';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAE7B,cAAc,cAAc,CAAC;AAG7B,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAGtE,OAAO,EAAE,UAAU,EAAE,MAAM,yCAAyC,CAAC;AACrE,OAAO,EAAE,KAAK,gBAAgB,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AAG5F,OAAO,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAC;AACzD,OAAO,EAAE,KAAK,YAAY,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAGhF,OAAO,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAC;AACzD,OAAO,EAAE,KAAK,YAAY,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAGjF,OAAO,EAAE,IAAI,EAAE,MAAM,6BAA6B,CAAC;AACnD,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,SAAS,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAG1F,OAAO,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAC;AACzD,OAAO,EAAE,KAAK,YAAY,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAGhF,OAAO,EAAE,WAAW,EAAE,MAAM,2CAA2C,CAAC;AACxE,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAG7E,OAAO,EAAE,OAAO,EAAE,MAAM,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AAE,MAAM,2CAA2C,CAAC;AACvE,OAAO,EAAE,KAAK,gBAAgB,EAAE,KAAK,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAGpG,OAAO,EAAE,WAAW,EAAE,MAAM,6CAA6C,CAAC;AAC1E,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAG/E,OAAO,EAAE,WAAW,EAAE,MAAM,6CAA6C,CAAC;AAC1E,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAG/E,OAAO,EAAE,WAAW,EAAE,MAAM,6CAA6C,CAAC;AAC1E,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAG/E,OAAO,EAAE,WAAW,EAAE,MAAM,6CAA6C,CAAC;AAC1E,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAG/E,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAC3E,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAC3E,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,0BAA0B,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,102 +1,106 @@
|
|
|
1
1
|
/* empty css */
|
|
2
|
-
import { STORAGE as t, THEME_SCHEME as p } from "./utils/constants/
|
|
3
|
-
import { FACE_ICONS as
|
|
4
|
-
import { getLocalState as
|
|
5
|
-
import { assignRef as
|
|
6
|
-
import { capitalizeFirstLetter as
|
|
7
|
-
import { doc as
|
|
8
|
-
import { createImage as
|
|
9
|
-
import { themeController as
|
|
10
|
-
import { XProvider as
|
|
11
|
-
import { useXData as
|
|
12
|
-
import { ActionCard as
|
|
13
|
-
import { EActionCardSize as
|
|
14
|
-
import { Avatar as
|
|
15
|
-
import { EAvatarSize as
|
|
16
|
-
import { Button as
|
|
17
|
-
import { EButtonTypes as
|
|
18
|
-
import { Icon as
|
|
19
|
-
import { EIconSize as
|
|
20
|
-
import { Lottie as
|
|
21
|
-
import { ELottieSize as
|
|
22
|
-
import { ProgressBar as
|
|
23
|
-
import { Spinner as
|
|
24
|
-
import { ESpinnerSize as
|
|
25
|
-
import { Textfield as
|
|
26
|
-
import { DatePicker as
|
|
2
|
+
import { STORAGE as t, THEME_SCHEME as m, ThemeColorsPreset as p, defaultColorPreset as f } from "./utils/constants/theme.js";
|
|
3
|
+
import { FACE_ICONS as x } from "./utils/constants/iconCollection.js";
|
|
4
|
+
import { getLocalState as s, setLocalState as n } from "./utils/function/localStorage.js";
|
|
5
|
+
import { assignRef as S, mergeRefs as g } from "./utils/function/mergeRefs.js";
|
|
6
|
+
import { capitalizeFirstLetter as P, safeStringFromCodePoint as d, unicodeToString as C } from "./utils/function/string.js";
|
|
7
|
+
import { doc as T, elementObserver as u, getCssProperty as I, getCssPropertyPx as h, getCssPropertyVh as y, getCssPropertyVw as z, isClient as A, localStore as F, setCssProperty as k, waitForElement as v, win as L } from "./utils/helper/domHelper.js";
|
|
8
|
+
import { createImage as D, getCroppedImg as R, getImageSize as B, getRadianAngle as M, readImageFile as O, readImageSrc as X } from "./utils/helper/imageHelper.js";
|
|
9
|
+
import { themeController as H } from "./utils/helper/themeController.js";
|
|
10
|
+
import { XProvider as V } from "./components/context/index.js";
|
|
11
|
+
import { useXData as G, useXTheme as j } from "./components/context/useContext.js";
|
|
12
|
+
import { ActionCard as J } from "./components/base/ActionCard/ActionCard.js";
|
|
13
|
+
import { EActionCardSize as Q } from "./components/base/ActionCard/types.js";
|
|
14
|
+
import { Avatar as W } from "./components/base/Avatar/Avatar.js";
|
|
15
|
+
import { EAvatarSize as Z } from "./components/base/Avatar/types.js";
|
|
16
|
+
import { Button as ee } from "./components/base/Button/Button.js";
|
|
17
|
+
import { EButtonTypes as oe } from "./components/base/Button/types.js";
|
|
18
|
+
import { Icon as me } from "./components/base/Icon/Icon.js";
|
|
19
|
+
import { EIconSize as fe } from "./components/base/Icon/types.js";
|
|
20
|
+
import { Lottie as xe } from "./components/base/Lottie/Lottie.js";
|
|
21
|
+
import { ELottieSize as se } from "./components/base/Lottie/types.js";
|
|
22
|
+
import { ProgressBar as ce } from "./components/base/ProgressBar/ProgressBar.js";
|
|
23
|
+
import { Spinner as ge } from "./components/base/Spinner/Spinner.js";
|
|
24
|
+
import { ESpinnerSize as Pe } from "./components/base/Spinner/types.js";
|
|
25
|
+
import { Textfield as Ce } from "./components/base/Textfield/Textfield.js";
|
|
26
|
+
import { DatePicker as Te } from "./components/base/DatePicker/DatePicker.js";
|
|
27
27
|
import { EDatePickerTypes as Ie } from "./components/base/DatePicker/types.js";
|
|
28
|
-
import { FilePicker as
|
|
29
|
-
import { FilePickerIcon as
|
|
30
|
-
import { Select as
|
|
31
|
-
import { ColorPopper as
|
|
32
|
-
import { Sider as
|
|
33
|
-
import { SiderModal as
|
|
34
|
-
import { Navigation as
|
|
35
|
-
import { ThemePicker as
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
28
|
+
import { FilePicker as ye } from "./components/base/FilePicker/FilePicker.js";
|
|
29
|
+
import { FilePickerIcon as Ae } from "./components/base/FilePicker/types.js";
|
|
30
|
+
import { Select as ke } from "./components/base/Select/Select.js";
|
|
31
|
+
import { ColorPopper as Le } from "./components/base/ColorPopper/ColorPopper.js";
|
|
32
|
+
import { Sider as De } from "./components/layout/Sider/Sider.js";
|
|
33
|
+
import { SiderModal as Be } from "./components/layout/SiderModal/SiderModal.js";
|
|
34
|
+
import { Navigation as Oe } from "./components/layout/Navigation/Navigation.js";
|
|
35
|
+
import { ThemePicker as be } from "./components/layout/ThemePicker/ThemePicker.js";
|
|
36
|
+
import { ThemeSelect as Ne } from "./components/layout/ThemeSelect/ThemeSelect.js";
|
|
37
|
+
import { ThemeSwitch as _e } from "./components/layout/ThemeSwitch/ThemeSwitch.js";
|
|
38
|
+
import { ImageEditor as je } from "./components/layout/ImageEditor/ImageEditor.js";
|
|
39
|
+
import { useScreenType as Je } from "./components/hooks/useScreen.js";
|
|
40
|
+
import { usePersistingState as Qe } from "./components/hooks/usePersistingState.js";
|
|
41
|
+
import { useDebouncedEffect as We } from "./components/hooks/useDebouncedEffect.js";
|
|
41
42
|
export {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
43
|
+
J as ActionCard,
|
|
44
|
+
W as Avatar,
|
|
45
|
+
ee as Button,
|
|
46
|
+
Le as ColorPopper,
|
|
47
|
+
Te as DatePicker,
|
|
48
|
+
Q as EActionCardSize,
|
|
49
|
+
Z as EAvatarSize,
|
|
50
|
+
oe as EButtonTypes,
|
|
50
51
|
Ie as EDatePickerTypes,
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
52
|
+
fe as EIconSize,
|
|
53
|
+
se as ELottieSize,
|
|
54
|
+
Pe as ESpinnerSize,
|
|
55
|
+
x as FACE_ICONS,
|
|
56
|
+
ye as FilePicker,
|
|
57
|
+
Ae as FilePickerIcon,
|
|
58
|
+
me as Icon,
|
|
59
|
+
je as ImageEditor,
|
|
60
|
+
xe as Lottie,
|
|
61
|
+
Oe as Navigation,
|
|
62
|
+
ce as ProgressBar,
|
|
62
63
|
t as STORAGE,
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
be as
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
P as
|
|
76
|
-
|
|
77
|
-
|
|
64
|
+
ke as Select,
|
|
65
|
+
De as Sider,
|
|
66
|
+
Be as SiderModal,
|
|
67
|
+
ge as Spinner,
|
|
68
|
+
m as THEME_SCHEME,
|
|
69
|
+
Ce as Textfield,
|
|
70
|
+
p as ThemeColorsPreset,
|
|
71
|
+
be as ThemePicker,
|
|
72
|
+
Ne as ThemeSelect,
|
|
73
|
+
_e as ThemeSwitch,
|
|
74
|
+
V as XProvider,
|
|
75
|
+
S as assignRef,
|
|
76
|
+
P as capitalizeFirstLetter,
|
|
77
|
+
D as createImage,
|
|
78
|
+
f as defaultColorPreset,
|
|
79
|
+
T as doc,
|
|
80
|
+
u as elementObserver,
|
|
81
|
+
R as getCroppedImg,
|
|
78
82
|
I as getCssProperty,
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
83
|
+
h as getCssPropertyPx,
|
|
84
|
+
y as getCssPropertyVh,
|
|
85
|
+
z as getCssPropertyVw,
|
|
86
|
+
B as getImageSize,
|
|
87
|
+
s as getLocalState,
|
|
88
|
+
M as getRadianAngle,
|
|
89
|
+
A as isClient,
|
|
90
|
+
F as localStore,
|
|
91
|
+
g as mergeRefs,
|
|
92
|
+
O as readImageFile,
|
|
93
|
+
X as readImageSrc,
|
|
94
|
+
d as safeStringFromCodePoint,
|
|
95
|
+
k as setCssProperty,
|
|
96
|
+
n as setLocalState,
|
|
97
|
+
H as themeController,
|
|
98
|
+
C as unicodeToString,
|
|
99
|
+
We as useDebouncedEffect,
|
|
100
|
+
Qe as usePersistingState,
|
|
101
|
+
Je as useScreenType,
|
|
102
|
+
G as useXData,
|
|
103
|
+
j as useXTheme,
|
|
104
|
+
v as waitForElement,
|
|
105
|
+
L as win
|
|
102
106
|
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { EThemeScheme, TThemeColor } from '../../components/context/Theme/types';
|
|
2
|
+
export declare const STORAGE: {
|
|
3
|
+
themeSchemeAttr: string;
|
|
4
|
+
themeScheme: string;
|
|
5
|
+
themeColor: string;
|
|
6
|
+
};
|
|
7
|
+
export declare const THEME_SCHEME: readonly [{
|
|
8
|
+
readonly name: EThemeScheme.auto;
|
|
9
|
+
readonly icon: "e163";
|
|
10
|
+
}, {
|
|
11
|
+
readonly name: EThemeScheme.light;
|
|
12
|
+
readonly icon: "f763";
|
|
13
|
+
}, {
|
|
14
|
+
readonly name: EThemeScheme.dark;
|
|
15
|
+
readonly icon: "f754";
|
|
16
|
+
}];
|
|
17
|
+
export declare const ThemeColorsPreset: Record<string, TThemeColor>;
|
|
18
|
+
export declare const defaultColorPreset: TThemeColor;
|
|
19
|
+
//# sourceMappingURL=theme.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../../src/utils/constants/theme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAE5E,eAAO,MAAM,OAAO;;;;CAInB,CAAC;AAEF,eAAO,MAAM,YAAY;;;;;;;;;EAIf,CAAC;AAEX,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAWzD,CAAC;AAEF,eAAO,MAAM,kBAAkB,aAA2B,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { EThemeScheme as e } from "../../components/context/Theme/types.js";
|
|
2
|
+
const s = {
|
|
3
|
+
themeSchemeAttr: "data-theme-scheme",
|
|
4
|
+
themeScheme: "xThemeScheme",
|
|
5
|
+
themeColor: "xThemeColor"
|
|
6
|
+
}, m = [
|
|
7
|
+
{ name: e.auto, icon: "e163" },
|
|
8
|
+
{ name: e.light, icon: "f763" },
|
|
9
|
+
{ name: e.dark, icon: "f754" }
|
|
10
|
+
], h = {
|
|
11
|
+
cherry: { h: 350, s: 70, l: 50 },
|
|
12
|
+
blush: { h: 335, s: 75, l: 55 },
|
|
13
|
+
saffron: { h: 19, s: 100, l: 56 },
|
|
14
|
+
sunset: { h: 28, s: 80, l: 55 },
|
|
15
|
+
mango: { h: 45, s: 80, l: 50 },
|
|
16
|
+
clay: { h: 20, s: 25, l: 50 },
|
|
17
|
+
mint: { h: 135, s: 45, l: 50 },
|
|
18
|
+
ocean: { h: 170, s: 60, l: 55 },
|
|
19
|
+
sky: { h: 205, s: 75, l: 50 },
|
|
20
|
+
plum: { h: 280, s: 40, l: 55 }
|
|
21
|
+
}, t = h.orange;
|
|
22
|
+
export {
|
|
23
|
+
s as STORAGE,
|
|
24
|
+
m as THEME_SCHEME,
|
|
25
|
+
h as ThemeColorsPreset,
|
|
26
|
+
t as defaultColorPreset
|
|
27
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../src/utils/function/common.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,GAAI,GAAG,OAAO,EAAE,GAAG,OAAO,KAAG,OAKhD,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { TThemeColor } from '../../components/context/Theme/types';
|
|
2
|
+
export declare const guessClosestColorName: (color: TThemeColor) => any;
|
|
3
|
+
export declare function getColorLabel(c?: TThemeColor): string | undefined;
|
|
4
|
+
export declare const isValidThemeColor: (c?: TThemeColor) => boolean;
|
|
5
|
+
//# sourceMappingURL=colorHelper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"colorHelper.d.ts","sourceRoot":"","sources":["../../../src/utils/helper/colorHelper.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAG9D,eAAO,MAAM,qBAAqB,GAAI,OAAO,WAAW,QAUvD,CAAC;AAEF,wBAAgB,aAAa,CAAE,CAAC,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,SAAS,CAMlE;AAED,eAAO,MAAM,iBAAiB,GAAI,IAAI,WAAW,KAAG,OACiC,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import s from "color-namer";
|
|
2
|
+
import { colord as l } from "colord";
|
|
3
|
+
import { ThemeColorsPreset as m } from "../constants/theme.js";
|
|
4
|
+
const f = (e) => {
|
|
5
|
+
const t = l(e).toHex(), r = s(t);
|
|
6
|
+
let o = null;
|
|
7
|
+
for (const n of r.ntc)
|
|
8
|
+
(!o || n.distance < o.distance) && (o = n);
|
|
9
|
+
return (o == null ? void 0 : o.name) || void 0;
|
|
10
|
+
};
|
|
11
|
+
function p(e) {
|
|
12
|
+
if (e) {
|
|
13
|
+
for (const [t, r] of Object.entries(m))
|
|
14
|
+
if (e.h === r.h && e.s === r.s && e.l === r.l)
|
|
15
|
+
return t;
|
|
16
|
+
return f(e);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
const b = (e) => !!e && typeof e.h == "number" && typeof e.s == "number" && typeof e.l == "number";
|
|
20
|
+
export {
|
|
21
|
+
p as getColorLabel,
|
|
22
|
+
f as guessClosestColorName,
|
|
23
|
+
b as isValidThemeColor
|
|
24
|
+
};
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
import { TThemeColor } from '../../components/context/Theme/types';
|
|
2
|
+
export declare const themeController: (preferredScheme: string | undefined | null, preferredColor: TThemeColor | undefined | null, defaultScheme?: string, defaultColorPreset?: TThemeColor) => string;
|
|
2
3
|
//# sourceMappingURL=themeController.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"themeController.d.ts","sourceRoot":"","sources":["../../../src/utils/helper/themeController.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"themeController.d.ts","sourceRoot":"","sources":["../../../src/utils/helper/themeController.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmC,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAG/F,eAAO,MAAM,eAAe,GAC3B,iBAAiB,MAAM,GAAG,SAAS,GAAG,IAAI,EAC1C,gBAAgB,WAAW,GAAG,SAAS,GAAG,IAAI,EAC9C,gBAAe,MAAuB,EACtC,qBAAoB,WAAiC,WAiCrD,CAAC"}
|
|
@@ -1,16 +1,35 @@
|
|
|
1
|
-
import { defaultScheme as
|
|
2
|
-
import { STORAGE as e } from "../constants/
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { defaultScheme as c } from "../../components/context/Theme/types.js";
|
|
2
|
+
import { defaultColorPreset as d, STORAGE as e } from "../constants/theme.js";
|
|
3
|
+
const S = (r, t, o = c, m = d) => {
|
|
4
|
+
const s = JSON.stringify(r), l = t ? JSON.stringify(t) : "null", n = JSON.stringify(m);
|
|
5
|
+
return `(function() {
|
|
6
|
+
try {
|
|
7
|
+
const storedScheme = localStorage.getItem('${e.themeScheme}');
|
|
8
|
+
const themeScheme = ${s} ?? storedScheme ?? '${o}';
|
|
8
9
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
const themeColorRaw = localStorage.getItem('${e.themeColor}');
|
|
11
|
+
let {h, s, l} = ${n};
|
|
12
|
+
|
|
13
|
+
const preferredColor = ${l};
|
|
14
|
+
|
|
15
|
+
if (preferredColor) {
|
|
16
|
+
({h, s, l} = preferredColor);
|
|
17
|
+
} else {
|
|
18
|
+
try {
|
|
19
|
+
const parsed = JSON.parse(themeColorRaw);
|
|
20
|
+
if (parsed && typeof parsed.h === 'number' && typeof parsed.s === 'number' && typeof parsed.l === 'number') {
|
|
21
|
+
({h, s, l} = parsed);
|
|
22
|
+
}
|
|
23
|
+
} catch {}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
document.documentElement.setAttribute('${e.themeSchemeAttr}', themeScheme);
|
|
27
|
+
document.documentElement.style.setProperty('--H', h.toString());
|
|
28
|
+
document.documentElement.style.setProperty('--S', s + '%');
|
|
29
|
+
document.documentElement.style.setProperty('--L', l + '%');
|
|
30
|
+
} catch {}
|
|
31
|
+
})();`;
|
|
32
|
+
};
|
|
14
33
|
export {
|
|
15
|
-
|
|
34
|
+
S as themeController
|
|
16
35
|
};
|
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,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,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"}
|