@hybridcore/ui 1.4.43 → 1.5.1

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.
@@ -0,0 +1,71 @@
1
+ import { jsxs as p, jsx as t } from "react/jsx-runtime";
2
+ import { useMemo as c } from "react";
3
+ import { IndicatorRoot as w, IndicatorBarContainer as g, IndicatorBarBackground as $, IndicatorBar as m, IndicatorMiddleContainer as N, IndicatorMiddle as P } from "./styled.js";
4
+ import i from "lodash";
5
+ const R = ({
6
+ value: n,
7
+ positiveBarColor: o,
8
+ negativeBarColor: s,
9
+ middleColor: e,
10
+ barBgColor: h,
11
+ showPositive: b = !0,
12
+ showNegative: x,
13
+ showMiddle: I
14
+ }) => {
15
+ const k = c(() => i.isArray(n) ? n.find((r) => r > 0) ?? 0 : n ?? 0, [n]), l = c(() => i.isArray(n) ? n.find((r) => r < 0) ?? 0 : n < 0 ? n : 0, [n]), a = (r) => {
16
+ let d = [];
17
+ const M = 100 / (r.length - 1);
18
+ return r.forEach((u, f) => {
19
+ if (f === 0) {
20
+ d.push(`${u} 0%`);
21
+ return;
22
+ }
23
+ if (f === r.length - 1) {
24
+ d.push(`${u} 100%`);
25
+ return;
26
+ }
27
+ d.push(`${u} ${M * f}%`);
28
+ }), d;
29
+ }, y = c(() => i.isArray(o) ? `linear-gradient(45deg, ${a(o).join(", ")})` : o, [o]), A = c(() => i.isArray(s) ? `linear-gradient(45deg, ${a(s).join(", ")})` : s, [s]), j = c(() => i.isArray(e) ? `radial-gradient(circle, ${a(e).join(", ")})` : e, [e]);
30
+ return /* @__PURE__ */ p(w, { children: [
31
+ x && /* @__PURE__ */ t(g, { children: /* @__PURE__ */ t(
32
+ $,
33
+ {
34
+ flexDirection: "row-reverse",
35
+ sx: {
36
+ background: h
37
+ },
38
+ children: /* @__PURE__ */ t(
39
+ m,
40
+ {
41
+ width: `${Math.abs(l)}%`,
42
+ sx: {
43
+ background: A
44
+ }
45
+ }
46
+ )
47
+ }
48
+ ) }),
49
+ I && /* @__PURE__ */ t(N, { children: /* @__PURE__ */ t(P, { sx: { background: j } }) }),
50
+ b && /* @__PURE__ */ t(g, { children: /* @__PURE__ */ t(
51
+ $,
52
+ {
53
+ sx: {
54
+ background: h
55
+ },
56
+ children: /* @__PURE__ */ t(
57
+ m,
58
+ {
59
+ width: `${k}%`,
60
+ sx: {
61
+ background: y
62
+ }
63
+ }
64
+ )
65
+ }
66
+ ) })
67
+ ] });
68
+ };
69
+ export {
70
+ R as LinearIndicator
71
+ };
@@ -0,0 +1,73 @@
1
+ import { styled as a, Box as o } from "@mui/material";
2
+ const n = a(o, {
3
+ name: "HCLinearIndicator",
4
+ // The component name
5
+ slot: "root"
6
+ // The slot name
7
+ })({
8
+ display: "flex",
9
+ alignItems: "center",
10
+ gap: 6
11
+ }), i = a(o, {
12
+ name: "HCLinearIndicator",
13
+ // The component name
14
+ slot: "barContainer"
15
+ // The slot name
16
+ })(() => ({
17
+ display: "flex",
18
+ flex: 1,
19
+ backgroundColor: "white",
20
+ boxShadow: "inset 0px 5px 6px rgba(0,0,0,0.15)",
21
+ paddingTop: 7,
22
+ paddingBottom: 7,
23
+ paddingLeft: 6,
24
+ paddingRight: 6,
25
+ borderRadius: 10
26
+ })), t = a(o, {
27
+ name: "HCLinearIndicator",
28
+ // The component name
29
+ slot: "barBackground"
30
+ // The slot name
31
+ })(() => ({
32
+ display: "flex",
33
+ width: "100%",
34
+ background: "#ECECEC",
35
+ borderRadius: 10
36
+ })), e = a(o, {
37
+ name: "HCLinearIndicator",
38
+ // The component name
39
+ slot: "bar"
40
+ // The slot name
41
+ })(({ theme: r }) => ({
42
+ background: r.palette.primary.main,
43
+ height: 7,
44
+ borderRadius: 10
45
+ })), c = a(o, {
46
+ name: "HCLinearIndicator",
47
+ // The component name
48
+ slot: "middleContainer"
49
+ // The slot name
50
+ })(({ theme: r }) => ({
51
+ backgroundColor: r.palette.background.default,
52
+ boxShadow: "inset 0px 5px 6px rgba(0,0,0,0.15)",
53
+ padding: 6,
54
+ borderRadius: "50%"
55
+ })), l = a(o, {
56
+ name: "HCLinearIndicator",
57
+ // The component name
58
+ slot: "middle"
59
+ // The slot name
60
+ })(({ theme: r }) => ({
61
+ background: r.palette.primary.main,
62
+ height: 9,
63
+ width: 9,
64
+ borderRadius: "50%"
65
+ }));
66
+ export {
67
+ e as IndicatorBar,
68
+ t as IndicatorBarBackground,
69
+ i as IndicatorBarContainer,
70
+ l as IndicatorMiddle,
71
+ c as IndicatorMiddleContainer,
72
+ n as IndicatorRoot
73
+ };
package/dist/main.d.ts CHANGED
@@ -433,6 +433,19 @@ export declare namespace KeyProductionUtils {
433
433
 
434
434
  export declare const KeyProtectionMenu: React.FC<Props_7>;
435
435
 
436
+ export declare const LinearIndicator: FC<LinearIndicatorProps>;
437
+
438
+ declare interface LinearIndicatorProps {
439
+ value: number | number[];
440
+ positiveBarColor?: string | string[];
441
+ negativeBarColor?: string | string[];
442
+ middleColor?: string | string[];
443
+ barBgColor?: string;
444
+ showPositive?: boolean;
445
+ showNegative?: boolean;
446
+ showMiddle?: boolean;
447
+ }
448
+
436
449
  export declare const Loading: React.FC<Props_8>;
437
450
 
438
451
  export { LocalizationProvider }
package/dist/main.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Access as Ht } from "./components/access/index.js";
2
2
  import { alert as Ft, confirm as Ct } from "./components/confirm/index.js";
