xtreme-ui 0.0.127 → 0.0.128
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/Avatar/Avatar.d.ts.map +1 -1
- package/dist/components/Button/Button.d.ts.map +1 -1
- package/dist/components/Button/types.d.ts +5 -2
- package/dist/components/Button/types.d.ts.map +1 -1
- package/dist/components/ColorPopper/ColorPopper.d.ts +1 -1
- package/dist/components/ColorPopper/ColorPopper.d.ts.map +1 -1
- package/dist/components/FilePicker/FilePicker.d.ts.map +1 -1
- package/dist/components/Select/types.d.ts +2 -2
- package/dist/components/Select/types.d.ts.map +1 -1
- package/dist/components/Textfield/types.d.ts +2 -2
- package/dist/components/Textfield/types.d.ts.map +1 -1
- package/dist/components/ThemeSwitch/ThemeSwitch.d.ts.map +1 -1
- package/dist/components/ThemeSwitch/types.d.ts +2 -3
- package/dist/components/ThemeSwitch/types.d.ts.map +1 -1
- package/dist/components/base/Avatar/Avatar.js +19 -19
- package/dist/components/base/Button/Button.js +16 -12
- package/dist/components/base/FilePicker/FilePicker.js +18 -18
- package/dist/components/layout/ThemeSwitch/ThemeSwitch.js +25 -22
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Avatar.d.ts","sourceRoot":"","sources":["../../../../src/components/base/Avatar/Avatar.tsx"],"names":[],"mappings":"AASA,OAAO,eAAe,CAAC;AACvB,OAAO,EAAe,KAAK,YAAY,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"Avatar.d.ts","sourceRoot":"","sources":["../../../../src/components/base/Avatar/Avatar.tsx"],"names":[],"mappings":"AASA,OAAO,eAAe,CAAC;AACvB,OAAO,EAAe,KAAK,YAAY,EAAE,MAAM,SAAS,CAAC;AAIzD,eAAO,MAAM,MAAM,yGA2DjB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../../src/components/base/Button/Button.tsx"],"names":[],"mappings":"AAMA,OAAO,eAAe,CAAC;AACvB,OAAO,EAAgB,KAAK,YAAY,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../../src/components/base/Button/Button.tsx"],"names":[],"mappings":"AAMA,OAAO,eAAe,CAAC;AACvB,OAAO,EAAgB,KAAK,YAAY,EAAE,MAAM,SAAS,CAAC;AAU1D,eAAO,MAAM,MAAM,4GAiBjB,CAAC"}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TIconProps } from 'gliff';
|
|
2
2
|
import { CSSProperties, HTMLAttributes } from 'react';
|
|
3
|
+
export type TClassicIconType = Extract<TIconProps, {
|
|
4
|
+
set?: "classic";
|
|
5
|
+
}>["type"];
|
|
3
6
|
export declare enum EButtonSize {
|
|
4
7
|
mini = "mini",
|
|
5
8
|
default = "default",
|
|
@@ -12,7 +15,7 @@ export interface BaseButton extends HTMLAttributes<HTMLButtonElement> {
|
|
|
12
15
|
size?: keyof typeof EButtonSize;
|
|
13
16
|
loading?: boolean;
|
|
14
17
|
disabled?: boolean;
|
|
15
|
-
iconType?:
|
|
18
|
+
iconType?: TClassicIconType;
|
|
16
19
|
iconPosition?: "left" | "right";
|
|
17
20
|
onClick?: () => void;
|
|
18
21
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/base/Button/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAE3D,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,MAA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U;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,5 +1,5 @@
|
|
|
1
|
+
import { AnyColor } from 'colord';
|
|
1
2
|
import { Ref } from 'react';
|
|
2
|
-
import { AnyColor } from 'colord/types';
|
|
3
3
|
import { TColorPopperProps } from './types';
|
|
4
4
|
declare function ColorPopperInner<T extends AnyColor = AnyColor>(props: TColorPopperProps<T>, ref: Ref<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
declare namespace ColorPopperInner {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColorPopper.d.ts","sourceRoot":"","sources":["../../../../src/components/base/ColorPopper/ColorPopper.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ColorPopper.d.ts","sourceRoot":"","sources":["../../../../src/components/base/ColorPopper/ColorPopper.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,QAAQ,EAAkD,MAAM,QAAQ,CAAC;AAEvF,OAAO,EAAc,KAAK,GAAG,EAAwC,MAAM,OAAO,CAAC;AAUnF,OAAO,oBAAoB,CAAC;AAE5B,OAAO,KAAK,EAAoB,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAEnE,iBAAS,gBAAgB,CAAC,CAAC,SAAS,QAAQ,GAAG,QAAQ,EAAE,KAAK,EAAE,iBAAiB,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,cAAc,CAAC,2CA6O7G;kBA7OQ,gBAAgB;;;AA+OzB,eAAO,MAAM,WAAW,EAAmC,CAAC,CAAC,SAAS,QAAQ,GAAG,QAAQ,EACxF,KAAK,EAAE,iBAAiB,CAAC,CAAC,CAAC,GAAG;IAAE,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAA;CAAE,KACvD,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FilePicker.d.ts","sourceRoot":"","sources":["../../../../src/components/base/FilePicker/FilePicker.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"FilePicker.d.ts","sourceRoot":"","sources":["../../../../src/components/base/FilePicker/FilePicker.tsx"],"names":[],"mappings":"AAUA,OAAO,mBAAmB,CAAC;AAE3B,OAAO,EAAa,KAAK,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAI3D,eAAO,MAAM,UAAU,GAAI,OAAO,gBAAgB,4CA8CjD,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ICON_TYPES } from 'gliff';
|
|
2
1
|
import { ReactNode } from 'react';
|
|
2
|
+
import { TClassicIconType } from '../Button/types';
|
|
3
3
|
export declare enum ESelectSize {
|
|
4
4
|
mini = "mini",
|
|
5
5
|
default = "default",
|
|
@@ -16,7 +16,7 @@ type TCommonProps<T> = {
|
|
|
16
16
|
}) => ReactNode;
|
|
17
17
|
size?: keyof typeof ESelectSize;
|
|
18
18
|
icon?: string;
|
|
19
|
-
iconType?:
|
|
19
|
+
iconType?: TClassicIconType;
|
|
20
20
|
placeholder?: string;
|
|
21
21
|
clearable?: boolean;
|
|
22
22
|
searchable?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/base/Select/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/base/Select/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC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IAAI,CAAC;CAC/B,CAAC;AAEF,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI,WAAW,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ICON_TYPES } from 'gliff';
|
|
2
1
|
import { ChangeEvent, CSSProperties, FocusEvent, KeyboardEvent } from 'react';
|
|
2
|
+
import { TClassicIconType } from '../Button/types';
|
|
3
3
|
export type TTextfieldProps = {
|
|
4
4
|
className?: string;
|
|
5
5
|
style?: CSSProperties;
|
|
@@ -10,7 +10,7 @@ export type TTextfieldProps = {
|
|
|
10
10
|
autoFocus?: boolean;
|
|
11
11
|
autoComplete?: keyof typeof ETextfieldAutoComplete;
|
|
12
12
|
icon?: string;
|
|
13
|
-
iconType?:
|
|
13
|
+
iconType?: TClassicIconType;
|
|
14
14
|
value?: string;
|
|
15
15
|
id?: string;
|
|
16
16
|
onChange?: (event: ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/base/Textfield/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/base/Textfield/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACnF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAExD,MAAM,MAAM,eAAe,GAAG;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,IAAI,CAAC,EAAE,MAAM,OAAO,cAAc,CAAC;IACnC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACn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AkB;IACjC,oBAAoB,uBAAuB;IAC3C,YAAY,iBAAiB;IAC7B,gBAAgB,mBAAmB;IACnC,eAAe,kBAAkB;IACjC,eAAe,kBAAkB;IACjC,eAAe,kBAAkB;IACjC,gBAAgB,mBAAmB;IACnC,gBAAgB,mBAAmB;IACnC,gBAAgB,mBAAmB;IACnC,gBAAgB,mBAAmB;IACnC,OAAO,YAAY;IACnB,cAAc,iBAAiB;IAC/B,aAAa,gBAAgB;IAC7B,SAAS,YAAY;IACrB,eAAe,kBAAkB;IACjC,oBAAoB,uBAAuB;IAC3C,gBAAgB,mBAAmB;IACnC,WAAW,cAAc;IACzB,QAAQ,WAAW;IACnB,cAAc,iBAAiB;IAC/B,aAAa,gBAAgB;IAC7B,QAAQ,WAAW;IACnB,SAAS,YAAY;IACrB,sBAAsB,yBAAyB;IAC/C,oBAAoB,uBAAuB;IAC3C,QAAQ,aAAa;IACrB,IAAI,SAAS;IACb,UAAU,aAAa;IACvB,YAAY,eAAe;IAC3B,WAAW,cAAc;IACzB,GAAG,QAAQ;IACX,kBAAkB,qBAAqB;IACvC,cAAc,iBAAiB;IAC/B,eAAe,kBAAkB;IACjC,WAAW,cAAc;IACzB,eAAe,kBAAkB;CACjC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeSwitch.d.ts","sourceRoot":"","sources":["../../../../src/components/layout/ThemeSwitch/ThemeSwitch.tsx"],"names":[],"mappings":"AAUA,OAAO,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AASjD,eAAO,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"ThemeSwitch.d.ts","sourceRoot":"","sources":["../../../../src/components/layout/ThemeSwitch/ThemeSwitch.tsx"],"names":[],"mappings":"AAUA,OAAO,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AASjD,eAAO,MAAM,WAAW,8GA2DtB,CAAC"}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { EButtonSize, EButtonTypes } from '../../base/Button/types';
|
|
1
|
+
import { EButtonSize, EButtonTypes, TClassicIconType } from '../../base/Button/types';
|
|
3
2
|
export type TThemeSwitchProps = {
|
|
4
3
|
className?: string;
|
|
5
4
|
withLabel?: boolean;
|
|
6
5
|
type?: keyof typeof EButtonTypes;
|
|
7
6
|
size?: keyof typeof EButtonSize;
|
|
8
|
-
iconType?:
|
|
7
|
+
iconType?: TClassicIconType;
|
|
9
8
|
};
|
|
10
9
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/layout/ThemeSwitch/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/layout/ThemeSwitch/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAE3F,MAAM,MAAM,iBAAiB,GAAG;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,OAAO,YAAY,CAAC;IACjC,IAAI,CAAC,EAAE,MAAM,OAAO,WAAW,CAAC;IAChC,QAAQ,CAAC,EAAE,gBAAgB,CAAC;CAC5B,CAAC"}
|
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as i } from "react/jsx-runtime";
|
|
3
|
-
import
|
|
4
|
-
import { Icon as
|
|
5
|
-
import { forwardRef as
|
|
3
|
+
import E from "clsx";
|
|
4
|
+
import { Icon as C } from "gliff";
|
|
5
|
+
import { forwardRef as F, useState as c, useEffect as L } from "react";
|
|
6
6
|
import { FACE_ICONS as m } from "../../../utils/constants/iconCollection.js";
|
|
7
|
-
import { readImageFile as
|
|
7
|
+
import { readImageFile as b, readImageSrc as M } from "../../../utils/helper/imageHelper.js";
|
|
8
8
|
import './avatar.css';/* empty css */
|
|
9
|
-
import { EAvatarSize as
|
|
10
|
-
const
|
|
11
|
-
const { className: u, src: a, file:
|
|
12
|
-
e && setTimeout(() => f(e), 300), setTimeout(() =>
|
|
9
|
+
import { EAvatarSize as R } from "./types.js";
|
|
10
|
+
const T = F((h, g) => {
|
|
11
|
+
const { className: u, src: a, file: t, alt: y, placeholderIcon: v, size: l = "default", onClick: I } = h, [n, f] = c(), [S, x] = c(m.happy[0]), [A, o] = c(!!a || !!t), [p, r] = c(!1), d = typeof l == "number" ? l : R[l], N = { "--iconSize": `${8 + d / 4}px` }, z = E("xtrAvatar", u, A && "loading", p && "error"), s = (e) => {
|
|
12
|
+
e && setTimeout(() => f(e), 300), setTimeout(() => o(!1), 1e3);
|
|
13
13
|
};
|
|
14
|
-
return
|
|
15
|
-
|
|
14
|
+
return L(() => {
|
|
15
|
+
x(m.happy[Math.floor(Math.random() * m.happy.length)]);
|
|
16
16
|
try {
|
|
17
|
-
|
|
18
|
-
console.log(e),
|
|
19
|
-
})) : a ? (
|
|
20
|
-
console.log(e, a),
|
|
17
|
+
t ? (o(!0), r(!1), b(t).then((e) => s(e)).catch((e) => {
|
|
18
|
+
console.log(e), o(!1), r(!0);
|
|
19
|
+
})) : a ? (o(!0), r(!1), M(a).then((e) => s(e)).catch((e) => {
|
|
20
|
+
console.log(e, a), o(!1), r(!0);
|
|
21
21
|
})) : (f(void 0), s());
|
|
22
22
|
} catch {
|
|
23
23
|
s();
|
|
24
24
|
}
|
|
25
|
-
}, [a,
|
|
25
|
+
}, [a, t]), /* @__PURE__ */ i("div", { ref: g, className: z, style: { "--avatarSize": `${d}px` }, onClick: I, role: "img", children: n ? (
|
|
26
26
|
// biome-ignore lint/performance/noImgElement: library component wrapping img
|
|
27
|
-
/* @__PURE__ */ i("img", { className: "image", src: n, alt:
|
|
28
|
-
) : /* @__PURE__ */ i(
|
|
27
|
+
/* @__PURE__ */ i("img", { className: "image", src: n, alt: y })
|
|
28
|
+
) : /* @__PURE__ */ i(C, { className: "placeholder", type: "solid", style: N, code: p ? "e1b7" : v ?? S }) });
|
|
29
29
|
});
|
|
30
|
-
|
|
30
|
+
T.displayName = "Avatar";
|
|
31
31
|
export {
|
|
32
|
-
|
|
32
|
+
T as Avatar
|
|
33
33
|
};
|
|
@@ -1,21 +1,25 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import
|
|
2
|
+
import { jsxs as x, jsx as i } from "react/jsx-runtime";
|
|
3
|
+
import N from "clsx";
|
|
4
4
|
import { Icon as B } from "gliff";
|
|
5
|
-
import { forwardRef as
|
|
6
|
-
import { ProgressBar as
|
|
5
|
+
import { forwardRef as g } from "react";
|
|
6
|
+
import { ProgressBar as z } from "../ProgressBar/ProgressBar.js";
|
|
7
7
|
import './button.css';/* empty css */
|
|
8
|
-
import { EButtonTypes as
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
import { EButtonTypes as S } from "./types.js";
|
|
9
|
+
const b = {
|
|
10
|
+
mini: { "--iconSize": "12px" },
|
|
11
|
+
default: { "--iconSize": "14px" },
|
|
12
|
+
large: { "--iconSize": "22px" }
|
|
13
|
+
}, h = g((a, c) => {
|
|
14
|
+
const { className: m, style: p = {}, label: e, type: t = "primary", size: n = "default", disabled: d = !1, loading: l = !1, icon: o, iconType: f, iconPosition: s = "left", onClick: u } = a, r = o ? /* @__PURE__ */ i(B, { className: "icon", code: o, type: f, style: b[n] }) : null, y = N("xtrButton", "shadowRipple", `${t}Type`, `${n}Size`, !e && "iconOnly", l && "loading", m);
|
|
15
|
+
return !e && !o ? null : /* @__PURE__ */ x("button", { ref: c, className: y, style: p, onClick: u, disabled: d, children: [
|
|
16
|
+
t.includes(S.link) && /* @__PURE__ */ i(z, { className: "underline", intermediate: l }),
|
|
13
17
|
s === "left" && r,
|
|
14
|
-
|
|
18
|
+
e && /* @__PURE__ */ i("span", { className: "label", children: e }),
|
|
15
19
|
s === "right" && r
|
|
16
20
|
] });
|
|
17
21
|
});
|
|
18
|
-
|
|
22
|
+
h.displayName = "Button";
|
|
19
23
|
export {
|
|
20
|
-
|
|
24
|
+
h as Button
|
|
21
25
|
};
|
|
@@ -1,38 +1,38 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as c, Fragment as f, jsx as
|
|
3
|
-
import
|
|
4
|
-
import { Icon as
|
|
2
|
+
import { jsxs as c, Fragment as f, jsx as l } from "react/jsx-runtime";
|
|
3
|
+
import x from "clsx";
|
|
4
|
+
import { Icon as C } from "gliff";
|
|
5
5
|
import { createPortal as b } from "react-dom";
|
|
6
6
|
import { useFilePicker as P } from "use-file-picker";
|
|
7
7
|
import { ImageEditor as u } from "../../layout/ImageEditor/ImageEditor.js";
|
|
8
|
-
import { Button as
|
|
8
|
+
import { Button as y } from "../Button/Button.js";
|
|
9
9
|
import './filePicker.css';/* empty css */
|
|
10
|
-
import { getFilePickerIcon as
|
|
11
|
-
import { imageExts as
|
|
12
|
-
const
|
|
13
|
-
const { className: g, children: n, draggable: d = !1, editable: h = !1, multiple:
|
|
10
|
+
import { getFilePickerIcon as I } from "./getFilePickerIcon.js";
|
|
11
|
+
import { imageExts as N } from "./types.js";
|
|
12
|
+
const S = { "--iconSize": "64px" }, A = (F) => {
|
|
13
|
+
const { className: g, children: n, draggable: d = !1, editable: h = !1, multiple: i = !1, accept: o = "*/*", onChange: t } = F, s = h && !i && (o.includes("image") || N.includes(o?.split?.(",")?.[0]?.replace(".", ""))), { openFilePicker: a, loading: k, plainFiles: r, clear: p } = P({
|
|
14
14
|
accept: o,
|
|
15
|
-
multiple:
|
|
15
|
+
multiple: i,
|
|
16
16
|
onFilesSuccessfullySelected: ({ plainFiles: e }) => {
|
|
17
17
|
s || t(e);
|
|
18
18
|
}
|
|
19
|
-
}), m =
|
|
19
|
+
}), m = x("xtrFilePicker", n && "wrapper", d && "draggable", g);
|
|
20
20
|
return n ? /* @__PURE__ */ c(f, { children: [
|
|
21
|
-
/* @__PURE__ */
|
|
22
|
-
s && r?.[0] && b(/* @__PURE__ */
|
|
21
|
+
/* @__PURE__ */ l("div", { className: m, onClick: a, children: n }),
|
|
22
|
+
s && r?.[0] && b(/* @__PURE__ */ l(u, { file: r?.[0], clearFile: p, onChange: (e) => t(e.blob ? [e.blob] : []) }), document.body)
|
|
23
23
|
] }) : d ? /* @__PURE__ */ c("div", { className: m, onClick: a, children: [
|
|
24
|
-
/* @__PURE__ */
|
|
24
|
+
/* @__PURE__ */ l(C, { code: "f0ed", set: "duotone", style: S }),
|
|
25
25
|
/* @__PURE__ */ c("h2", { children: [
|
|
26
26
|
"Drop File",
|
|
27
|
-
|
|
27
|
+
i ? "s" : "",
|
|
28
28
|
" Here"
|
|
29
29
|
] }),
|
|
30
|
-
/* @__PURE__ */
|
|
30
|
+
/* @__PURE__ */ l("p", { children: "or click here to open file chooser" })
|
|
31
31
|
] }) : /* @__PURE__ */ c(f, { children: [
|
|
32
|
-
/* @__PURE__ */
|
|
33
|
-
s && r?.[0] && b(/* @__PURE__ */
|
|
32
|
+
/* @__PURE__ */ l(y, { className: m, label: `Choose File${i ? "s" : ""}`, icon: I(o), onClick: a, loading: k }),
|
|
33
|
+
s && r?.[0] && b(/* @__PURE__ */ l(u, { file: r?.[0], clearFile: p, onChange: (e) => t(e.blob ? [e.blob] : []) }), document.body)
|
|
34
34
|
] });
|
|
35
35
|
};
|
|
36
36
|
export {
|
|
37
|
-
|
|
37
|
+
A as FilePicker
|
|
38
38
|
};
|
|
@@ -1,54 +1,57 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as M, jsx as
|
|
2
|
+
import { jsxs as M, jsx as a } from "react/jsx-runtime";
|
|
3
3
|
import O from "clsx";
|
|
4
|
-
import { forwardRef as E, useMemo as
|
|
5
|
-
import { Button as
|
|
4
|
+
import { forwardRef as E, useMemo as h } from "react";
|
|
5
|
+
import { Button as u } from "../../base/Button/Button.js";
|
|
6
6
|
import { Select as N } from "../../base/Select/Select.js";
|
|
7
7
|
import { useXTheme as g } from "../../context/useContext.js";
|
|
8
8
|
import { useScreenType as v } from "../../hooks/useScreen.js";
|
|
9
9
|
import { isValidThemeColor as w, getColorLabel as j } from "../../../utils/helper/colorHelper.js";
|
|
10
|
-
import { THEME_SCHEME as
|
|
10
|
+
import { THEME_SCHEME as m, ThemeColorsPreset as d } from "../../../utils/constants/theme.js";
|
|
11
11
|
import './themeSwitch.css';/* empty css */
|
|
12
|
-
const L = Object.entries(
|
|
12
|
+
const L = Object.entries(d).map(([t, i]) => ({
|
|
13
13
|
label: t.charAt(0).toUpperCase() + t.slice(1),
|
|
14
|
-
value:
|
|
15
|
-
})),
|
|
16
|
-
const { className: C, type: b = "secondary", size:
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
14
|
+
value: i
|
|
15
|
+
})), n = Object.values(d), H = E((t, i) => {
|
|
16
|
+
const { className: C, type: b = "secondary", size: l = "default", iconType: c = "solid" } = t, { themeScheme: e, setThemeScheme: x, themeColor: o, setThemeColor: f } = g(), s = v(), p = h(() => m[(m.findIndex((r) => r.name === e) + 1) % m.length], [e]), S = h(() => m.find((r) => r.name === e)?.icon ?? "", [e]), T = h(() => {
|
|
17
|
+
const r = o ?? n[0];
|
|
18
|
+
return n[(n.indexOf(r) + 1) % n.length];
|
|
19
|
+
}, [o]), y = O("xtrThemeSwitch", C, !s.isMobile && "withLabel");
|
|
20
|
+
return !e || !w(o) ? null : /* @__PURE__ */ M("div", { ref: i, className: y, children: [
|
|
21
|
+
/* @__PURE__ */ a(
|
|
22
|
+
u,
|
|
20
23
|
{
|
|
21
24
|
className: "xtrThemeScheme",
|
|
22
25
|
type: b,
|
|
23
|
-
size:
|
|
26
|
+
size: l,
|
|
24
27
|
icon: S,
|
|
25
|
-
iconType:
|
|
26
|
-
label:
|
|
28
|
+
iconType: c,
|
|
29
|
+
label: s.isMobile ? void 0 : e,
|
|
27
30
|
onClick: () => p.name && x(p.name)
|
|
28
31
|
}
|
|
29
32
|
),
|
|
30
|
-
|
|
33
|
+
s.isLargest ? /* @__PURE__ */ a(
|
|
31
34
|
N,
|
|
32
35
|
{
|
|
33
36
|
clearable: !1,
|
|
34
37
|
searchable: !1,
|
|
35
|
-
size:
|
|
38
|
+
size: l,
|
|
36
39
|
icon: "f53f",
|
|
37
|
-
iconType:
|
|
40
|
+
iconType: c,
|
|
38
41
|
placeholder: "Theme",
|
|
39
42
|
options: L,
|
|
40
43
|
value: o,
|
|
41
44
|
onChange: f
|
|
42
45
|
}
|
|
43
|
-
) : /* @__PURE__ */
|
|
44
|
-
|
|
46
|
+
) : /* @__PURE__ */ a(
|
|
47
|
+
u,
|
|
45
48
|
{
|
|
46
49
|
className: "xtrThemeColor",
|
|
47
50
|
type: "primary",
|
|
48
|
-
size:
|
|
51
|
+
size: l,
|
|
49
52
|
icon: "f53f",
|
|
50
|
-
iconType:
|
|
51
|
-
label:
|
|
53
|
+
iconType: c,
|
|
54
|
+
label: s.isMobile ? void 0 : j(o),
|
|
52
55
|
onClick: () => T && f(T)
|
|
53
56
|
}
|
|
54
57
|
)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "xtreme-ui",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.128",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Collection of reusable components that can be used in web projects",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"clsx": "^2.1.1",
|
|
26
26
|
"color-namer": "^1.4.0",
|
|
27
27
|
"colord": "^2.9.3",
|
|
28
|
-
"gliff": "^0.0.
|
|
28
|
+
"gliff": "^0.0.12",
|
|
29
29
|
"react-calendar": "^6.0.0",
|
|
30
30
|
"react-clock": "^6.0.0",
|
|
31
31
|
"react-datetime-picker": "^7.0.1",
|