qaema-ui 0.0.41 → 0.0.43

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,7 +1,4 @@
1
- import { getDefaultExportFromCjs as r } from "./_commonjsHelpers.js";
2
- import { __require as t } from "../node_modules/react-helmet-async/node_modules/react-fast-compare/index.js";
3
- var a = t();
4
- const m = /* @__PURE__ */ r(a);
1
+ var s = { exports: {} };
5
2
  export {
6
- m as default
3
+ s as __module
7
4
  };
@@ -1,7 +1,4 @@
1
- import { getDefaultExportFromCjs as r } from "./_commonjsHelpers.js";
2
- import { __require as o } from "../node_modules/shallowequal/index.js";
3
- var a = o();
4
- const t = /* @__PURE__ */ r(a);
1
+ var p = { exports: {} };
5
2
  export {
6
- t as default
3
+ p as __module
7
4
  };
@@ -1,4 +1,7 @@
1
- var s = { exports: {} };
1
+ import { getDefaultExportFromCjs as r } from "./_commonjsHelpers.js";
2
+ import { __require as t } from "../node_modules/react-helmet-async/node_modules/react-fast-compare/index.js";
3
+ var a = t();
4
+ const m = /* @__PURE__ */ r(a);
2
5
  export {
3
- s as __module
6
+ m as default
4
7
  };
@@ -1,4 +1,7 @@
1
- var p = { exports: {} };
1
+ import { getDefaultExportFromCjs as r } from "./_commonjsHelpers.js";
2
+ import { __require as o } from "../node_modules/shallowequal/index.js";
3
+ var a = o();
4
+ const t = /* @__PURE__ */ r(a);
2
5
  export {
3
- p as __module
6
+ t as default
4
7
  };
@@ -4,6 +4,7 @@ type AmountItemProps = {
4
4
  data: AmountCellData;
5
5
  type?: CellType;
6
6
  width?: string;
7
+ height?: string;
7
8
  numberOptions?: TypographyProps;
8
9
  decimalOptions?: TypographyProps;
9
10
  };
@@ -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 b = r.div`
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
- `, S = r.div`
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
- }, A = r.img`
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
- `, C = {
29
+ `, $ = {
30
30
  SAR: l
31
- }, T = ({ data: e, width: c, numberOptions: a, decimalOptions: m }) => {
31
+ }, W = ({ data: e, width: c, height: a, numberOptions: m, decimalOptions: h }) => {
32
32
  var n;
33
- const i = e.value ?? "", [h, d = "00"] = i.split("."), p = Number(h.replace(/,/g, "")).toLocaleString(), g = ((n = e.currencyCode) == null ? void 0 : n.trim()) ?? "SAR", u = C[g] || l, { variant: x = "smText", weight: y = "bold", ...f } = a || {}, { variant: v = "smText", weight: w, ...j } = m || {};
34
- return /* @__PURE__ */ t.jsx(S, { $width: c, children: i.length > 0 && /* @__PURE__ */ t.jsxs(b, { children: [
35
- /* @__PURE__ */ t.jsx(A, { src: u, alt: e.value }),
36
- /* @__PURE__ */ t.jsx(o, { variant: x, weight: y, style: s, ...f, children: p }),
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: v, weight: w, style: s, ...j, children: d })
38
+ /* @__PURE__ */ t.jsx(o, { variant: w, weight: j, style: s, ...b, children: g })
39
39
  ] }) });
40
40
  };
41
41
  export {
42
- T as default
42
+ W as default
43
43
  };
@@ -19,6 +19,7 @@ export type RadioInputProps = {
19
19
  optional?: boolean;
20
20
  error?: string;
21
21
  badge?: BadgeConfig;
22
+ optionsVariant?: string;
22
23
  };
23
24
  declare const RadioInput: React.FC<RadioInputProps>;
24
25
  export default RadioInput;
@@ -1,20 +1,20 @@
1
- import { j as l } from "../_virtual/jsx-runtime.js";
2
- import { TbSparkles as y } from "../node_modules/react-icons/tb/index.js";
3
- import o from "styled-components";
4
- import { useQaemaCoreTranslation as m } from "../i18n/i18n.js";
5
- import w from "./Hint.js";
6
- import { Optional as $ } from "./InputField.js";
7
- import j from "./Radio.js";
8
- const b = o.div`
1
+ import { j as i } from "../_virtual/jsx-runtime.js";
2
+ import { TbSparkles as $ } from "../node_modules/react-icons/tb/index.js";
3
+ import a, { css as p } from "styled-components";
4
+ import { useQaemaCoreTranslation as w } from "../i18n/i18n.js";
5
+ import j from "./Hint.js";
6
+ import { Optional as v } from "./InputField.js";
7
+ import b from "./Radio.js";
8
+ const F = a.div`
9
9
  display: flex;
