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.
Files changed (63) hide show
  1. package/dist/components/base/ActionCard/actionCard.module.scss.js +6 -6
  2. package/dist/components/base/Button/button.module.scss.js +23 -23
  3. package/dist/components/base/ColorPicker/ColorPicker.d.ts.map +1 -1
  4. package/dist/components/base/ColorPicker/ColorPicker.js +18 -16
  5. package/dist/components/base/ColorPicker/colorPicker.module.scss.js +8 -8
  6. package/dist/components/base/ColorPopper/ColorPopper.d.ts +10 -1
  7. package/dist/components/base/ColorPopper/ColorPopper.d.ts.map +1 -1
  8. package/dist/components/base/ColorPopper/ColorPopper.js +168 -67
  9. package/dist/components/base/ColorPopper/types.d.ts +16 -4
  10. package/dist/components/base/ColorPopper/types.d.ts.map +1 -1
  11. package/dist/components/base/Icon/Icon.js +13 -13
  12. package/dist/components/base/Icon/types.d.ts +2 -0
  13. package/dist/components/base/Icon/types.d.ts.map +1 -1
  14. package/dist/components/base/ProgressBar/progressbar.module.scss.js +1 -1
  15. package/dist/components/base/Select/Select.d.ts.map +1 -1
  16. package/dist/components/base/Select/Select.js +56 -47
  17. package/dist/components/base/Select/types.d.ts +9 -4
  18. package/dist/components/base/Select/types.d.ts.map +1 -1
  19. package/dist/components/base/Textfield/Textfield.d.ts.map +1 -1
  20. package/dist/components/base/Textfield/Textfield.js +23 -21
  21. package/dist/components/base/Textfield/textfield.module.scss.js +22 -20
  22. package/dist/components/base/Textfield/types.d.ts +1 -0
  23. package/dist/components/base/Textfield/types.d.ts.map +1 -1
  24. package/dist/components/context/Theme/ThemeContext.d.ts.map +1 -1
  25. package/dist/components/context/Theme/ThemeContext.js +19 -14
  26. package/dist/components/context/Theme/types.d.ts +12 -17
  27. package/dist/components/context/Theme/types.d.ts.map +1 -1
  28. package/dist/components/context/Theme/types.js +4 -8
  29. package/dist/components/layout/Navigation/navigation.module.scss.js +9 -9
  30. package/dist/components/layout/Sider/sider.module.scss.js +6 -6
  31. package/dist/components/layout/ThemePicker/ThemePicker.d.ts.map +1 -1
  32. package/dist/components/layout/ThemePicker/ThemePicker.js +53 -50
  33. package/dist/components/layout/ThemeSelect/ThemeSelect.d.ts +3 -0
  34. package/dist/components/layout/ThemeSelect/ThemeSelect.d.ts.map +1 -0
  35. package/dist/components/layout/ThemeSelect/ThemeSelect.js +37 -0
  36. package/dist/components/layout/ThemeSelect/types.d.ts +8 -0
  37. package/dist/components/layout/ThemeSelect/types.d.ts.map +1 -0
  38. package/dist/components/layout/ThemeSwitch/ThemeSwitch.d.ts.map +1 -1
  39. package/dist/components/layout/ThemeSwitch/ThemeSwitch.js +40 -40
  40. package/dist/index.d.ts +2 -0
  41. package/dist/index.d.ts.map +1 -1
  42. package/dist/index.js +99 -95
  43. package/dist/utils/constants/theme.d.ts +19 -0
  44. package/dist/utils/constants/theme.d.ts.map +1 -0
  45. package/dist/utils/constants/theme.js +27 -0
  46. package/dist/utils/function/common.d.ts +2 -0
  47. package/dist/utils/function/common.d.ts.map +1 -0
  48. package/dist/utils/function/common.js +4 -0
  49. package/dist/utils/helper/colorHelper.d.ts +5 -0
  50. package/dist/utils/helper/colorHelper.d.ts.map +1 -0
  51. package/dist/utils/helper/colorHelper.js +24 -0
  52. package/dist/utils/helper/themeController.d.ts +2 -1
  53. package/dist/utils/helper/themeController.d.ts.map +1 -1
  54. package/dist/utils/helper/themeController.js +32 -13
  55. package/dist/utils/index.d.ts +1 -1
  56. package/dist/utils/index.d.ts.map +1 -1
  57. package/dist/xtreme-ui.css +1 -1
  58. package/package.json +4 -1
  59. package/dist/components/base/ColorPopper/colorPopper.module.scss.js +0 -11
  60. package/dist/components/layout/ThemePicker/themePicker.module.scss.js +0 -39
  61. package/dist/utils/constants/commons.d.ts +0 -18
  62. package/dist/utils/constants/commons.d.ts.map +0 -1
  63. package/dist/utils/constants/commons.js +0 -15