3
- import { Card as It } from "./components/card/index.js";
3
+ import { Card as jt } from "./components/card/index.js";
4
4
  import { CardAlternate as $t } from "./components/card-alternate/index.js";
5
5
  import { CollapsibleCard as Et } from "./components/collapsible-card/index.js";
6
6
  import { ConditionalWrapper as zt } from "./components/conditional-wrapper/index.js";
@@ -14,20 +14,21 @@ import { InstanceForm as re } from "./components/instance-form/index.js";
14
14
  import { InstanceHierarchyTable as ne } from "./components/instance-hierarchy-table/index.js";
15
15
  import { InstanceTable as ae } from "./components/instance-table/index.js";
16
16
  import { KeyProtectionMenu as he } from "./components/key-protection/menu.js";
17
- import { Loading as ue } from "./components/loading/index.js";
18
- import { LocalizationProvider as fe } from "@mui/x-date-pickers";
19
- import { PhoneInput as le } from "./components/phone-input/index.js";
20
- import { SearchInput as ye } from "./components/search-input/index.js";
21
- import { SecurityLevel as De } from "./components/data-security-selectors/security-level/index.js";
22
- import { TemplateForm as ge } from "./components/template-form/index.js";
23
- import { TemplateFilters as Te } from "./components/template-filters/index.js";
24
- import { TemplatePropertyFilters as we } from "./components/template-property-filters/index.js";
25
- import { TreeSelect as ve } from "./components/tree-select/index.js";
26
- import { TreeViewFilter as Se } from "./components/treeview-filter/index.js";
27
- import { S as be } from "./utils-Bq0ye5vf.js";
28
- import { i as Be } from "./index-DlnzUkwe.js";
29
- import { b as Ce } from "./helpers-DaCoWmi2.js";
30
- import { ThemeProvider as Ie, createTheme as Pe } from "@mui/material";
17
+ import { LinearIndicator as ue } from "./components/linear-indicator/index.js";
18
+ import { Loading as fe } from "./components/loading/index.js";
19
+ import { LocalizationProvider as le } from "@mui/x-date-pickers";
20
+ import { PhoneInput as ye } from "./components/phone-input/index.js";
21
+ import { SearchInput as De } from "./components/search-input/index.js";
22
+ import { SecurityLevel as ge } from "./components/data-security-selectors/security-level/index.js";
23
+ import { TemplateForm as Te } from "./components/template-form/index.js";
24
+ import { TemplateFilters as we } from "./components/template-filters/index.js";
25
+ import { TemplatePropertyFilters as ve } from "./components/template-property-filters/index.js";
26
+ import { TreeSelect as Se } from "./components/tree-select/index.js";
27
+ import { TreeViewFilter as be } from "./components/treeview-filter/index.js";
28
+ import { S as Be } from "./utils-Bq0ye5vf.js";
29
+ import { i as Ce } from "./index-DlnzUkwe.js";
30
+ import { b as je } from "./helpers-DaCoWmi2.js";
31
+ import { ThemeProvider as $e, createTheme as We } from "@mui/material";
31
32
  import { a as dt } from "./objectWithoutPropertiesLoose-DJteAcBH.js";