10
10
  align-items: center;
11
11
  gap: ${({ theme: e }) => e.spacing.xs};
12
- `, v = o.div`
12
+ `, z = a.div`
13
13
  display: flex;
14
14
  flex-direction: column;
15
15
  justify-content: space-between;
16
16
  gap: ${({ theme: e }) => e.spacing.xs};
17
- `, F = o.div`
17
+ `, R = a.div`
18
18
  display: flex;
19
19
  flex-direction: row;
20
20
  align-items: center;
@@ -30,7 +30,7 @@ const b = o.div`
30
30
  line-height: ${({ theme: e }) => e.typography.lineHeights.xs};
31
31
  color: ${({ theme: e }) => e.colors.grey.n350};
32
32
  }
33
- `, z = o.span`
33
+ `, I = a.span`
34
34
  display: inline-flex;
35
35
  align-items: center;
36
36
  height: 20px;
@@ -38,52 +38,62 @@ const b = o.div`
38
38
  gap: 8px;
39
39
  border-radius: 4px;
40
40
  background: ${({ theme: e }) => {
41
- var n, i, s;
42
- return ((s = (i = (n = e.colors) == null ? void 0 : n.primary) == null ? void 0 : i.purple) == null ? void 0 : s.n100) || "#F1EEFF";
41
+ var n, l, t;
42
+ return ((t = (l = (n = e.colors) == null ? void 0 : n.primary) == null ? void 0 : l.purple) == null ? void 0 : t.n100) || "#F1EEFF";
43
43
  }};
44
44
  color: ${({ theme: e }) => {
45
- var n, i, s;
46
- return ((s = (i = (n = e.colors) == null ? void 0 : n.primary) == null ? void 0 : i.purple) == null ? void 0 : s.n450) || "#7259FF";
45
+ var n, l, t;
46
+ return ((t = (l = (n = e.colors) == null ? void 0 : n.primary) == null ? void 0 : l.purple) == null ? void 0 : t.n450) || "#7259FF";
47
47
  }};
48
48
  font-size: ${({ theme: e }) => e.typography.sizes.s2 || "10px"};
49
49
  line-height: ${({ theme: e }) => e.typography.lineHeights.m};
50
50
  font-weight: 400;
51
- `, R = o(y)`
51
+ `, O = a($)`
52
52
  width: 12px;
53
53
  height: 12px;
54
54
  flex: 0 0 auto;
