xtreme-ui 0.0.95 → 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/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.map +1 -1
- package/dist/components/base/ColorPopper/ColorPopper.js +165 -85
- package/dist/components/base/ColorPopper/types.d.ts +11 -0
- package/dist/components/base/ColorPopper/types.d.ts.map +1 -1
- package/dist/components/base/Icon/Icon.js +12 -12
- 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/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 +19 -17
- package/dist/components/base/Textfield/types.d.ts +1 -0
- package/dist/components/base/Textfield/types.d.ts.map +1 -1
- package/dist/components/layout/ThemePicker/ThemePicker.d.ts.map +1 -1
- package/dist/components/layout/ThemePicker/ThemePicker.js +50 -46
- package/dist/components/layout/ThemeSelect/ThemeSelect.d.ts +2 -2
- package/dist/components/layout/ThemeSelect/ThemeSelect.d.ts.map +1 -1
- package/dist/components/layout/ThemeSelect/ThemeSelect.js +37 -0
- package/dist/components/layout/ThemeSelect/types.d.ts +2 -4
- package/dist/components/layout/ThemeSelect/types.d.ts.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +17 -15
- package/dist/utils/constants/theme.d.ts +1 -1
- package/dist/utils/constants/theme.d.ts.map +1 -1
- package/dist/utils/constants/theme.js +17 -19
- package/dist/xtreme-ui.css +1 -1
- package/package.json +1 -1
- package/dist/components/layout/ThemePicker/themePicker.module.scss.js +0 -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 +1 @@
|
|
|
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;
|
|
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,106 +1,186 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import { useFloating as
|
|
5
|
-
import
|
|
6
|
-
import { colord as s, getFormat as
|
|
7
|
-
import { ColorPicker as
|
|
8
|
-
import { Icon as
|
|
9
|
-
import { Textfield as
|
|
10
|
-
import "../../../utils/
|
|
11
|
-
import {
|
|
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";
|
|
12
14
|
/* empty css */
|
|
13
|
-
function
|
|
15
|
+
function F(V, L) {
|
|
14
16
|
const {
|
|
15
|
-
className:
|
|
16
|
-
popperClassName:
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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({
|
|
24
32
|
open: S,
|
|
25
|
-
onOpenChange:
|
|
33
|
+
onOpenChange: N,
|
|
26
34
|
middleware: [
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
35
|
+
ie({ crossAxis: !0, padding: 18 }),
|
|
36
|
+
ce(),
|
|
37
|
+
ae(({ placement: e }) => e === "bottom" ? 10 : 16)
|
|
30
38
|
],
|
|
31
|
-
whileElementsMounted:
|
|
32
|
-
}), { isMounted:
|
|
39
|
+
whileElementsMounted: ne
|
|
40
|
+
}), { isMounted: J, styles: K } = he($, {
|
|
33
41
|
duration: 200,
|
|
34
|
-
initial: ({ side:
|
|
42
|
+
initial: ({ side: e }) => ({
|
|
35
43
|
opacity: 0,
|
|
36
|
-
|
|
37
|
-
translate: o === "bottom" ? "0 12px" : "0 -12px"
|
|
44
|
+
translate: e === "bottom" ? "0px 8px" : "0px -8px"
|
|
38
45
|
})
|
|
39
|
-
}), { getReferenceProps:
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
])
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}, [
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
},
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
a(o);
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}, D = () => {
|
|
64
|
-
const o = r.toHsv();
|
|
65
|
-
a(o), i(r.toHex()), d(r);
|
|
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);
|
|
66
70
|
};
|
|
67
|
-
return
|
|
68
|
-
|
|
69
|
-
|
|
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,
|
|
82
|
+
{
|
|
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,
|
|
70
97
|
{
|
|
71
|
-
className:
|
|
72
|
-
ref:
|
|
73
|
-
placeholder:
|
|
98
|
+
className: B("colorInput", O),
|
|
99
|
+
ref: P.setReference,
|
|
100
|
+
placeholder: z,
|
|
74
101
|
icon: "f53f",
|
|
75
|
-
|
|
76
|
-
|
|
102
|
+
iconType: "solid",
|
|
103
|
+
active: S,
|
|
104
|
+
value: u,
|
|
105
|
+
onChange: (e) => X(e.target.value),
|
|
77
106
|
style: {
|
|
78
|
-
"--colorBrandPrimary":
|
|
79
|
-
"--iconColor":
|
|
107
|
+
"--colorBrandPrimary": k,
|
|
108
|
+
"--iconColor": E
|
|
80
109
|
},
|
|
81
|
-
onFocus: () =>
|
|
82
|
-
|
|
110
|
+
onFocus: () => N(!0),
|
|
111
|
+
...b()
|
|
83
112
|
}
|
|
84
113
|
),
|
|
85
|
-
|
|
114
|
+
J && /* @__PURE__ */ i(
|
|
86
115
|
"div",
|
|
87
116
|
{
|
|
88
|
-
ref:
|
|
89
|
-
className:
|
|
90
|
-
style: { ...
|
|
91
|
-
...
|
|
117
|
+
ref: ve([L, P.setFloating]),
|
|
118
|
+
className: B("xtrColorPopper", j),
|
|
119
|
+
style: { ...G, ...K, "--colorBrandPrimary": k },
|
|
120
|
+
...Q(),
|
|
92
121
|
children: [
|
|
93
|
-
/* @__PURE__ */
|
|
94
|
-
/* @__PURE__ */
|
|
95
|
-
|
|
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,
|
|
149
|
+
{
|
|
150
|
+
code: "f1da",
|
|
151
|
+
type: "solid",
|
|
152
|
+
style: { "--colorBrandPrimary": W },
|
|
153
|
+
onClick: ee
|
|
154
|
+
}
|
|
155
|
+
)
|
|
96
156
|
] }),
|
|
97
|
-
/* @__PURE__ */
|
|
98
|
-
|
|
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,
|
|
99
178
|
{
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
179
|
+
className: "colorPicker",
|
|
180
|
+
alpha: q,
|
|
181
|
+
shade: D,
|
|
182
|
+
color: v,
|
|
183
|
+
setColor: Y
|
|
104
184
|
}
|
|
105
185
|
)
|
|
106
186
|
]
|
|
@@ -108,8 +188,8 @@ function y(v, R) {
|
|
|
108
188
|
)
|
|
109
189
|
] });
|
|
110
190
|
}
|
|
111
|
-
const
|
|
112
|
-
|
|
191
|
+
const Be = se(F);
|
|
192
|
+
F.displayName = "ColorPopper";
|
|
113
193
|
export {
|
|
114
|
-
|
|
194
|
+
Be as ColorPopper
|
|
115
195
|
};
|
|
@@ -1,12 +1,23 @@
|
|
|
1
|
+
import { TThemeScheme } from '../../context/Theme/types';
|
|
1
2
|
import { HslColor, RgbColor, HsvColor, RgbaColor, AnyColor } from 'colord';
|
|
3
|
+
export declare enum EColorPopperSize {
|
|
4
|
+
mini = "mini",
|
|
5
|
+
default = "default"
|
|
6
|
+
}
|
|
2
7
|
export type ExtractColorType<T> = T extends RgbColor ? RgbColor : T extends RgbaColor ? RgbaColor : T extends HslColor ? HslColor : T extends HsvColor ? HsvColor : AnyColor;
|
|
3
8
|
export type TColorPopperProps<T extends AnyColor = AnyColor> = {
|
|
4
9
|
className?: string;
|
|
5
10
|
popperClassName?: string;
|
|
11
|
+
size?: keyof typeof EColorPopperSize;
|
|
6
12
|
placeholder?: string;
|
|
13
|
+
colorHeading?: string;
|
|
14
|
+
schemeHeading?: string;
|
|
15
|
+
themeScheme?: TThemeScheme | undefined;
|
|
16
|
+
setThemeScheme?: (scheme: TThemeScheme | undefined) => void;
|
|
7
17
|
showReset?: boolean;
|
|
8
18
|
alpha?: boolean;
|
|
9
19
|
shade?: boolean;
|
|
20
|
+
swatch?: T[];
|
|
10
21
|
color: T;
|
|
11
22
|
setColor: (col: ExtractColorType<T>) => void;
|
|
12
23
|
};
|
|
@@ -1 +1 @@
|
|
|
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,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/base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sx as p } from "react/jsx-runtime";
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import
|
|
3
|
+
import { forwardRef as a } from "react";
|
|
4
|
+
import f from "clsx";
|
|
5
5
|
import "../../../utils/constants/theme.js";
|
|
6
|
-
import { unicodeToString as
|
|
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":"Textfield.d.ts","sourceRoot":"","sources":["../../../../src/components/base/Textfield/Textfield.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE1C,eAAO,MAAM,SAAS,
|
|
1
|
+
{"version":3,"file":"Textfield.d.ts","sourceRoot":"","sources":["../../../../src/components/base/Textfield/Textfield.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE1C,eAAO,MAAM,SAAS,8GAwGpB,CAAC"}
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs as w, jsx as o } from "react/jsx-runtime";
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import
|
|
5
|
-
import { Icon as
|
|
3
|
+
import { forwardRef as D, useMemo as f } from "react";
|
|
4
|
+
import F from "clsx";
|
|
5
|
+
import { Icon as L } from "../Icon/Icon.js";
|
|
6
6
|
import r from "./textfield.module.scss.js";
|
|
7
|
-
const
|
|
7
|
+
const U = D((g, T) => {
|
|
8
8
|
const {
|
|
9
|
-
className:
|
|
10
|
-
style:
|
|
9
|
+
className: v,
|
|
10
|
+
style: C,
|
|
11
11
|
type: e = "text",
|
|
12
|
-
textarea:
|
|
12
|
+
textarea: t,
|
|
13
13
|
placeholder: a,
|
|
14
14
|
autoComplete: m = "off",
|
|
15
|
+
active: I,
|
|
15
16
|
autoFocus: d,
|
|
16
17
|
icon: l,
|
|
17
18
|
iconType: E = "regular",
|
|
@@ -23,28 +24,29 @@ const L = v((g, T) => {
|
|
|
23
24
|
onKeyDown: i,
|
|
24
25
|
onEnterKey: u
|
|
25
26
|
} = g, p = f(() => {
|
|
26
|
-
if (
|
|
27
|
+
if (t === !0) return null;
|
|
27
28
|
if (l) return l;
|
|
28
29
|
if (e === "number") return "23";
|
|
29
30
|
if (e === "search") return "f002";
|
|
30
31
|
if (e === "password") return "f30d";
|
|
31
|
-
}, [
|
|
32
|
+
}, [t, l, e]), K = f(() => {
|
|
32
33
|
if (a) return a;
|
|
33
34
|
if (e === "number") return "Enter a number";
|
|
34
35
|
if (e === "search") return "Search";
|
|
35
36
|
if (e === "password") return "Enter password";
|
|
36
37
|
if (e === "phone") return "Enter phone number";
|
|
37
|
-
}, [a, e]), j = f(() => e === "phone" ? "number" : e, [e]), N = (
|
|
38
|
-
c == null || c(
|
|
39
|
-
}, b = (
|
|
40
|
-
|
|
41
|
-
}, k =
|
|
38
|
+
}, [a, e]), j = f(() => e === "phone" ? "number" : e, [e]), N = (n) => {
|
|
39
|
+
c == null || c(n);
|
|
40
|
+
}, b = (n) => {
|
|
41
|
+
n.key === "Enter" && (u == null || u(n)), i == null || i(n);
|
|
42
|
+
}, k = F(
|
|
42
43
|
r.textfield,
|
|
43
44
|
p && r.withIcon,
|
|
44
|
-
|
|
45
|
+
t && r.textarea,
|
|
45
46
|
s && r.hasValue,
|
|
46
47
|
e === "phone" && r.phone,
|
|
47
|
-
|
|
48
|
+
I && r.active,
|
|
49
|
+
v
|
|
48
50
|
);
|
|
49
51
|
return /* @__PURE__ */ w(
|
|
50
52
|
"div",
|
|
@@ -52,14 +54,14 @@ const L = v((g, T) => {
|
|
|
52
54
|
ref: T,
|
|
53
55
|
className: k,
|
|
54
56
|
role: "textbox",
|
|
55
|
-
style:
|
|
57
|
+
style: C,
|
|
56
58
|
children: [
|
|
57
|
-
p && !
|
|
59
|
+
p && !t && /* @__PURE__ */ o(L, { className: r.icon, code: p, type: E }),
|
|
58
60
|
e === "phone" && /* @__PURE__ */ w("div", { className: r.dialCode, children: [
|
|
59
61
|
/* @__PURE__ */ o("span", { style: { backgroundImage: "url(https://flagcdn.com/in.svg)" } }),
|
|
60
62
|
/* @__PURE__ */ o("p", { children: "+91" })
|
|
61
63
|
] }),
|
|
62
|
-
|
|
64
|
+
t ? /* @__PURE__ */ o(
|
|
63
65
|
"textarea",
|
|
64
66
|
{
|
|
65
67
|
className: r.input,
|
|
@@ -92,7 +94,7 @@ const L = v((g, T) => {
|
|
|
92
94
|
}
|
|
93
95
|
);
|
|
94
96
|
});
|
|
95
|
-
|
|
97
|
+
U.displayName = "Textfield";
|
|
96
98
|
export {
|
|
97
|
-
|
|
99
|
+
U as Textfield
|
|
98
100
|
};
|
|
@@ -1,23 +1,25 @@
|
|
|
1
|
-
const
|
|
2
|
-
textfield:
|
|
3
|
-
icon:
|
|
4
|
-
dialCode:
|
|
5
|
-
input:
|
|
1
|
+
const t = "_textfield_1dif2_1", e = "_icon_1dif2_29", _ = "_dialCode_1dif2_39", i = "_input_1dif2_60", o = "_placeholder_1dif2_79", a = "_withIcon_1dif2_94", c = "_textarea_1dif2_104", d = "_phone_1dif2_114", n = "_hasValue_1dif2_120", l = "_active_1dif2_141", s = {
|
|
2
|
+
textfield: t,
|
|
3
|
+
icon: e,
|
|
4
|
+
dialCode: _,
|
|
5
|
+
input: i,
|
|
6
6
|
placeholder: o,
|
|
7
|
-
withIcon:
|
|
8
|
-
textarea:
|
|
9
|
-
phone:
|
|
10
|
-
hasValue:
|
|
7
|
+
withIcon: a,
|
|
8
|
+
textarea: c,
|
|
9
|
+
phone: d,
|
|
10
|
+
hasValue: n,
|
|
11
|
+
active: l
|
|
11
12
|
};
|
|
12
13
|
export {
|
|
14
|
+
l as active,
|
|
13
15
|
s as default,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
_ as dialCode,
|
|
17
|
+
n as hasValue,
|
|
18
|
+
e as icon,
|
|
19
|
+
i as input,
|
|
20
|
+
d as phone,
|
|
19
21
|
o as placeholder,
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
22
|
+
c as textarea,
|
|
23
|
+
t as textfield,
|
|
24
|
+
a as withIcon
|
|
23
25
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/base/Textfield/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE9E,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1C,MAA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B;IACvC,UAAU,aAAa;IACvB,OAAO,UAAU;IACjB,UAAU,aAAa;IACvB,cAAc,iBAAiB;IAC/B,kBAAkB,qBAAqB;IACvC,eAAe,kBAAkB;IACjC,oBAAoB,uBAAuB;IAC3C,cAAc,iBAAiB;IAC/B,gBAAgB,mBAAmB;IACnC,eAAe,kBAAkB;IACjC,eAAe,kBAAkB;IACjC,eAAe,kBAAkB;IACjC,gBAAgB,mBAAmB;IACnC,gBAAgB,mBAAmB;IACnC,gBAAgB,mBAAmB;IACnC,gBAAgB,mBAAmB;IACnC,SAAS,YAAY;IACrB,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,UAAU,aAAa;IACvB,MAAM,SAAS;IACf,UAAU,aAAa;IACvB,YAAY,eAAe;IAC3B,WAAW,cAAc;IACzB,KAAK,QAAQ;IACb,kBAAkB,qBAAqB;IACvC,cAAc,iBAAiB;IAC/B,eAAe,kBAAkB;IACjC,WAAW,cAAc;IACzB,eAAe,kBAAkB;CACjC"}
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/base/Textfield/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE9E,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1C,MAAM,MAAM,eAAe,GAAG;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,IAAI,CAAC,EAAE,MAAM,O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kB,qBAAqB;IACvC,eAAe,kBAAkB;IACjC,oBAAoB,uBAAuB;IAC3C,cAAc,iBAAiB;IAC/B,gBAAgB,mBAAmB;IACnC,eAAe,kBAAkB;IACjC,eAAe,kBAAkB;IACjC,eAAe,kBAAkB;IACjC,gBAAgB,mBAAmB;IACnC,gBAAgB,mBAAmB;IACnC,gBAAgB,mBAAmB;IACnC,gBAAgB,mBAAmB;IACnC,SAAS,YAAY;IACrB,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,UAAU,aAAa;IACvB,MAAM,SAAS;IACf,UAAU,aAAa;IACvB,YAAY,eAAe;IAC3B,WAAW,cAAc;IACzB,KAAK,QAAQ;IACb,kBAAkB,qBAAqB;IACvC,cAAc,iBAAiB;IAC/B,eAAe,kBAAkB;IACjC,WAAW,cAAc;IACzB,eAAe,kBAAkB;CACjC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemePicker.d.ts","sourceRoot":"","sources":["../../../../src/components/layout/ThemePicker/ThemePicker.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ThemePicker.d.ts","sourceRoot":"","sources":["../../../../src/components/layout/ThemePicker/ThemePicker.tsx"],"names":[],"mappings":"AAaA,OAAO,oBAAoB,CAAC;AAC5B,OAAO,EAAqC,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAG/E,eAAO,MAAM,WAAW,8GAwEtB,CAAC"}
|