xtreme-ui 0.0.83 → 0.0.85
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/Button/types.d.ts +3 -4
- package/dist/components/base/Button/types.d.ts.map +1 -1
- package/dist/components/layout/SchemeSwitch/SchemeSwitch.d.ts +1 -1
- package/dist/components/layout/SchemeSwitch/SchemeSwitch.d.ts.map +1 -1
- package/dist/components/layout/SchemeSwitch/SchemeSwitch.js +19 -18
- package/dist/index.js +77 -76
- package/dist/utils/function/mergeRefs.d.ts +3 -2
- package/dist/utils/function/mergeRefs.d.ts.map +1 -1
- package/dist/utils/function/mergeRefs.js +17 -6
- package/package.json +1 -1
|
@@ -5,7 +5,7 @@ export declare enum EButtonSize {
|
|
|
5
5
|
default = "default",
|
|
6
6
|
large = "large"
|
|
7
7
|
}
|
|
8
|
-
interface BaseButton extends HTMLAttributes<HTMLButtonElement> {
|
|
8
|
+
export interface BaseButton extends HTMLAttributes<HTMLButtonElement> {
|
|
9
9
|
className?: string;
|
|
10
10
|
style?: CSSProperties;
|
|
11
11
|
type?: keyof typeof EButtonTypes;
|
|
@@ -16,11 +16,11 @@ interface BaseButton extends HTMLAttributes<HTMLButtonElement> {
|
|
|
16
16
|
iconPosition?: 'left' | 'right';
|
|
17
17
|
onClick?: () => void;
|
|
18
18
|
}
|
|
19
|
-
interface ButtonWithLabel extends BaseButton {
|
|
19
|
+
export interface ButtonWithLabel extends BaseButton {
|
|
20
20
|
label: string;
|
|
21
21
|
icon?: string;
|
|
22
22
|
}
|
|
23
|
-
interface ButtonWithIconName extends BaseButton {
|
|
23
|
+
export interface ButtonWithIconName extends BaseButton {
|
|
24
24
|
label?: string;
|
|
25
25
|
icon: string;
|
|
26
26
|
}
|
|
@@ -33,5 +33,4 @@ export declare enum EButtonTypes {
|
|
|
33
33
|
link = "link",
|
|
34
34
|
linkDanger = "linkDanger"
|
|
35
35
|
}
|
|
36
|
-
export {};
|
|
37
36
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/base/Button/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAEtD,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1C,oBAAY,WAAW;IACtB,IAAI,SAAS;IACb,OAAO,YAAY;IACnB,KAAK,UAAU;CACf;AACD,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/base/Button/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAEtD,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1C,oBAAY,WAAW;IACtB,IAAI,SAAS;IACb,OAAO,YAAY;IACnB,KAAK,UAAU;CACf;AACD,MAAM,WAAW,UAAW,SAAQ,cAAc,CAAC,iBAAiB,CAAC;IACpE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,IAAI,CAAC,EAAE,MAAM,OAAO,YAAY,CAAC;IACjC,IAAI,CAAC,EAAE,MAAM,OAAO,WAAW,CAAC;IAChC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,OAAO,SAAS,CAAC;IAClC,YAAY,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAChC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,MAAM,WAAW,eAAgB,SAAQ,UAAU;IAClD,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,kBAAmB,SAAQ,UAAU;IACrD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACb;AAED,MAAM,MAAM,YAAY,GAAG,eAAe,GAAG,kBAAkB,CAAC;AAEhE,oBAAY,YAAY;IACvB,OAAO,YAAY;IACnB,aAAa,kBAAkB;IAC/B,SAAS,cAAc;IACvB,eAAe,oBAAoB;IACnC,IAAI,SAAS;IACb,UAAU,eAAe;CACzB"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { TSchemeSwitchProps } from './types';
|
|
2
|
-
export declare const SchemeSwitch: import('react').ForwardRefExoticComponent<TSchemeSwitchProps & import('react').RefAttributes<
|
|
2
|
+
export declare const SchemeSwitch: import('react').ForwardRefExoticComponent<TSchemeSwitchProps & import('react').RefAttributes<HTMLButtonElement>>;
|
|
3
3
|
//# sourceMappingURL=SchemeSwitch.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SchemeSwitch.d.ts","sourceRoot":"","sources":["../../../../src/components/layout/SchemeSwitch/SchemeSwitch.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SchemeSwitch.d.ts","sourceRoot":"","sources":["../../../../src/components/layout/SchemeSwitch/SchemeSwitch.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAE7C,eAAO,MAAM,YAAY,kHAyBvB,CAAC"}
|
|
@@ -1,28 +1,29 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import { Button as
|
|
5
|
-
import { useXTheme as
|
|
2
|
+
import { jsx as p } from "react/jsx-runtime";
|
|
3
|
+
import { forwardRef as S, useMemo as n } from "react";
|
|
4
|
+
import { Button as y } from "../../base/Button/Button.js";
|
|
5
|
+
import { useXTheme as T } from "../../context/useContext.js";
|
|
6
6
|
import { THEME_SCHEME as o } from "../../../utils/constants/commons.js";
|
|
7
|
-
const
|
|
8
|
-
const { className:
|
|
7
|
+
const w = S((r, c) => {
|
|
8
|
+
const { className: i, withLabel: s = !1, type: a = "secondary", size: h = "default", iconType: f = "solid" } = r, { themeScheme: e, setThemeScheme: l } = T(), m = n(() => o[(o.findIndex((t) => t.name === e) + 1) % o.length], [e]), u = n(() => {
|
|
9
9
|
var t;
|
|
10
|
-
return ((t = o.find((
|
|
10
|
+
return ((t = o.find((d) => d.name === e)) == null ? void 0 : t.icon) ?? "";
|
|
11
11
|
}, [e]);
|
|
12
|
-
return /* @__PURE__ */
|
|
13
|
-
|
|
12
|
+
return /* @__PURE__ */ p(
|
|
13
|
+
y,
|
|
14
14
|
{
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
15
|
+
ref: c,
|
|
16
|
+
className: i,
|
|
17
|
+
type: a,
|
|
18
|
+
size: h,
|
|
19
|
+
icon: u,
|
|
20
|
+
iconType: f,
|
|
21
|
+
label: s ? `${e === "system" ? "auto" : e}` : void 0,
|
|
22
|
+
onClick: () => m.name && l(m.name)
|
|
22
23
|
}
|
|
23
24
|
);
|
|
24
25
|
});
|
|
25
|
-
|
|
26
|
+
w.displayName = "SchemeSwitch";
|
|
26
27
|
export {
|
|
27
|
-
|
|
28
|
+
w as SchemeSwitch
|
|
28
29
|
};
|
package/dist/index.js
CHANGED
|
@@ -1,93 +1,94 @@
|
|
|
1
1
|
/* empty css */
|
|
2
2
|
import { STORAGE as t, THEME_SCHEME as m } from "./utils/constants/commons.js";
|
|
3
3
|
import { getLocalState as i, setLocalState as f } from "./utils/function/localStorage.js";
|
|
4
|
-
import {
|
|
5
|
-
import { capitalizeFirstLetter as
|
|
6
|
-
import { doc as
|
|
7
|
-
import { createImage as
|
|
4
|
+
import { assignRef as a, mergeRefs as s } from "./utils/function/mergeRefs.js";
|
|
5
|
+
import { capitalizeFirstLetter as c, safeStringFromCodePoint as g, unicodeToString as S } from "./utils/function/string.js";
|
|
6
|
+
import { doc as d, elementObserver as P, getCssProperty as E, getCssPropertyPx as C, getCssPropertyVh as I, getCssPropertyVw as T, isClient as y, localStore as z, setCssProperty as h, waitForElement as A, win as F } from "./utils/helper/domHelper.js";
|
|
7
|
+
import { createImage as u, getCroppedImg as v, getImageSize as L, getRadianAngle as w, readImageFile as R, readImageSrc as B } from "./utils/helper/imageHelper.js";
|
|
8
8
|
import { themeController as M } from "./utils/helper/themeController.js";
|
|
9
|
-
import { XProvider as
|
|
10
|
-
import { useXData as
|
|
11
|
-
import { ActionCard as
|
|
12
|
-
import { EActionCardSize as
|
|
13
|
-
import { Avatar as
|
|
14
|
-
import { EAvatarSize as
|
|
15
|
-
import { Button as
|
|
16
|
-
import { EButtonTypes as
|
|
17
|
-
import { Icon as
|
|
18
|
-
import { EIconSize as
|
|
19
|
-
import { Lottie as
|
|
20
|
-
import { ELottieSize as
|
|
21
|
-
import { ProgressBar as
|
|
22
|
-
import { Spinner as
|
|
23
|
-
import { ESpinnerSize as
|
|
9
|
+
import { XProvider as H } from "./components/context/index.js";
|
|
10
|
+
import { useXData as V, useXTheme as b } from "./components/context/useContext.js";
|
|
11
|
+
import { ActionCard as N } from "./components/base/ActionCard/ActionCard.js";
|
|
12
|
+
import { EActionCardSize as j } from "./components/base/ActionCard/types.js";
|
|
13
|
+
import { Avatar as J } from "./components/base/Avatar/Avatar.js";
|
|
14
|
+
import { EAvatarSize as Q } from "./components/base/Avatar/types.js";
|
|
15
|
+
import { Button as W } from "./components/base/Button/Button.js";
|
|
16
|
+
import { EButtonTypes as Z } from "./components/base/Button/types.js";
|
|
17
|
+
import { Icon as ee } from "./components/base/Icon/Icon.js";
|
|
18
|
+
import { EIconSize as oe } from "./components/base/Icon/types.js";
|
|
19
|
+
import { Lottie as me } from "./components/base/Lottie/Lottie.js";
|
|
20
|
+
import { ELottieSize as ie } from "./components/base/Lottie/types.js";
|
|
21
|
+
import { ProgressBar as xe } from "./components/base/ProgressBar/ProgressBar.js";
|
|
22
|
+
import { Spinner as se } from "./components/base/Spinner/Spinner.js";
|
|
23
|
+
import { ESpinnerSize as ce } from "./components/base/Spinner/types.js";
|
|
24
24
|
import { Textfield as Se } from "./components/base/Textfield/Textfield.js";
|
|
25
|
-
import { DatePicker as
|
|
26
|
-
import { EDatePickerTypes as
|
|
27
|
-
import { FilePicker as
|
|
28
|
-
import { FilePickerIcon as
|
|
29
|
-
import { Select as
|
|
30
|
-
import { ColorPopper as
|
|
31
|
-
import { Sider as
|
|
32
|
-
import { SiderModal as
|
|
33
|
-
import { Navigation as
|
|
25
|
+
import { DatePicker as de } from "./components/base/DatePicker/DatePicker.js";
|
|
26
|
+
import { EDatePickerTypes as Ee } from "./components/base/DatePicker/types.js";
|
|
27
|
+
import { FilePicker as Ie } from "./components/base/FilePicker/FilePicker.js";
|
|
28
|
+
import { FilePickerIcon as ye } from "./components/base/FilePicker/types.js";
|
|
29
|
+
import { Select as he } from "./components/base/Select/Select.js";
|
|
30
|
+
import { ColorPopper as Fe } from "./components/base/ColorPopper/ColorPopper.js";
|
|
31
|
+
import { Sider as ue } from "./components/layout/Sider/Sider.js";
|
|
32
|
+
import { SiderModal as Le } from "./components/layout/SiderModal/SiderModal.js";
|
|
33
|
+
import { Navigation as Re } from "./components/layout/Navigation/Navigation.js";
|
|
34
34
|
import { ThemePicker as De } from "./components/layout/ThemePicker/ThemePicker.js";
|
|
35
|
-
import { SchemeSwitch as
|
|
36
|
-
import { ImageEditor as
|
|
35
|
+
import { SchemeSwitch as Xe } from "./components/layout/SchemeSwitch/SchemeSwitch.js";
|
|
36
|
+
import { ImageEditor as Oe } from "./components/layout/ImageEditor/ImageEditor.js";
|
|
37
37
|
export {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
38
|
+
N as ActionCard,
|
|
39
|
+
J as Avatar,
|
|
40
|
+
W as Button,
|
|
41
|
+
Fe as ColorPopper,
|
|
42
|
+
de as DatePicker,
|
|
43
|
+
j as EActionCardSize,
|
|
44
|
+
Q as EAvatarSize,
|
|
45
|
+
Z as EButtonTypes,
|
|
46
|
+
Ee as EDatePickerTypes,
|
|
47
|
+
oe as EIconSize,
|
|
48
|
+
ie as ELottieSize,
|
|
49
|
+
ce as ESpinnerSize,
|
|
50
|
+
Ie as FilePicker,
|
|
51
|
+
ye as FilePickerIcon,
|
|
52
|
+
ee as Icon,
|
|
53
|
+
Oe as ImageEditor,
|
|
54
|
+
me as Lottie,
|
|
55
|
+
Re as Navigation,
|
|
56
|
+
xe as ProgressBar,
|
|
57
57
|
t as STORAGE,
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
58
|
+
Xe as SchemeSwitch,
|
|
59
|
+
he as Select,
|
|
60
|
+
ue as Sider,
|
|
61
|
+
Le as SiderModal,
|
|
62
|
+
se as Spinner,
|
|
63
63
|
m as THEME_SCHEME,
|
|
64
64
|
Se as Textfield,
|
|
65
65
|
De as ThemePicker,
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
d as
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
E as
|
|
74
|
-
C as
|
|
75
|
-
I as
|
|
76
|
-
|
|
66
|
+
H as XProvider,
|
|
67
|
+
a as assignRef,
|
|
68
|
+
c as capitalizeFirstLetter,
|
|
69
|
+
u as createImage,
|
|
70
|
+
d as doc,
|
|
71
|
+
P as elementObserver,
|
|
72
|
+
v as getCroppedImg,
|
|
73
|
+
E as getCssProperty,
|
|
74
|
+
C as getCssPropertyPx,
|
|
75
|
+
I as getCssPropertyVh,
|
|
76
|
+
T as getCssPropertyVw,
|
|
77
|
+
L as getImageSize,
|
|
77
78
|
i as getLocalState,
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
79
|
+
w as getRadianAngle,
|
|
80
|
+
y as isClient,
|
|
81
|
+
z as localStore,
|
|
82
|
+
s as mergeRefs,
|
|
83
|
+
R as readImageFile,
|
|
83
84
|
B as readImageSrc,
|
|
84
|
-
|
|
85
|
-
|
|
85
|
+
g as safeStringFromCodePoint,
|
|
86
|
+
h as setCssProperty,
|
|
86
87
|
f as setLocalState,
|
|
87
88
|
M as themeController,
|
|
88
89
|
S as unicodeToString,
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
90
|
+
V as useXData,
|
|
91
|
+
b as useXTheme,
|
|
92
|
+
A as waitForElement,
|
|
93
|
+
F as win
|
|
93
94
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare
|
|
1
|
+
import { Ref, RefCallback } from 'react';
|
|
2
|
+
export declare function assignRef<T>(ref: Ref<T> | undefined | null, value: T | null): void;
|
|
3
|
+
export declare function mergeRefs<T>(refs: (Ref<T> | undefined | null)[]): RefCallback<T>;
|
|
3
4
|
//# sourceMappingURL=mergeRefs.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mergeRefs.d.ts","sourceRoot":"","sources":["../../../src/utils/function/mergeRefs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"mergeRefs.d.ts","sourceRoot":"","sources":["../../../src/utils/function/mergeRefs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAEzC,wBAAgB,SAAS,CAAC,CAAC,EAC1B,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,GAAG,SAAS,GAAG,IAAI,EAC9B,KAAK,EAAE,CAAC,GAAG,IAAI,GACb,IAAI,CAUN;AAED,wBAAgB,SAAS,CAAC,CAAC,EAAG,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,SAAS,GAAG,IAAI,CAAC,EAAE,GAAG,WAAW,CAAC,CAAC,CAAC,CAIjF"}
|
|
@@ -1,8 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
function r(n, t) {
|
|
2
|
+
if (typeof n == "function")
|
|
3
|
+
n(t);
|
|
4
|
+
else if (n != null)
|
|
5
|
+
try {
|
|
6
|
+
n.current = t;
|
|
7
|
+
} catch {
|
|
8
|
+
throw new Error(`Cannot assign value "${t}" to ref "${n}"`);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
function c(n) {
|
|
12
|
+
return (t) => {
|
|
13
|
+
n.forEach((o) => r(o, t));
|
|
14
|
+
};
|
|
15
|
+
}
|
|
6
16
|
export {
|
|
7
|
-
|
|
17
|
+
r as assignRef,
|
|
18
|
+
c as mergeRefs
|
|
8
19
|
};
|