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.
Files changed (31) hide show
  1. package/dist/components/base/ColorPicker/ColorPicker.d.ts.map +1 -1
  2. package/dist/components/base/ColorPicker/ColorPicker.js +18 -16
  3. package/dist/components/base/ColorPicker/colorPicker.module.scss.js +8 -8
  4. package/dist/components/base/ColorPopper/ColorPopper.d.ts.map +1 -1
  5. package/dist/components/base/ColorPopper/ColorPopper.js +165 -85
  6. package/dist/components/base/ColorPopper/types.d.ts +11 -0
  7. package/dist/components/base/ColorPopper/types.d.ts.map +1 -1
  8. package/dist/components/base/Icon/Icon.js +12 -12
  9. package/dist/components/base/Icon/types.d.ts +2 -0
  10. package/dist/components/base/Icon/types.d.ts.map +1 -1
  11. package/dist/components/base/Textfield/Textfield.d.ts.map +1 -1
  12. package/dist/components/base/Textfield/Textfield.js +23 -21
  13. package/dist/components/base/Textfield/textfield.module.scss.js +19 -17
  14. package/dist/components/base/Textfield/types.d.ts +1 -0
  15. package/dist/components/base/Textfield/types.d.ts.map +1 -1
  16. package/dist/components/layout/ThemePicker/ThemePicker.d.ts.map +1 -1
  17. package/dist/components/layout/ThemePicker/ThemePicker.js +50 -46
  18. package/dist/components/layout/ThemeSelect/ThemeSelect.d.ts +2 -2
  19. package/dist/components/layout/ThemeSelect/ThemeSelect.d.ts.map +1 -1
  20. package/dist/components/layout/ThemeSelect/ThemeSelect.js +37 -0
  21. package/dist/components/layout/ThemeSelect/types.d.ts +2 -4
  22. package/dist/components/layout/ThemeSelect/types.d.ts.map +1 -1
  23. package/dist/index.d.ts +2 -0
  24. package/dist/index.d.ts.map +1 -1
  25. package/dist/index.js +17 -15
  26. package/dist/utils/constants/theme.d.ts +1 -1
  27. package/dist/utils/constants/theme.d.ts.map +1 -1
  28. package/dist/utils/constants/theme.js +17 -19
  29. package/dist/xtreme-ui.css +1 -1
  30. package/package.json +1 -1
  31. 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;AAE5C,eAAO,MAAM,WAAW,8GAiCtB,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 n, jsx as a } from "react/jsx-runtime";
