qaema-ui 0.0.52 → 0.0.53

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.
@@ -10,14 +10,14 @@ import { HelperTextWrapper as pe } from "./PhoneInputField.js";
10
10
  import Se from "./SearchBar.js";
11
11
  import me from "./Spinner.js";
12
12
  import F from "./Typography.js";
13
- const Le = (f) => {
13
+ const Le = (i) => {
14
14
  const {
15
15
  label: b,
16
16
  options: m,
17
17
  // value,
18
18
  placeholder: H = "Select Something",
19
19
  optional: M = !1,
20
- error: s = "",
20
+ error: f = "",
21
21
  disabled: h = !1,
22
22
  selectIdentifier: D,
23
23
  keyIdentifier: v = "id",
@@ -27,21 +27,21 @@ const Le = (f) => {
27
27
  allowSearch: R,
28
28
  searchHandler: A,
29
29
  searchPlaceholder: B,
30
- onToggle: o,
31
- multiSelect: c = !1,
30
+ onToggle: s,
31
+ multiSelect: o = !1,
32
32
  isLoading: Q = !1,
33
33
  currentSelectedOptions: y = [],
34
34
  isInteractive: I = !1,
35
35
  endIcon: T
36
- } = f, u = g(null), p = g(null), d = te(), { t: k } = ae(), U = g(null), [a, x] = w(y), [i, O] = w(!1), [Z, q] = w(0), $ = P ?? /* @__PURE__ */ r.jsx(r.Fragment, {}), G = le("dropdown"), S = _(() => {
36
+ } = i, c = g(null), p = g(null), u = te(), { t: k } = ae(), U = g(null), [a, x] = w(y), [d, O] = w(!1), [Z, q] = w(0), $ = P ?? /* @__PURE__ */ r.jsx(r.Fragment, {}), G = le("dropdown"), S = _(() => {
37
37
  var e, n;
38
- (e = u == null ? void 0 : u.current) != null && e.offsetWidth && p.current && q(((n = u.current) == null ? void 0 : n.offsetWidth) / 16);
38
+ (e = c == null ? void 0 : c.current) != null && e.offsetWidth && p.current && q(((n = c.current) == null ? void 0 : n.offsetWidth) / 16);
39
39
  }, []);
40
- C(() => (i && (S(), window.addEventListener("resize", S)), () => window.removeEventListener("resize", S)), [i, S]), C(() => {
40
+ C(() => (d && (S(), window.addEventListener("resize", S)), () => window.removeEventListener("resize", S)), [d, S]), C(() => {
41
41
  x(y);
42
42
  }, [y]);
43
- const J = (e, n, t, l = "default") => t ? d.colors.grey.n400 : e ? d.colors.state.error.n450 : n ? d.colors.primary.dark.n600 : l === "light-primary" ? d.colors.primary.purple.n450 : d.colors.grey.n300, E = (e) => a.some((n) => typeof n.value == "object" && typeof e.value == "object" ? n.value[v] === e.value[v] : n.value === e.value), K = (e) => {
44
- if (c) {
43
+ const J = (e, n, t, l = "default") => t ? u.colors.grey.n400 : e ? u.colors.state.error.n450 : n ? u.colors.primary.dark.n600 : l === "light-primary" ? u.colors.primary.purple.n450 : u.colors.grey.n300, E = (e) => a.some((n) => typeof n.value == "object" && typeof e.value == "object" ? n.value[v] === e.value[v] : n.value === e.value), K = (e) => {
44
+ if (o) {
45
45
  const n = E(e);
46
46
  let t;
47
47
  n ? t = a.filter((l) => typeof l.value == "object" && typeof e.value == "object" ? l.value[v] !== e.value[v] : l.value !== e.value) : t = [...a, e], x(t), j(t.map((l) => l.value));
@@ -52,17 +52,17 @@ const Le = (f) => {
52
52
  x(n), j(n.map((t) => t.value));
53
53
  }, X = () => {
54
54
  var e;
55
- return a.length === 0 ? H : c ? `${a.length} ${k("SELECTED")}` : (e = a[0]) == null ? void 0 : e.label;
55
+ return a.length === 0 ? H : o ? `${a.length} ${k("SELECTED")}` : (e = a[0]) == null ? void 0 : e.label;
56
56
  };
57
57
  C(() => {
58
58
  const e = (n) => {
59
- p.current && u.current && !p.current.contains(n.target) && !u.current.contains(n.target) && (O(!1), o == null || o(!1));
59
+ p.current && c.current && !p.current.contains(n.target) && !c.current.contains(n.target) && (O(!1), s == null || s(!1));
60
60
  };
61
- return i && document.addEventListener("mousedown", e), () => {
61
+ return d && document.addEventListener("mousedown", e), () => {
62
62
  document.removeEventListener("mousedown", e);
63
63
  };
64
- }, [i, o]);
65
- const Y = () => I || (s == null ? void 0 : s.length) === 0 ? null : /* @__PURE__ */ r.jsx(pe, { error: s, children: s });
64
+ }, [d, s]);
65
+ const Y = () => I ? null : /* @__PURE__ */ r.jsx(pe, { error: f || "", children: f && f });
66
66
  return /* @__PURE__ */ r.jsxs(se, { children: [
67
67
  b && /* @__PURE__ */ r.jsxs(oe, { children: [
68
68
  /* @__PURE__ */ r.jsx("label", { children: b }),
@@ -71,14 +71,14 @@ const Le = (f) => {
71
71
  /* @__PURE__ */ r.jsxs(
72
72
  ce,
73
73
  {
74
- show: i,
74
+ show: d,
75
75
  onToggle: () => {
76
- o == null || o(!i), O((e) => !e);
76
+ s == null || s(!d), O((e) => !e);
77
77
  },
78
78
  placement: "bottom-start",
79
- autoClose: c ? "outside" : !0,
79
+ autoClose: o ? "outside" : !0,
80
80
  children: [
81
- /* @__PURE__ */ r.jsx(ue, { disabled: h, ref: u, $valid: !s, $variant: f.variant || "default", children: /* @__PURE__ */ r.jsx(de, { $valid: !s, $isInteractive: I, $hasDyncWidth: !h, children: /* @__PURE__ */ r.jsxs("div", { className: "title-container", children: [
81
+ /* @__PURE__ */ r.jsx(ue, { disabled: h, ref: c, $valid: !f, $variant: i.variant || "default", children: /* @__PURE__ */ r.jsx(de, { $valid: !f, $isInteractive: I, $hasDyncWidth: !h, children: /* @__PURE__ */ r.jsxs("div", { className: "title-container", children: [
82
82
  /* @__PURE__ */ r.jsxs("div", { className: "heading-container", children: [
83
83
  N && typeof $ == "function" && /* @__PURE__ */ r.jsx($, {}),
84
84
  /* @__PURE__ */ r.jsx(
@@ -86,26 +86,26 @@ const Le = (f) => {
86
86
  {
87
87
  component: "span",
88
88
  variant: "mdText",
89
- color: J(s, a.length > 0, h, f.variant || "default"),
89
+ color: J(f, a.length > 0, h, i.variant || "default"),
90
90
  children: X()
91
91
  }
92
92
  )
93
93
  ] }),
94
94
  (T || !h) && /* @__PURE__ */ r.jsxs(ie, { children: [
95
95
  T,
96
- !c && a.length > 0 && !h && /* @__PURE__ */ r.jsx(
96
+ !o && a.length > 0 && !h && /* @__PURE__ */ r.jsx(
97
97
  W,
98
98
  {
99
99
  style: { cursor: "pointer", marginLeft: "0.5rem" },
100
100
  onClick: (e) => {
101
- e.stopPropagation(), x([]), j(c ? [] : "");
101
+ e.stopPropagation(), x([]), j(o ? [] : "");
102
102
  }
103
103
  }
104
104
  ),
105
105
  !h && /* @__PURE__ */ r.jsx(ee, {})
106
106
  ] })
107
107
  ] }) }) }),
108
- i && /* @__PURE__ */ r.jsxs(fe, { ref: p, $menuWidth: Z, $zIndex: G, children: [
108
+ d && /* @__PURE__ */ r.jsxs(fe, { ref: p, $menuWidth: Z, $zIndex: G, children: [
109
109
  R && /* @__PURE__ */ r.jsx(he, { children: /* @__PURE__ */ r.jsx(Se, { placeholder: B, onSearch: A }) }),
110
110
  /* @__PURE__ */ r.jsxs(
111
111
  ve,
@@ -113,7 +113,7 @@ const Le = (f) => {
113
113
  ref: U,
114
114
  onScroll: (e) => {
115
115
  var n;
116
- (n = f.onScroll) == null || n.call(f, e);
116
+ (n = i.onScroll) == null || n.call(i, e);
117
117
  },
118
118
  children: [
119
119
  m == null ? void 0 : m.map((e) => {
@@ -125,7 +125,7 @@ const Le = (f) => {
125
125
  onClick: () => K(e),
126
126
  $selected: n,
127
127
  children: [
128
- c && (n ? /* @__PURE__ */ r.jsx(re, { color: d.colors.primary.purple.n500 }) : /* @__PURE__ */ r.jsx(ne, { color: d.colors.primary.purple.n450 })),
128
+ o && (n ? /* @__PURE__ */ r.jsx(re, { color: u.colors.primary.purple.n500 }) : /* @__PURE__ */ r.jsx(ne, { color: u.colors.primary.purple.n450 })),
129
129
  " ",
130
130
  /* @__PURE__ */ r.jsx(F, { variant: "smText", children: e == null ? void 0 : e.label })
131
131
  ]
@@ -141,7 +141,7 @@ const Le = (f) => {
141
141
  ]
142
142
  }
143
143
  ),
144
- c && a.length > 0 && /* @__PURE__ */ r.jsx(xe, { children: a.map((e) => {
144
+ o && a.length > 0 && /* @__PURE__ */ r.jsx(xe, { children: a.map((e) => {
145
145
  var n, t, l;
146
146
  return /* @__PURE__ */ r.jsxs(
147
147
  je,
@@ -120,7 +120,7 @@ const g = {
120
120
  &:-webkit-autofill {
121
121
  box-shadow: none;
122
122
  }
123
- `, b = i.span`
123
+ `, y = i.span`
124
124
  display: flex;
125
125
  align-items: center;
126
126
  justify-content: center;
@@ -153,11 +153,13 @@ const g = {
153
153
  gap: ${({ theme: o }) => o.spacing.xxs};
154
154
  font-size: ${({ theme: o }) => o.typography.sizes.s3};
155
155
  color: ${({ error: o, touched: r }) => o && r ? ({ theme: t }) => t.colors.state.error.n450 : ({ theme: t }) => t.colors.grey.n400};
156
- margin-top: ${({ theme: o }) => o.spacing.xxs};
156
+
157
157
  flex-direction: ${({ theme: o }) => o.dir === "rtl" ? "row-reverse" : "row"};
158
158
  justify-content: ${({ theme: o }) => o.dir === "rtl" ? "flex-end" : "flex-start"};
159
159
  text-align: ${({ theme: o }) => o.dir === "rtl" ? "right" : "left"};
160
- `, w = i.span`
160
+ min-height: 1.2rem;
161
+ visibility: ${({ error: o, touched: r }) => o && r ? "visible" : "hidden"};
162
+ `, m = i.span`
161
163
  color: ${({ theme: o }) => o.colors.primary.purple.n500};
162
164
  text-decoration: underline;
163
165
  cursor: pointer;
@@ -177,7 +179,7 @@ const g = {
177
179
  type: n = "text",
178
180
  disabled: u = !1,
179
181
  helperText: x,
180
- optional: m = !1,
182
+ optional: w = !1,
181
183
  helperTextLink: a,
182
184
  success: f = !1,
183
185
  error: l = "",
@@ -187,29 +189,29 @@ const g = {
187
189
  endIcon: h,
188
190
  onBlur: j = () => {
189
191
  },
190
- checked: S,
191
- name: y = "",
192
- isInteractive: k = !1,
193
- ...v
192
+ checked: v,
193
+ name: b = "",
194
+ isInteractive: S = !1,
195
+ ...k
194
196
  }) => {
195
197
  const z = H(), { t: C } = R(), F = () => l || (z.dir == "rtl" ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
196
- a && /* @__PURE__ */ e.jsx(w, { onClick: a.onClick, children: a.text }),
198
+ a && /* @__PURE__ */ e.jsx(m, { onClick: a.onClick, children: a.text }),
197
199
  x
198
200
  ] }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
199
201
  x,
200
- a && /* @__PURE__ */ e.jsx(w, { onClick: a.onClick, children: a.text })
201
- ] })), A = () => k || !x && !a && (!l || !d) ? null : /* @__PURE__ */ e.jsx(N, { error: l, touched: d, children: F() });
202
+ a && /* @__PURE__ */ e.jsx(m, { onClick: a.onClick, children: a.text })
203
+ ] })), A = () => S ? null : /* @__PURE__ */ e.jsx(N, { error: l, touched: d, children: (x || a || l) && F() });
202
204
  return /* @__PURE__ */ e.jsxs(W, { children: [
203
205
  o && /* @__PURE__ */ e.jsxs(G, { children: [
204
206
  o,
205
207
  " ",
206
- m && /* @__PURE__ */ e.jsxs(O, { children: [
208
+ w && /* @__PURE__ */ e.jsxs(O, { children: [
207
209
  " ",
208
210
  C("OPTIONAL")
209
211
  ] })
210
212
  ] }),
211
213
  /* @__PURE__ */ e.jsxs(E, { success: f, readonly: $, disabled: u, touched: d, error: l, children: [
212
- p && /* @__PURE__ */ e.jsx(b, { success: f, error: l, touched: d, children: p }),
214
+ p && /* @__PURE__ */ e.jsx(y, { success: f, error: l, touched: d, children: p }),
213
215
  /* @__PURE__ */ e.jsx(
214
216
  I,
215
217
  {
@@ -217,19 +219,19 @@ const g = {
217
219
  error: l,
218
220
  readonly: $,
219
221
  onBlur: j,
220
- checked: S,
222
+ checked: v,
221
223
  touched: d,
222
224
  value: t,
223
- id: y,
225
+ id: b,
224
226
  onChange: s,
225
227
  type: n,
226
228
  disabled: u,
227
229
  placeholder: r,
228
- name: y,
229
- ...v
230
+ name: b,
231
+ ...k
230
232
  }
231
233
  ),
232
- h && /* @__PURE__ */ e.jsx(b, { success: f, error: l, touched: d, children: h })
234
+ h && /* @__PURE__ */ e.jsx(y, { success: f, error: l, touched: d, children: h })
233
235
  ] }),
234
236
  A()
235
237
  ] });
@@ -441,10 +441,11 @@ const _t = f.div`
441
441
  gap: ${({ theme: s }) => s.spacing.xxs};
442
442
  font-size: ${({ theme: s }) => s.typography.sizes.s3};
443
443
  color: ${({ error: s }) => s ? ({ theme: o }) => o.colors.state.error.n450 : ({ theme: o }) => o.colors.grey.n400};
444
- margin-top: ${({ theme: s }) => s.spacing.xxs};
445
444
  flex-direction: ${({ theme: s }) => s.dir === "rtl" ? "row-reverse" : "row"};
446
445
  justify-content: ${({ theme: s }) => s.dir === "rtl" ? "flex-end" : "flex-start"};
447
446
  text-align: ${({ theme: s }) => s.dir === "rtl" ? "right" : "left"};
447
+ min-height: 1.2rem;
448
+ visibility: ${({ error: s }) => s ? "visible" : "hidden"};
448
449
  `, fg = ({
449
450
  label: s,
450
451
  value: o,
@@ -458,7 +459,7 @@ const _t = f.div`
458
459
  name: j = "",
459
460
  maxLength: e
460
461
  }) => {
461
- const z = w.find((l) => l.code === k) ?? w.find((l) => l.code === "SA"), [d, c] = x(z), [i, b] = x(o), $ = () => t ? /* @__PURE__ */ r.jsx(Qt, { error: t, children: t }) : null;
462
+ const z = w.find((l) => l.code === k) ?? w.find((l) => l.code === "SA"), [d, c] = x(z), [i, b] = x(o), $ = () => /* @__PURE__ */ r.jsx(Qt, { error: t || "", children: t && t });
462
463
  return /* @__PURE__ */ r.jsxs(Mt, { children: [
463
464
  /* @__PURE__ */ r.jsx(Nt, { label: s, optional: m }),
464
465
  /* @__PURE__ */ r.jsx(
@@ -1,5 +1,5 @@
1
1
  import { j as o } from "../_virtual/jsx-runtime.js";
2
- import { useState as y, useEffect as H } from "react";
2
+ import { useState as m, useEffect as H } from "react";
3
3
  import { FaTimesCircle as O, FaSearch as R } from "../node_modules/react-icons/fa/index.js";
4
4
  import s, { useTheme as X } from "styled-components";
5
5
  import { device as w } from "../constants/breakPoints.constant.js";
@@ -76,23 +76,24 @@ const A = s.div`
76
76
  flex-direction: row;
77
77
  gap: ${({ theme: r }) => r.spacing.xxs};
78
78
  padding: ${({ theme: r }) => r.spacing.xs};
79
- background-color: ${({ theme: r }) => r.colors.grey.n100};
79
+ background-color: ${({ theme: r }) => r.colors.grey.n150};
80
80
  border: 1px solid transparent;
81
81
  border-radius: ${({ theme: r }) => r.borderRadius.lg};
82
82
  `, P = s(Z)`
83
83
  border: none;
84
84
  padding: 0;
85
85
  margin-top: ${({ theme: r }) => r.spacing.xxs};
86
- background-color: ${({ theme: r }) => r.colors.grey.n100};
86
+ background-color: ${({ theme: r }) => r.colors.grey.n150};
87
87
  font-family: ${({ theme: r }) => r.dir === "rtl" ? r.fonts.arabic : r.fonts.english} !important;
88
88
  direction: ${({ theme: r }) => r.dir} !important;
89
89
  svg {
90
- background-color: ${({ theme: r }) => r.colors.grey.n100};
90
+ background-color: ${({ theme: r }) => r.colors.grey.n150};
91
91
  }
92
92
  `, I = s(_.Control)`
93
93
  padding: ${({ theme: r }) => r.spacing.xxs};
94
94
  border: none;
95
- background-color: ${({ theme: r }) => r.colors.grey.n100};
95
+ background-color: ${({ theme: r }) => r.colors.grey.n150};
96
+ color: ${({ theme: r }) => r.colors.grey.n350};
96
97
 
97
98
  &:focus-visible {
98
99
  outline: none;
@@ -115,13 +116,13 @@ const A = s.div`
115
116
  padding: ${({ theme: r }) => r.spacing.m};
116
117
  text-align: center;
117
118
  `, ur = (r) => {
118
- const { logoSrc: C, searchPlaceHolder: T, categories: c, linkComponent: f, open: E, setOpen: L, currentPath: u, extraSideMenuItems: p, onLogoClick: B } = r, a = X(), { t: D } = U(), F = K("sidemenu"), [l, M] = y(""), [t, N] = y(c), g = (n) => {
119
+ const { logoSrc: C, searchPlaceHolder: T, categories: c, linkComponent: f, open: E, setOpen: L, currentPath: u, extraSideMenuItems: p, onLogoClick: B } = r, a = X(), { t: D } = U(), F = K("sidemenu"), [l, M] = m(""), [t, N] = m(c), g = (n) => {
119
120
  const e = [];
120
121
  c == null || c.forEach((d) => {
121
122
  var h;
122
123
  const i = (h = d == null ? void 0 : d.navItems) == null ? void 0 : h.filter((x) => {
123
- var $, m;
124
- return (m = ($ = x == null ? void 0 : x.title) == null ? void 0 : $.toLowerCase()) == null ? void 0 : m.includes(n == null ? void 0 : n.toLowerCase());
124
+ var $, y;
125
+ return (y = ($ = x == null ? void 0 : x.title) == null ? void 0 : $.toLowerCase()) == null ? void 0 : y.includes(n == null ? void 0 : n.toLowerCase());
125
126
  });
126
127
  (i == null ? void 0 : i.length) > 0 && e.push({ ...d, navItems: i });
127
128
  }), N(e);
@@ -144,7 +145,7 @@ const A = s.div`
144
145
  onClick: () => {
145
146
  g(l);
146
147
  },
147
- children: /* @__PURE__ */ o.jsx(R, { color: a.colors.grey.n400 })
148
+ children: /* @__PURE__ */ o.jsx(R, { color: a.colors.grey.n350 })
148
149
  }
149
150
  ),
150
151
  /* @__PURE__ */ o.jsx(
@@ -1,10 +1,10 @@
1
1
  import { j as o } from "../_virtual/jsx-runtime.js";
2
- import { FiPlus as y, FiMinus as m } from "../node_modules/react-icons/fi/index.js";
3
- import { IoMdArrowDropup as f, IoMdArrowDropdown as $ } from "../node_modules/react-icons/io/index.js";
4
- import e from "styled-components";
2
+ import { FiPlus as m, FiMinus as f } from "../node_modules/react-icons/fi/index.js";
3
+ import { IoMdArrowDropup as $, IoMdArrowDropdown as u } from "../node_modules/react-icons/io/index.js";
4
+ import s from "styled-components";
5
5
  import { device as t } from "../constants/breakPoints.constant.js";
6
- import u from "../assets/svg/Riyal.svg.js";
7
- const j = e.div`
6
+ import j from "../assets/svg/Riyal.svg.js";
7
+ const w = s.div`
8
8
  display: flex;
9
9
  width: 100%;
10
10
  height: 4rem;
@@ -12,8 +12,8 @@ const j = e.div`
12
12
  border: 1px solid ${({ theme: r }) => r.colors.grey.n100};
13
13
  overflow: hidden;
14
14
  background-color: ${({ theme: r }) => r.colors.grey.n50};
15
- `, w = e.div`
16
- border: 1px solid ${({ theme: r }) => r.colors.grey.n150};
15
+ `, b = s.div`
16
+ /* border: 1px solid ${({ theme: r }) => r.colors.grey.n150}; */
17
17
  flex: 1;
18
18
  display: flex;
19
19
  flex-direction: column;
@@ -24,7 +24,14 @@ const j = e.div`
24
24
  @media ${t.tablet} {
25
25
  padding: ${({ theme: r }) => r.spacing.xxs} ${({ theme: r }) => r.spacing.xs};
26
26
  }
27
- `, v = e.div`
27
+ ${({ $isLast: r, theme: e }) => !r && `
28
+ border-right: 1px solid ${e.colors.grey.n150};
29
+ [dir='rtl'] {
30
+ border-right: none !important;
31
+ border-left: 1px solid ${e.colors.grey.n150};
32
+ }
33
+ `}
34
+ `, v = s.div`
28
35
  display: flex;
29
36
  align-items: center;
30
37
  font-size: ${({ theme: r }) => r.typography.sizes.s3};
@@ -33,7 +40,7 @@ const j = e.div`
33
40
  @media ${t.tablet} {
34
41
  font-size: ${({ theme: r }) => r.typography.sizes.s1};
35
42
  }
36
- `, b = e.div`
43
+ `, z = s.div`
37
44
  width: 2.0625rem;
38
45
  height: 0.75rem;
39
46
  display: flex;
@@ -43,25 +50,25 @@ const j = e.div`
43
50
  font-weight: 600;
44
51
  font-size: ${({ theme: r }) => r.typography.sizes.s1};
45
52
  line-height: 0.8125rem;
46
- color: ${({ theme: r, state: s }) => s === "negative" ? r.colors.state.error.n450 : r.colors.grey.n650};
53
+ color: ${({ theme: r, state: e }) => e === "negative" ? r.colors.state.error.n450 : r.colors.grey.n650};
47
54
  svg {
48
- color: ${({ theme: r, state: s }) => s === "negative" ? r.colors.state.error.n450 : r.colors.grey.n650};
55
+ color: ${({ theme: r, state: e }) => e === "negative" ? r.colors.state.error.n450 : r.colors.grey.n650};
49
56
  flex-shrink: 0;
50
57
  }
51
- `, p = e.div`
58
+ `, p = s.div`
52
59
  display: flex;
53
60
  align-items: center;
54
61
  justify-content: center;
55
62
  svg {
56
63
  width: 0.875rem;
57
64
  height: 0.875rem;
58
- color: ${({ theme: r, state: s }) => s === "positive" ? r.colors.state.success.n450 : r.colors.state.error.n450};
65
+ color: ${({ theme: r, state: e }) => e === "positive" ? r.colors.state.success.n450 : r.colors.state.error.n450};
59
66
  }
60
- `, z = e.div`
67
+ `, I = s.div`
61
68
  display: flex;
62
69
  align-items: center;
63
70
  gap: ${({ theme: r }) => r.spacing.xxs};
64
- `, I = e.div`
71
+ `, A = s.div`
65
72
  font-size: ${({ theme: r }) => r.typography.sizes.s6};
66
73
  font-weight: bold;
67
74
  color: ${({ theme: r }) => r.colors.grey.n800};
@@ -69,18 +76,18 @@ const j = e.div`
69
76
  @media ${t.tablet} {
70
77
  font-size: ${({ theme: r }) => r.typography.sizes.s3};
71
78
  }
72
- `, A = e.span`
79
+ `, R = s.span`
73
80
  font-size: ${({ theme: r }) => r.typography.sizes.s3};
74
81
  color: ${({ theme: r }) => r.colors.grey.n400};
75
82
  @media ${t.tablet} {
76
83
  font-size: ${({ theme: r }) => r.typography.sizes.s1};
77
84
  }
78
- `, R = e.img`
85
+ `, k = s.img`
79
86
  width: ${({ $width: r = "1rem" }) => r};
80
87
  height: 1rem;
81
88
  object-fit: contain;
82
89
  flex-shrink: 0;
83
- `, k = e.div`
90
+ `, C = s.div`
84
91
  width: 1.5rem;
85
92
  height: 1.5rem;
86
93
  border: none;
@@ -93,42 +100,43 @@ const j = e.div`
93
100
  height: 1rem;
94
101
  color: ${({ theme: r }) => r.colors.grey.n400};
95
102
  }
96
- `, C = ({
103
+ `, D = ({
97
104
  title: r,
98
- amount: s,
105
+ amount: e,
99
106
  decimal: i = "00",
100
- percentage: d,
107
+ percentage: a,
101
108
  state: n,
102
109
  indicators: h,
103
110
  variant: g = "currency",
104
- icon: x
111
+ icon: x,
112
+ $isLast: y
105
113
  }) => {
106
- const { arrow: c = !0, sign: l = !0, percentage: a = !0 } = h || {};
107
- return /* @__PURE__ */ o.jsxs(w, { children: [
114
+ const { arrow: c = !0, sign: l = !0, percentage: d = !0 } = h || {};
115
+ return /* @__PURE__ */ o.jsxs(b, { $isLast: y, children: [
108
116
  /* @__PURE__ */ o.jsxs(v, { children: [
109
117
  /* @__PURE__ */ o.jsx("span", { children: r }),
110
- (c || l || a) && /* @__PURE__ */ o.jsx(b, { state: n, children: n === "positive" ? /* @__PURE__ */ o.jsxs(o.Fragment, { children: [
111
- l && /* @__PURE__ */ o.jsx(y, {}),
112
- a && `${d}%`,
113
- c && /* @__PURE__ */ o.jsx(p, { state: n, children: /* @__PURE__ */ o.jsx(f, {}) })
114
- ] }) : /* @__PURE__ */ o.jsxs(o.Fragment, { children: [
115
- c && /* @__PURE__ */ o.jsx(p, { state: n, children: /* @__PURE__ */ o.jsx($, {}) }),
118
+ (c || l || d) && /* @__PURE__ */ o.jsx(z, { state: n, children: n === "positive" ? /* @__PURE__ */ o.jsxs(o.Fragment, { children: [
116
119
  l && /* @__PURE__ */ o.jsx(m, {}),
117
- a && `${d}%`
120
+ d && `${a}%`,
121
+ c && /* @__PURE__ */ o.jsx(p, { state: n, children: /* @__PURE__ */ o.jsx($, {}) })
122
+ ] }) : /* @__PURE__ */ o.jsxs(o.Fragment, { children: [
123
+ c && /* @__PURE__ */ o.jsx(p, { state: n, children: /* @__PURE__ */ o.jsx(u, {}) }),
124
+ l && /* @__PURE__ */ o.jsx(f, {}),
125
+ d && `${a}%`
118
126
  ] }) })
119
127
  ] }),
120
- /* @__PURE__ */ o.jsxs(z, { children: [
121
- g === "icon" ? /* @__PURE__ */ o.jsx(k, { children: x }) : /* @__PURE__ */ o.jsx(R, { src: u, alt: "Riyal" }),
122
- /* @__PURE__ */ o.jsxs(I, { children: [
123
- s,
124
- g !== "icon" && i && /* @__PURE__ */ o.jsxs(A, { children: [
128
+ /* @__PURE__ */ o.jsxs(I, { children: [
129
+ g === "icon" ? /* @__PURE__ */ o.jsx(C, { children: x }) : /* @__PURE__ */ o.jsx(k, { src: j, alt: "Riyal" }),
130
+ /* @__PURE__ */ o.jsxs(A, { children: [
131
+ e,
132
+ g !== "icon" && i && /* @__PURE__ */ o.jsxs(R, { children: [
125
133
  ".",
126
134
  i
127
135
  ] })
128
136
  ] })
129
137
  ] })
130
138
  ] });
131
- }, B = ({ data: r }) => /* @__PURE__ */ o.jsx(j, { children: r.map((s, i) => /* @__PURE__ */ o.jsx(C, { ...s }, i)) });
139
+ }, E = ({ data: r }) => /* @__PURE__ */ o.jsx(w, { children: r.map((e, i) => /* @__PURE__ */ o.jsx(D, { ...e, $isLast: i === r.length - 1 }, i)) });
132
140
  export {
133
- B as default
141
+ E as default
134
142
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "qaema-ui",
3
3
  "private": false,
4
- "version": "0.0.52",
4
+ "version": "0.0.53",
5
5
  "type": "module",
6
6
  "publishConfig": {
7
7
  "access": "public"