xtreme-ui 0.0.91 → 0.0.92

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":"Avatar.d.ts","sourceRoot":"","sources":["../../../../src/components/base/Avatar/Avatar.tsx"],"names":[],"mappings":"AAQA,OAAO,eAAe,CAAC;AACvB,OAAO,EAAe,YAAY,EAAE,MAAM,SAAS,CAAC;AAEpD,eAAO,MAAM,MAAM,yGAsEjB,CAAC"}
1
+ {"version":3,"file":"Avatar.d.ts","sourceRoot":"","sources":["../../../../src/components/base/Avatar/Avatar.tsx"],"names":[],"mappings":"AASA,OAAO,eAAe,CAAC;AACvB,OAAO,EAAe,YAAY,EAAE,MAAM,SAAS,CAAC;AAIpD,eAAO,MAAM,MAAM,yGAwEjB,CAAC"}
@@ -1,46 +1,52 @@
1
1
  "use client";
2
- import { jsxs as z, jsx as d } from "react/jsx-runtime";
3
- import { forwardRef as A, useState as c, useEffect as N } from "react";
2
+ import { jsx as i } from "react/jsx-runtime";
3
+ import { forwardRef as x, useState as c, useEffect as E } from "react";
4
4
  import S from "clsx";
5
- import { readImageFile as E, readImageSrc as L } from "../../../utils/helper/imageHelper.js";
6
- import { Icon as b } from "../Icon/Icon.js";
5
+ import { FACE_ICONS as d } from "../../../utils/constants/iconCollection.js";
6
+ import { readImageFile as z, readImageSrc as C } from "../../../utils/helper/imageHelper.js";
7
+ import { Icon as F } from "../Icon/Icon.js";
7
8
  /* empty css */