3
- import { forwardRef as p } from "react";
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 d from "@uiw/react-color-shade-slider";
6
- import C from "@uiw/react-color-wheel";
7
- import N from "clsx";
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 v = p((l, m) => {
10
- const { className: c, shade: t = !0, alpha: h = !0, color: o = { h: 0, s: 0, v: 100, a: 1 }, setColor: s } = l, i = N(e.colorPicker, c);
11
- return /* @__PURE__ */ n(
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: m,
15
- className: i,
14
+ ref: t,
15
+ className: n,
16
16
  children: [
17
17
  /* @__PURE__ */ a(
18
- C,
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
- t && /* @__PURE__ */ a(
26
- d,
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
- h && /* @__PURE__ */ a(
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
- v.displayName = "ColorPicker";
47
+ x.displayName = "ColorPicker";
46
48
  export {
47
- v as ColorPicker
49
+ x as ColorPicker
48
50
  };
@@ -1,13 +1,13 @@
1
- const e = "_colorPicker_1lsi0_1", l = "_wheel_1lsi0_6", s = "_shade_1lsi0_10", o = "_alpha_1lsi0_10", _ = {
1
+ const e = "_colorPicker_16j6k_1", o = "_wheel_16j6k_5", _ = "_shade_16j6k_9", a = "_alpha_16j6k_9", c = {
2
2
  colorPicker: e,
3
- wheel: l,
4
- shade: s,
5
- alpha: o
3
+ wheel: o,
4
+ shade: _,
5
+ alpha: a
6
6
  };
7
7
  export {
8
- o as alpha,
8
+ a as alpha,
9
9
  e as colorPicker,
10
- _ as default,
11
- s as shade,
12
- l as wheel
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;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
+ {"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 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";
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 y(v, R) {
15
+ function F(V, L) {
14
16
  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({
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: g,
33
+ onOpenChange: N,
26
34
  middleware: [
27
- W({ padding: 18 }),
28
- X(),
29
- Y(({ placement: o }) => o === "bottom" ? 10 : 16)
35
+ ie({ crossAxis: !0, padding: 18 }),
36
+ ce(),
37
+ ae(({ placement: e }) => e === "bottom" ? 10 : 16)
30
38
  ],
31
- whileElementsMounted: Q
32
- }), { isMounted: O, styles: V } = Z(m, {
39
+ whileElementsMounted: ne
40
+ }), { isMounted: J, styles: K } = he($, {
33
41
  duration: 200,
34
- initial: ({ side: o }) => ({
42
+ initial: ({ side: e }) => ({
35
43
  opacity: 0,
36
- scale: 0.9,
37
- translate: o === "bottom" ? "0 12px" : "0 -12px"
44
+ translate: e === "bottom" ? "0px 8px" : "0px -8px"
38
45
  })
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);
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 /* @__PURE__ */ u(z, { children: [
68
- /* @__PURE__ */ c(
69
- no,
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: P("colorInput", k),
72
- ref: x.setReference,
73
- placeholder: I,
98
+ className: B("colorInput", O),
99
+ ref: P.setReference,
100
+ placeholder: z,
74
101
  icon: "f53f",
75
- value: w,
76
- onChange: (o) => E(o.target.value),
102
+ iconType: "solid",
103
+ active: S,
104
+ value: u,
105
+ onChange: (e) => X(e.target.value),
77
106
  style: {
78
- "--colorBrandPrimary": H,
79
- "--iconColor": B
107
+ "--colorBrandPrimary": k,
108
+ "--iconColor": E
80
109
  },
81
- onFocus: () => g(!0),
82
- ...$()
110
+ onFocus: () => N(!0),
111
+ ...b()
83
112
  }
84
113
  ),
85
- O && /* @__PURE__ */ u(
114
+ J && /* @__PURE__ */ i(
86
115
  "div",
87
116
  {
88
- ref: lo([R, x.setFloating]),
89
- className: P("xtrColorPopper", F),
90
- style: { ...T, ...V, "--colorBrandPrimary": H },
91
- ...j(),
117
+ ref: ve([L, P.setFloating]),
118
+ className: B("xtrColorPopper", j),
119
+ style: { ...G, ...K, "--colorBrandPrimary": k },
120
+ ...Q(),
92
121
  children: [
93
- /* @__PURE__ */ u("div", { className: "header", children: [
94
- /* @__PURE__ */ c("h1", { children: "Choose a color" }),
95
- M && /* @__PURE__ */ c(so, { code: "f1da", onClick: D })
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__ */ c(
98
- ro,
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
- alpha: N,
101
- shade: b,
102
- color: p,
103
- setColor: L
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 Ho = A(y);
112
- y.displayName = "ColorPopper";
191
+ const Be = se(F);
192
+ F.displayName = "ColorPopper";
113
193
  export {
114
- Ho as ColorPopper
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,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"}
1
+ {"version":3,"file":"types.d.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
2
2
  import { jsx as p } from "react/jsx-runtime";
3
- import { forwardRef as l } from "react";
4
- import a from "clsx";
3
+ import { forwardRef as a } from "react";
4
+ import f from "clsx";
5
5
  import "../../../utils/constants/theme.js";
6
- import { unicodeToString as f } from "../../../utils/function/string.js";
6
+ import { unicodeToString as d } from "../../../utils/function/string.js";
7
7
  /* empty css */
8
- import { EIconSize as d } from "./types.js";
9
- const u = l((e, i) => {
10
- const { className: n, code: r, type: c = "light", size: o = "default", onClick: t } = e, m = `${typeof o == "number" ? o : d[o]}px`, s = a(
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
- c,
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: s,
22
- style: { "--iconSize": m },
23
- "data-content": f(r),
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
- u.displayName = "Icon";
29
+ x.displayName = "Icon";
30
30
  export {
31
- u as Icon
31
+ x as Icon
32
32
  };
@@ -1,5 +1,7 @@
1
+ import { CSSProperties } from 'react';
1
2
  export type IIconProps = {
2
3
  className?: string;
4
+ style?: CSSProperties;
3
5
  code: string;
4
6
  type?: keyof typeof EIconType;
5
7
  size?: number | keyof typeof EIconSize;
@@ -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,8GAsGpB,CAAC"}
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 v, useMemo as f } from "react";
4
- import D from "clsx";
5
- import { Icon as F } from "../Icon/Icon.js";
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 L = v((g, T) => {
7
+ const U = D((g, T) => {
8
8
  const {
9
- className: C,
10
- style: I,
9
+ className: v,
10
+ style: C,
11
11
  type: e = "text",
12
- textarea: n,
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 (n === !0) return null;
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
- }, [n, l, e]), K = f(() => {
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 = (t) => {
38
- c == null || c(t);
39
- }, b = (t) => {
40
- t.key === "Enter" && (u == null || u(t)), i == null || i(t);
41
- }, k = D(
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
- n && r.textarea,
45
+ t && r.textarea,
45
46
  s && r.hasValue,
46
47
  e === "phone" && r.phone,
47
- C
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: I,
57
+ style: C,
56
58
  children: [
57
- p && !n && /* @__PURE__ */ o(F, { className: r.icon, code: p, type: E }),
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
- n ? /* @__PURE__ */ o(
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
- L.displayName = "Textfield";
97
+ U.displayName = "Textfield";
96
98
  export {
97
- L as Textfield
99
+ U as Textfield
98
100
  };
@@ -1,23 +1,25 @@
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
- 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: d,
8
- textarea: a,
9
- phone: c,
10
- hasValue: l
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
- t as dialCode,
15
- l as hasValue,
16
- n as icon,
17
- _ as input,
18
- c as phone,
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
- a as textarea,
21
- e as textfield,
22
- d as withIcon
22
+ c as textarea,
23
+ t as textfield,
24
+ a as withIcon
23
25
  };
@@ -6,6 +6,7 @@ export type TTextfieldProps = {
6
6
  type?: keyof typeof ETextfieldType;
7
7
  textarea?: boolean;
8
8
  placeholder?: string;
9
+ active?: boolean;
9
10
  autoFocus?: boolean;
10
11
  autoComplete?: keyof typeof ETextfieldAutoComplete;
11
12
  icon?: string;
@@ -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,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;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,OAAO,sBAAsB,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a,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":"AAYA,OAAO,EAAqC,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAG/E,eAAO,MAAM,WAAW,8GAuEtB,CAAC"}
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"}