qaema-ui 0.0.41 → 0.0.42
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.
|
@@ -2,15 +2,15 @@ import { j as t } from "../_virtual/jsx-runtime.js";
|
|
|
2
2
|
import r from "styled-components";
|
|
3
3
|
import l from "../assets/svg/Riyal.svg.js";
|
|
4
4
|
import o from "./Typography.js";
|
|
5
|
-
const
|
|
5
|
+
const S = r.div`
|
|
6
6
|
display: flex;
|
|
7
7
|
justify-content: center;
|
|
8
8
|
align-items: center;
|
|
9
9
|
overflow: hidden;
|
|
10
10
|
flex-direction: ${({ theme: e }) => e.dir == "rtl" && "row-reverse"};
|
|
11
|
-
`,
|
|
11
|
+
`, A = r.div`
|
|
12
12
|
width: ${({ $width: e = "12.18rem" }) => e};
|
|
13
|
-
height: 3.5rem;
|
|
13
|
+
height: ${({ $height: e = "3.5rem" }) => e};
|
|
14
14
|
display: flex;
|
|
15
15
|
align-items: center;
|
|
16
16
|
gap: 2px;
|
|
@@ -20,24 +20,24 @@ const b = r.div`
|
|
|
20
20
|
whiteSpace: "nowrap",
|
|
21
21
|
overflow: "hidden",
|
|
22
22
|
textOverflow: "ellipsis"
|
|
23
|
-
},
|
|
23
|
+
}, C = r.img`
|
|
24
24
|
width: ${({ $width: e = ".75rem" }) => e};
|
|
25
25
|
height: 0.75rem;
|
|
26
26
|
object-fit: contain;
|
|
27
27
|
flex-shrink: 0;
|
|
28
28
|
margin-right: 2px;
|
|
29
|
-
`,
|
|
29
|
+
`, $ = {
|
|
30
30
|
SAR: l
|
|
31
|
-
},
|
|
31
|
+
}, W = ({ data: e, width: c, height: a, numberOptions: m, decimalOptions: h }) => {
|
|
32
32
|
var n;
|
|
33
|
-
const i = e.value ?? "", [
|
|
34
|
-
return /* @__PURE__ */ t.jsx(
|
|
35
|
-
/* @__PURE__ */ t.jsx(
|
|
36
|
-
/* @__PURE__ */ t.jsx(o, { variant:
|
|
33
|
+
const i = e.value ?? "", [d, g = "00"] = i.split("."), p = Number(d.replace(/,/g, "")).toLocaleString(), u = ((n = e.currencyCode) == null ? void 0 : n.trim()) ?? "SAR", x = $[u] || l, { variant: y = "smText", weight: f = "bold", ...v } = m || {}, { variant: w = "smText", weight: j, ...b } = h || {};
|
|
34
|
+
return /* @__PURE__ */ t.jsx(A, { $width: c, $height: a, children: i.length > 0 && /* @__PURE__ */ t.jsxs(S, { children: [
|
|
35
|
+
/* @__PURE__ */ t.jsx(C, { src: x, alt: e.value }),
|
|
36
|
+
/* @__PURE__ */ t.jsx(o, { variant: y, weight: f, style: s, ...v, children: p }),
|
|
37
37
|
".",
|
|
38
|
-
/* @__PURE__ */ t.jsx(o, { variant:
|
|
38
|
+
/* @__PURE__ */ t.jsx(o, { variant: w, weight: j, style: s, ...b, children: g })
|
|
39
39
|
] }) });
|
|
40
40
|
};
|
|
41
41
|
export {
|
|
42
|
-
|
|
42
|
+
W as default
|
|
43
43
|
};
|
|
@@ -44,13 +44,13 @@ const S = i.div`
|
|
|
44
44
|
const n = l;
|
|
45
45
|
t = /* @__PURE__ */ e.jsx(w, { ...n });
|
|
46
46
|
} else if (r === "trend") {
|
|
47
|
-
const n = typeof l == "object" && l !== null ? l : { value: l },
|
|
47
|
+
const n = typeof l == "object" && l !== null ? l : { value: l }, a = n.direction ?? "neutral", c = x.colors.state.success.n450, s = x.colors.state.error.n450, u = a === "up" ? c : a === "down" ? s : p;
|
|
48
48
|
t = /* @__PURE__ */ e.jsx(d, { variant: "smText", color: u, children: typeof n.value == "number" ? n.value.toString() : n.value });
|
|
49
49
|
} else if (r === "component")
|
|
50
50
|
t = l;
|
|
51
51
|
else if (r === "amount") {
|
|
52
|
-
const
|
|
53
|
-
t = /* @__PURE__ */ e.jsx(v, { data:
|
|
52
|
+
const a = { value: l };
|
|
53
|
+
t = /* @__PURE__ */ e.jsx(v, { data: a, width: "auto", height: "auto" });
|
|
54
54
|
} else {
|
|
55
55
|
const n = l;
|
|
56
56
|
t = /* @__PURE__ */ e.jsx(d, { variant: "smText", color: p, children: typeof n == "number" ? n.toString() : n });
|
|
@@ -68,10 +68,10 @@ function z({
|
|
|
68
68
|
btnLabel: x,
|
|
69
69
|
btnConfig: t,
|
|
70
70
|
trailingActionsConfig: n,
|
|
71
|
-
callout:
|
|
71
|
+
callout: a
|
|
72
72
|
}) {
|
|
73
|
-
const
|
|
74
|
-
return /* @__PURE__ */ e.jsxs($, { padding: "2rem", shadowVariant: "none", hoverEffect: !1, border: `1px solid ${
|
|
73
|
+
const c = y();
|
|
74
|
+
return /* @__PURE__ */ e.jsxs($, { padding: "2rem", shadowVariant: "none", hoverEffect: !1, border: `1px solid ${c.colors.grey.n100}`, children: [
|
|
75
75
|
/* @__PURE__ */ e.jsxs(S, { children: [
|
|
76
76
|
/* @__PURE__ */ e.jsxs(B, { children: [
|
|
77
77
|
/* @__PURE__ */ e.jsx(d, { variant: "h6", weight: "semiBold", children: l }),
|
|
@@ -80,19 +80,19 @@ function z({
|
|
|
80
80
|
" "
|
|
81
81
|
] })
|
|
82
82
|
] }),
|
|
83
|
-
/* @__PURE__ */ e.jsx(d, { variant: "caption", color:
|
|
83
|
+
/* @__PURE__ */ e.jsx(d, { variant: "caption", color: c.colors.grey.n400, children: p })
|
|
84
84
|
] }),
|
|
85
85
|
/* @__PURE__ */ e.jsxs(R, { children: [
|
|
86
86
|
r.map((s, h) => {
|
|
87
87
|
var u;
|
|
88
88
|
return ((u = s == null ? void 0 : s.items) == null ? void 0 : u.length) === 0 ? null : /* @__PURE__ */ e.jsxs(V, { children: [
|
|
89
|
-
/* @__PURE__ */ e.jsx(d, { variant: "span", weight: "regular", color:
|
|
90
|
-
s.items.map((m, g) => /* @__PURE__ */ e.jsx(b, { children: /* @__PURE__ */ e.jsx(f, { variant: m == null ? void 0 : m.variant, label: m.label, value: m.value, color:
|
|
89
|
+
/* @__PURE__ */ e.jsx(d, { variant: "span", weight: "regular", color: c.colors.grey.n400, children: s.title }),
|
|
90
|
+
s.items.map((m, g) => /* @__PURE__ */ e.jsx(b, { children: /* @__PURE__ */ e.jsx(f, { variant: m == null ? void 0 : m.variant, label: m.label, value: m.value, color: c.colors.grey.n400 }) }, `${h}-${g}`))
|
|
91
91
|
] }, s.title);
|
|
92
92
|
}),
|
|
93
|
-
o && /* @__PURE__ */ e.jsx(E, { children: /* @__PURE__ */ e.jsx(f, { variant: o == null ? void 0 : o.variant, label: (o == null ? void 0 : o.label) ?? "", value: (o == null ? void 0 : o.value) ?? "", color:
|
|
93
|
+
o && /* @__PURE__ */ e.jsx(E, { children: /* @__PURE__ */ e.jsx(f, { variant: o == null ? void 0 : o.variant, label: (o == null ? void 0 : o.label) ?? "", value: (o == null ? void 0 : o.value) ?? "", color: c.colors.grey.n400 }) }),
|
|
94
94
|
n && (n == null ? void 0 : n.length) > 0 && n.map((s) => /* @__PURE__ */ e.jsx(j, { ...s == null ? void 0 : s.btnConfig, children: (s == null ? void 0 : s.label) ?? "" })),
|
|
95
|
-
|
|
95
|
+
a && /* @__PURE__ */ e.jsx(T, { callout: a })
|
|
96
96
|
] })
|
|
97
97
|
] });
|
|
98
98
|
}
|