8
- import { EAvatarSize as j } from "./types.js";
9
- const C = A((p, g) => {
10
- const { className: u, src: a, file: t, alt: v, placeholderIcon: h = "f03e", size: i = "default", onClick: x } = p, [l, m] = c(), [I, r] = c(!!a || !!t), [f, s] = c(!1), n = typeof i == "number" ? i : j[i], y = S(
9
+ import { EAvatarSize as L } from "./types.js";
10
+ const M = d.happy[Math.floor(Math.random() * d.happy.length)], _ = x((g, h) => {
11
+ const { className: u, src: a, file: r, alt: v, placeholderIcon: A = M, size: l = "default", onClick: I } = g, [m, n] = c(), [y, t] = c(!!a || !!r), [f, o] = c(!1), p = typeof l == "number" ? l : L[l], N = S(
11
12
  "xtrAvatar",
12
13
  u,
13
- I && "loading",
14
+ y && "loading",
14
15
  f && "error"
15
- ), o = (e) => {
16
- e && setTimeout(() => m(e), 300), setTimeout(() => r(!1), 1e3);
16
+ ), s = (e) => {
17
+ e && setTimeout(() => n(e), 300), setTimeout(() => t(!1), 1e3);
17
18
  };
18
- return N(() => {
19
+ return E(() => {
19
20
  try {
20
- t ? (r(!0), s(!1), E(t).then((e) => o(e)).catch((e) => {
21
- console.log(e), r(!1), s(!0);
22
- })) : a ? (r(!0), s(!1), L(a).then((e) => o(e)).catch((e) => {
23
- console.log(e, a), r(!1), s(!0);
24
- })) : (m(void 0), o());
21
+ r ? (t(!0), o(!1), z(r).then((e) => s(e)).catch((e) => {
22
+ console.log(e), t(!1), o(!0);
23
+ })) : a ? (t(!0), o(!1), C(a).then((e) => s(e)).catch((e) => {
24
+ console.log(e, a), t(!1), o(!0);
25
+ })) : (n(void 0), s());
25
26
  } catch {
26
- o();
27
+ s();
27
28
  }
28
- }, [a, t]), /* @__PURE__ */ z(
29
+ }, [a, r]), /* @__PURE__ */ i(
29
30
  "div",
30
31
  {
31
- ref: g,
32
- className: y,
33
- style: { "--avatarSize": n + "px" },
34
- onClick: x,
32
+ ref: h,
33
+ className: N,
34
+ style: { "--avatarSize": p + "px" },
35
+ onClick: I,
35
36
  role: "img",
36
- children: [
37
- !l && /* @__PURE__ */ d(b, { className: "placeholder", type: "solid", size: 8 + n / 4, code: f ? "e1b7" : h }),
38
- l && /* @__PURE__ */ d("img", { className: "image", src: l, alt: v })
39
- ]
37
+ children: m ? /* @__PURE__ */ i("img", { className: "image", src: m, alt: v }) : /* @__PURE__ */ i(
38
+ F,
39
+ {
40
+ className: "placeholder",
41
+ type: "solid",
42
+ size: 8 + p / 4,
43
+ code: f ? "e1b7" : A
44
+ }
45
+ )
40
46
  }
41
47
  );
42
48
  });
43
- C.displayName = "Avatar";
49
+ _.displayName = "Avatar";
44
50
  export {
45
- C as Avatar
51
+ _ as Avatar
46
52
  };
package/dist/index.js CHANGED
@@ -1,100 +1,102 @@
1
1
  /* empty css */
2
2
  import { STORAGE as t, THEME_SCHEME as p } from "./utils/constants/commons.js";
3
- import { getLocalState as f, setLocalState as i } from "./utils/function/localStorage.js";
4
- import { assignRef as a, mergeRefs as s } from "./utils/function/mergeRefs.js";
5
- import { capitalizeFirstLetter as c, safeStringFromCodePoint as g, unicodeToString as S } from "./utils/function/string.js";
6
- import { doc as d, elementObserver as P, getCssProperty as E, getCssPropertyPx as C, getCssPropertyVh as T, getCssPropertyVw as u, isClient as I, localStore as y, setCssProperty as z, waitForElement as h, win as A } from "./utils/helper/domHelper.js";
7
- import { createImage as k, getCroppedImg as v, getImageSize as L, getRadianAngle as w, readImageFile as D, readImageSrc as R } from "./utils/helper/imageHelper.js";
8
- import { themeController as M } from "./utils/helper/themeController.js";
9
- import { XProvider as b } from "./components/context/index.js";
10
- import { useXData as O, useXTheme as V } from "./components/context/useContext.js";
11
- import { ActionCard as N } from "./components/base/ActionCard/ActionCard.js";
12
- import { EActionCardSize as j } from "./components/base/ActionCard/types.js";
13
- import { Avatar as J } from "./components/base/Avatar/Avatar.js";
14
- import { EAvatarSize as Q } from "./components/base/Avatar/types.js";
15
- import { Button as W } from "./components/base/Button/Button.js";
16
- import { EButtonTypes as Z } from "./components/base/Button/types.js";
17
- import { Icon as ee } from "./components/base/Icon/Icon.js";
18
- import { EIconSize as oe } from "./components/base/Icon/types.js";
19
- import { Lottie as pe } from "./components/base/Lottie/Lottie.js";
20
- import { ELottieSize as fe } from "./components/base/Lottie/types.js";
21
- import { ProgressBar as xe } from "./components/base/ProgressBar/ProgressBar.js";
22
- import { Spinner as se } from "./components/base/Spinner/Spinner.js";
23
- import { ESpinnerSize as ce } from "./components/base/Spinner/types.js";
24
- import { Textfield as Se } from "./components/base/Textfield/Textfield.js";
25
- import { DatePicker as de } from "./components/base/DatePicker/DatePicker.js";
26
- import { EDatePickerTypes as Ee } from "./components/base/DatePicker/types.js";
27
- import { FilePicker as Te } from "./components/base/FilePicker/FilePicker.js";
28
- import { FilePickerIcon as Ie } from "./components/base/FilePicker/types.js";
29
- import { Select as ze } from "./components/base/Select/Select.js";
30
- import { ColorPopper as Ae } from "./components/base/ColorPopper/ColorPopper.js";
31
- import { Sider as ke } from "./components/layout/Sider/Sider.js";
32
- import { SiderModal as Le } from "./components/layout/SiderModal/SiderModal.js";
33
- import { Navigation as De } from "./components/layout/Navigation/Navigation.js";
34
- import { ThemePicker as Be } from "./components/layout/ThemePicker/ThemePicker.js";
35
- import { ThemeSwitch as Xe } from "./components/layout/ThemeSwitch/ThemeSwitch.js";
36
- import { ImageEditor as He } from "./components/layout/ImageEditor/ImageEditor.js";
37
- import { useScreenType as Ve } from "./components/hooks/useScreen.js";
38
- import { usePersistingState as Ne } from "./components/hooks/usePersistingState.js";
39
- import { useDebouncedEffect as je } from "./components/hooks/useDebouncedEffect.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";
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";
40
41
  export {
41
- N as ActionCard,
42
- J as Avatar,
43
- W as Button,
44
- Ae as ColorPopper,
45
- de as DatePicker,
46
- j as EActionCardSize,
47
- Q as EAvatarSize,
48
- Z as EButtonTypes,
49
- Ee as EDatePickerTypes,
50
- oe as EIconSize,
51
- fe as ELottieSize,
52
- ce as ESpinnerSize,
53
- Te as FilePicker,
54
- Ie as FilePickerIcon,
55
- ee as Icon,
56
- He as ImageEditor,
57
- pe as Lottie,
58
- De as Navigation,
59
- xe as ProgressBar,
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,
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,
60
62
  t as STORAGE,
61
- ze as Select,
62
- ke as Sider,
63
- Le as SiderModal,
64
- se as Spinner,
63
+ Fe as Select,
64
+ Le as Sider,
65
+ De as SiderModal,
66
+ ce as Spinner,
65
67
  p as THEME_SCHEME,
66
- Se as Textfield,
67
- Be as ThemePicker,
68
- Xe as ThemeSwitch,
69
- b as XProvider,
70
- a as assignRef,
71
- c as capitalizeFirstLetter,
72
- k as createImage,
73
- d as doc,
74
- P as elementObserver,
75
- v as getCroppedImg,
76
- E as getCssProperty,
77
- C as getCssPropertyPx,
78
- T as getCssPropertyVh,
79
- u as getCssPropertyVw,
80
- L as getImageSize,
81
- f as getLocalState,
82
- w as getRadianAngle,
83
- I as isClient,
84
- y as localStore,
85
- s as mergeRefs,
86
- D as readImageFile,
87
- R as readImageSrc,
88
- g as safeStringFromCodePoint,
89
- z as setCssProperty,
90
- i as setLocalState,
91
- M as themeController,
92
- S as unicodeToString,
93
- je as useDebouncedEffect,
94
- Ne as usePersistingState,
95
- Ve as useScreenType,
96
- O as useXData,
97
- V as useXTheme,
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,
78
+ 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,
98
100
  h as waitForElement,
99
- A as win
101
+ k as win
100
102
  };
@@ -0,0 +1,5 @@
1
+ export declare const FACE_ICONS: {
2
+ happy: string[];
3
+ sad: string[];
4
+ };
5
+ //# sourceMappingURL=iconCollection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"iconCollection.d.ts","sourceRoot":"","sources":["../../../src/utils/constants/iconCollection.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU;;;CAyGtB,CAAC"}
@@ -0,0 +1,109 @@
1
+ const e = {
2
+ happy: [
3
+ "f118",
4
+ "e392",
5
+ "f580",
6
+ "f5b8",
7
+ "e409",
8
+ "e3a4",
9
+ "e39d",
10
+ "f5c2",
11
+ "e398",
12
+ "e396",
13
+ "f4da",
14
+ "e391",
15
+ "e390",
16
+ "e38f",
17
+ "e38d",
18
+ "e389",
19
+ "e383",
20
+ "f59c",
21
+ "f59b",
22
+ "f59a",
23
+ "f599",
24
+ "f598",
25
+ "e37d",
26
+ "f597",
27
+ "f596",
28
+ "e379",
29
+ "f58c",
30
+ "f581",
31
+ "f58b",
32
+ "f58a",
33
+ "f589",
34
+ "f588",
35
+ "f587",
36
+ "f586",
37
+ "f585",
38
+ "f584",
39
+ "f583",
40
+ "f582",
41
+ "e377",
42
+ "f579",
43
+ "e2fe",
44
+ "e372",
45
+ "e36e",
46
+ "e47c",
47
+ "e36b",
48
+ "e368",
49
+ "f2fe"
50
+ ],
51
+ sad: [
52
+ "e3a0",
53
+ "e3a5",
54
+ "e3a3",
55
+ "e3a2",
56
+ "e3a1",
57
+ "e39f",
58
+ "f5c8",
59
+ "e485",
60
+ "e397",
61
+ "e395",
62
+ "e394",
63
+ "e393",
64
+ "e38b",
65
+ "f5b4",
66
+ "e38a",
67
+ "f5b3",
68
+ "f5a5",
69
+ "e388",
70
+ "e387",
71
+ "e386",
72
+ "e385",
73
+ "e384",
74
+ "e382",
75
+ "e380",
76
+ "e483",
77
+ "f5a4",
78
+ "f11a",
79
+ "e37c",
80
+ "e37b",
81
+ "e37a",
82
+ "e378",
83
+ "f57f",
84
+ "e376",
85
+ "f57a",
86
+ "f119",
87
+ "e375",
88
+ "e374",
89
+ "e373",
90
+ "e480",
91
+ "e371",
92
+ "e47f",
93
+ "f567",
94
+ "e36f",
95
+ "e47e",
96
+ "e36d",
97
+ "e36c",
98
+ "e47d",
99
+ "e36a",
100
+ "e369",
101
+ "f556",
102
+ "f6e2",
103
+ "f8f6",
104
+ "f54c"
105
+ ]
106
+ };
107
+ export {
108
+ e as FACE_ICONS
109
+ };
@@ -1,4 +1,5 @@
1
1
  export * from './constants/commons';
2
+ export * from './constants/iconCollection';
2
3
  export * from './function/localStorage';
3
4
  export * from './function/mergeRefs';
4
5
  export * from './function/string';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,0BAA0B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,0BAA0B,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xtreme-ui",
3
- "version": "0.0.91",
3
+ "version": "0.0.92",
4
4
  "type": "module",
5
5
  "description": "Collection of reusable components that can be used in web projects",
6
6
  "main": "dist/index.js",