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
|
@@ -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,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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColorPicker.d.ts","sourceRoot":"","sources":["../../../../src/components/base/ColorPicker/ColorPicker.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"ColorPicker.d.ts","sourceRoot":"","sources":["../../../../src/components/base/ColorPicker/ColorPicker.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAG5C,eAAO,MAAM,WAAW,8GAkCtB,CAAC"}
|
|
@@ -1,36 +1,38 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { forwardRef as
|
|
2
|
+
import { jsxs as p, jsx as a } from "react/jsx-runtime";
|
|
3
|
+
import { forwardRef as d } from "react";
|
|
4
4
|
import f from "@uiw/react-color-alpha";
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
5
|
+
import C from "@uiw/react-color-shade-slider";
|
|
6
|
+
import N from "@uiw/react-color-wheel";
|
|
7
|
+
import v from "clsx";
|
|
8
8
|
import e from "./colorPicker.module.scss.js";
|
|
9
|
-
const
|
|
10
|
-
const { className:
|
|
11
|
-
return /* @__PURE__ */
|
|
9
|
+
const l = 180, x = d((m, t) => {
|
|
10
|
+
const { className: h, shade: c = !0, alpha: i = !0, color: o = { h: 0, s: 0, v: 100, a: 1 }, setColor: s } = m, n = v(e.colorPicker, h);
|
|
11
|
+
return /* @__PURE__ */ p(
|
|
12
12
|
"div",
|
|
13
13
|
{
|
|
14
|
-
ref:
|
|
15
|
-
className:
|
|
14
|
+
ref: t,
|
|
15
|
+
className: n,
|
|
16
16
|
children: [
|
|
17
17
|
/* @__PURE__ */ a(
|
|
18
|
-
|
|
18
|
+
N,
|
|
19
19
|
{
|
|
20
20
|
className: e.wheel,
|
|
21
21
|
color: o,
|
|
22
|
+
width: l,
|
|
23
|
+
height: l,
|
|
22
24
|
onChange: (r) => s(r.hsva)
|
|
23
25
|
}
|
|
24
26
|
),
|
|
25
|
-
|
|
26
|
-
|
|
27
|
+
c && /* @__PURE__ */ a(
|
|
28
|
+
C,
|
|
27
29
|
{
|
|
28
30
|
className: e.shade,
|
|
29
31
|
hsva: o,
|
|
30
32
|
onChange: ({ v: r }) => s({ ...o, v: r })
|
|
31
33
|
}
|
|
32
34
|
),
|
|
33
|
-
|
|
35
|
+
i && /* @__PURE__ */ a(
|
|
34
36
|
f,
|
|
35
37
|
{
|
|
36
38
|
className: e.alpha,
|
|
@@ -42,7 +44,7 @@ const v = p((l, m) => {
|
|
|
42
44
|
}
|
|
43
45
|
);
|
|
44
46
|
});
|
|
45
|
-
|
|
47
|
+
x.displayName = "ColorPicker";
|
|
46
48
|
export {
|
|
47
|
-
|
|
49
|
+
x as ColorPicker
|
|
48
50
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
const e = "
|
|
1
|
+
const e = "_colorPicker_16j6k_1", o = "_wheel_16j6k_5", _ = "_shade_16j6k_9", a = "_alpha_16j6k_9", c = {
|
|
2
2
|
colorPicker: e,
|
|
3
|
-
wheel:
|
|
4
|
-
shade:
|
|
5
|
-
alpha:
|
|
3
|
+
wheel: o,
|
|
4
|
+
shade: _,
|
|
5
|
+
alpha: a
|
|
6
6
|
};
|
|
7
7
|
export {
|
|
8
|
-
|
|
8
|
+
a as alpha,
|
|
9
9
|
e as colorPicker,
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
c as default,
|
|
11
|
+
_ as shade,
|
|
12
|
+
o as wheel
|
|
13
13
|
};
|
|
@@ -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;AAwB9E,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,2CAqO9G;kBArOQ,gBAAgB;;;AAuOzB,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,195 @@
|
|
|
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/
|
|
11
|
-
import {
|
|
12
|
-
import
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
2
|
+
import { jsxs as i, Fragment as te, jsx as t } from "react/jsx-runtime";
|
|
3
|
+
import { forwardRef as se, useMemo as M, useState as g, useRef as re, useEffect as I } from "react";
|
|
4
|
+
import { useFloating as le, autoUpdate as ne, shift as ie, flip as ce, offset as ae, useTransitionStyles as he, useInteractions as de, useClick as me, useDismiss as pe } from "@floating-ui/react";
|
|
5
|
+
import B from "clsx";
|
|
6
|
+
import { colord as s, getFormat as fe } from "colord";
|
|
7
|
+
import { ColorPicker as ue } from "../ColorPicker/ColorPicker.js";
|
|
8
|
+
import { Icon as Ce } from "../Icon/Icon.js";
|
|
9
|
+
import { Textfield as ge } from "../Textfield/Textfield.js";
|
|
10
|
+
import { getColorLabel as ye } from "../../../utils/helper/colorHelper.js";
|
|
11
|
+
import { THEME_SCHEME as He } from "../../../utils/constants/theme.js";
|
|
12
|
+
import { mergeRefs as ve } from "../../../utils/function/mergeRefs.js";
|
|
13
|
+
import { Button as w } from "../Button/Button.js";
|
|
14
|
+
/* empty css */
|
|
15
|
+
function F(V, L) {
|
|
16
|
+
const {
|
|
17
|
+
className: O,
|
|
18
|
+
popperClassName: j,
|
|
19
|
+
size: R = "default",
|
|
20
|
+
placeholder: z = "Color Picker",
|
|
21
|
+
colorHeading: d = "Pick color",
|
|
22
|
+
schemeHeading: T,
|
|
23
|
+
themeScheme: m,
|
|
24
|
+
setThemeScheme: y,
|
|
25
|
+
showReset: A = !0,
|
|
26
|
+
alpha: q,
|
|
27
|
+
shade: D,
|
|
28
|
+
swatch: H,
|
|
29
|
+
color: c,
|
|
30
|
+
setColor: p
|
|
31
|
+
} = V, r = M(() => s(c), []), f = M(() => fe(c), [c]), [v, a] = g(r.toHsv()), [u, h] = g(r.toHex()), [U, _] = g(d), x = re(!1), [S, N] = g(!1), { refs: P, floatingStyles: G, context: $ } = le({
|
|
32
|
+
open: S,
|
|
33
|
+
onOpenChange: N,
|
|
17
34
|
middleware: [
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
35
|
+
ie({ crossAxis: !0, padding: 18 }),
|
|
36
|
+
ce(),
|
|
37
|
+
ae(({ placement: e }) => e === "bottom" ? 10 : 16)
|
|
21
38
|
],
|
|
22
|
-
whileElementsMounted:
|
|
23
|
-
}), { isMounted:
|
|
39
|
+
whileElementsMounted: ne
|
|
40
|
+
}), { isMounted: J, styles: K } = he($, {
|
|
24
41
|
duration: 200,
|
|
25
|
-
initial: (e) => ({
|
|
42
|
+
initial: ({ side: e }) => ({
|
|
26
43
|
opacity: 0,
|
|
27
|
-
|
|
28
|
-
translate: (e == null ? void 0 : e.side) === "bottom" ? "0 12px" : "0 -12px"
|
|
44
|
+
translate: e === "bottom" ? "0px 8px" : "0px -8px"
|
|
29
45
|
})
|
|
30
|
-
}), { getReferenceProps:
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
]),
|
|
34
|
-
const
|
|
35
|
-
|
|
46
|
+
}), { getReferenceProps: b, getFloatingProps: Q } = de([
|
|
47
|
+
me($),
|
|
48
|
+
pe($)
|
|
49
|
+
]), [k, W, E] = M(() => {
|
|
50
|
+
const e = s(v), o = e.toHsl(), l = r.toHsl();
|
|
51
|
+
return [
|
|
52
|
+
`${Math.round(o.h)} ${Math.round(o.s)}% ${Math.round(o.l)}%`,
|
|
53
|
+
`${Math.round(l.h)} ${Math.round(l.s)}% ${Math.round(l.l)}%`,
|
|
54
|
+
e.isLight() ? "black" : "white"
|
|
55
|
+
];
|
|
56
|
+
}, [r, v]), C = (e) => {
|
|
57
|
+
x.current = !0, f === "rgb" ? p(e.toRgb()) : f === "hex" ? p(e.toHex()) : f === "hsl" ? p(e.toHsl()) : f === "hsv" && p(e.toHsv());
|
|
58
|
+
}, X = (e) => {
|
|
59
|
+
h(e);
|
|
60
|
+
const o = s(e);
|
|
61
|
+
o.isValid() && (a(o.toHsv()), C(o));
|
|
62
|
+
}, Y = (e) => {
|
|
63
|
+
const o = s(e);
|
|
64
|
+
a(e), h(o.toHex()), C(o);
|
|
65
|
+
}, Z = (e) => {
|
|
66
|
+
const o = s(e);
|
|
67
|
+
a(o.toHsv()), h(o.toHex()), C(o);
|
|
68
|
+
}, ee = () => {
|
|
69
|
+
a(r.toHsv()), h(r.toHex()), C(r);
|
|
36
70
|
};
|
|
37
|
-
return
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
71
|
+
return I(() => {
|
|
72
|
+
if (!x.current) {
|
|
73
|
+
const e = s(c);
|
|
74
|
+
a(e.toHsv()), h(e.toHex());
|
|
75
|
+
}
|
|
76
|
+
x.current = !1;
|
|
77
|
+
}, [c]), I(() => {
|
|
78
|
+
_(ye(s(u).toHsl()) ?? d);
|
|
79
|
+
}, [d, u]), /* @__PURE__ */ i(te, { children: [
|
|
80
|
+
R === "mini" ? /* @__PURE__ */ t(
|
|
81
|
+
w,
|
|
43
82
|
{
|
|
44
|
-
className:
|
|
45
|
-
ref:
|
|
46
|
-
|
|
47
|
-
icon: "
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
83
|
+
className: "colorButton",
|
|
84
|
+
ref: P.setReference,
|
|
85
|
+
size: R,
|
|
86
|
+
icon: "f53f",
|
|
87
|
+
iconType: "solid",
|
|
88
|
+
style: {
|
|
89
|
+
"--themeColor": k,
|
|
90
|
+
"--iconColor": E
|
|
91
|
+
},
|
|
92
|
+
onClick: () => N(!0),
|
|
93
|
+
...b()
|
|
94
|
+
}
|
|
95
|
+
) : /* @__PURE__ */ t(
|
|
96
|
+
ge,
|
|
97
|
+
{
|
|
98
|
+
className: B("colorInput", O),
|
|
99
|
+
ref: P.setReference,
|
|
100
|
+
placeholder: z,
|
|
101
|
+
icon: "f53f",
|
|
102
|
+
iconType: "solid",
|
|
103
|
+
active: S,
|
|
104
|
+
value: u,
|
|
105
|
+
onChange: (e) => X(e.target.value),
|
|
106
|
+
style: {
|
|
107
|
+
"--colorBrandPrimary": k,
|
|
108
|
+
"--iconColor": E
|
|
109
|
+
},
|
|
110
|
+
onFocus: () => N(!0),
|
|
111
|
+
...b()
|
|
53
112
|
}
|
|
54
113
|
),
|
|
55
|
-
|
|
114
|
+
J && /* @__PURE__ */ i(
|
|
56
115
|
"div",
|
|
57
116
|
{
|
|
58
|
-
ref:
|
|
59
|
-
className:
|
|
60
|
-
style: { ...
|
|
61
|
-
...
|
|
117
|
+
ref: ve([L, P.setFloating]),
|
|
118
|
+
className: B("xtrColorPopper", j),
|
|
119
|
+
style: { ...G, ...K, "--colorBrandPrimary": k },
|
|
120
|
+
...Q(),
|
|
62
121
|
children: [
|
|
63
|
-
/* @__PURE__ */
|
|
64
|
-
/* @__PURE__ */
|
|
65
|
-
|
|
66
|
-
|
|
122
|
+
T && /* @__PURE__ */ i("div", { className: "themeScheme", children: [
|
|
123
|
+
/* @__PURE__ */ t("div", { className: "header", children: /* @__PURE__ */ i("div", { className: "heading", children: [
|
|
124
|
+
/* @__PURE__ */ t("h1", { children: m }),
|
|
125
|
+
/* @__PURE__ */ t("h1", { children: T })
|
|
126
|
+
] }) }),
|
|
127
|
+
/* @__PURE__ */ t("div", { className: "schemeSelector", children: He.map(({ name: e, icon: o }, l) => /* @__PURE__ */ t(
|
|
128
|
+
w,
|
|
129
|
+
{
|
|
130
|
+
icon: o,
|
|
131
|
+
iconType: "solid",
|
|
132
|
+
disabled: m === e,
|
|
133
|
+
type: m === e ? "primary" : "secondary",
|
|
134
|
+
style: {
|
|
135
|
+
color: m === e ? "hsl(var(--colorBrandPrimary))" : void 0
|
|
136
|
+
},
|
|
137
|
+
onClick: () => y == null ? void 0 : y(e)
|
|
138
|
+
},
|
|
139
|
+
`ThemeScheme-${e}-${l}`
|
|
140
|
+
)) })
|
|
141
|
+
] }),
|
|
142
|
+
/* @__PURE__ */ i("div", { className: "header", children: [
|
|
143
|
+
/* @__PURE__ */ i("div", { className: "heading", children: [
|
|
144
|
+
/* @__PURE__ */ t("h1", { children: U }),
|
|
145
|
+
/* @__PURE__ */ t("h1", { children: d })
|
|
146
|
+
] }),
|
|
147
|
+
A && /* @__PURE__ */ t(
|
|
148
|
+
Ce,
|
|
67
149
|
{
|
|
68
150
|
code: "f1da",
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
151
|
+
type: "solid",
|
|
152
|
+
style: { "--colorBrandPrimary": W },
|
|
153
|
+
onClick: ee
|
|
72
154
|
}
|
|
73
155
|
)
|
|
74
156
|
] }),
|
|
75
|
-
/* @__PURE__ */
|
|
76
|
-
|
|
157
|
+
H && /* @__PURE__ */ t("div", { className: "swatch", children: H.map((e, o) => {
|
|
158
|
+
const l = s(u).isEqual(e), n = s(e).toHsl(), oe = `${n.h} ${n.s}% ${n.l}%`;
|
|
159
|
+
return /* @__PURE__ */ t(
|
|
160
|
+
w,
|
|
161
|
+
{
|
|
162
|
+
className: "swatchItem",
|
|
163
|
+
icon: "f00c",
|
|
164
|
+
iconType: "solid",
|
|
165
|
+
size: "mini",
|
|
166
|
+
style: {
|
|
167
|
+
"--themeColor": oe,
|
|
168
|
+
color: l ? "white" : "transparent"
|
|
169
|
+
},
|
|
170
|
+
onClick: () => Z(n)
|
|
171
|
+
},
|
|
172
|
+
`ThemeColor-${n.h}${n.s}${n.l}-${o}`
|
|
173
|
+
);
|
|
174
|
+
}) }),
|
|
175
|
+
H && /* @__PURE__ */ t("hr", {}),
|
|
176
|
+
/* @__PURE__ */ t(
|
|
177
|
+
ue,
|
|
77
178
|
{
|
|
78
|
-
|
|
79
|
-
alpha:
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
}
|
|
179
|
+
className: "colorPicker",
|
|
180
|
+
alpha: q,
|
|
181
|
+
shade: D,
|
|
182
|
+
color: v,
|
|
183
|
+
setColor: Y
|
|
84
184
|
}
|
|
85
185
|
)
|
|
86
186
|
]
|
|
87
187
|
}
|
|
88
188
|
)
|
|
89
189
|
] });
|
|
90
|
-
}
|
|
91
|
-
|
|
190
|
+
}
|
|
191
|
+
const Be = se(F);
|
|
192
|
+
F.displayName = "ColorPopper";
|
|
92
193
|
export {
|
|
93
|
-
|
|
194
|
+
Be as ColorPopper
|
|
94
195
|
};
|
|
@@ -1,12 +1,24 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { TThemeScheme } from '../../context/Theme/types';
|
|
2
|
+
import { HslColor, RgbColor, HsvColor, RgbaColor, AnyColor } from 'colord';
|
|
3
|
+
export declare enum EColorPopperSize {
|
|
4
|
+
mini = "mini",
|
|
5
|
+
default = "default"
|
|
6
|
+
}
|
|
7
|
+
export type ExtractColorType<T> = T extends RgbColor ? RgbColor : T extends RgbaColor ? RgbaColor : T extends HslColor ? HslColor : T extends HsvColor ? HsvColor : AnyColor;
|
|
8
|
+
export type TColorPopperProps<T extends AnyColor = AnyColor> = {
|
|
3
9
|
className?: string;
|
|
4
10
|
popperClassName?: string;
|
|
11
|
+
size?: keyof typeof EColorPopperSize;
|
|
5
12
|
placeholder?: string;
|
|
13
|
+
colorHeading?: string;
|
|
14
|
+
schemeHeading?: string;
|
|
15
|
+
themeScheme?: TThemeScheme | undefined;
|
|
16
|
+
setThemeScheme?: (scheme: TThemeScheme | undefined) => void;
|
|
6
17
|
showReset?: boolean;
|
|
7
18
|
alpha?: boolean;
|
|
8
19
|
shade?: boolean;
|
|
9
|
-
|
|
10
|
-
|
|
20
|
+
swatch?: T[];
|
|
21
|
+
color: T;
|
|
22
|
+
setColor: (col: ExtractColorType<T>) => void;
|
|
11
23
|
};
|
|
12
24
|
//# 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,KAAK,QAAQ,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/base/ColorPopper/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAE/D,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAEhF,oBAAY,gBAAgB;IAC3B,IAAI,SAAS;IACb,OAAO,YAAY;CACnB;AAED,MAAM,MAAM,gBAAgB,CAAC,CAAC,IAAI,CAAC,SAAS,QAAQ,GACjD,QAAQ,GAAG,CAAC,SAAS,SAAS,GAAG,SAAS,GAAG,CAAC,SAAS,QAAQ,GAC/D,QAAQ,GAAG,CAAC,SAAS,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAEvD,MAAM,MAAM,iBAAiB,CAAC,CAAC,SAAS,QAAQ,GAAG,QAAQ,IAAI;IAC9D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,IAAI,CAAC,EAAE,MAAM,OAAO,gBAAgB,CAAC;IACrC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,YAAY,GAAG,SAAS,CAAC;IACvC,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,YAAY,GAAG,SAAS,KAAK,IAAI,CAAC;IAC5D,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC;IACb,KAAK,EAAE,CAAC,CAAC;IACT,QAAQ,EAAE,CAAC,GAAG,EAAE,gBAAgB,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC;CAC7C,CAAC"}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as p } from "react/jsx-runtime";
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import
|
|
5
|
-
import "../../../utils/constants/
|
|
6
|
-
import { unicodeToString as
|
|
3
|
+
import { forwardRef as a } from "react";
|
|
4
|
+
import f from "clsx";
|
|
5
|
+
import "../../../utils/constants/theme.js";
|
|
6
|
+
import { unicodeToString as d } from "../../../utils/function/string.js";
|
|
7
7
|
/* empty css */
|
|
8
|
-
import { EIconSize as
|
|
9
|
-
const
|
|
10
|
-
const { className: n,
|
|
8
|
+
import { EIconSize as u } from "./types.js";
|
|
9
|
+
const x = a((e, i) => {
|
|
10
|
+
const { className: n, style: r = {}, code: c, type: m = "light", size: o = "default", onClick: t } = e, s = `${typeof o == "number" ? o : u[o]}px`, l = f(
|
|
11
11
|
"xtrIcon",
|
|
12
12
|
"fontAwesome",
|
|
13
|
-
|
|
13
|
+
m,
|
|
14
14
|
t && "iconButton",
|
|
15
15
|
n
|
|
16
16
|
);
|
|
@@ -18,15 +18,15 @@ const u = l((e, i) => {
|
|
|
18
18
|
"i",
|
|
19
19
|
{
|
|
20
20
|
ref: i,
|
|
21
|
-
className:
|
|
22
|
-
style: { "--iconSize":
|
|
23
|
-
"data-content":
|
|
21
|
+
className: l,
|
|
22
|
+
style: { "--iconSize": s, ...r },
|
|
23
|
+
"data-content": d(c),
|
|
24
24
|
role: "img",
|
|
25
25
|
onClick: t
|
|
26
26
|
}
|
|
27
27
|
);
|
|
28
28
|
});
|
|
29
|
-
|
|
29
|
+
x.displayName = "Icon";
|
|
30
30
|
export {
|
|
31
|
-
|
|
31
|
+
x as Icon
|
|
32
32
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/base/Icon/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,GAAG;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,OAAO,SAAS,CAAC;IAC9B,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,OAAO,SAAS,CAAC;IACvC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACrB,CAAA;AACD,oBAAY,SAAS;IACpB,IAAI,SAAS;IACb,KAAK,UAAU;IACf,OAAO,YAAY;IACnB,KAAK,UAAU;IACf,OAAO,YAAY;IACnB,UAAU,eAAe;IACzB,YAAY,iBAAiB;IAC7B,UAAU,eAAe;IACzB,KAAK,UAAU;CACf;AAED,oBAAY,SAAS;IACpB,IAAI,KAAK;IACT,OAAO,KAAK;IACZ,KAAK,KAAK;CACV"}
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/base/Icon/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAEtC,MAAM,MAAM,UAAU,GAAG;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,OAAO,SAAS,CAAC;IAC9B,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,OAAO,SAAS,CAAC;IACvC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACrB,CAAA;AACD,oBAAY,SAAS;IACpB,IAAI,SAAS;IACb,KAAK,UAAU;IACf,OAAO,YAAY;IACnB,KAAK,UAAU;IACf,OAAO,YAAY;IACnB,UAAU,eAAe;IACzB,YAAY,iBAAiB;IAC7B,UAAU,eAAe;IACzB,KAAK,UAAU;CACf;AAED,oBAAY,SAAS;IACpB,IAAI,KAAK;IACT,OAAO,KAAK;IACZ,KAAK,KAAK;CACV"}
|
|
@@ -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"}
|