xtreme-ui 0.0.94 → 0.0.95

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) 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/ColorPopper/ColorPopper.d.ts +10 -1
  4. package/dist/components/base/ColorPopper/ColorPopper.d.ts.map +1 -1
  5. package/dist/components/base/ColorPopper/ColorPopper.js +88 -67
  6. package/dist/components/base/ColorPopper/types.d.ts +5 -4
  7. package/dist/components/base/ColorPopper/types.d.ts.map +1 -1
  8. package/dist/components/base/Icon/Icon.js +1 -1
  9. package/dist/components/base/ProgressBar/progressbar.module.scss.js +1 -1
  10. package/dist/components/base/Select/Select.d.ts.map +1 -1
  11. package/dist/components/base/Select/Select.js +56 -47
  12. package/dist/components/base/Select/types.d.ts +9 -4
  13. package/dist/components/base/Select/types.d.ts.map +1 -1
  14. package/dist/components/base/Textfield/textfield.module.scss.js +14 -14
  15. package/dist/components/context/Theme/ThemeContext.d.ts.map +1 -1
  16. package/dist/components/context/Theme/ThemeContext.js +19 -14
  17. package/dist/components/context/Theme/types.d.ts +12 -17
  18. package/dist/components/context/Theme/types.d.ts.map +1 -1
  19. package/dist/components/context/Theme/types.js +4 -8
  20. package/dist/components/layout/Navigation/navigation.module.scss.js +9 -9
  21. package/dist/components/layout/Sider/sider.module.scss.js +6 -6
  22. package/dist/components/layout/ThemePicker/ThemePicker.d.ts.map +1 -1
  23. package/dist/components/layout/ThemePicker/ThemePicker.js +37 -38
  24. package/dist/components/layout/ThemePicker/themePicker.module.scss.js +28 -28
  25. package/dist/components/layout/ThemeSelect/ThemeSelect.d.ts +3 -0
  26. package/dist/components/layout/ThemeSelect/ThemeSelect.d.ts.map +1 -0
  27. package/dist/components/layout/ThemeSelect/types.d.ts +10 -0
  28. package/dist/components/layout/ThemeSelect/types.d.ts.map +1 -0
  29. package/dist/components/layout/ThemeSwitch/ThemeSwitch.d.ts.map +1 -1
  30. package/dist/components/layout/ThemeSwitch/ThemeSwitch.js +40 -40
  31. package/dist/index.js +97 -95
  32. package/dist/utils/constants/theme.d.ts +19 -0
  33. package/dist/utils/constants/theme.d.ts.map +1 -0
  34. package/dist/utils/constants/theme.js +29 -0
  35. package/dist/utils/function/common.d.ts +2 -0
  36. package/dist/utils/function/common.d.ts.map +1 -0
  37. package/dist/utils/function/common.js +4 -0
  38. package/dist/utils/helper/colorHelper.d.ts +5 -0
  39. package/dist/utils/helper/colorHelper.d.ts.map +1 -0
  40. package/dist/utils/helper/colorHelper.js +24 -0
  41. package/dist/utils/helper/themeController.d.ts +2 -1
  42. package/dist/utils/helper/themeController.d.ts.map +1 -1
  43. package/dist/utils/helper/themeController.js +32 -13
  44. package/dist/utils/index.d.ts +1 -1
  45. package/dist/utils/index.d.ts.map +1 -1
  46. package/dist/xtreme-ui.css +1 -1
  47. package/package.json +4 -1
  48. package/dist/components/base/ColorPopper/colorPopper.module.scss.js +0 -11
  49. package/dist/utils/constants/commons.d.ts +0 -18
  50. package/dist/utils/constants/commons.d.ts.map +0 -1
  51. package/dist/utils/constants/commons.js +0 -15
@@ -1,10 +1,6 @@
1
- var r = /* @__PURE__ */ ((t) => (t.light = "light", t.dark = "dark", t.system = "system", t))(r || {});
2
- const a = "system";
3
- var n = /* @__PURE__ */ ((t) => (t.red = "red", t.pink = "pink", t.orange = "orange", t.green = "green", t.blue = "blue", t.violet = "violet", t))(n || {});
4
- const s = "violet";
1
+ var a = /* @__PURE__ */ ((t) => (t.light = "light", t.dark = "dark", t.auto = "auto", t))(a || {});
2
+ const r = "auto";
5
3
  export {
6
- n as EThemeColor,
7
- r as EThemeScheme,
8
- s as defaultColor,
9
- a as defaultScheme
4
+ a as EThemeScheme,
5
+ r as defaultScheme
10
6
  };