32
33
  import C from "dayjs";
33
34
  import { h as U, j as z } from "./createTheme-DrgvKMA_.js";
@@ -123,15 +124,15 @@ var et = { exports: {} };
123
124
  return v || A.slice(1);
124
125
  });
125
126
  })).match(c), g = u.length, Y = 0; Y < g; Y += 1) {
126
- var j = u[Y], O = Z[j], T = O && O[0], L = O && O[1];
127
- u[Y] = L ? { regex: T, parser: L } : j.replace(/^\[|\]$/g, "");
127
+ var I = u[Y], O = Z[I], T = O && O[0], L = O && O[1];
128
+ u[Y] = L ? { regex: T, parser: L } : I.replace(/^\[|\]$/g, "");
128
129
  }
129
130
  return function(S) {
130
131
  for (var w = {}, M = 0, y = 0; M < g; M += 1) {
131
132
  var k = u[M];
132
133
  if (typeof k == "string") y += k.length;
133
134
  else {
134
- var v = k.regex, A = k.parser, I = S.slice(y), F = v.exec(I)[0];
135
+ var v = k.regex, A = k.parser, j = S.slice(y), F = v.exec(j)[0];
135
136
  A.call(w, F), S = S.replace(F, "");
136
137
  }
137
138
  }
@@ -148,22 +149,22 @@ var et = { exports: {} };
148
149
  d.p.customParseFormat = !0, r && r.parseTwoDigitYear && (i = r.parseTwoDigitYear);
149
150
  var u = h.prototype, g = u.parse;
150
151
  u.parse = function(Y) {
151
- var j = Y.date, O = Y.utc, T = Y.args;
152
+ var I = Y.date, O = Y.utc, T = Y.args;
152
153
  this.$u = O;
153
154
  var L = T[1];
154
155
  if (typeof L == "string") {
155
156
  var S = T[2] === !0, w = T[3] === !0, M = S || w, y = T[2];
156
- w && (y = T[2]), n = this.$locale(), !S && y && (n = d.Ls[y]), this.$d = function(I, F, b, P) {
157
+ w && (y = T[2]), n = this.$locale(), !S && y && (n = d.Ls[y]), this.$d = function(j, F, b, P) {
157
158
  try {
158
- if (["x", "X"].indexOf(F) > -1) return new Date((F === "X" ? 1e3 : 1) * I);
159
- var m = B(F)(I), N = m.year, $ = m.month, nt = m.day, ot = m.hours, at = m.minutes, it = m.seconds, ht = m.milliseconds, R = m.zone, X = m.week, J = /* @__PURE__ */ new Date(), _ = nt || (N || $ ? 1 : J.getDate()), V = N || J.getFullYear(), W = 0;
159
+ if (["x", "X"].indexOf(F) > -1) return new Date((F === "X" ? 1e3 : 1) * j);
160
+ var m = B(F)(j), N = m.year, $ = m.month, nt = m.day, ot = m.hours, at = m.minutes, it = m.seconds, ht = m.milliseconds, R = m.zone, X = m.week, J = /* @__PURE__ */ new Date(), _ = nt || (N || $ ? 1 : J.getDate()), V = N || J.getFullYear(), W = 0;
160
161
  N && !$ || (W = $ > 0 ? $ - 1 : J.getMonth());
161
162
  var E, q = ot || 0, G = at || 0, K = it || 0, Q = ht || 0;
162
163
  return R ? new Date(Date.UTC(V, W, _, q, G, K, Q + 60 * R.offset * 1e3)) : b ? new Date(Date.UTC(V, W, _, q, G, K, Q)) : (E = new Date(V, W, _, q, G, K, Q), X && (E = P(E).week(X).toDate()), E);
163
164
  } catch {
164
165
  return /* @__PURE__ */ new Date("");
165
166
  }
166
- }(j, L, O, d), this.init(), y && y !== !0 && (this.$L = this.locale(y).$L), M && j != this.format(L) && (this.$d = /* @__PURE__ */ new Date("")), n = {};
167
+ }(I, L, O, d), this.init(), y && y !== !0 && (this.$L = this.locale(y).$L), M && I != this.format(L) && (this.$d = /* @__PURE__ */ new Date("")), n = {};
167
168
  } else if (L instanceof Array) for (var k = L.length, v = 1; v <= k; v += 1) {
168
169
  T[1] = L[v - 1];
169
170
  var A = d.apply(this, T);
@@ -384,9 +385,9 @@ class St {
384
385
  }
385
386
  export {
386
387
  Ht as Access,
387
- Ce as AccessUtils,
388
+ je as AccessUtils,
388
389
  St as AdapterDayjs,
389
- It as Card,
390
+ jt as Card,
390
391
  $t as CardAlternate,
391
392
  Et as CollapsibleCard,
392
393
  zt as ConditionalWrapper,
@@ -399,21 +400,22 @@ export {
399
400
  re as InstanceForm,
400
401
  ne as InstanceHierarchyTable,
401
402
  ae as InstanceTable,
402
- be as KeyProductionUtils,
403
+ Be as KeyProductionUtils,
403
404
  he as KeyProtectionMenu,
404
- ue as Loading,
405
- fe as LocalizationProvider,
406
- Be as Map,
407
- le as PhoneInput,
408
- ye as SearchInput,
409
- De as SecurityLevel,
410
- Te as TemplateFilters,
411
- ge as TemplateForm,
412
- we as TemplatePropertyFilters,
413
- Ie as ThemeProvider,
414
- ve as TreeSelect,
415
- Se as TreeViewFilter,
405
+ ue as LinearIndicator,
406
+ fe as Loading,
407
+ le as LocalizationProvider,
408
+ Ce as Map,
409
+ ye as PhoneInput,
410
+ De as SearchInput,
411
+ ge as SecurityLevel,
412
+ we as TemplateFilters,
413
+ Te as TemplateForm,
414
+ ve as TemplatePropertyFilters,
415
+ $e as ThemeProvider,
416
+ Se as TreeSelect,
417
+ be as TreeViewFilter,
416
418
  Ft as alert,
417
419
  Ct as confirm,
418
- Pe as createTheme
420
+ We as createTheme
419
421
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@hybridcore/ui",
3
3
  "description": "Hybrid Core UI Library",
4
- "version": "1.4.43",
4
+ "version": "1.5.1",
5
5
  "author": "Hybrid Core",
6
6
  "license": "ISC",
7
7
  "type": "module",