55
- `, E = (e) => {
56
- const { name: n, label: i = "", options: s, value: p, disabled: h, optional: c = !1, onChange: g, error: a, badge: r } = e, { t: d } = m();
57
- if (!(s != null && s.length)) return null;
58
- const x = (t) => r != null && r.showFor ? typeof r.showFor == "function" ? !!r.showFor(t) : r.showFor === t.value : !1, f = (r == null ? void 0 : r.label) ?? "Recommended";
59
- return /* @__PURE__ */ l.jsxs(v, { children: [
60
- i && /* @__PURE__ */ l.jsxs(F, { children: [
61
- /* @__PURE__ */ l.jsx("label", { children: i }),
62
- c && /* @__PURE__ */ l.jsx($, { children: d("OPTIONAL") })
55
+ `, S = a.div`
56
+ display: flex;
57
+ width: 100%;
58
+ flex-direction: ${({ $variant: e }) => e};
59
+ ${({ $variant: e, theme: n }) => e === "row" ? p`
60
+ justify-content: space-between;
61
+ align-items: center;
62
+ ` : p`
63
+ gap: ${n.spacing.xs};
64
+ `}
65
+ `, A = (e) => {
66
+ const { name: n, label: l = "", options: t, value: c, disabled: h, optional: d = !1, onChange: g, error: o, badge: s, optionsVariant: x = "column" } = e, { t: f } = w();
67
+ if (!(t != null && t.length)) return null;
68
+ const u = (r) => s != null && s.showFor ? typeof s.showFor == "function" ? !!s.showFor(r) : s.showFor === r.value : !1, y = (s == null ? void 0 : s.label) ?? "Recommended";
69
+ return /* @__PURE__ */ i.jsxs(z, { children: [
70
+ l && /* @__PURE__ */ i.jsxs(R, { children: [
71
+ /* @__PURE__ */ i.jsx("label", { children: l }),
72
+ d && /* @__PURE__ */ i.jsx(v, { children: f("OPTIONAL") })
63
73
  ] }),
64
- s.map((t) => {
65
- const u = x(t);
66
- return /* @__PURE__ */ l.jsxs(b, { children: [
67
- /* @__PURE__ */ l.jsx(
68
- j,
74
+ /* @__PURE__ */ i.jsx(S, { $variant: x, children: t.map((r) => {
75
+ const m = u(r);
76
+ return /* @__PURE__ */ i.jsxs(F, { children: [
77
+ /* @__PURE__ */ i.jsx(
78
+ b,
69
79
  {
70
80
  name: n,
71
- label: t.label,
72
- value: t.value,
73
- $selected: p === (t == null ? void 0 : t.value),
81
+ label: r.label,
82
+ value: r.value,
83
+ $selected: c === (r == null ? void 0 : r.value),
74
84
  onChange: g,
75
85
  $disabled: h
76
86
  }
77
87
  ),
78
- u && /* @__PURE__ */ l.jsxs(z, { children: [
79
- (r == null ? void 0 : r.showIcon) !== !1 && /* @__PURE__ */ l.jsx(R, {}),
80
- f
88
+ m && /* @__PURE__ */ i.jsxs(I, { children: [
89
+ (s == null ? void 0 : s.showIcon) !== !1 && /* @__PURE__ */ i.jsx(O, {}),
90
+ y
81
91
  ] })
82
- ] }, t.value);
83
- }),
84
- a && /* @__PURE__ */ l.jsx(w, { variant: "error", title: a })
92
+ ] }, r.value);
93
+ }) }),
94
+ o && /* @__PURE__ */ i.jsx(j, { variant: "error", title: o })
85
95
  ] });
86
96
  };
87
97
  export {
88
- E as default
98
+ A as default
89
99
  };
@@ -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 }, c = n.direction ?? "neutral", a = x.colors.state.success.n450, s = x.colors.state.error.n450, u = c === "up" ? a : c === "down" ? s : p;
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 c = { value: l };
53
- t = /* @__PURE__ */ e.jsx(v, { data: c, width: "auto" });
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: c
71
+ callout: a
72
72
  }) {
73
- const a = y();
74
- return /* @__PURE__ */ e.jsxs($, { padding: "2rem", shadowVariant: "none", hoverEffect: !1, border: `1px solid ${a.colors.grey.n100}`, children: [
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: a.colors.grey.n400, children: p })
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: a.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: a.colors.grey.n400 }) }, `${h}-${g}`))
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: a.colors.grey.n400 }) }),
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
- c && /* @__PURE__ */ e.jsx(T, { callout: c })
95
+ a && /* @__PURE__ */ e.jsx(T, { callout: a })
96
96
  ] })
97
97
  ] });
98
98
  }
@@ -1,4 +1,4 @@
1
- import { __module as s } from "../../_virtual/index5.js";
1
+ import { __module as s } from "../../_virtual/index3.js";
2
2
  /*!
3
3
  Copyright (c) 2018 Jed Watson.
4
4
  Licensed under the MIT License (MIT), see
@@ -1,4 +1,4 @@
1
- import { __module as r } from "../../_virtual/index6.js";
1
+ import { __module as r } from "../../_virtual/index4.js";
2
2
  import { __require as s } from "../react-is/index.js";
3
3
  import { __require as t } from "./factoryWithTypeCheckers.js";
4
4
  import { __require as p } from "./factoryWithThrowingShims.js";
@@ -2,9 +2,9 @@ var Q = Object.defineProperty;
2
2
  var X = (e, t, r) => t in e ? Q(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
3
  var h = (e, t, r) => X(e, typeof t != "symbol" ? t + "" : t, r);
4
4
  import y, { Component as R } from "react";
5
- import ee from "../../../_virtual/index3.js";
5
+ import ee from "../../../_virtual/index5.js";
6
6
  import F from "../../../_virtual/browser.js";
7
- import te from "../../../_virtual/index4.js";
7
+ import te from "../../../_virtual/index6.js";
8
8
  var Y = /* @__PURE__ */ ((e) => (e.BASE = "base", e.BODY = "body", e.HEAD = "head", e.HTML = "html", e.LINK = "link", e.META = "meta", e.NOSCRIPT = "noscript", e.SCRIPT = "script", e.STYLE = "style", e.TITLE = "title", e.FRAGMENT = "Symbol(react.fragment)", e))(Y || {}), $ = {
9
9
  link: { rel: ["amphtml", "canonical", "alternate"] },
10
10
  script: { type: ["application/ld+json"] },
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "qaema-ui",
3
3
  "private": false,
4
- "version": "0.0.41",
4
+ "version": "0.0.43",
5
5
  "type": "module",
6
6
  "publishConfig": {
7
7
  "access": "public"