xtreme-ui 0.0.93 → 0.0.95
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/Avatar/Avatar.js +24 -23
- package/dist/components/base/Button/button.module.scss.js +23 -23
- 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 +88 -67
- package/dist/components/base/ColorPopper/types.d.ts +5 -4
- package/dist/components/base/ColorPopper/types.d.ts.map +1 -1
- package/dist/components/base/Icon/Icon.js +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.module.scss.js +14 -14
- 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 +37 -38
- package/dist/components/layout/ThemePicker/themePicker.module.scss.js +28 -28
- 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/types.d.ts +10 -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.js +97 -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 +29 -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/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
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
const i = "
|
|
1
|
+
const i = "_actionCard_114zv_1", e = "_miniSize_114zv_14", z = "_smallSize_114zv_17", m = "_mediumSize_114zv_20", _ = {
|
|
2
2
|
actionCard: i,
|
|
3
3
|
miniSize: e,
|
|
4
|
-
smallSize:
|
|
5
|
-
mediumSize:
|
|
4
|
+
smallSize: z,
|
|
5
|
+
mediumSize: m
|
|
6
6
|
};
|
|
7
7
|
export {
|
|
8
8
|
i as actionCard,
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
_ as default,
|
|
10
|
+
m as mediumSize,
|
|
11
11
|
e as miniSize,
|
|
12
|
-
|
|
12
|
+
z as smallSize
|
|
13
13
|
};
|
|
@@ -1,52 +1,53 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as i } from "react/jsx-runtime";
|
|
3
|
-
import { forwardRef as
|
|
3
|
+
import { forwardRef as z, useState as c, useEffect as E } from "react";
|
|
4
4
|
import C from "clsx";
|
|
5
|
-
import { FACE_ICONS as
|
|
6
|
-
import { readImageFile as
|
|
7
|
-
import { Icon as
|
|
5
|
+
import { FACE_ICONS as m } from "../../../utils/constants/iconCollection.js";
|
|
6
|
+
import { readImageFile as F, readImageSrc as L } from "../../../utils/helper/imageHelper.js";
|
|
7
|
+
import { Icon as b } from "../Icon/Icon.js";
|
|
8
8
|
/* empty css */
|
|
9
|
-
import { EAvatarSize as
|
|
10
|
-
const
|
|
11
|
-
const { className: u, src: a, file: o, alt: v, placeholderIcon:
|
|
9
|
+
import { EAvatarSize as M } from "./types.js";
|
|
10
|
+
const R = z((h, g) => {
|
|
11
|
+
const { className: u, src: a, file: o, alt: v, placeholderIcon: y, size: l = "default", onClick: I } = h, [n, f] = c(), [x, A] = c(m.happy[0]), [N, t] = c(!!a || !!o), [p, r] = c(!1), d = typeof l == "number" ? l : M[l], S = C(
|
|
12
12
|
"xtrAvatar",
|
|
13
13
|
u,
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
N && "loading",
|
|
15
|
+
p && "error"
|
|
16
16
|
), s = (e) => {
|
|
17
|
-
e && setTimeout(() =>
|
|
17
|
+
e && setTimeout(() => f(e), 300), setTimeout(() => t(!1), 1e3);
|
|
18
18
|
};
|
|
19
|
-
return
|
|
19
|
+
return E(() => {
|
|
20
|
+
A(m.happy[Math.floor(Math.random() * m.happy.length)]);
|
|
20
21
|
try {
|
|
21
|
-
o ? (t(!0), r(!1),
|
|
22
|
+
o ? (t(!0), r(!1), F(o).then((e) => s(e)).catch((e) => {
|
|
22
23
|
console.log(e), t(!1), r(!0);
|
|
23
|
-
})) : a ? (t(!0), r(!1),
|
|
24
|
+
})) : a ? (t(!0), r(!1), L(a).then((e) => s(e)).catch((e) => {
|
|
24
25
|
console.log(e, a), t(!1), r(!0);
|
|
25
|
-
})) : (
|
|
26
|
+
})) : (f(void 0), s());
|
|
26
27
|
} catch {
|
|
27
28
|
s();
|
|
28
29
|
}
|
|
29
30
|
}, [a, o]), /* @__PURE__ */ i(
|
|
30
31
|
"div",
|
|
31
32
|
{
|
|
32
|
-
ref:
|
|
33
|
-
className:
|
|
34
|
-
style: { "--avatarSize":
|
|
33
|
+
ref: g,
|
|
34
|
+
className: S,
|
|
35
|
+
style: { "--avatarSize": d + "px" },
|
|
35
36
|
onClick: I,
|
|
36
37
|
role: "img",
|
|
37
|
-
children:
|
|
38
|
-
|
|
38
|
+
children: n ? /* @__PURE__ */ i("img", { className: "image", src: n, alt: v }) : /* @__PURE__ */ i(
|
|
39
|
+
b,
|
|
39
40
|
{
|
|
40
41
|
className: "placeholder",
|
|
41
42
|
type: "solid",
|
|
42
|
-
size: 8 +
|
|
43
|
-
code:
|
|
43
|
+
size: 8 + d / 4,
|
|
44
|
+
code: p ? "e1b7" : y ?? x
|
|
44
45
|
}
|
|
45
46
|
)
|
|
46
47
|
}
|
|
47
48
|
);
|
|
48
49
|
});
|
|
49
|
-
|
|
50
|
+
R.displayName = "Avatar";
|
|
50
51
|
export {
|
|
51
|
-
|
|
52
|
+
R as Avatar
|
|
52
53
|
};
|
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
const
|
|
2
|
-
button:
|
|
3
|
-
label:
|
|
1
|
+
const n = "_button_1n6xg_1", e = "_label_1n6xg_14", _ = "_icon_1n6xg_21", i = "_underline_1n6xg_25", o = "_primaryType_1n6xg_48", r = "_primaryDangerType_1n6xg_48", a = "_secondaryType_1n6xg_52", y = "_secondaryDangerType_1n6xg_52", g = "_linkType_1n6xg_56", l = "_linkDangerType_1n6xg_56", c = "_miniSize_1n6xg_85", s = "_iconOnly_1n6xg_96", t = "_defaultSize_1n6xg_103", p = "_largeSize_1n6xg_121", x = "_loading_1n6xg_149", T = "_barberPole_1n6xg_1", d = "_spin_1n6xg_1", b = {
|
|
2
|
+
button: n,
|
|
3
|
+
label: e,
|
|
4
4
|
icon: _,
|
|
5
5
|
underline: i,
|
|
6
6
|
primaryType: o,
|
|
7
7
|
primaryDangerType: r,
|
|
8
8
|
secondaryType: a,
|
|
9
9
|
secondaryDangerType: y,
|
|
10
|
-
linkType:
|
|
11
|
-
linkDangerType:
|
|
12
|
-
miniSize:
|
|
13
|
-
iconOnly:
|
|
14
|
-
defaultSize:
|
|
15
|
-
largeSize:
|
|
16
|
-
loading:
|
|
17
|
-
barberPole:
|
|
18
|
-
spin:
|
|
10
|
+
linkType: g,
|
|
11
|
+
linkDangerType: l,
|
|
12
|
+
miniSize: c,
|
|
13
|
+
iconOnly: s,
|
|
14
|
+
defaultSize: t,
|
|
15
|
+
largeSize: p,
|
|
16
|
+
loading: x,
|
|
17
|
+
barberPole: T,
|
|
18
|
+
spin: d
|
|
19
19
|
};
|
|
20
20
|
export {
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
T as barberPole,
|
|
22
|
+
n as button,
|
|
23
23
|
b as default,
|
|
24
|
-
|
|
24
|
+
t as defaultSize,
|
|
25
25
|
_ as icon,
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
26
|
+
s as iconOnly,
|
|
27
|
+
e as label,
|
|
28
|
+
p as largeSize,
|
|
29
|
+
l as linkDangerType,
|
|
30
|
+
g as linkType,
|
|
31
|
+
x as loading,
|
|
32
|
+
c as miniSize,
|
|
33
33
|
r as primaryDangerType,
|
|
34
34
|
o as primaryType,
|
|
35
35
|
y as secondaryDangerType,
|
|
36
36
|
a as secondaryType,
|
|
37
|
-
|
|
37
|
+
d as spin,
|
|
38
38
|
i as underline
|
|
39
39
|
};
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
import { Ref } from 'react';
|
|
1
2
|
import { TColorPopperProps } from './types';
|
|
2
|
-
|
|
3
|
+
import { AnyColor } from 'colord/types';
|
|
4
|
+
declare function ColorPopperInner<T extends AnyColor = AnyColor>(props: TColorPopperProps<T>, ref: Ref<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare namespace ColorPopperInner {
|
|
6
|
+
var displayName: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const ColorPopper: <T extends AnyColor = AnyColor>(props: TColorPopperProps<T> & {
|
|
9
|
+
ref?: Ref<HTMLDivElement>;
|
|
10
|
+
}) => ReturnType<typeof ColorPopperInner>;
|
|
11
|
+
export {};
|
|
3
12
|
//# sourceMappingURL=ColorPopper.d.ts.map
|
|
@@ -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":"AAAA,OAAO,EAAoD,GAAG,EAAE,MAAM,OAAO,CAAC;AAqB9E,OAAO,oBAAoB,CAAC;AAE5B,OAAO,KAAK,EAAoB,iBAAiB,EAAE,MAAM,SAAS,CAAC;AACnE,OAAO,KAAK,EAAE,QAAQ,EAAoB,MAAM,cAAc,CAAC;AAE/D,iBAAS,gBAAgB,CAAC,CAAC,SAAS,QAAQ,GAAG,QAAQ,EAAG,KAAK,EAAE,iBAAiB,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,cAAc,CAAC,2CA+H9G;kBA/HQ,gBAAgB;;;AAiIzB,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,94 +1,115 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import { useFloating as
|
|
5
|
-
import
|
|
6
|
-
import { colord as
|
|
7
|
-
import { ColorPicker as
|
|
8
|
-
import { Icon as
|
|
9
|
-
import { Textfield as
|
|
10
|
-
import "../../../utils/constants/
|
|
11
|
-
import { mergeRefs as
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
const {
|
|
15
|
-
|
|
16
|
-
|
|
2
|
+
import { jsxs as u, Fragment as z, jsx as c } from "react/jsx-runtime";
|
|
3
|
+
import { forwardRef as A, useMemo as h, useState as C, useRef as G, useEffect as J } from "react";
|
|
4
|
+
import { useFloating as K, autoUpdate as Q, shift as W, flip as X, offset as Y, useTransitionStyles as Z, useInteractions as _, useClick as oo, useDismiss as eo } from "@floating-ui/react";
|
|
5
|
+
import P from "clsx";
|
|
6
|
+
import { colord as s, getFormat as to } from "colord";
|
|
7
|
+
import { ColorPicker as ro } from "../ColorPicker/ColorPicker.js";
|
|
8
|
+
import { Icon as so } from "../Icon/Icon.js";
|
|
9
|
+
import { Textfield as no } from "../Textfield/Textfield.js";
|
|
10
|
+
import "../../../utils/constants/theme.js";
|
|
11
|
+
import { mergeRefs as lo } from "../../../utils/function/mergeRefs.js";
|
|
12
|
+
/* empty css */
|
|
13
|
+
function y(v, R) {
|
|
14
|
+
const {
|
|
15
|
+
className: k,
|
|
16
|
+
popperClassName: F,
|
|
17
|
+
placeholder: I = "Color Picker",
|
|
18
|
+
showReset: M = !0,
|
|
19
|
+
alpha: N,
|
|
20
|
+
shade: b,
|
|
21
|
+
color: t,
|
|
22
|
+
setColor: n
|
|
23
|
+
} = v, r = h(() => s(t), []), l = h(() => to(t), [t]), [p, a] = C(r.toHsv()), [w, i] = C(r.toHex()), f = G(!1), [S, g] = C(!1), { refs: x, floatingStyles: T, context: m } = K({
|
|
24
|
+
open: S,
|
|
25
|
+
onOpenChange: g,
|
|
17
26
|
middleware: [
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
27
|
+
W({ padding: 18 }),
|
|
28
|
+
X(),
|
|
29
|
+
Y(({ placement: o }) => o === "bottom" ? 10 : 16)
|
|
21
30
|
],
|
|
22
|
-
whileElementsMounted:
|
|
23
|
-
}), { isMounted:
|
|
31
|
+
whileElementsMounted: Q
|
|
32
|
+
}), { isMounted: O, styles: V } = Z(m, {
|
|
24
33
|
duration: 200,
|
|
25
|
-
initial: (
|
|
34
|
+
initial: ({ side: o }) => ({
|
|
26
35
|
opacity: 0,
|
|
27
36
|
scale: 0.9,
|
|
28
|
-
translate:
|
|
37
|
+
translate: o === "bottom" ? "0 12px" : "0 -12px"
|
|
29
38
|
})
|
|
30
|
-
}), { getReferenceProps:
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
])
|
|
34
|
-
|
|
35
|
-
|
|
39
|
+
}), { getReferenceProps: $, getFloatingProps: j } = _([
|
|
40
|
+
oo(m),
|
|
41
|
+
eo(m)
|
|
42
|
+
]);
|
|
43
|
+
J(() => {
|
|
44
|
+
if (!f.current) {
|
|
45
|
+
const o = s(t);
|
|
46
|
+
a(o.toHsv()), i(o.toHex());
|
|
47
|
+
}
|
|
48
|
+
f.current = !1;
|
|
49
|
+
}, [t]);
|
|
50
|
+
const [H, B] = h(() => {
|
|
51
|
+
const o = s(p), { h: e, s: U, l: q } = o.toHsl();
|
|
52
|
+
return [`${Math.round(e)} ${Math.round(U)}% ${Math.round(q)}%`, o.isLight() ? "black" : "white"];
|
|
53
|
+
}, [p]), d = (o) => {
|
|
54
|
+
f.current = !0, l === "rgb" ? n(o.toRgb()) : l === "hex" ? n(o.toHex()) : l === "hsl" ? n(o.toHsl()) : l === "hsv" && n(o.toHsv());
|
|
55
|
+
}, E = (o) => {
|
|
56
|
+
i(o);
|
|
57
|
+
const e = s(o);
|
|
58
|
+
e.isValid() && (a(e.toHsv()), d(e));
|
|
59
|
+
}, L = (o) => {
|
|
60
|
+
a(o);
|
|
61
|
+
const e = s(o);
|
|
62
|
+
i(e.toHex()), d(e);
|
|
63
|
+
}, D = () => {
|
|
64
|
+
const o = r.toHsv();
|
|
65
|
+
a(o), i(r.toHex()), d(r);
|
|
36
66
|
};
|
|
37
|
-
return
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}, [s, r, i, o]), /* @__PURE__ */ f(q, { children: [
|
|
41
|
-
/* @__PURE__ */ l(
|
|
42
|
-
Y,
|
|
67
|
+
return /* @__PURE__ */ u(z, { children: [
|
|
68
|
+
/* @__PURE__ */ c(
|
|
69
|
+
no,
|
|
43
70
|
{
|
|
44
|
-
className:
|
|
71
|
+
className: P("colorInput", k),
|
|
45
72
|
ref: x.setReference,
|
|
46
|
-
placeholder:
|
|
47
|
-
icon: "
|
|
73
|
+
placeholder: I,
|
|
74
|
+
icon: "f53f",
|
|
48
75
|
value: w,
|
|
49
|
-
onChange: (
|
|
50
|
-
style: {
|
|
51
|
-
|
|
52
|
-
|
|
76
|
+
onChange: (o) => E(o.target.value),
|
|
77
|
+
style: {
|
|
78
|
+
"--colorBrandPrimary": H,
|
|
79
|
+
"--iconColor": B
|
|
80
|
+
},
|
|
81
|
+
onFocus: () => g(!0),
|
|
82
|
+
...$()
|
|
53
83
|
}
|
|
54
84
|
),
|
|
55
|
-
|
|
85
|
+
O && /* @__PURE__ */ u(
|
|
56
86
|
"div",
|
|
57
87
|
{
|
|
58
|
-
ref:
|
|
59
|
-
className:
|
|
60
|
-
style: { ...
|
|
61
|
-
...
|
|
88
|
+
ref: lo([R, x.setFloating]),
|
|
89
|
+
className: P("xtrColorPopper", F),
|
|
90
|
+
style: { ...T, ...V, "--colorBrandPrimary": H },
|
|
91
|
+
...j(),
|
|
62
92
|
children: [
|
|
63
|
-
/* @__PURE__ */
|
|
64
|
-
/* @__PURE__ */
|
|
65
|
-
|
|
66
|
-
X,
|
|
67
|
-
{
|
|
68
|
-
code: "f1da",
|
|
69
|
-
onClick: () => {
|
|
70
|
-
n(u.toHsv()), a(u.toHex());
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
)
|
|
93
|
+
/* @__PURE__ */ u("div", { className: "header", children: [
|
|
94
|
+
/* @__PURE__ */ c("h1", { children: "Choose a color" }),
|
|
95
|
+
M && /* @__PURE__ */ c(so, { code: "f1da", onClick: D })
|
|
74
96
|
] }),
|
|
75
|
-
/* @__PURE__ */
|
|
76
|
-
|
|
97
|
+
/* @__PURE__ */ c(
|
|
98
|
+
ro,
|
|
77
99
|
{
|
|
100
|
+
alpha: N,
|
|
78
101
|
shade: b,
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
setColor: (e) => {
|
|
82
|
-
n(e), a(t(e).toHex());
|
|
83
|
-
}
|
|
102
|
+
color: p,
|
|
103
|
+
setColor: L
|
|
84
104
|
}
|
|
85
105
|
)
|
|
86
106
|
]
|
|
87
107
|
}
|
|
88
108
|
)
|
|
89
109
|
] });
|
|
90
|
-
}
|
|
91
|
-
|
|
110
|
+
}
|
|
111
|
+
const Ho = A(y);
|
|
112
|
+
y.displayName = "ColorPopper";
|
|
92
113
|
export {
|
|
93
|
-
|
|
114
|
+
Ho as ColorPopper
|
|
94
115
|
};
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { AnyColor } from 'colord';
|
|
2
|
-
export type
|
|
1
|
+
import { HslColor, RgbColor, HsvColor, RgbaColor, AnyColor } from 'colord';
|
|
2
|
+
export type ExtractColorType<T> = T extends RgbColor ? RgbColor : T extends RgbaColor ? RgbaColor : T extends HslColor ? HslColor : T extends HsvColor ? HsvColor : AnyColor;
|
|
3
|
+
export type TColorPopperProps<T extends AnyColor = AnyColor> = {
|
|
3
4
|
className?: string;
|
|
4
5
|
popperClassName?: string;
|
|
5
6
|
placeholder?: string;
|
|
6
7
|
showReset?: boolean;
|
|
7
8
|
alpha?: boolean;
|
|
8
9
|
shade?: boolean;
|
|
9
|
-
color:
|
|
10
|
-
setColor: (col:
|
|
10
|
+
color: T;
|
|
11
|
+
setColor: (col: ExtractColorType<T>) => void;
|
|
11
12
|
};
|
|
12
13
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/base/ColorPopper/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/base/ColorPopper/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAEhF,MAAM,MAAM,gBAAgB,CAAC,CAAC,IAAI,CAAC,SAAS,QAAQ,GACjD,QAAQ,GACR,CAAC,SAAS,SAAS,GACnB,SAAS,GACT,CAAC,SAAS,QAAQ,GAClB,QAAQ,GACR,CAAC,SAAS,QAAQ,GAClB,QAAQ,GACR,QAAQ,CAAC;AAEZ,MAAM,MAAM,iBAAiB,CAAC,CAAC,SAAS,QAAQ,GAAG,QAAQ,IAAI;IAC9D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,KAAK,EAAE,CAAC,CAAC;IACT,QAAQ,EAAE,CAAC,GAAG,EAAE,gBAAgB,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC;CAC7C,CAAC"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { jsx as p } from "react/jsx-runtime";
|
|
3
3
|
import { forwardRef as l } from "react";
|
|
4
4
|
import a from "clsx";
|
|
5
|
-
import "../../../utils/constants/
|
|
5
|
+
import "../../../utils/constants/theme.js";
|
|
6
6
|
import { unicodeToString as f } from "../../../utils/function/string.js";
|
|
7
7
|
/* empty css */
|
|
8
8
|
import { EIconSize as d } from "./types.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../../../src/components/base/Select/Select.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../../../src/components/base/Select/Select.tsx"],"names":[],"mappings":"AAeA,OAAO,eAAe,CAAC;AACvB,OAAO,EAAU,YAAY,EAAE,MAAM,SAAS,CAAC;AAE/C,wBAAgB,MAAM,CAAC,CAAC,EAAG,KAAK,EAAE,YAAY,CAAC,CAAC,CAAC,2CA2EhD"}
|
|
@@ -1,65 +1,74 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { useState as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
2
|
+
import { jsxs as I, jsx as c } from "react/jsx-runtime";
|
|
3
|
+
import { useState as O, useMemo as j } from "react";
|
|
4
|
+
import y from "clsx";
|
|
5
|
+
import z from "react-select";
|
|
6
|
+
import { isEqual as d } from "../../../utils/function/common.js";
|
|
7
|
+
import { Icon as H } from "../Icon/Icon.js";
|
|
7
8
|
/* empty css */
|
|
8
|
-
function $(
|
|
9
|
+
function $(h) {
|
|
9
10
|
const {
|
|
10
|
-
className:
|
|
11
|
-
multi:
|
|
12
|
-
placeholder:
|
|
13
|
-
noOptionsMessage:
|
|
14
|
-
icon:
|
|
15
|
-
size:
|
|
16
|
-
iconType:
|
|
17
|
-
clearable:
|
|
18
|
-
searchable:
|
|
19
|
-
disabled:
|
|
20
|
-
loading:
|
|
21
|
-
options:
|
|
11
|
+
className: S,
|
|
12
|
+
multi: l = !1,
|
|
13
|
+
placeholder: a = "Select an option",
|
|
14
|
+
noOptionsMessage: v,
|
|
15
|
+
icon: n,
|
|
16
|
+
size: i = "default",
|
|
17
|
+
iconType: x = "regular",
|
|
18
|
+
clearable: g = !0,
|
|
19
|
+
searchable: m = !0,
|
|
20
|
+
disabled: C = !1,
|
|
21
|
+
loading: b = !1,
|
|
22
|
+
options: o,
|
|
22
23
|
value: t,
|
|
23
|
-
onChange:
|
|
24
|
-
} =
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
onChange: p
|
|
25
|
+
} = h, [u, f] = O(!1), N = j(() => {
|
|
26
|
+
if (l) {
|
|
27
|
+
const e = t ?? [];
|
|
28
|
+
return o.filter((s) => e.some((r) => d(s.value, r)));
|
|
29
|
+
} else
|
|
30
|
+
return o.find((e) => d(e.value, t)) || null;
|
|
31
|
+
}, [l, o, t]), M = y(
|
|
28
32
|
"xtrSelectWrapper",
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
33
|
+
i && `${i}Size`,
|
|
34
|
+
l ? "multi" : "single",
|
|
35
|
+
n && "withIcon",
|
|
32
36
|
!!t && "withValue",
|
|
33
|
-
|
|
34
|
-
!
|
|
35
|
-
|
|
37
|
+
u && "open",
|
|
38
|
+
!m && "noSearch",
|
|
39
|
+
S
|
|
36
40
|
);
|
|
37
|
-
return /* @__PURE__ */
|
|
41
|
+
return /* @__PURE__ */ I("div", { className: M, children: [
|
|
38
42
|
/* @__PURE__ */ c(
|
|
39
|
-
|
|
43
|
+
z,
|
|
40
44
|
{
|
|
41
45
|
className: "xtrSelect",
|
|
42
46
|
classNamePrefix: "xtrSelect",
|
|
43
|
-
isMulti:
|
|
44
|
-
menuIsOpen:
|
|
45
|
-
onMenuOpen: () =>
|
|
46
|
-
onMenuClose: () =>
|
|
47
|
-
noOptionsMessage:
|
|
48
|
-
placeholder:
|
|
49
|
-
isClearable:
|
|
50
|
-
isSearchable:
|
|
51
|
-
isDisabled:
|
|
52
|
-
isLoading:
|
|
53
|
-
options:
|
|
54
|
-
value:
|
|
47
|
+
isMulti: l,
|
|
48
|
+
menuIsOpen: u,
|
|
49
|
+
onMenuOpen: () => f(!0),
|
|
50
|
+
onMenuClose: () => f(!1),
|
|
51
|
+
noOptionsMessage: v,
|
|
52
|
+
placeholder: a,
|
|
53
|
+
isClearable: g,
|
|
54
|
+
isSearchable: m,
|
|
55
|
+
isDisabled: C,
|
|
56
|
+
isLoading: b,
|
|
57
|
+
options: o,
|
|
58
|
+
value: N,
|
|
55
59
|
onChange: (e) => {
|
|
56
|
-
|
|
57
|
-
|
|
60
|
+
if (l) {
|
|
61
|
+
const s = (e == null ? void 0 : e.map((r) => r.value)) ?? [];
|
|
62
|
+
p(s);
|
|
63
|
+
} else {
|
|
64
|
+
const s = (e == null ? void 0 : e.value) ?? null;
|
|
65
|
+
p(s);
|
|
66
|
+
}
|
|
58
67
|
}
|
|
59
68
|
}
|
|
60
69
|
),
|
|
61
|
-
|
|
62
|
-
|
|
70
|
+
a && !l && /* @__PURE__ */ c("p", { className: "placeholder", children: a }),
|
|
71
|
+
n && /* @__PURE__ */ c(H, { className: "xtrSelectIcon", code: n, type: x })
|
|
63
72
|
] });
|
|
64
73
|
}
|
|
65
74
|
export {
|
|
@@ -24,11 +24,16 @@ type TCommonProps<T> = {
|
|
|
24
24
|
loading?: boolean;
|
|
25
25
|
options: Option<T>[];
|
|
26
26
|
};
|
|
27
|
-
type SingleProps<T> = TCommonProps<T> & {
|
|
27
|
+
export type SingleProps<T> = TCommonProps<T> & {
|
|
28
28
|
multi?: false;
|
|
29
|
-
value?: T;
|
|
30
|
-
onChange: (value: T) => void;
|
|
29
|
+
value?: T | undefined;
|
|
30
|
+
onChange: (value: T | undefined) => void;
|
|
31
31
|
};
|
|
32
|
-
export type
|
|
32
|
+
export type MultiProps<T> = TCommonProps<T> & {
|
|
33
|
+
multi: true;
|
|
34
|
+
value?: T[];
|
|
35
|
+
onChange: (value: T[]) => void;
|
|
36
|
+
};
|
|
37
|
+
export type TSelectProps<T> = SingleProps<T> | MultiProps<T>;
|
|
33
38
|
export {};
|
|
34
39
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/base/Select/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1C,oBAAY,WAAW;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/base/Select/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1C,oBAAY,WAAW;IACrB,IAAI,SAAS;IACb,OAAO,YAAY;IACnB,KAAK,UAAU;CAChB;AAED,MAAM,MAAM,MAAM,CAAC,CAAC,IAAI;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,CAAC,CAAA;CAAE,CAAC;AAEpD,KAAK,YAAY,CAAC,CAAC,IAAI;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gBAAgB,CAAC,EAAE,CAAC,GAAG,EAAE;QAAE,UAAU,EAAE,MAAM,CAAA;KAAE,KAAK,SAAS,CAAC;IAC9D,IAAI,CAAC,EAAE,MAAM,OAAO,WAAW,CAAC;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,OAAO,SAAS,CAAC;IAClC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI,YAAY,CAAC,CAAC,CAAC,GAAG;IAC7C,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,KAAK,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC;IACtB,QAAQ,EAAE,CAAC,KAAK,EAAE,CAAC,GAAG,SAAS,KAAK,IAAI,CAAC;CAC1C,CAAC;AAEF,MAAM,MAAM,UAAU,CAAC,CAAC,IAAI,YAAY,CAAC,CAAC,CAAC,GAAG;IAC5C,KAAK,EAAE,IAAI,CAAC;IACZ,KAAK,CAAC,EAAE,CAAC,EAAE,CAAC;IACZ,QAAQ,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,IAAI,CAAC;CAChC,CAAC;AAEF,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI,WAAW,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC"}
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
const
|
|
2
|
-
textfield:
|
|
3
|
-
icon:
|
|
4
|
-
dialCode:
|
|
1
|
+
const e = "_textfield_zn0ed_1", n = "_icon_zn0ed_29", t = "_dialCode_zn0ed_39", _ = "_input_zn0ed_60", o = "_placeholder_zn0ed_79", d = "_withIcon_zn0ed_94", a = "_textarea_zn0ed_104", c = "_phone_zn0ed_114", l = "_hasValue_zn0ed_120", s = {
|
|
2
|
+
textfield: e,
|
|
3
|
+
icon: n,
|
|
4
|
+
dialCode: t,
|
|
5
5
|
input: _,
|
|
6
|
-
placeholder:
|
|
7
|
-
withIcon:
|
|
6
|
+
placeholder: o,
|
|
7
|
+
withIcon: d,
|
|
8
8
|
textarea: a,
|
|
9
9
|
phone: c,
|
|
10
|
-
hasValue:
|
|
10
|
+
hasValue: l
|
|
11
11
|
};
|
|
12
12
|
export {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
s as default,
|
|
14
|
+
t as dialCode,
|
|
15
|
+
l as hasValue,
|
|
16
|
+
n as icon,
|
|
17
17
|
_ as input,
|
|
18
18
|
c as phone,
|
|
19
|
-
|
|
19
|
+
o as placeholder,
|
|
20
20
|
a as textarea,
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
e as textfield,
|
|
22
|
+
d as withIcon
|
|
23
23
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeContext.d.ts","sourceRoot":"","sources":["../../../../src/components/context/Theme/ThemeContext.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAe,iBAAiB,EAAE,mBAAmB,EAAgB,MAAM,SAAS,CAAC;AAS5F,QAAA,MAAM,YAAY,4CAA8B,CAAC;AACjD,QAAA,MAAM,aAAa,GAAI,cAAc,mBAAmB,
|
|
1
|
+
{"version":3,"file":"ThemeContext.d.ts","sourceRoot":"","sources":["../../../../src/components/context/Theme/ThemeContext.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAe,iBAAiB,EAAE,mBAAmB,EAAgB,MAAM,SAAS,CAAC;AAS5F,QAAA,MAAM,YAAY,4CAA8B,CAAC;AACjD,QAAA,MAAM,aAAa,GAAI,cAAc,mBAAmB,4CAoCvD,CAAC;AAEF,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,CAAC"}
|