@@ -1,21 +1,21 @@
1
- const t = "_navigation_1vrjr_1", r = "_brand_1vrjr_10", o = "_routeList_1vrjr_19", n = "_route_1vrjr_19", _ = "_icon_1vrjr_52", a = "_label_1vrjr_59", i = "_loading_1vrjr_79", c = "_active_1vrjr_98", e = {
1
+ const t = "_navigation_10g7s_1", o = "_brand_10g7s_10", n = "_routeList_10g7s_19", _ = "_route_10g7s_19", s = "_icon_10g7s_52", a = "_label_10g7s_59", i = "_loading_10g7s_79", c = "_active_10g7s_98", e = {
2
2
  navigation: t,
3
- brand: r,
4
- routeList: o,
5
- route: n,
6
- icon: _,
3
+ brand: o,
4
+ routeList: n,
5
+ route: _,
6
+ icon: s,
7
7
  label: a,
8
8
  loading: i,
9
9
  active: c
10
10
  };
11
11
  export {
12
12
  c as active,
13
- r as brand,
13
+ o as brand,
14
14
  e as default,
15
- _ as icon,
15
+ s as icon,
16
16
  a as label,
17
17
  i as loading,
18
18
  t as navigation,
19
- n as route,
20
- o as routeList
19
+ _ as route,
20
+ n as routeList
21
21
  };
@@ -1,21 +1,21 @@
1
- const e = "_sider_1dq8m_1", i = "_leftSiderContainer_1dq8m_13", t = "_rightSiderContainer_1dq8m_21", n = "_content_1dq8m_29", r = "_miniLeftSider_1dq8m_39", d = "_miniRightSider_1dq8m_46", _ = "_leftOpen_1dq8m_53", o = "_rightOpen_1dq8m_66", s = {
1
+ const e = "_sider_11os5_1", i = "_leftSiderContainer_11os5_13", t = "_rightSiderContainer_11os5_21", n = "_content_11os5_29", r = "_miniLeftSider_11os5_39", o = "_miniRightSider_11os5_46", _ = "_leftOpen_11os5_53", s = "_rightOpen_11os5_66", d = {
2
2
  sider: e,
3
3
  leftSiderContainer: i,
4
4
  rightSiderContainer: t,
5
5
  content: n,
6
6
  miniLeftSider: r,
7
- miniRightSider: d,
7
+ miniRightSider: o,
8
8
  leftOpen: _,
9
- rightOpen: o
9
+ rightOpen: s
10
10
  };
11
11
  export {
12
12
  n as content,
13
- s as default,
13
+ d as default,
14
14
  _ as leftOpen,
15
15
  i as leftSiderContainer,
16
16
  r as miniLeftSider,
17
- d as miniRightSider,
18
- o as rightOpen,
17
+ o as miniRightSider,
18
+ s as rightOpen,
19
19
  t as rightSiderContainer,
20
20
  e as sider
21
21
  };
@@ -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;AAE/E,eAAO,MAAM,WAAW,8GAuEtB,CAAC"}
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,73 +1,72 @@
1
1
  "use client";
2
- import { jsxs as m, jsx as o } from "react/jsx-runtime";
2
+ import { jsxs as m, jsx as r } from "react/jsx-runtime";
3
3
  import { forwardRef as T } from "react";
4
- import c from "clsx";
4
+ import l from "clsx";
5
5
  import { ActionCard as C } from "../../base/ActionCard/ActionCard.js";
6
- import { Button as k } from "../../base/Button/Button.js";
7
- import { Icon as S } from "../../base/Icon/Icon.js";
8
- import { EThemeColor as $ } from "../../context/Theme/types.js";
9
- import { useXTheme as g } from "../../context/useContext.js";
10
- import { THEME_SCHEME as u } from "../../../utils/constants/commons.js";
11
- import { capitalizeFirstLetter as y } from "../../../utils/function/string.js";
12
- import e from "./themePicker.module.scss.js";
13
- import { EThemePickerGap as x, EThemePickerSize as E } from "./types.js";
14
- const P = T((a, l) => {
15
- const { className: h, size: i = "default" } = a, { themeScheme: t, setThemeScheme: n, themeColor: d, setThemeColor: p } = g(), f = c(
16
- e.themePicker,
6
+ import { Button as $ } from "../../base/Button/Button.js";
7
+ import { Icon as u } from "../../base/Icon/Icon.js";
8
+ import { useXTheme as E } from "../../context/useContext.js";
9
+ import { isEqual as S } from "../../../utils/function/common.js";
10
+ import { THEME_SCHEME as g, ThemeColorsPreset as k } from "../../../utils/constants/theme.js";
11
+ import o from "./themePicker.module.scss.js";
12
+ import { EThemePickerGap as x, EThemePickerSize as y } from "./types.js";
13
+ const P = Object.values(k), I = T((c, a) => {
14
+ const { className: h, size: s = "default" } = c, { themeScheme: t, setThemeScheme: n, themeColor: d, setThemeColor: p } = E(), f = l(
15
+ o.themePicker,
17
16
  h
18
17
  );
19
18
  return /* @__PURE__ */ m(
20
19
  "div",
21
20
  {
22
- ref: l,
21
+ ref: a,
23
22
  className: f,
24
23
  role: "region",
25
24
  style: {
26
- "--schemeSize": `${E[i]}px`,
27
- "--schemeGap": `${x[i]}px`
25
+ "--schemeSize": `${y[s]}px`,
26
+ "--schemeGap": `${x[s]}px`
28
27
  },
29
28
  children: [
30
- /* @__PURE__ */ o("div", { className: e.themeSchemes, role: "radiogroup", children: u.map(({ name: r, icon: s }, N) => /* @__PURE__ */ m(
29
+ /* @__PURE__ */ r("div", { className: o.themeSchemes, role: "radiogroup", children: g.map(({ name: e, icon: i }, N) => /* @__PURE__ */ m(
31
30
  C,
32
31
  {
33
- className: c(e.themeSchemeItem, e[r], t === r && e.active),
34
- onClick: () => n(r),
32
+ className: l(o.themeSchemeItem, o[e], t === e && o.active),
33
+ onClick: () => n(e),
35
34
  children: [
36
- /* @__PURE__ */ m("div", { className: e.design, children: [
37
- /* @__PURE__ */ o("div", { className: e.navigation, children: Array.from({ length: 6 }, (I, v) => /* @__PURE__ */ o("div", { className: e.navigationItem }, `ThemeScheme-${r}-navigation-${v}`)) }),
38
- /* @__PURE__ */ m("div", { className: e.content, children: [
39
- /* @__PURE__ */ o("div", { className: e.header }),
40
- /* @__PURE__ */ o("div", { className: e.profile })
35
+ /* @__PURE__ */ m("div", { className: o.design, children: [
36
+ /* @__PURE__ */ r("div", { className: o.navigation, children: Array.from({ length: 6 }, (j, v) => /* @__PURE__ */ r("div", { className: o.navigationItem }, `ThemeScheme-${e}-navigation-${v}`)) }),
37
+ /* @__PURE__ */ m("div", { className: o.content, children: [
38
+ /* @__PURE__ */ r("div", { className: o.header }),
39
+ /* @__PURE__ */ r("div", { className: o.profile })
41
40
  ] })
42
41
  ] }),
43
- /* @__PURE__ */ m("div", { className: e.footer, children: [
44
- /* @__PURE__ */ o(S, { className: e.footerIcon, code: t === r ? "f058" : s, type: "solid" }),
45
- /* @__PURE__ */ o("span", { className: e.footerLabel, children: r })
42
+ /* @__PURE__ */ m("div", { className: o.footer, children: [
43
+ /* @__PURE__ */ r(u, { className: o.footerIcon, code: t === e ? "f058" : i, type: "solid" }),
44
+ /* @__PURE__ */ r("span", { className: o.footerLabel, children: e })
46
45
  ] })
47
46
  ]
48
47
  },
49
- `ThemeScheme-${r}-${N}`
48
+ `ThemeScheme-${e}-${N}`
50
49
  )) }),
51
- /* @__PURE__ */ o("div", { className: e.themeColors, role: "radiogroup", children: Object.keys($).map((r, s) => /* @__PURE__ */ o(
52
- k,
50
+ /* @__PURE__ */ r("div", { className: o.themeColors, role: "radiogroup", children: P.map((e, i) => /* @__PURE__ */ r(
51
+ $,
53
52
  {
54
- className: e.themeColorsItem,
55
- size: i,
53
+ className: o.themeColorsItem,
54
+ size: s,
56
55
  icon: "f00c",
57
56
  iconType: "solid",
58
57
  style: {
59
- "--themeColor": `var(--color${y(r)}Accent)`,
60
- color: d === r ? "white" : "transparent"
58
+ "--themeColor": `${e.h} ${e.s}% ${e.l}%`,
59
+ color: S(e, d) ? "white" : "transparent"
61
60
  },
62
- onClick: () => p(r)
61
+ onClick: () => p(e)
63
62
  },
64
- `ThemeColor-${r}-${s}`
63
+ `ThemeColor-${e.h}${e.s}${e.l}-${i}`
65
64
  )) })
66
65
  ]
67
66
  }
68
67
  );
69
68
  });
70
- P.displayName = "ThemePicker";
69
+ I.displayName = "ThemePicker";
71
70
  export {
72
- P as ThemePicker
71
+ I as ThemePicker
73
72
  };
@@ -1,39 +1,39 @@
1
- const e = "_themePicker_71mms_1", t = "_themeSchemes_71mms_11", m = "_themeSchemeItem_71mms_18", o = "_system_71mms_30", s = "_light_71mms_51", _ = "_dark_71mms_60", n = "_design_71mms_69", c = "_navigation_71mms_77", i = "_navigationItem_71mms_89", a = "_content_71mms_102", r = "_header_71mms_112", h = "_profile_71mms_141", l = "_footer_71mms_164", f = "_footerIcon_71mms_175", g = "_footerLabel_71mms_180", d = "_active_71mms_191", v = "_themeColors_71mms_203", I = {
1
+ const e = "_themePicker_iibr7_1", t = "_themeSchemes_iibr7_11", i = "_themeSchemeItem_iibr7_18", o = "_auto_iibr7_30", _ = "_light_iibr7_51", n = "_dark_iibr7_60", r = "_design_iibr7_69", c = "_navigation_iibr7_77", s = "_navigationItem_iibr7_89", a = "_content_iibr7_102", h = "_header_iibr7_112", m = "_profile_iibr7_141", b = "_footer_iibr7_164", l = "_footerIcon_iibr7_175", f = "_footerLabel_iibr7_180", g = "_active_iibr7_191", d = "_themeColors_iibr7_203", v = {
2
2
  themePicker: e,
3
3
  themeSchemes: t,
4
- themeSchemeItem: m,
5
- system: o,
6
- light: s,
7
- dark: _,
8
- design: n,
4
+ themeSchemeItem: i,
5
+ auto: o,
6
+ light: _,
7
+ dark: n,
8
+ design: r,
9
9
  navigation: c,
10
- navigationItem: i,
10
+ navigationItem: s,
11
11
  content: a,
12
- header: r,
13
- profile: h,
14
- footer: l,
15
- footerIcon: f,
16
- footerLabel: g,
17
- active: d,
18
- themeColors: v
12
+ header: h,
13
+ profile: m,
14
+ footer: b,
15
+ footerIcon: l,
16
+ footerLabel: f,
17
+ active: g,
18
+ themeColors: d
19
19
  };
20
20
  export {
21
- d as active,
21
+ g as active,
22
+ o as auto,
22
23
  a as content,
23
- _ as dark,
24
- I as default,
25
- n as design,
26
- l as footer,
27
- f as footerIcon,
28
- g as footerLabel,
29
- r as header,
30
- s as light,
24
+ n as dark,
25
+ v as default,
26
+ r as design,
27
+ b as footer,
28
+ l as footerIcon,
29
+ f as footerLabel,
30
+ h as header,
31
+ _ as light,
31
32
  c as navigation,
32
- i as navigationItem,
33
- h as profile,
34
- o as system,
35
- v as themeColors,
33
+ s as navigationItem,
34
+ m as profile,
35
+ d as themeColors,
36
36
  e as themePicker,
37
- m as themeSchemeItem,
37
+ i as themeSchemeItem,
38
38
  t as themeSchemes
39
39
  };
@@ -0,0 +1,3 @@
1
+ import { TThemeSwitchProps } from './types';
2
+ export declare const ThemeSelect: import('react').ForwardRefExoticComponent<TThemeSwitchProps & import('react').RefAttributes<HTMLDivElement>>;
3
+ //# sourceMappingURL=ThemeSelect.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ThemeSelect.d.ts","sourceRoot":"","sources":["../../../../src/components/layout/ThemeSelect/ThemeSelect.tsx"],"names":[],"mappings":"AAQA,OAAO,oBAAoB,CAAC;AAC5B,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAE5C,eAAO,MAAM,WAAW,8GAetB,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { EIconType } from '../../base/Icon/types';
2
+ import { EButtonSize, EButtonTypes } from '../../base/Button/types';
3
+ export type TThemeSwitchProps = {
4
+ className?: string;
5
+ withLabel?: boolean;
6
+ type?: keyof typeof EButtonTypes;
7
+ size?: keyof typeof EButtonSize;
8
+ iconType?: keyof typeof EIconType;
9
+ };
10
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/layout/ThemeSelect/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAExD,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAEpE,MAAM,MAAM,iBAAiB,GAAG;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,OAAO,YAAY,CAAC;IACjC,IAAI,CAAC,EAAE,MAAM,OAAO,WAAW,CAAC;IAChC,QAAQ,CAAC,EAAE,MAAM,OAAO,SAAS,CAAC;CAClC,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"ThemeSwitch.d.ts","sourceRoot":"","sources":["../../../../src/components/layout/ThemeSwitch/ThemeSwitch.tsx"],"names":[],"mappings":"AAWA,OAAO,oBAAoB,CAAC;AAC5B,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAQ5C,eAAO,MAAM,WAAW,8GAiEtB,CAAC"}
1
+ {"version":3,"file":"ThemeSwitch.d.ts","sourceRoot":"","sources":["../../../../src/components/layout/ThemeSwitch/ThemeSwitch.tsx"],"names":[],"mappings":"AAWA,OAAO,oBAAoB,CAAC;AAC5B,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAS5C,eAAO,MAAM,WAAW,8GA+DtB,CAAC"}
@@ -1,67 +1,67 @@
1
1
  "use client";
2
- import { jsxs as N, jsx as a } from "react/jsx-runtime";
3
- import { forwardRef as O, useMemo as c } from "react";
4
- import M from "clsx";
5
- import { Button as u } from "../../base/Button/Button.js";
6
- import { Select as j } from "../../base/Select/Select.js";
7
- import { EThemeColor as T } from "../../context/Theme/types.js";
8
- import { useXTheme as I } from "../../context/useContext.js";
9
- import { useScreenType as g } from "../../hooks/useScreen.js";
10
- import { THEME_SCHEME as m } from "../../../utils/constants/commons.js";
2
+ import { jsxs as O, jsx as c } from "react/jsx-runtime";
3
+ import { forwardRef as v, useMemo as a } from "react";
4
+ import w from "clsx";
5
+ import { Button as d } from "../../base/Button/Button.js";
6
+ import { Select as M } from "../../base/Select/Select.js";
7
+ import { useXTheme as g } from "../../context/useContext.js";
8
+ import { useScreenType as j } from "../../hooks/useScreen.js";
9
+ import { isValidThemeColor as I, getColorLabel as k } from "../../../utils/helper/colorHelper.js";
10
+ import { ThemeColorsPreset as u, THEME_SCHEME as m } from "../../../utils/constants/theme.js";
11
11
  /* empty css */
12
- const k = Object.values(T).map((t) => ({
13
- value: t,
14
- label: t.charAt(0).toUpperCase() + t.slice(1)
15
- })), i = Object.values(T), H = O((t, d) => {
16
- const { className: C, type: x = "secondary", size: n = "default", iconType: s = "solid" } = t, { themeScheme: e, setThemeScheme: b, themeColor: r, setThemeColor: h } = I(), { isMobile: S, isDesktop: y } = g(), l = !S, p = c(() => m[(m.findIndex((o) => o.name === e) + 1) % m.length], [e]), v = c(() => {
12
+ const H = Object.entries(u).map(([r, n]) => ({
13
+ label: r.charAt(0).toUpperCase() + r.slice(1),
14
+ value: n
15
+ })), h = Object.values(u), L = v((r, n) => {
16
+ const { className: C, type: x = "secondary", size: s = "default", iconType: i = "solid" } = r, { themeScheme: e, setThemeScheme: S, themeColor: t, setThemeColor: p } = g(), { isMobile: l, isDesktop: b } = j(), f = a(() => m[(m.findIndex((o) => o.name === e) + 1) % m.length], [e]), y = a(() => {
17
17
  var o;
18
- return ((o = m.find((w) => w.name === e)) == null ? void 0 : o.icon) ?? "";
19
- }, [e]), f = c(() => i[(i.findIndex((o) => o === r) + 1) % i.length], [r]), E = M(
18
+ return ((o = m.find((N) => N.name === e)) == null ? void 0 : o.icon) ?? "";
19
+ }, [e]), T = a(() => h[(h.findIndex((o) => o === t) + 1) % h.length], [t]), E = w(
20
20
  "xtrThemeSwitch",
21
21
  C,
22
- l && "withLabel"
22
+ !l && "withLabel"
23
23
  );
24
- return !e || !r ? null : /* @__PURE__ */ N("div", { ref: d, className: E, children: [
25
- /* @__PURE__ */ a(
26
- u,
24
+ return !e || !I(t) ? null : /* @__PURE__ */ O("div", { ref: n, className: E, children: [
25
+ /* @__PURE__ */ c(
26
+ d,
27
27
  {
28
28
  className: "xtrThemeScheme",
29
29
  type: x,
30
- size: n,
31
- icon: v,
32
- iconType: s,
33
- label: l ? e === "system" ? "auto" : e : void 0,
34
- onClick: () => p.name && b(p.name)
30
+ size: s,
31
+ icon: y,
32
+ iconType: i,
33
+ label: l ? void 0 : e,
34
+ onClick: () => f.name && S(f.name)
35
35
  }
36
36
  ),
37
- y ? /* @__PURE__ */ a(
38
- j,
37
+ b ? /* @__PURE__ */ c(
38
+ M,
39
39
  {
40
40
  clearable: !1,
41
41
  searchable: !1,
42
- size: n,
43
- options: k,
42
+ size: s,
44
43
  icon: "f53f",
45
- iconType: s,
44
+ iconType: i,
46
45
  placeholder: "Theme",
47
- value: r,
48
- onChange: h
46
+ options: H,
47
+ value: t,
48
+ onChange: p
49
49
  }
50
- ) : /* @__PURE__ */ a(
51
- u,
50
+ ) : /* @__PURE__ */ c(
51
+ d,
52
52
  {
53
53
  className: "xtrThemeColor",
54
54
  type: "primary",
55
- size: n,
55
+ size: s,
56
56
  icon: "f53f",
57
- iconType: s,
58
- label: l ? r : void 0,
59
- onClick: () => f && h(f)
57
+ iconType: i,
58
+ label: l ? void 0 : k(t),
59
+ onClick: () => T && p(T)
60
60
  }
61
61
  )
62
62
  ] });
63
63
  });
64
- H.displayName = "ThemeSwitch";
64
+ L.displayName = "ThemeSwitch";
65
65
  export {
66
- H as ThemeSwitch
66
+ L as ThemeSwitch
67
67
  };
package/dist/index.js CHANGED
@@ -1,102 +1,104 @@
1
1
  /* empty css */
2
- import { STORAGE as t, THEME_SCHEME as p } from "./utils/constants/commons.js";
3
- import { FACE_ICONS as f } from "./utils/constants/iconCollection.js";
4
- import { getLocalState as x, setLocalState as a } from "./utils/function/localStorage.js";
5
- import { assignRef as n, mergeRefs as c } from "./utils/function/mergeRefs.js";
6
- import { capitalizeFirstLetter as g, safeStringFromCodePoint as l, unicodeToString as d } from "./utils/function/string.js";
7
- import { doc as P, elementObserver as C, getCssProperty as I, getCssPropertyPx as T, getCssPropertyVh as u, getCssPropertyVw as y, isClient as z, localStore as A, setCssProperty as F, waitForElement as h, win as k } from "./utils/helper/domHelper.js";
8
- import { createImage as L, getCroppedImg as w, getImageSize as D, getRadianAngle as R, readImageFile as B, readImageSrc as M } from "./utils/helper/imageHelper.js";
9
- import { themeController as X } from "./utils/helper/themeController.js";
10
- import { XProvider as H } from "./components/context/index.js";
11
- import { useXData as V, useXTheme as _ } from "./components/context/useContext.js";
12
- import { ActionCard as j } from "./components/base/ActionCard/ActionCard.js";
13
- import { EActionCardSize as J } from "./components/base/ActionCard/types.js";
14
- import { Avatar as Q } from "./components/base/Avatar/Avatar.js";
15
- import { EAvatarSize as W } from "./components/base/Avatar/types.js";
16
- import { Button as Z } from "./components/base/Button/Button.js";
17
- import { EButtonTypes as ee } from "./components/base/Button/types.js";
18
- import { Icon as oe } from "./components/base/Icon/Icon.js";
19
- import { EIconSize as pe } from "./components/base/Icon/types.js";
20
- import { Lottie as fe } from "./components/base/Lottie/Lottie.js";
21
- import { ELottieSize as xe } from "./components/base/Lottie/types.js";
22
- import { ProgressBar as se } from "./components/base/ProgressBar/ProgressBar.js";
23
- import { Spinner as ce } from "./components/base/Spinner/Spinner.js";
24
- import { ESpinnerSize as ge } from "./components/base/Spinner/types.js";
25
- import { Textfield as de } from "./components/base/Textfield/Textfield.js";
26
- import { DatePicker as Pe } from "./components/base/DatePicker/DatePicker.js";
2
+ import { STORAGE as t, THEME_SCHEME as m, ThemeColorsPreset as p, defaultColorPreset as f } from "./utils/constants/theme.js";
3
+ import { FACE_ICONS as x } from "./utils/constants/iconCollection.js";
4
+ import { getLocalState as s, setLocalState as n } from "./utils/function/localStorage.js";
5
+ import { assignRef as S, mergeRefs as g } from "./utils/function/mergeRefs.js";
6
+ import { capitalizeFirstLetter as P, safeStringFromCodePoint as d, unicodeToString as C } from "./utils/function/string.js";
7
+ import { doc as T, elementObserver as u, getCssProperty as I, getCssPropertyPx as y, getCssPropertyVh as h, getCssPropertyVw as z, isClient as A, localStore as F, setCssProperty as k, waitForElement as v, win as L } from "./utils/helper/domHelper.js";
8
+ import { createImage as D, getCroppedImg as R, getImageSize as B, getRadianAngle as M, readImageFile as O, readImageSrc as X } from "./utils/helper/imageHelper.js";
9
+ import { themeController as H } from "./utils/helper/themeController.js";
10
+ import { XProvider as V } from "./components/context/index.js";
11
+ import { useXData as G, useXTheme as j } from "./components/context/useContext.js";
12
+ import { ActionCard as J } from "./components/base/ActionCard/ActionCard.js";
13
+ import { EActionCardSize as Q } from "./components/base/ActionCard/types.js";
14
+ import { Avatar as W } from "./components/base/Avatar/Avatar.js";
15
+ import { EAvatarSize as Z } from "./components/base/Avatar/types.js";
16
+ import { Button as ee } from "./components/base/Button/Button.js";
17
+ import { EButtonTypes as oe } from "./components/base/Button/types.js";
18
+ import { Icon as me } from "./components/base/Icon/Icon.js";
19
+ import { EIconSize as fe } from "./components/base/Icon/types.js";
20
+ import { Lottie as xe } from "./components/base/Lottie/Lottie.js";
21
+ import { ELottieSize as se } from "./components/base/Lottie/types.js";
22
+ import { ProgressBar as ce } from "./components/base/ProgressBar/ProgressBar.js";
23
+ import { Spinner as ge } from "./components/base/Spinner/Spinner.js";
24
+ import { ESpinnerSize as Pe } from "./components/base/Spinner/types.js";
25
+ import { Textfield as Ce } from "./components/base/Textfield/Textfield.js";
26
+ import { DatePicker as Te } from "./components/base/DatePicker/DatePicker.js";
27
27
  import { EDatePickerTypes as Ie } from "./components/base/DatePicker/types.js";
28
- import { FilePicker as ue } from "./components/base/FilePicker/FilePicker.js";
29
- import { FilePickerIcon as ze } from "./components/base/FilePicker/types.js";
30
- import { Select as Fe } from "./components/base/Select/Select.js";
31
- import { ColorPopper as ke } from "./components/base/ColorPopper/ColorPopper.js";
32
- import { Sider as Le } from "./components/layout/Sider/Sider.js";
33
- import { SiderModal as De } from "./components/layout/SiderModal/SiderModal.js";
34
- import { Navigation as Be } from "./components/layout/Navigation/Navigation.js";
35
- import { ThemePicker as Oe } from "./components/layout/ThemePicker/ThemePicker.js";
36
- import { ThemeSwitch as be } from "./components/layout/ThemeSwitch/ThemeSwitch.js";
37
- import { ImageEditor as Ne } from "./components/layout/ImageEditor/ImageEditor.js";
38
- import { useScreenType as _e } from "./components/hooks/useScreen.js";
39
- import { usePersistingState as je } from "./components/hooks/usePersistingState.js";
40
- import { useDebouncedEffect as Je } from "./components/hooks/useDebouncedEffect.js";
28
+ import { FilePicker as he } from "./components/base/FilePicker/FilePicker.js";
29
+ import { FilePickerIcon as Ae } from "./components/base/FilePicker/types.js";
30
+ import { Select as ke } from "./components/base/Select/Select.js";
31
+ import { ColorPopper as Le } from "./components/base/ColorPopper/ColorPopper.js";
32
+ import { Sider as De } from "./components/layout/Sider/Sider.js";
33
+ import { SiderModal as Be } from "./components/layout/SiderModal/SiderModal.js";
34
+ import { Navigation as Oe } from "./components/layout/Navigation/Navigation.js";
35
+ import { ThemePicker as be } from "./components/layout/ThemePicker/ThemePicker.js";
36
+ import { ThemeSwitch as Ne } from "./components/layout/ThemeSwitch/ThemeSwitch.js";
37
+ import { ImageEditor as _e } from "./components/layout/ImageEditor/ImageEditor.js";
38
+ import { useScreenType as je } from "./components/hooks/useScreen.js";
39
+ import { usePersistingState as Je } from "./components/hooks/usePersistingState.js";
40
+ import { useDebouncedEffect as Qe } from "./components/hooks/useDebouncedEffect.js";
41
41
  export {
42
- j as ActionCard,
43
- Q as Avatar,
44
- Z as Button,
45
- ke as ColorPopper,
46
- Pe as DatePicker,
47
- J as EActionCardSize,
48
- W as EAvatarSize,
49
- ee as EButtonTypes,
42
+ J as ActionCard,
43
+ W as Avatar,
44
+ ee as Button,
45
+ Le as ColorPopper,
46
+ Te as DatePicker,
47
+ Q as EActionCardSize,
48
+ Z as EAvatarSize,
49
+ oe as EButtonTypes,
50
50
  Ie as EDatePickerTypes,
51
- pe as EIconSize,
52
- xe as ELottieSize,
53
- ge as ESpinnerSize,
54
- f as FACE_ICONS,
55
- ue as FilePicker,
56
- ze as FilePickerIcon,
57
- oe as Icon,
58
- Ne as ImageEditor,
59
- fe as Lottie,
60
- Be as Navigation,
61
- se as ProgressBar,
51
+ fe as EIconSize,
52
+ se as ELottieSize,
53
+ Pe as ESpinnerSize,
54
+ x as FACE_ICONS,
55
+ he as FilePicker,
56
+ Ae as FilePickerIcon,
57
+ me as Icon,
58
+ _e as ImageEditor,
59
+ xe as Lottie,
60
+ Oe as Navigation,
61
+ ce as ProgressBar,
62
62
  t as STORAGE,
63
- Fe as Select,
64
- Le as Sider,
65
- De as SiderModal,
66
- ce as Spinner,
67
- p as THEME_SCHEME,
68
- de as Textfield,
69
- Oe as ThemePicker,
70
- be as ThemeSwitch,
71
- H as XProvider,
72
- n as assignRef,
73
- g as capitalizeFirstLetter,
74
- L as createImage,
75
- P as doc,
76
- C as elementObserver,
77
- w as getCroppedImg,
63
+ ke as Select,
64
+ De as Sider,
65
+ Be as SiderModal,
66
+ ge as Spinner,
67
+ m as THEME_SCHEME,
68
+ Ce as Textfield,
69
+ p as ThemeColorsPreset,
70
+ be as ThemePicker,
71
+ Ne as ThemeSwitch,
72
+ V as XProvider,
73
+ S as assignRef,
74
+ P as capitalizeFirstLetter,
75
+ D as createImage,
76
+ f as defaultColorPreset,
77
+ T as doc,
78
+ u as elementObserver,
79
+ R as getCroppedImg,
78
80
  I as getCssProperty,
79
- T as getCssPropertyPx,
80
- u as getCssPropertyVh,
81
- y as getCssPropertyVw,
82
- D as getImageSize,
83
- x as getLocalState,
84
- R as getRadianAngle,
85
- z as isClient,
86
- A as localStore,
87
- c as mergeRefs,
88
- B as readImageFile,
89
- M as readImageSrc,
90
- l as safeStringFromCodePoint,
91
- F as setCssProperty,
92
- a as setLocalState,
93
- X as themeController,
94
- d as unicodeToString,
95
- Je as useDebouncedEffect,
96
- je as usePersistingState,
97
- _e as useScreenType,
98
- V as useXData,
99
- _ as useXTheme,
100
- h as waitForElement,
101
- k as win
81
+ y as getCssPropertyPx,
82
+ h as getCssPropertyVh,
83
+ z as getCssPropertyVw,
84
+ B as getImageSize,
85
+ s as getLocalState,
86
+ M as getRadianAngle,
87
+ A as isClient,
88
+ F as localStore,
89
+ g as mergeRefs,
90
+ O as readImageFile,
91
+ X as readImageSrc,
92
+ d as safeStringFromCodePoint,
93
+ k as setCssProperty,
94
+ n as setLocalState,
95
+ H as themeController,
96
+ C as unicodeToString,
97
+ Qe as useDebouncedEffect,
98
+ Je as usePersistingState,
99
+ je as useScreenType,
100
+ G as useXData,
101
+ j as useXTheme,
102
+ v as waitForElement,
103
+ L as win
102
104
  };
@@ -0,0 +1,19 @@
1
+ import { EThemeScheme, TThemeColor } from '../../components/context/Theme/types';
2
+ export declare const STORAGE: {
3
+ themeSchemeAttr: string;
4
+ themeScheme: string;
5
+ themeColor: string;
6
+ };
7
+ export declare const THEME_SCHEME: readonly [{
8
+ readonly name: EThemeScheme.auto;
9
+ readonly icon: "e2ca";
10
+ }, {
11
+ readonly name: EThemeScheme.light;
12
+ readonly icon: "f763";
13
+ }, {
14
+ readonly name: EThemeScheme.dark;
15
+ readonly icon: "f754";
16
+ }];
17
+ export declare const ThemeColorsPreset: Record<string, TThemeColor>;
18
+ export declare const defaultColorPreset: TThemeColor;
19
+ //# sourceMappingURL=theme.d.ts.map