@@ -1,13 +1,13 @@
1
- const i = "_actionCard_1715r_1", e = "_miniSize_1715r_14", m = "_smallSize_1715r_17", _ = "_mediumSize_1715r_20", a = {
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: m,
5
- mediumSize: _
4
+ smallSize: z,
5
+ mediumSize: m
6
6
  };
7
7
  export {
8
8
  i as actionCard,
9
- a as default,
10
- _ as mediumSize,
9
+ _ as default,
10
+ m as mediumSize,
11
11
  e as miniSize,
12
- m as smallSize
12
+ z as smallSize
13
13
  };
@@ -1,39 +1,39 @@
1
- const e = "_button_13e5w_1", n = "_label_13e5w_14", _ = "_icon_13e5w_21", i = "_underline_13e5w_25", o = "_primaryType_13e5w_48", r = "_primaryDangerType_13e5w_48", a = "_secondaryType_13e5w_52", y = "_secondaryDangerType_13e5w_52", l = "_linkType_13e5w_56", c = "_linkDangerType_13e5w_56", s = "_miniSize_13e5w_85", t = "_iconOnly_13e5w_96", p = "_defaultSize_13e5w_103", T = "_largeSize_13e5w_121", w = "_loading_13e5w_149", d = "_barberPole_13e5w_1", g = "_spin_13e5w_1", b = {
2
- button: e,
3
- label: n,
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: l,
11
- linkDangerType: c,
12
- miniSize: s,
13
- iconOnly: t,
14
- defaultSize: p,
15
- largeSize: T,
16
- loading: w,
17
- barberPole: d,
18
- spin: g
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
- d as barberPole,
22
- e as button,
21
+ T as barberPole,
22
+ n as button,
23
23
  b as default,
24
- p as defaultSize,
24
+ t as defaultSize,
25
25
  _ as icon,
26
- t as iconOnly,
27
- n as label,
28
- T as largeSize,
29
- c as linkDangerType,
30
- l as linkType,
31
- w as loading,
32
- s as miniSize,
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
- g as spin,
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;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,3 +1,12 @@
1
+ import { Ref } from 'react';
1
2
  import { TColorPopperProps } from './types';
2
- export declare const ColorPopper: import('react').ForwardRefExoticComponent<TColorPopperProps & import('react').RefAttributes<HTMLDivElement>>;
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":"AAsBA,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAI5C,eAAO,MAAM,WAAW,8GAuGtB,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,94 +1,195 @@
1
1
  "use client";
2
- import { jsxs as f, Fragment as q, jsx as l } from "react/jsx-runtime";
3
- import { forwardRef as D, useMemo as g, useState as p, useEffect as L } from "react";
4
- import { useFloating as U, autoUpdate as z, shift as A, flip as B, offset as G, useTransitionStyles as J, useInteractions as K, useClick as Q, useDismiss as V } from "@floating-ui/react";
5
- import C from "clsx";
6
- import { colord as t, getFormat as H } from "colord";
7
- import { ColorPicker as W } from "../ColorPicker/ColorPicker.js";
8
- import { Icon as X } from "../Icon/Icon.js";
9
- import { Textfield as Y } from "../Textfield/Textfield.js";
10
- import "../../../utils/constants/commons.js";
11
- import { mergeRefs as Z } from "../../../utils/function/mergeRefs.js";
12
- import h from "./colorPopper.module.scss.js";
13
- const _ = D((v, y) => {
14
- const { className: P, popperClassName: F, placeholder: N = "Color Picker", showReset: R = !0, shade: b, alpha: k, color: s, setColor: o } = v, u = g(() => t(s), []), r = g(() => H(s), [s]), [i, n] = p(t(s).toHsv()), [w, a] = p(t(s).toHex()), [I, d] = p(!1), { refs: x, floatingStyles: S, context: c } = U({
15
- open: I,
16
- onOpenChange: d,
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
- A(),
19
- B(),
20
- G(({ placement: e }) => e === "bottom" ? 10 : 16)
35
+ ie({ crossAxis: !0, padding: 18 }),
36
+ ce(),
37
+ ae(({ placement: e }) => e === "bottom" ? 10 : 16)
21
38
  ],
22
- whileElementsMounted: z
23
- }), { isMounted: T, styles: E } = J(c, {
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
- scale: 0.9,
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: M, getFloatingProps: O } = K([
31
- Q(c),
32
- V(c)
33
- ]), j = (e) => {
34
- const m = H(e);
35
- a(e), m && (m === "hex" && e.length > 6 || m !== "hex") && n(t(e).toHsv());
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 L(() => {
38
- const e = t(i);
39
- e.isEqual(t(s)) || (r === "rgb" ? o == null || o(e.toRgb()) : r === "hex" ? o == null || o(e.toHex()) : r === "hsl" ? o == null || o(e.toHsl()) : r === "hsv" && (o == null || o(e.toHsv())));
40
- }, [s, r, i, o]), /* @__PURE__ */ f(q, { children: [
41
- /* @__PURE__ */ l(
42
- Y,
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: C(h.colorInput, P),
45
- ref: x.setReference,
46
- placeholder: N,
47
- icon: "color",
48
- value: w,
49
- onChange: (e) => j(e.target.value),
50
- style: { "--chipColor": t(i).toHex() },
51
- onFocus: () => d(!0),
52
- ...M()
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
- T && /* @__PURE__ */ f(
114
+ J && /* @__PURE__ */ i(
56
115
  "div",
57
116
  {
58
- ref: Z([y, x.setFloating]),
59
- className: C(h.colorPopper, F),
60
- style: { ...S, ...E },
61
- ...O(),
117
+ ref: ve([L, P.setFloating]),
118
+ className: B("xtrColorPopper", j),
119
+ style: { ...G, ...K, "--colorBrandPrimary": k },
120
+ ...Q(),
62
121
  children: [
63
- /* @__PURE__ */ f("div", { className: h.header, children: [
64
- /* @__PURE__ */ l("h1", { children: "Choose a color" }),
65
- R && /* @__PURE__ */ l(
66
- X,
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
- onClick: () => {
70
- n(u.toHsv()), a(u.toHex());
71
- }
151
+ type: "solid",
152
+ style: { "--colorBrandPrimary": W },
153
+ onClick: ee
72
154
  }
73
155
  )
74
156
  ] }),
75
- /* @__PURE__ */ l(
76
- W,
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
- shade: b,
79
- alpha: k,
80
- color: i,
81
- setColor: (e) => {
82
- n(e), a(t(e).toHex());
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
- _.displayName = "ColorPopper";
190
+ }
191
+ const Be = se(F);
192
+ F.displayName = "ColorPopper";
92
193
  export {
93
- _ as ColorPopper
194
+ Be as ColorPopper
94
195
  };
@@ -1,12 +1,24 @@
1
- import { AnyColor } from 'colord';
2
- export type TColorPopperProps = {
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
- color: AnyColor;
10
- setColor: (col: AnyColor) => void;
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;AAEvC,MAAM,MAAM,iBAAiB,GAAG;IAC/B,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,QAAQ,CAAC;IAChB,QAAQ,EAAE,CAAC,GAAG,EAAE,QAAQ,KAAK,IAAI,CAAC;CAClC,CAAA"}
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 l } from "react";
4
- import a from "clsx";
5
- import "../../../utils/constants/commons.js";
6
- import { unicodeToString as f } from "../../../utils/function/string.js";
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 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,4 +1,4 @@
1
- const r = "_progressBar_luf46_1", s = "_progress_luf46_1", e = "_intermediate_luf46_31", t = {
1
+ const r = "_progressBar_192yn_1", s = "_progress_192yn_1", e = "_intermediate_192yn_31", t = {
2
2
  progressBar: r,
3
3
  progress: s,
4
4
  intermediate: e
@@ -1 +1 @@
1
- {"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../../../src/components/base/Select/Select.tsx"],"names":[],"mappings":"AAOA,OAAO,eAAe,CAAC;AACvB,OAAO,EAAU,YAAY,EAAE,MAAM,SAAS,CAAC;AAE/C,wBAAgB,MAAM,CAAC,CAAC,EAAG,KAAK,EAAE,YAAY,CAAC,CAAC,CAAC,2CAgEhD"}
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"}