xtreme-ui 0.0.30 → 0.0.31

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.
@@ -1 +1 @@
1
- {"version":3,"file":"useTheme.d.ts","sourceRoot":"","sources":["../../../src/components/hooks/useTheme.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAGpC,eAAO,MAAM,UAAU,UAAW,MAAM,SAGvC,CAAC;AACF,eAAO,MAAM,QAAQ,iBAAkB,MAAM,uBAQ5C,CAAC;AAEF,aAAK,OAAO;IACX,KAAK,UAAU;IACf,IAAI,SAAS;IACb,MAAM,WAAW;CACjB;AACD,MAAM,MAAM,OAAO,GAAG,MAAM,OAAO,OAAO,CAAC;AAC3C,oBAAY,MAAM;IACjB,GAAG,QAAQ;IACX,IAAI,SAAS;IACb,MAAM,WAAW;IACjB,IAAI,SAAS;IACb,MAAM,WAAW;IACjB,KAAK,UAAU;CACf;AACD,MAAM,MAAM,MAAM,GAAG,MAAM,OAAO,MAAM,CAAC;AAEzC,MAAM,MAAM,MAAM,GAAG;IACpB,MAAM,EAAE,OAAO,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;CACd,CAAA;AACD,eAAO,MAAM,YAAY;;;CAGxB,CAAC"}
1
+ {"version":3,"file":"useTheme.d.ts","sourceRoot":"","sources":["../../../src/components/hooks/useTheme.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAGpC,eAAO,MAAM,UAAU,UAAW,MAAM,SAGvC,CAAC;AACF,eAAO,MAAM,QAAQ,iBAAkB,MAAM,uBAQ5C,CAAC;AAEF,aAAK,OAAO;IACX,KAAK,UAAU;IACf,IAAI,SAAS;IACb,MAAM,WAAW;CACjB;AACD,MAAM,MAAM,OAAO,GAAG,MAAM,OAAO,OAAO,CAAC;AAC3C,oBAAY,MAAM;IACjB,GAAG,QAAQ;IACX,IAAI,SAAS;IACb,MAAM,WAAW;IACjB,IAAI,SAAS;IACb,MAAM,WAAW;IACjB,KAAK,UAAU;CACf;AACD,MAAM,MAAM,MAAM,GAAG,MAAM,OAAO,MAAM,CAAC;AAEzC,MAAM,MAAM,MAAM,GAAG;IACpB,MAAM,EAAE,OAAO,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;CACd,CAAA;AACD,eAAO,MAAM,YAAY;;;CAGxB,CAAC"}
@@ -1,21 +1,23 @@
1
1
  "use client";
2
- import { useEffect as s } from "react";
3
- import { STORAGE as c } from "../../utils/constants/commons.js";
4
- import { usePersistingState as r } from "./usePersistingState.js";
5
- const m = (e) => {
6
- document.documentElement.setAttribute("data-theme-scheme", e == null ? void 0 : e.scheme), document.documentElement.setAttribute("data-theme-color", e == null ? void 0 : e.color);
7
- }, i = (e) => {
8
- const [t, o] = r(c.theme, e);
9
- return s(() => {
10
- m(t);
2
+ import { useEffect as m } from "react";
3
+ import { STORAGE as n } from "../../utils/constants/commons.js";
4
+ import { doc as c } from "../../utils/helper/domHelper.js";
5
+ import { usePersistingState as u } from "./usePersistingState.js";
6
+ const i = (e) => {
7
+ var t, o, r, s;
8
+ (o = (t = c) == null ? void 0 : t.documentElement) == null || o.setAttribute("data-theme-scheme", e == null ? void 0 : e.scheme), (s = (r = c) == null ? void 0 : r.documentElement) == null || s.setAttribute("data-theme-color", e == null ? void 0 : e.color);
9
+ }, p = (e) => {
10
+ const [t, o] = u(n.theme, e);
11
+ return m(() => {
12
+ i(t);
11
13
  }, [t]), [t, o];
12
- }, l = {
14
+ }, T = {
13
15
  scheme: "system",
14
16
  color: "red"
15
17
  /* red */
16
18
  };
17
19
  export {
18
- m as applyTheme,
19
- l as defaultTheme,
20
- i as useTheme
20
+ i as applyTheme,
21
+ T as defaultTheme,
22
+ p as useTheme
21
23
  };
package/dist/index.js CHANGED
@@ -1,52 +1,54 @@
1
1
  "use client";
2
2
  import "./styles/index.scss.js";
3
- import { dom as t, elementObserver as p, getCssProperty as i, getCssPropertyPx as m, getCssPropertyVh as f, getCssPropertyVw as s, isClient as x, setCssProperty as n, waitForElement as a } from "./utils/helper/domHelper.js";
4
- import { mergeRefs as P } from "./utils/function/mergeRefs.js";
5
- import { capitalizeFirstLetter as C, safeStringFromCodePoint as d, unicodeToString as l } from "./utils/function/string.js";
6
- import { XProvider as E } from "./components/context/index.js";
7
- import { useXData as u } from "./components/context/useContext.js";
8
- import { Avatar as z } from "./components/base/Avatar/Avatar.js";
9
- import { EAvatarSize as F } from "./components/base/Avatar/types.js";
10
- import { Button as T } from "./components/base/Button/Button.js";
11
- import { EButtonTypes as A } from "./components/base/Button/types.js";
12
- import { Icon as V } from "./components/base/Icon/Icon.js";
13
- import { EIconSize as b } from "./components/base/Icon/types.js";
14
- import { Lottie as D } from "./components/base/Lottie/Lottie.js";
15
- import { ELottieSize as O } from "./components/base/Lottie/types.js";
16
- import { ProgressBar as j } from "./components/base/ProgressBar/ProgressBar.js";
17
- import { Spinner as q } from "./components/base/Spinner/Spinner.js";
18
- import { ESpinnerSize as H } from "./components/base/Spinner/types.js";
19
- import { Textfield as K } from "./components/base/Textfield/Textfield.js";
20
- import { Sider as Q } from "./components/layout/Sider/Sider.js";
21
- import { Navigation as W } from "./components/layout/Navigation/Navigation.js";
3
+ import { doc as t, elementObserver as p, getCssProperty as i, getCssPropertyPx as m, getCssPropertyVh as f, getCssPropertyVw as s, isClient as x, localStore as n, setCssProperty as a, waitForElement as S, win as g } from "./utils/helper/domHelper.js";
4
+ import { mergeRefs as l } from "./utils/function/mergeRefs.js";
5
+ import { capitalizeFirstLetter as C, safeStringFromCodePoint as d, unicodeToString as y } from "./utils/function/string.js";
6
+ import { XProvider as u } from "./components/context/index.js";
7
+ import { useXData as z } from "./components/context/useContext.js";
8
+ import { Avatar as B } from "./components/base/Avatar/Avatar.js";
9
+ import { EAvatarSize as L } from "./components/base/Avatar/types.js";
10
+ import { Button as A } from "./components/base/Button/Button.js";
11
+ import { EButtonTypes as V } from "./components/base/Button/types.js";
12
+ import { Icon as b } from "./components/base/Icon/Icon.js";
13
+ import { EIconSize as D } from "./components/base/Icon/types.js";
14
+ import { Lottie as O } from "./components/base/Lottie/Lottie.js";
15
+ import { ELottieSize as j } from "./components/base/Lottie/types.js";
16
+ import { ProgressBar as q } from "./components/base/ProgressBar/ProgressBar.js";
17
+ import { Spinner as H } from "./components/base/Spinner/Spinner.js";
18
+ import { ESpinnerSize as K } from "./components/base/Spinner/types.js";
19
+ import { Textfield as Q } from "./components/base/Textfield/Textfield.js";
20
+ import { Sider as W } from "./components/layout/Sider/Sider.js";
21
+ import { Navigation as Z } from "./components/layout/Navigation/Navigation.js";
22
22
  export {
23
- z as Avatar,
24
- T as Button,
25
- F as EAvatarSize,
26
- A as EButtonTypes,
27
- b as EIconSize,
28
- O as ELottieSize,
29
- H as ESpinnerSize,
30
- V as Icon,
31
- D as Lottie,
32
- W as Navigation,
33
- j as ProgressBar,
34
- Q as Sider,
35
- q as Spinner,
36
- K as Textfield,
37
- E as XProvider,
23
+ B as Avatar,
24
+ A as Button,
25
+ L as EAvatarSize,
26
+ V as EButtonTypes,
27
+ D as EIconSize,
28
+ j as ELottieSize,
29
+ K as ESpinnerSize,
30
+ b as Icon,
31
+ O as Lottie,
32
+ Z as Navigation,
33
+ q as ProgressBar,
34
+ W as Sider,
35
+ H as Spinner,
36
+ Q as Textfield,
37
+ u as XProvider,
38
38
  C as capitalizeFirstLetter,
39
- t as dom,
39
+ t as doc,
40
40
  p as elementObserver,
41
41
  i as getCssProperty,
42
42
  m as getCssPropertyPx,
43
43
  f as getCssPropertyVh,
44
44
  s as getCssPropertyVw,
45
45
  x as isClient,
46
- P as mergeRefs,
46
+ n as localStore,
47
+ l as mergeRefs,
47
48
  d as safeStringFromCodePoint,
48
- n as setCssProperty,
49
- l as unicodeToString,
50
- u as useXData,
51
- a as waitForElement
49
+ a as setCssProperty,
50
+ y as unicodeToString,
51
+ z as useXData,
52
+ S as waitForElement,
53
+ g as win
52
54
  };
@@ -1 +1 @@
1
- {"version":3,"file":"localStorage.d.ts","sourceRoot":"","sources":["../../../src/utils/function/localStorage.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa,WAAY,MAAM,gCAS3C,CAAC;AAEF,eAAO,MAAM,aAAa,WAAY,MAAM,mBAO3C,CAAC"}
1
+ {"version":3,"file":"localStorage.d.ts","sourceRoot":"","sources":["../../../src/utils/function/localStorage.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,aAAa,WAAY,MAAM,gCAS3C,CAAC;AAEF,eAAO,MAAM,aAAa,WAAY,MAAM,mBAO3C,CAAC"}
@@ -1,19 +1,22 @@
1
1
  "use client";
2
- const c = (o, e) => {
2
+ import { localStore as r } from "../helper/domHelper.js";
3
+ const n = (c, o) => {
4
+ var e;
3
5
  try {
4
- const t = localStorage.getItem(o);
5
- return t ? JSON.parse(t) : e ?? "";
6
+ const t = (e = r) == null ? void 0 : e.getItem(c);
7
+ return t ? JSON.parse(t) : o ?? "";
6
8
  } catch (t) {
7
- return console.log(t), e ?? "";
9
+ return console.log(t), o ?? "";
8
10
  }
9
- }, r = (o, e) => {
11
+ }, l = (c, o) => {
12
+ var e;
10
13
  try {
11
- localStorage.setItem(o, JSON.stringify(e));
14
+ (e = r) == null || e.setItem(c, JSON.stringify(o));
12
15
  } catch (t) {
13
16
  console.log(t);
14
17
  }
15
18
  };
16
19
  export {
17
- c as getLocalState,
18
- r as setLocalState
20
+ n as getLocalState,
21
+ l as setLocalState
19
22
  };
@@ -1,6 +1,8 @@
1
1
  import { RefObject } from 'react';
2
2
  export declare const isClient: boolean;
3
- export declare const dom: (Window & typeof globalThis) | undefined;
3
+ export declare const win: (Window & typeof globalThis) | undefined;
4
+ export declare const doc: Document | undefined;
5
+ export declare const localStore: Storage | undefined;
4
6
  export declare const getCssProperty: (property: string, element: RefObject<HTMLElement>) => string;
5
7
  export declare const getCssPropertyPx: (property: string, element: RefObject<HTMLElement>) => number;
6
8
  export declare const getCssPropertyVh: (property: string, element: RefObject<HTMLElement>) => number[];
@@ -1 +1 @@
1
- {"version":3,"file":"domHelper.d.ts","sourceRoot":"","sources":["../../../src/utils/helper/domHelper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,eAAO,MAAM,QAAQ,SAAgC,CAAC;AACtD,eAAO,MAAM,GAAG,0CAAgC,CAAC;AAEjD,eAAO,MAAM,cAAc,aAAc,MAAM,WAAW,UAAU,WAAW,CAAC,WAE/E,CAAC;AAEF,eAAO,MAAM,gBAAgB,aAAc,MAAM,WAAW,UAAU,WAAW,CAAC,WAEjF,CAAC;AAEF,eAAO,MAAM,gBAAgB,aAAc,MAAM,WAAW,UAAU,WAAW,CAAC,aAGjF,CAAC;AAEF,eAAO,MAAM,gBAAgB,aAAc,MAAM,WAAW,UAAU,WAAW,CAAC,aAGjF,CAAC;AAEF,eAAO,MAAM,cAAc,aAAc,MAAM,SAAS,MAAM,WAAW,UAAU,WAAW,CAAC,cAE9F,CAAC;AAEF,eAAO,MAAM,cAAc,aAAc,MAAM,yBAc9C,CAAC;AAEF,eAAO,MAAM,eAAe,OAAQ,uBAAuB,aAAa,MAAM,EAAE,SAkB/E,CAAC;AAEF,KAAK,uBAAuB,GAAG,CAAC,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,OAAO,qBAAqB,EAAE,MAAM,EAAE,cAAc,KAAK,IAAI,CAAA;AAChI,aAAK,qBAAqB;IACzB,KAAK,UAAU;IACf,OAAO,YAAY;CACnB"}
1
+ {"version":3,"file":"domHelper.d.ts","sourceRoot":"","sources":["../../../src/utils/helper/domHelper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,eAAO,MAAM,QAAQ,SAAgC,CAAC;AACtD,eAAO,MAAM,GAAG,0CAAgC,CAAC;AACjD,eAAO,MAAM,GAAG,sBAAkC,CAAC;AACnD,eAAO,MAAM,UAAU,qBAAsC,CAAC;AAE9D,eAAO,MAAM,cAAc,aAAc,MAAM,WAAW,UAAU,WAAW,CAAC,WAE/E,CAAC;AAEF,eAAO,MAAM,gBAAgB,aAAc,MAAM,WAAW,UAAU,WAAW,CAAC,WAEjF,CAAC;AAEF,eAAO,MAAM,gBAAgB,aAAc,MAAM,WAAW,UAAU,WAAW,CAAC,aAGjF,CAAC;AAEF,eAAO,MAAM,gBAAgB,aAAc,MAAM,WAAW,UAAU,WAAW,CAAC,aAGjF,CAAC;AAEF,eAAO,MAAM,cAAc,aAAc,MAAM,SAAS,MAAM,WAAW,UAAU,WAAW,CAAC,cAE9F,CAAC;AAEF,eAAO,MAAM,cAAc,aAAc,MAAM,yBAc9C,CAAC;AAEF,eAAO,MAAM,eAAe,OAAQ,uBAAuB,aAAa,MAAM,EAAE,SAkB/E,CAAC;AAEF,KAAK,uBAAuB,GAAG,CAAC,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,OAAO,qBAAqB,EAAE,MAAM,EAAE,cAAc,KAAK,IAAI,CAAA;AAChI,aAAK,qBAAqB;IACzB,KAAK,UAAU;IACf,OAAO,YAAY;CACnB"}
@@ -1,38 +1,40 @@
1
1
  "use client";
2
- const s = typeof window < "u", r = s ? window : void 0, c = (n, e) => s ? getComputedStyle((e == null ? void 0 : e.current) || document.documentElement).getPropertyValue(n) : "", v = (n, e) => parseInt(c(n, e).replace(/px/g, "")), g = (n, e) => {
3
- const t = parseInt(c(n, e).replace(/vh/g, ""));
4
- return [((r == null ? void 0 : r.innerHeight) ?? 0) * t / 100, t];
5
- }, h = (n, e) => {
6
- const t = parseInt(c(n, e).replace(/vw/g, ""));
7
- return [((r == null ? void 0 : r.innerWidth) ?? 0) * t / 100, t];
8
- }, b = (n, e, t) => s ? ((t == null ? void 0 : t.current) || document.documentElement).style.setProperty(n, e) : "", w = (n) => new Promise((e) => {
2
+ const c = typeof window < "u", o = c ? window : void 0, f = c ? document : void 0, g = c ? localStorage : void 0, s = (n, e) => c ? getComputedStyle((e == null ? void 0 : e.current) || document.documentElement).getPropertyValue(n) : "", h = (n, e) => parseInt(s(n, e).replace(/px/g, "")), b = (n, e) => {
3
+ const t = parseInt(s(n, e).replace(/vh/g, ""));
4
+ return [((o == null ? void 0 : o.innerHeight) ?? 0) * t / 100, t];
5
+ }, l = (n, e) => {
6
+ const t = parseInt(s(n, e).replace(/vw/g, ""));
7
+ return [((o == null ? void 0 : o.innerWidth) ?? 0) * t / 100, t];
8
+ }, P = (n, e, t) => c ? ((t == null ? void 0 : t.current) || document.documentElement).style.setProperty(n, e) : "", w = (n) => new Promise((e) => {
9
9
  let t = document.querySelector(n);
10
10
  if (t)
11
11
  return e(t);
12
- const o = new MutationObserver(() => {
13
- t = document.querySelector(n), t && (e(t), o.disconnect());
12
+ const r = new MutationObserver(() => {
13
+ t = document.querySelector(n), t && (e(t), r.disconnect());
14
14
  });
15
- o.observe(document.body, { childList: !0, subtree: !0 });
16
- }), P = (n, e) => {
15
+ r.observe(document.body, { childList: !0, subtree: !0 });
16
+ }), C = (n, e) => {
17
17
  var t;
18
- (t = e == null ? void 0 : e.forEach) == null || t.call(e, (o) => {
19
- let u;
20
- new MutationObserver((i) => {
18
+ (t = e == null ? void 0 : e.forEach) == null || t.call(e, (r) => {
19
+ let d;
20
+ new MutationObserver((u) => {
21
21
  var a;
22
- document.querySelector(o) && (u = document.querySelector(o)), (a = i == null ? void 0 : i.forEach) == null || a.call(i, (d) => {
23
- d.type === "childList" && (Array.from(d.addedNodes).indexOf(u) > -1 && n(u, "added", d), Array.from(d.removedNodes).indexOf(u) > -1 && n(u, "removed", d));
22
+ document.querySelector(r) && (d = document.querySelector(r)), (a = u == null ? void 0 : u.forEach) == null || a.call(u, (i) => {
23
+ i.type === "childList" && (Array.from(i.addedNodes).indexOf(d) > -1 && n(d, "added", i), Array.from(i.removedNodes).indexOf(d) > -1 && n(d, "removed", i));
24
24
  });
25
25
  }).observe(document.body, { childList: !0, subtree: !0 });
26
26
  });
27
27
  };
28
28
  export {
29
- r as dom,
30
- P as elementObserver,
31
- c as getCssProperty,
32
- v as getCssPropertyPx,
33
- g as getCssPropertyVh,
34
- h as getCssPropertyVw,
35
- s as isClient,
36
- b as setCssProperty,
37
- w as waitForElement
29
+ f as doc,
30
+ C as elementObserver,
31
+ s as getCssProperty,
32
+ h as getCssPropertyPx,
33
+ b as getCssPropertyVh,
34
+ l as getCssPropertyVw,
35
+ c as isClient,
36
+ g as localStore,
37
+ P as setCssProperty,
38
+ w as waitForElement,
39
+ o as win
38
40
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xtreme-ui",
3
- "version": "0.0.30",
3
+ "version": "0.0.31",
4
4
  "type": "module",
5
5
  "description": "Collection of reusable components that can be used in web projects",
6
6
  "main": "dist/index.js",