qaema-ui 0.0.60 → 0.0.62

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.
@@ -38,7 +38,7 @@ const u = i.div`
38
38
  const t = g(d ?? "default");
39
39
  return /* @__PURE__ */ e.jsxs(u, { bgColor: r, $variantStyles: t, children: [
40
40
  n && /* @__PURE__ */ e.jsx(f, { src: n, alt: "badge-image" }),
41
- s && /* @__PURE__ */ e.jsx(m, { variant: "span", color: o ?? t.color, weight: c, children: s }),
41
+ s && /* @__PURE__ */ e.jsx(m, { variant: "span", color: o ?? t.color, weight: c ?? "semiBold", children: s }),
42
42
  l,
43
43
  a && /* @__PURE__ */ e.jsx(h, { onClick: a, $variantStyles: t, children: /* @__PURE__ */ e.jsx(p, { color: o ?? t.color, size: "0.75rem" }) })
44
44
  ] });
@@ -6,28 +6,28 @@ import Y from "../../Pagination.js";
6
6
  import Z from "../../Typography.js";
7
7
  import O, { CheckboxCell as H } from "./components/CellComponents.js";
8
8
  import z from "./components/TableHead.js";
9
- import { TableContainer as D, LoadingOverlay as k, TablesWrapper as F, DataScrollBox as R, StyledTable as w, TableBody as W, EmptyState as ee, TableRow as y, TableCellContainer as b, ActionsTable as te, TableFooter as ne } from "./Table.styles.js";
9
+ import { TableContainer as D, LoadingOverlay as k, TablesWrapper as F, DataScrollBox as R, StyledTable as w, TableBody as W, EmptyState as ee, TableRow as y, TableCellContainer as b, ActionsTable as te, TableFooter as se } from "./Table.styles.js";
10
10
  function xe({
11
11
  columns: T,
12
- data: n,
12
+ data: s,
13
13
  keyField: l,
14
14
  selectable: j = !1,
15
- onRowSelect: m,
15
+ onRowSelect: o,
16
16
  rowActions: x,
17
17
  stickyHeader: $ = !1,
18
18
  loading: f = !1,
19
19
  emptyStateMessage: I,
20
- pagination: s,
20
+ pagination: n,
21
21
  onRowClick: u,
22
22
  rowClassName: p,
23
23
  isRowDisabled: d,
24
- breakpoint: _ = "md",
24
+ breakpoint: N = "md",
25
25
  alignHeader: C = "start",
26
26
  // Dropdown related props
27
- isTableHeadVisible: K = !1,
27
+ isTableHeadVisible: _ = !1,
28
28
  isRowSelected: S
29
29
  }) {
30
- const [h, g] = v([]), [B, P] = v(_), [M, A] = v(null), { t: N } = U();
30
+ const [h, g] = v([]), [B, a] = v(N), [K, A] = v(null), { t: M } = U();
31
31
  L(() => {
32
32
  const e = () => {
33
33
  A(null);
@@ -38,31 +38,31 @@ function xe({
38
38
  }, []), L(() => {
39
39
  const e = () => {
40
40
  const i = window.innerWidth;
41
- i < 576 ? P("sm") : i < 992 ? P("md") : P("lg");
41
+ i < 576 ? a("sm") : i < 992 ? a("md") : a("lg");
42
42
  };
43
43
  return e(), window.addEventListener("resize", e), () => window.removeEventListener("resize", e);
44
44
  }, []);
45
- const a = Q(() => T.filter((e) => typeof e.hidden == "function" ? !e.hidden(B) : !e.hidden), [T, B]), V = () => {
46
- h.length === n.length ? g([]) : g([...n]), m && m(h.length === n.length ? [] : [...n]);
45
+ const P = Q(() => T.filter((e) => typeof e.hidden == "function" ? !e.hidden(B) : !e.hidden), [T, B]), V = () => {
46
+ h.length === s.length ? g([]) : g([...s]), o && o(h.length === s.length ? [] : [...s]);
47
47
  }, q = (e) => {
48
48
  const i = h.filter((r) => e[l] === r[l]);
49
49
  return i && i.length > 0;
50
50
  }, G = (e) => {
51
- const i = h.some((o) => o[l] === e[l]);
51
+ const i = h.some((m) => m[l] === e[l]);
52
52
  let r;
53
- i ? r = h.filter((o) => o[l] !== e[l]) : r = [...h, e], g(r), m && m(r);
53
+ i ? r = h.filter((m) => m[l] !== e[l]) : r = [...h, e], g(r), o && o(r);
54
54
  };
55
55
  return /* @__PURE__ */ t.jsxs(D, { children: [
56
56
  f && /* @__PURE__ */ t.jsx(k, { children: /* @__PURE__ */ t.jsx(X, { size: "3rem" }) }),
57
57
  /* @__PURE__ */ t.jsxs(F, { children: [
58
58
  /* @__PURE__ */ t.jsx(R, { children: /* @__PURE__ */ t.jsxs(w, { children: [
59
- K && /* @__PURE__ */ t.jsx(
59
+ _ && /* @__PURE__ */ t.jsx(
60
60
  z,
61
61
  {
62
- data: n,
62
+ data: s,
63
63
  handleSelectAll: V,
64
64
  selectedRows: h,
65
- visibleColumns: a,
65
+ visibleColumns: P,
66
66
  alignHeader: C,
67
67
  rowActions: void 0,
68
68
  stickyHeader: $,
@@ -70,12 +70,12 @@ function xe({
70
70
  loading: f
71
71
  }
72
72
  ),
73
- /* @__PURE__ */ t.jsx(W, { children: n.length === 0 ? /* @__PURE__ */ t.jsx("tr", { children: /* @__PURE__ */ t.jsx("td", { colSpan: (j ? 1 : 0) + a.length, children: /* @__PURE__ */ t.jsx(ee, { children: /* @__PURE__ */ t.jsx(Z, { variant: "mdText", children: I ?? N("NO_DATA_AVAILABLE") }) }) }) }) : n == null ? void 0 : n.map((e, i) => {
74
- const r = (d == null ? void 0 : d(e)) ?? !1, o = S ? S(e) : h.some((c) => c[l] === e[l]), E = e[l], J = (p == null ? void 0 : p(e, i)) ?? "";
73
+ /* @__PURE__ */ t.jsx(W, { children: s.length === 0 ? /* @__PURE__ */ t.jsx("tr", { children: /* @__PURE__ */ t.jsx("td", { colSpan: (j ? 1 : 0) + P.length, children: /* @__PURE__ */ t.jsx(ee, { children: /* @__PURE__ */ t.jsx(Z, { variant: "mdText", children: I ?? M("NO_DATA_AVAILABLE") }) }) }) }) : s == null ? void 0 : s.map((e, i) => {
74
+ const r = (d == null ? void 0 : d(e)) ?? !1, m = S ? S(e) : h.some((c) => c[l] === e[l]), E = e[l], J = (p == null ? void 0 : p(e, i)) ?? "";
75
75
  return /* @__PURE__ */ t.jsxs(
76
76
  y,
77
77
  {
78
- $selected: o,
78
+ $selected: m,
79
79
  $disabled: r,
80
80
  $clickable: !!u && !r,
81
81
  onClick: () => !r && (u == null ? void 0 : u(e)),
@@ -93,13 +93,14 @@ function xe({
93
93
  }
94
94
  }
95
95
  ) }),
96
- a.map((c) => /* @__PURE__ */ t.jsx(b, { $align: c.align, children: /* @__PURE__ */ t.jsx(
96
+ P.map((c) => /* @__PURE__ */ t.jsx(b, { $align: c.align, children: /* @__PURE__ */ t.jsx(
97
97
  O,
98
98
  {
99
99
  column: c,
100
100
  row: e,
101
101
  type: c.cellType ?? "text",
102
102
  align: c.align,
103
+ className: c.className,
103
104
  width: c.width ?? "",
104
105
  minWidth: c.minWidth ?? "",
105
106
  maxWidth: c.maxWidth ?? ""
@@ -115,7 +116,7 @@ function xe({
115
116
  /* @__PURE__ */ t.jsx(
116
117
  z,
117
118
  {
118
- data: n,
119
+ data: s,
119
120
  handleSelectAll: () => {
120
121
  },
121
122
  selectedRows: h,
@@ -127,7 +128,7 @@ function xe({
127
128
  loading: f
128
129
  }
129
130
  ),
130
- /* @__PURE__ */ t.jsx(W, { children: n.length === 0 ? /* @__PURE__ */ t.jsx("tr", { children: /* @__PURE__ */ t.jsx("td", { children: /* @__PURE__ */ t.jsx("div", { style: { height: "3.5rem" } }) }) }) : n == null ? void 0 : n.map((e) => {
131
+ /* @__PURE__ */ t.jsx(W, { children: s.length === 0 ? /* @__PURE__ */ t.jsx("tr", { children: /* @__PURE__ */ t.jsx("td", { children: /* @__PURE__ */ t.jsx("div", { style: { height: "3.5rem" } }) }) }) : s == null ? void 0 : s.map((e) => {
131
132
  const i = (d == null ? void 0 : d(e)) ?? !1;
132
133
  return /* @__PURE__ */ t.jsx(y, { $disabled: i, children: /* @__PURE__ */ t.jsx(b, { $align: "center", $isActionCell: !0, children: /* @__PURE__ */ t.jsx(
133
134
  O,
@@ -137,7 +138,7 @@ function xe({
137
138
  iconOptions: {
138
139
  keyField: l,
139
140
  rowActions: x,
140
- activeDropdown: M,
141
+ activeDropdown: K,
141
142
  setActiveDropdown: A
142
143
  }
143
144
  }
@@ -145,21 +146,21 @@ function xe({
145
146
  }) })
146
147
  ] })
147
148
  ] }),
148
- s && s.enabled && /* @__PURE__ */ t.jsx(ne, { children: /* @__PURE__ */ t.jsx(
149
+ n && n.enabled && /* @__PURE__ */ t.jsx(se, { children: /* @__PURE__ */ t.jsx(
149
150
  Y,
150
151
  {
151
- currentPage: s.currentPage,
152
- totalPages: s.totalPages,
153
- onChange: s.onPageChange,
152
+ currentPage: n.currentPage,
153
+ totalPages: n.totalPages,
154
+ onChange: n.onPageChange,
154
155
  disabled: f,
155
- hidePrevButton: s.hidePrevButton,
156
- hideNextButton: s.hideNextButton,
157
- siblingCount: s.siblingCount,
158
- boundaryCount: s.boundaryCount,
159
- itemsPerPage: s.pageSize,
160
- totalItems: s.totalItems,
161
- itemsPerPageOptions: s.itemsPerPageOptions,
162
- onItemsPerPageChange: s.onItemsPerPageChange
156
+ hidePrevButton: n.hidePrevButton,
157
+ hideNextButton: n.hideNextButton,
158
+ siblingCount: n.siblingCount,
159
+ boundaryCount: n.boundaryCount,
160
+ itemsPerPage: n.pageSize,
161
+ totalItems: n.totalItems,
162
+ itemsPerPageOptions: n.itemsPerPageOptions,
163
+ onItemsPerPageChange: n.onItemsPerPageChange
163
164
  }
164
165
  ) })
165
166
  ] });
@@ -4,6 +4,7 @@ export type TableColumn<T> = {
4
4
  id: string;
5
5
  header: string | React.ReactNode;
6
6
  accessor: keyof T | ((row: T) => React.ReactNode);
7
+ className?: string;
7
8
  width?: string;
8
9
  minWidth?: string;
9
10
  maxWidth?: string;
@@ -18,21 +18,21 @@ const p = r.div`
18
18
  `, d = r.div`
19
19
  display: flex;
20
20
  align-items: center;
21
- `, u = ({ onHeaderBack: e, headerTitle: o, withRightIcon: s }) => {
22
- const a = c().dir === "rtl", i = s;
21
+ `, u = ({ onHeaderBack: e, headerTitle: s, withRightIcon: o }) => {
22
+ const a = c().dir === "rtl", i = o;
23
23
  return /* @__PURE__ */ t.jsxs(p, { children: [
24
24
  /* @__PURE__ */ t.jsxs(d, { children: [
25
25
  e && /* @__PURE__ */ t.jsx(
26
26
  n,
27
27
  {
28
- icon: /* @__PURE__ */ t.jsx(m, { style: a ? { transform: "rotate(180deg)" } : {} }),
28
+ icon: /* @__PURE__ */ t.jsx(m, { style: a ? { transform: "rotate(180deg)" } : {}, size: 20 }),
29
29
  onClick: e,
30
30
  onlyIcon: !0,
31
31
  size: "md",
32
32
  variant: "outline-primary"
33
33
  }
34
34
  ),
35
- /* @__PURE__ */ t.jsx(l, { variant: "h3", children: o })
35
+ /* @__PURE__ */ t.jsx(l, { variant: "h3", children: s })
36
36
  ] }),
37
37
  i && /* @__PURE__ */ t.jsx(n, { icon: /* @__PURE__ */ t.jsx(i, {}), onClick: e, onlyIcon: !0, size: "md", variant: "outline-primary" })
38
38
  ] });
@@ -1,12 +1,12 @@
1
1
  import { j as n } from "../_virtual/jsx-runtime.js";
2
2
  import { useState as c } from "react";
3
- import { FaSearch as f } from "../node_modules/react-icons/fa/index.js";
3
+ import { FaSearch as u } from "../node_modules/react-icons/fa/index.js";
4
4
  import a, { useTheme as y } from "styled-components";
5
5
  import { useQaemaCoreTranslation as x } from "../i18n/i18n.js";
6
6
  import { a as h } from "../node_modules/@react-spring/web/dist/react-spring_web.modern.js";
7
7
  import { useSpring as b } from "../node_modules/@react-spring/core/dist/react-spring_core.modern.js";
8
- import w from "../node_modules/react-bootstrap/esm/Button.js";
9
- import $ from "../node_modules/react-bootstrap/esm/Form.js";
8
+ import $ from "../node_modules/react-bootstrap/esm/Button.js";
9
+ import w from "../node_modules/react-bootstrap/esm/Form.js";
10
10
  const j = a(h.div)`
11
11
  display: flex;
12
12
  flex-direction: row;
@@ -17,14 +17,14 @@ const j = a(h.div)`
17
17
  background-color: ${({ theme: e }) => e.colors.grey.n50};
18
18
  overflow: hidden;
19
19
  height: 2rem;
20
- `, v = a(w)`
20
+ `, v = a($)`
21
21
  border: none;
22
22
  padding: 0 0.5rem;
23
23
  background-color: transparent;
24
24
  display: flex;
25
25
  align-items: center;
26
26
  justify-content: center;
27
- `, E = a($.Control)`
27
+ `, E = a(w.Control)`
28
28
  border: none;
29
29
  background-color: transparent;
30
30
  height: 2rem;
@@ -38,7 +38,8 @@ const j = a(h.div)`
38
38
  }
39
39
 
40
40
  &::placeholder {
41
- color: ${({ theme: e }) => e.colors.grey.n300};
41
+ color: ${({ theme: e }) => e.colors.grey.n350};
42
+ font-size: ${({ theme: e }) => e.typography.sizes.s3};
42
43
  }
43
44
  `, I = ({ placeholder: e, onSearch: r }) => {
44
45
  const i = y(), { t: p } = x(), [m, l] = c(!1), [o, d] = c(""), t = m || !!o, g = b({
@@ -46,7 +47,7 @@ const j = a(h.div)`
46
47
  paddingLeft: t ? i.spacing.s : "0rem",
47
48
  paddingRight: t ? i.spacing.s : "0rem",
48
49
  config: { tension: 250, friction: 20 }
49
- }), u = (s) => {
50
+ }), f = (s) => {
50
51
  s.key === "Enter" && r && r(o);
51
52
  };
52
53
  return /* @__PURE__ */ n.jsxs(j, { style: g, onMouseEnter: () => l(!0), onMouseLeave: () => l(!1), children: [
@@ -56,7 +57,7 @@ const j = a(h.div)`
56
57
  onClick: () => {
57
58
  (o == null ? void 0 : o.length) > 0 && r && r(o);
58
59
  },
59
- children: /* @__PURE__ */ n.jsx(f, { color: i.colors.grey.n400, size: "1rem" })
60
+ children: /* @__PURE__ */ n.jsx(u, { color: i.colors.grey.n400, size: "1rem" })
60
61
  }
61
62
  ),
62
63
  t && /* @__PURE__ */ n.jsx(
@@ -67,7 +68,7 @@ const j = a(h.div)`
67
68
  onChange: (s) => {
68
69
  s.target.value == "" && o ? (r == null || r(""), d("")) : d(s.target.value);
69
70
  },
70
- onKeyDown: u,
71
+ onKeyDown: f,
71
72
  autoFocus: !0
72
73
  }
73
74
  )
@@ -1,7 +1,8 @@
1
- import { j as i } from "../_virtual/jsx-runtime.js";
1
+ import { j as o } from "../_virtual/jsx-runtime.js";
2
2
  import { useState as m, useEffect as H } from "react";
3
- import { FaTimesCircle as O, FaSearch as R } from "../node_modules/react-icons/fa/index.js";
4
- import o, { useTheme as X } from "styled-components";
3
+ import { FaTimesCircle as O } from "../node_modules/react-icons/fa/index.js";
4
+ import { FiSearch as R } from "../node_modules/react-icons/fi/index.js";
5
+ import n, { useTheme as X } from "styled-components";
5
6
  import { device as S } from "../constants/breakPoints.constant.js";
6
7
  import K from "../hooks/useZIndex.js";
7
8
  import { useQaemaCoreTranslation as M } from "../i18n/i18n.js";
@@ -12,7 +13,7 @@ import b from "./NavItem.js";
12
13
  import w from "./Typography.js";
13
14
  import Z from "../node_modules/react-bootstrap/esm/Button.js";
14
15
  import _ from "../node_modules/react-bootstrap/esm/Form.js";
15
- const v = o.div`
16
+ const v = n.div`
16
17
  direction: ${({ theme: r }) => r == null ? void 0 : r.dir};
17
18
  position: fixed;
18
19
  top: 0;
@@ -43,16 +44,16 @@ const v = o.div`
43
44
  ${({ theme: r }) => {
44
45
  if ((r == null ? void 0 : r.dir) === "rtl") return `padding-left: 0 !important;padding-right: ${r.spacing.xs};`;
45
46
  }}
46
- `, A = o.div`
47
+ `, A = n.div`
47
48
  display: flex;
48
49
  flex-direction: row;
49
50
  width: 100%;
50
51
  justify-content: space-between;
51
- `, J = o.div`
52
+ `, J = n.div`
52
53
  padding-right: ${({ theme: r }) => r.spacing.sm};
53
54
  padding-left: ${({ theme: r }) => r.spacing.sm};
54
55
  cursor: pointer;
55
- `, Q = o.div`
56
+ `, Q = n.div`
56
57
  display: none;
57
58
 
58
59
  @media ${S.tablet} {
@@ -64,15 +65,15 @@ const v = o.div`
64
65
  height: 1.5rem;
65
66
  }
66
67
  }
67
- `, q = o.div`
68
+ `, q = n.div`
68
69
  padding-right: ${({ theme: r }) => r.spacing.s};
69
70
  padding-left: ${({ theme: r }) => r.spacing.s};
70
- `, G = o.div`
71
+ `, G = n.div`
71
72
  justify-content: space-between;
72
73
  display: flex;
73
74
  flex-direction: column;
74
75
  height: 100%;
75
- `, Y = o.div`
76
+ `, Y = n.div`
76
77
  display: flex;
77
78
  flex-direction: row;
78
79
  gap: ${({ theme: r }) => r.spacing.xxs};
@@ -80,7 +81,7 @@ const v = o.div`
80
81
  background-color: ${({ theme: r }) => r.colors.grey.n150};
81
82
  border: 1px solid transparent;
82
83
  border-radius: ${({ theme: r }) => r.borderRadius.lg};
83
- `, P = o(Z)`
84
+ `, P = n(Z)`
84
85
  border: none;
85
86
  padding: 0;
86
87
  margin-top: ${({ theme: r }) => r.spacing.xxs};
@@ -90,16 +91,22 @@ const v = o.div`
90
91
  svg {
91
92
  background-color: ${({ theme: r }) => r.colors.grey.n150};
92
93
  }
93
- `, I = o(_.Control)`
94
+ `, I = n(_.Control)`
94
95
  padding: ${({ theme: r }) => r.spacing.xxs};
95
96
  border: none;
96
97
  background-color: ${({ theme: r }) => r.colors.grey.n150};
97
98
  color: ${({ theme: r }) => r.colors.grey.n350};
99
+ font-size: ${({ theme: r }) => r.typography.sizes.s4};
98
100
 
99
101
  &:focus-visible {
100
102
  outline: none;
101
103
  }
102
- `, rr = o.div`
104
+
105
+ &::placeholder {
106
+ font-size: ${({ theme: r }) => r.typography.sizes.s4} !important;
107
+ color: ${({ theme: r }) => r.colors.grey.n350} !important;
108
+ }
109
+ `, rr = n.div`
103
110
  padding-right: ${({ theme: r }) => r.spacing.s};
104
111
  button {
105
112
  width: 100%;
@@ -108,89 +115,89 @@ const v = o.div`
108
115
  ${({ theme: r }) => {
109
116
  if ((r == null ? void 0 : r.dir) === "rtl") return `padding-right: 0 !important;padding-left: ${r.spacing.s};`;
110
117
  }}
111
- `, nr = o(w)`
118
+ `, ir = n(w)`
112
119
  padding-right: ${({ theme: r }) => r.spacing.s};
113
120
  padding-left: ${({ theme: r }) => r.spacing.s};
114
121
  margin-top: 0;
115
122
  margin-bottom: ${({ theme: r }) => r.spacing.xs};
116
- `, ir = o.div`
123
+ `, or = n.div`
117
124
  padding: ${({ theme: r }) => r.spacing.m};
118
125
  text-align: center;
119
- `, or = o.div`
126
+ `, nr = n.div`
120
127
  button {
121
128
  width: 100%;
122
129
  border-radius: ${({ theme: r }) => r.spacing.xxs};
123
130
  }
124
- `, sr = o(U)`
131
+ `, sr = n(U)`
125
132
  margin-left: -${({ theme: r }) => r.spacing.xs};
126
133
  width: calc(100% + ${({ theme: r }) => r.spacing.xs});
127
134
  ${({ theme: r }) => {
128
135
  if ((r == null ? void 0 : r.dir) === "rtl") return `margin-left: 0; margin-right: -${r.spacing.xs}; width: calc(100% + ${r.spacing.xs});`;
129
136
  }}
130
137
  margin-bottom: ${({ theme: r }) => r.spacing.sm};
131
- `, mr = (r) => {
132
- const { logoSrc: C, searchPlaceHolder: k, categories: a, linkComponent: f, open: T, setOpen: E, currentPath: u, extraSideMenuItems: l, onLogoClick: D } = r, p = X(), { t: L } = M(), B = K("sidemenu"), [c, F] = m(""), [d, N] = m(a), g = (n) => {
138
+ `, jr = (r) => {
139
+ const { logoSrc: C, searchPlaceHolder: k, categories: p, linkComponent: f, open: z, setOpen: T, currentPath: u, extraSideMenuItems: l, onLogoClick: E } = r, a = X(), { t: D } = M(), L = K("sidemenu"), [c, B] = m(""), [t, F] = m(p), g = (i) => {
133
140
  const e = [];
134
- a == null || a.forEach((t) => {
141
+ p == null || p.forEach((d) => {
135
142
  var h;
136
- const s = (h = t == null ? void 0 : t.navItems) == null ? void 0 : h.filter((x) => {
143
+ const s = (h = d == null ? void 0 : d.navItems) == null ? void 0 : h.filter((x) => {
137
144
  var $, y;
138
- return (y = ($ = x == null ? void 0 : x.title) == null ? void 0 : $.toLowerCase()) == null ? void 0 : y.includes(n == null ? void 0 : n.toLowerCase());
145
+ return (y = ($ = x == null ? void 0 : x.title) == null ? void 0 : $.toLowerCase()) == null ? void 0 : y.includes(i == null ? void 0 : i.toLowerCase());
139
146
  });
140
- (s == null ? void 0 : s.length) > 0 && e.push({ ...t, navItems: s });
141
- }), N(e);
142
- }, W = (n) => {
143
- n.key === "Enter" && g(c);
147
+ (s == null ? void 0 : s.length) > 0 && e.push({ ...d, navItems: s });
148
+ }), F(e);
149
+ }, N = (i) => {
150
+ i.key === "Enter" && g(c);
144
151
  };
145
152
  H(() => {
146
153
  c === "" && g(c);
147
154
  }, [c]);
148
- const z = (n, e) => n ? e === n || (e == null ? void 0 : e.startsWith(n + "/")) : !1;
149
- return /* @__PURE__ */ i.jsxs(v, { className: T ? "active" : "", $zIndex: B, children: [
150
- /* @__PURE__ */ i.jsxs(A, { children: [
151
- /* @__PURE__ */ i.jsx(J, { onClick: D, children: /* @__PURE__ */ i.jsx(V, { src: C, width: "6.336rem", height: "2rem" }) }),
152
- /* @__PURE__ */ i.jsx(Q, { onClick: () => E(!1), children: /* @__PURE__ */ i.jsx(O, { color: p.colors.primary.purple.n450 }) })
155
+ const W = (i, e) => i ? e === i || (e == null ? void 0 : e.startsWith(i + "/")) : !1;
156
+ return /* @__PURE__ */ o.jsxs(v, { className: z ? "active" : "", $zIndex: L, children: [
157
+ /* @__PURE__ */ o.jsxs(A, { children: [
158
+ /* @__PURE__ */ o.jsx(J, { onClick: E, children: /* @__PURE__ */ o.jsx(V, { src: C, width: "6.336rem", height: "2rem" }) }),
159
+ /* @__PURE__ */ o.jsx(Q, { onClick: () => T(!1), children: /* @__PURE__ */ o.jsx(O, { color: a.colors.primary.purple.n450 }) })
153
160
  ] }),
154
- /* @__PURE__ */ i.jsx(q, { children: /* @__PURE__ */ i.jsxs(Y, { children: [
155
- /* @__PURE__ */ i.jsx(
161
+ /* @__PURE__ */ o.jsx(q, { children: /* @__PURE__ */ o.jsxs(Y, { children: [
162
+ /* @__PURE__ */ o.jsx(
156
163
  P,
157
164
  {
158
165
  onClick: () => {
159
166
  g(c);
160
167
  },
161
- children: /* @__PURE__ */ i.jsx(R, { color: p.colors.grey.n350 })
168
+ children: /* @__PURE__ */ o.jsx(R, { color: a.colors.grey.n350, size: 20 })
162
169
  }
163
170
  ),
164
- /* @__PURE__ */ i.jsx(
171
+ /* @__PURE__ */ o.jsx(
165
172
  I,
166
173
  {
167
174
  placeholder: k ?? "Search",
168
175
  value: c,
169
- onChange: (n) => {
170
- F(n.target.value);
176
+ onChange: (i) => {
177
+ B(i.target.value);
171
178
  },
172
- onKeyDown: W
179
+ onKeyDown: N
173
180
  }
174
181
  )
175
182
  ] }) }),
176
- /* @__PURE__ */ i.jsxs(G, { children: [
177
- /* @__PURE__ */ i.jsxs("div", { children: [
178
- (d == null ? void 0 : d.length) === 0 && /* @__PURE__ */ i.jsx(ir, { children: /* @__PURE__ */ i.jsx(w, { variant: "smText", children: L("NO_RESULTS_FOUND") }) }),
179
- (d == null ? void 0 : d.length) > 0 && (d == null ? void 0 : d.map((n) => {
180
- var e, t;
181
- return ((e = n == null ? void 0 : n.navItems) == null ? void 0 : e.length) === 0 ? null : /* @__PURE__ */ i.jsxs(rr, { className: n == null ? void 0 : n.code, children: [
182
- /* @__PURE__ */ i.jsx(nr, { variant: "xsText", color: p.colors.grey.n300, children: n == null ? void 0 : n.title }),
183
- (t = n == null ? void 0 : n.navItems) == null ? void 0 : t.map((s) => /* @__PURE__ */ i.jsx(j, { to: (s == null ? void 0 : s.path) ?? "/", component: f, wrapper: !0, children: /* @__PURE__ */ i.jsx(b, { item: { variant: "normal", active: z(s.path, u), ...s } }) }, s == null ? void 0 : s.path))
184
- ] }, n == null ? void 0 : n.title);
183
+ /* @__PURE__ */ o.jsxs(G, { children: [
184
+ /* @__PURE__ */ o.jsxs("div", { children: [
185
+ (t == null ? void 0 : t.length) === 0 && /* @__PURE__ */ o.jsx(or, { children: /* @__PURE__ */ o.jsx(w, { variant: "smText", children: D("NO_RESULTS_FOUND") }) }),
186
+ (t == null ? void 0 : t.length) > 0 && (t == null ? void 0 : t.map((i) => {
187
+ var e, d;
188
+ return ((e = i == null ? void 0 : i.navItems) == null ? void 0 : e.length) === 0 ? null : /* @__PURE__ */ o.jsxs(rr, { className: i == null ? void 0 : i.code, children: [
189
+ /* @__PURE__ */ o.jsx(ir, { variant: "xsText", color: a.colors.grey.n300, children: i == null ? void 0 : i.title }),
190
+ (d = i == null ? void 0 : i.navItems) == null ? void 0 : d.map((s) => /* @__PURE__ */ o.jsx(j, { to: (s == null ? void 0 : s.path) ?? "/", component: f, wrapper: !0, children: /* @__PURE__ */ o.jsx(b, { item: { variant: "normal", active: W(s.path, u), ...s } }) }, s == null ? void 0 : s.path))
191
+ ] }, i == null ? void 0 : i.title);
185
192
  }))
186
193
  ] }),
187
- /* @__PURE__ */ i.jsxs(or, { children: [
188
- (l == null ? void 0 : l.length) > 0 && /* @__PURE__ */ i.jsx(sr, { color: p.colors.grey.n150 }),
189
- l == null ? void 0 : l.map((n) => /* @__PURE__ */ i.jsx(j, { to: (n == null ? void 0 : n.path) ?? "/", component: f, wrapper: !0, children: /* @__PURE__ */ i.jsx(b, { item: { variant: "normal", active: u === n.path, ...n } }) }, n == null ? void 0 : n.path))
194
+ /* @__PURE__ */ o.jsxs(nr, { children: [
195
+ (l == null ? void 0 : l.length) > 0 && /* @__PURE__ */ o.jsx(sr, { color: a.colors.grey.n150 }),
196
+ l == null ? void 0 : l.map((i) => /* @__PURE__ */ o.jsx(j, { to: (i == null ? void 0 : i.path) ?? "/", component: f, wrapper: !0, children: /* @__PURE__ */ o.jsx(b, { item: { variant: "normal", active: u === i.path, ...i } }) }, i == null ? void 0 : i.path))
190
197
  ] })
191
198
  ] })
192
199
  ] });
193
200
  };
194
201
  export {
195
- mr as default
202
+ jr as default
196
203
  };
@@ -7,10 +7,11 @@ import j from "../assets/svg/Riyal.svg.js";
7
7
  const w = s.div`
8
8
  display: flex;
9
9
  width: 100%;
10
- height: 4rem;
10
+ height: 5rem;
11
11
  border-radius: ${({ theme: r }) => r.borderRadius.md};
12
12
  border: 1px solid ${({ theme: r }) => r.colors.grey.n100};
13
- overflow: hidden;
13
+ overflow-x: auto;
14
+ overflow-y: hidden;
14
15
  background-color: ${({ theme: r }) => r.colors.grey.n50};
15
16
  `, b = s.div`
16
17
  /* border: 1px solid ${({ theme: r }) => r.colors.grey.n150}; */
@@ -19,7 +20,7 @@ const w = s.div`
19
20
  flex-direction: column;
20
21
  justify-content: center;
21
22
  padding: 0.625rem ${({ theme: r }) => r.spacing.s};
22
- gap: ${({ theme: r }) => r.spacing.xxs};
23
+
23
24
  background-color: ${({ theme: r }) => r.colors.grey.n50};
24
25
  @media ${t.tablet} {
25
26
  padding: ${({ theme: r }) => r.spacing.xxs} ${({ theme: r }) => r.spacing.xs};
@@ -48,7 +49,7 @@ const w = s.div`
48
49
  justify-content: start;
49
50
  font-family: 'Noto Sans Display', sans-serif;
50
51
  font-weight: 600;
51
- font-size: ${({ theme: r }) => r.typography.sizes.s1};
52
+ font-size: ${({ theme: r }) => r.typography.sizes.s2};
52
53
  line-height: 0.8125rem;
53
54
  color: ${({ theme: r, state: e }) => e === "negative" ? r.colors.state.error.n450 : r.colors.grey.n650};
54
55
  svg {
@@ -108,11 +109,11 @@ const w = s.div`
108
109
  state: n,
109
110
  indicators: h,
110
111
  variant: g = "currency",
111
- icon: x,
112
- $isLast: y
112
+ icon: y,
113
+ $isLast: x
113
114
  }) => {
114
115
  const { arrow: c = !0, sign: l = !0, percentage: d = !0 } = h || {};
115
- return /* @__PURE__ */ o.jsxs(b, { $isLast: y, children: [
116
+ return /* @__PURE__ */ o.jsxs(b, { $isLast: x, children: [
116
117
  /* @__PURE__ */ o.jsxs(v, { children: [
117
118
  /* @__PURE__ */ o.jsx("span", { children: r }),
118
119
  (c || l || d) && /* @__PURE__ */ o.jsx(z, { state: n, children: n === "positive" ? /* @__PURE__ */ o.jsxs(o.Fragment, { children: [
@@ -126,7 +127,7 @@ const w = s.div`
126
127
  ] }) })
127
128
  ] }),
128
129
  /* @__PURE__ */ o.jsxs(I, { children: [
129
- g === "icon" ? /* @__PURE__ */ o.jsx(C, { children: x }) : /* @__PURE__ */ o.jsx(k, { src: j, alt: "Riyal" }),
130
+ g === "icon" ? /* @__PURE__ */ o.jsx(C, { children: y }) : /* @__PURE__ */ o.jsx(k, { src: j, alt: "Riyal" }),
130
131
  /* @__PURE__ */ o.jsxs(A, { children: [
131
132
  e,
132
133
  g !== "icon" && i && /* @__PURE__ */ o.jsxs(R, { children: [
@@ -1,102 +1,107 @@
1
1
  import { j as t } from "../../_virtual/jsx-runtime.js";
2
- import { useState as v, useEffect as E, useMemo as G } from "react";
3
- import { useTranslation as J } from "react-i18next";
4
- import N from "../Spinner.js";
5
- import Q from "../Pagination.js";
6
- import U from "../Typography.js";
7
- import L, { CheckboxCell as X } from "./components/CellComponents.js";
2
+ import { useState as p, useRef as Q, useCallback as U, useEffect as T, useMemo as X } from "react";
3
+ import { useTranslation as Y } from "react-i18next";
4
+ import Z from "../Spinner.js";
5
+ import D from "../Pagination.js";
6
+ import k from "../Typography.js";
7
+ import W, { CheckboxCell as F } from "./components/CellComponents.js";
8
8
  import O from "./components/TableHead.js";
9
- import { TableContainer as Y, LoadingOverlay as Z, TablesWrapper as H, DataScrollBox as D, StyledTable as k, TableBody as z, EmptyState as F, TableRow as W, TableCellContainer as b, ActionsTable as R, TableFooter as w } from "./Table.styles.js";
10
- function de({
11
- columns: T,
12
- data: i,
13
- keyField: r,
14
- selectable: u = !1,
15
- onRowSelect: x,
9
+ import { TableContainer as R, LoadingOverlay as w, TablesWrapper as ee, DataScrollBox as te, StyledTable as re, TableBody as y, EmptyState as ne, TableRow as I, TableCellContainer as $, ActionsTable as se, TableFooter as le } from "./Table.styles.js";
10
+ function fe({
11
+ columns: C,
12
+ data: s,
13
+ keyField: l,
14
+ selectable: g = !1,
15
+ onRowSelect: a,
16
16
  rowActions: m,
17
- stickyHeader: $ = !1,
18
- loading: a = !1,
19
- emptyStateMessage: y,
20
- pagination: n,
21
- onRowClick: f,
22
- rowClassName: j,
17
+ stickyHeader: B = !1,
18
+ loading: x = !1,
19
+ emptyStateMessage: N,
20
+ pagination: r,
21
+ onRowClick: u,
22
+ rowClassName: b,
23
23
  isRowDisabled: d,
24
- breakpoint: I = "md",
25
- alignHeader: C = "start"
24
+ breakpoint: _ = "md",
25
+ alignHeader: E = "start"
26
26
  }) {
27
- const [h, p] = v([]), [S, g] = v(I), [_, B] = v(null), { t: K } = J();
28
- E(() => {
27
+ const [h, v] = p([]), [L, P] = p(_), [K, z] = p(null), [M, V] = p(!1), f = Q(null), { t: q } = Y(), j = U(() => {
28
+ f.current && V(f.current.scrollWidth > f.current.clientWidth);
29
+ }, []);
30
+ T(() => (j(), window.addEventListener("resize", j), () => window.removeEventListener("resize", j)), [j, s]), T(() => {
29
31
  const e = () => {
30
- B(null);
32
+ z(null);
31
33
  };
32
34
  return document.addEventListener("click", e), () => {
33
35
  document.removeEventListener("click", e);
34
36
  };
35
- }, []), E(() => {
37
+ }, []), T(() => {
36
38
  const e = () => {
37
- const l = window.innerWidth;
38
- l < 576 ? g("sm") : l < 992 ? g("md") : g("lg");
39
+ const i = window.innerWidth;
40
+ i < 576 ? P("sm") : i < 992 ? P("md") : P("lg");
39
41
  };
40
42
  return e(), window.addEventListener("resize", e), () => window.removeEventListener("resize", e);
41
43
  }, []);
42
- const P = G(() => T.filter((e) => typeof e.hidden == "function" ? !e.hidden(S) : !e.hidden), [T, S]), M = () => {
43
- h.length === i.length ? p([]) : p([...i]), x && x(h.length === i.length ? [] : [...i]);
44
- }, V = (e) => {
45
- const l = h.filter((s) => e[r] === s[r]);
46
- return l && l.length > 0;
47
- }, q = (e) => {
48
- const l = h.some((o) => o[r] === e[r]);
49
- let s;
50
- l ? s = h.filter((o) => o[r] !== e[r]) : s = [...h, e], p(s), x && x(s);
44
+ const S = X(() => C.filter((e) => typeof e.hidden == "function" ? !e.hidden(L) : !e.hidden), [C, L]), G = () => {
45
+ h.length === s.length ? v([]) : v([...s]), a && a(h.length === s.length ? [] : [...s]);
46
+ }, H = (e) => {
47
+ const i = h.filter((n) => e[l] === n[l]);
48
+ return i && i.length > 0;
49
+ }, J = (e) => {
50
+ const i = h.some((o) => o[l] === e[l]);
51
+ let n;
52
+ i ? n = h.filter((o) => o[l] !== e[l]) : n = [...h, e], v(n), a && a(n);
51
53
  };
52
- return /* @__PURE__ */ t.jsxs(Y, { children: [
53
- a && /* @__PURE__ */ t.jsx(Z, { children: /* @__PURE__ */ t.jsx(N, { size: "3rem" }) }),
54
- /* @__PURE__ */ t.jsxs(H, { children: [
55
- /* @__PURE__ */ t.jsx(D, { children: /* @__PURE__ */ t.jsxs(k, { children: [
54
+ return /* @__PURE__ */ t.jsxs(R, { children: [
55
+ x && /* @__PURE__ */ t.jsx(w, { children: /* @__PURE__ */ t.jsx(Z, { size: "3rem" }) }),
56
+ /* @__PURE__ */ t.jsxs(ee, { children: [
57
+ /* @__PURE__ */ t.jsx(te, { ref: f, children: /* @__PURE__ */ t.jsxs(re, { children: [
56
58
  /* @__PURE__ */ t.jsx(
57
59
  O,
58
60
  {
59
- data: i,
60
- handleSelectAll: M,
61
+ data: s,
62
+ handleSelectAll: G,
61
63
  selectedRows: h,
62
- visibleColumns: P,
63
- alignHeader: C,
64
+ visibleColumns: S,
65
+ alignHeader: E,
64
66
  rowActions: void 0,
65
- stickyHeader: $,
66
- selectable: u,
67
- loading: a
67
+ stickyHeader: B,
68
+ selectable: g,
69
+ loading: x
68
70
  }
69
71
  ),
70
- /* @__PURE__ */ t.jsx(z, { children: i.length === 0 ? /* @__PURE__ */ t.jsx("tr", { children: /* @__PURE__ */ t.jsx("td", { colSpan: (u ? 1 : 0) + P.length, children: /* @__PURE__ */ t.jsx(F, { children: /* @__PURE__ */ t.jsx(U, { variant: "mdText", children: y ?? K("NO_DATA_AVAILABLE") }) }) }) }) : i.map((e, l) => {
71
- const s = (d == null ? void 0 : d(e)) ?? !1, o = h.some((c) => c[r] === e[r]), A = e[r];
72
+ /* @__PURE__ */ t.jsx(y, { children: s.length === 0 ? /* @__PURE__ */ t.jsx("tr", { children: /* @__PURE__ */ t.jsx("td", { colSpan: (g ? 1 : 0) + S.length, children: /* @__PURE__ */ t.jsx(ne, { children: /* @__PURE__ */ t.jsx(k, { variant: "mdText", children: N ?? q("NO_DATA_AVAILABLE") }) }) }) }) : s.map((e, i) => {
73
+ const n = (d == null ? void 0 : d(e)) ?? !1, o = h.some((c) => c[l] === e[l]), A = e[l];
72
74
  return /* @__PURE__ */ t.jsxs(
73
- W,
75
+ I,
74
76
  {
75
77
  $selected: o,
76
- $disabled: s,
77
- $clickable: !!f && !s,
78
- onClick: () => !s && (f == null ? void 0 : f(e)),
79
- className: (j == null ? void 0 : j(e, l)) ?? "",
78
+ $disabled: n,
79
+ $clickable: !!u && !n,
80
+ onClick: () => {
81
+ n || u == null || u(e);
82
+ },
83
+ className: (b == null ? void 0 : b(e, i)) ?? "",
80
84
  children: [
81
- u && /* @__PURE__ */ t.jsx(b, { $align: "center", $isFirstColumn: !0, children: /* @__PURE__ */ t.jsx(
82
- X,
85
+ g && /* @__PURE__ */ t.jsx($, { $align: "center", $isFirstColumn: !0, children: /* @__PURE__ */ t.jsx(
86
+ F,
83
87
  {
84
88
  checkBoxOptions: {
85
- checked: V(e),
89
+ checked: H(e),
86
90
  $variant: "primary",
87
- $disabled: s,
91
+ $disabled: n,
88
92
  $size: "sm",
89
- onChange: () => !s && q(e)
93
+ onChange: () => !n && J(e)
90
94
  }
91
95
  }
92
96
  ) }),
93
- P.map((c) => /* @__PURE__ */ t.jsx(b, { $align: c.align, children: /* @__PURE__ */ t.jsx(
94
- L,
97
+ S.map((c) => /* @__PURE__ */ t.jsx($, { $align: c.align, children: /* @__PURE__ */ t.jsx(
98
+ W,
95
99
  {
96
100
  column: c,
97
101
  row: e,
98
102
  type: c.cellType ?? "text",
99
103
  align: c.align,
104
+ className: c.className,
100
105
  width: c.width ?? "",
101
106
  minWidth: c.minWidth ?? "",
102
107
  maxWidth: c.maxWidth ?? ""
@@ -108,59 +113,59 @@ function de({
108
113
  );
109
114
  }) })
110
115
  ] }) }),
111
- m && m.length > 0 && /* @__PURE__ */ t.jsxs(R, { children: [
116
+ m && m.length > 0 && /* @__PURE__ */ t.jsxs(se, { $hasScrollbar: M, children: [
112
117
  /* @__PURE__ */ t.jsx(
113
118
  O,
114
119
  {
115
- data: i,
120
+ data: s,
116
121
  handleSelectAll: () => {
117
122
  },
118
123
  selectedRows: h,
119
124
  visibleColumns: [],
120
- alignHeader: C,
125
+ alignHeader: E,
121
126
  rowActions: m,
122
- stickyHeader: $,
127
+ stickyHeader: B,
123
128
  selectable: !1,
124
- loading: a
129
+ loading: x
125
130
  }
126
131
  ),
127
- /* @__PURE__ */ t.jsx(z, { children: i.length === 0 ? /* @__PURE__ */ t.jsx("tr", { children: /* @__PURE__ */ t.jsx("td", { children: /* @__PURE__ */ t.jsx("div", { style: { height: "3.5rem" } }) }) }) : i.map((e) => {
128
- const l = (d == null ? void 0 : d(e)) ?? !1;
129
- return /* @__PURE__ */ t.jsx(W, { $disabled: l, children: /* @__PURE__ */ t.jsx(b, { $align: "center", $isActionCell: !0, children: /* @__PURE__ */ t.jsx(
130
- L,
132
+ /* @__PURE__ */ t.jsx(y, { children: s.length === 0 ? /* @__PURE__ */ t.jsx("tr", { children: /* @__PURE__ */ t.jsx("td", { children: /* @__PURE__ */ t.jsx("div", { style: { height: "3.5rem" } }) }) }) : s.map((e) => {
133
+ const i = (d == null ? void 0 : d(e)) ?? !1;
134
+ return /* @__PURE__ */ t.jsx(I, { $disabled: i, children: /* @__PURE__ */ t.jsx($, { $align: "center", $isActionCell: !0, children: /* @__PURE__ */ t.jsx(
135
+ W,
131
136
  {
132
137
  row: e,
133
138
  type: "icon",
134
139
  iconOptions: {
135
- keyField: r,
140
+ keyField: l,
136
141
  rowActions: m,
137
- activeDropdown: _,
138
- setActiveDropdown: B
142
+ activeDropdown: K,
143
+ setActiveDropdown: z
139
144
  }
140
145
  }
141
- ) }) }, `action-${e[r]}`);
146
+ ) }) }, `action-${e[l]}`);
142
147
  }) })
143
148
  ] })
144
149
  ] }),
145
- n && n.enabled && /* @__PURE__ */ t.jsx(w, { children: /* @__PURE__ */ t.jsx(
146
- Q,
150
+ r && r.enabled && /* @__PURE__ */ t.jsx(le, { children: /* @__PURE__ */ t.jsx(
151
+ D,
147
152
  {
148
- currentPage: n.currentPage,
149
- totalPages: n.totalPages,
150
- onChange: n.onPageChange,
151
- disabled: a,
152
- hidePrevButton: n.hidePrevButton,
153
- hideNextButton: n.hideNextButton,
154
- siblingCount: n.siblingCount,
155
- boundaryCount: n.boundaryCount,
156
- itemsPerPage: n.pageSize,
157
- totalItems: n.totalItems,
158
- itemsPerPageOptions: n.itemsPerPageOptions,
159
- onItemsPerPageChange: n.onItemsPerPageChange
153
+ currentPage: r.currentPage,
154
+ totalPages: r.totalPages,
155
+ onChange: r.onPageChange,
156
+ disabled: x,
157
+ hidePrevButton: r.hidePrevButton,
158
+ hideNextButton: r.hideNextButton,
159
+ siblingCount: r.siblingCount,
160
+ boundaryCount: r.boundaryCount,
161
+ itemsPerPage: r.pageSize,
162
+ totalItems: r.totalItems,
163
+ itemsPerPageOptions: r.itemsPerPageOptions,
164
+ onItemsPerPageChange: r.onItemsPerPageChange
160
165
  }
161
166
  ) })
162
167
  ] });
163
168
  }
164
169
  export {
165
- de as default
170
+ fe as default
166
171
  };
@@ -53,6 +53,8 @@ export declare const TablesWrapper: import("styled-components/dist/types").IStyl
53
53
  export declare const DataScrollBox: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<Omit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>, "ref"> & {
54
54
  ref?: ((instance: HTMLDivElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLDivElement> | null | undefined;
55
55
  }, never>> & string;
56
- export declare const ActionsTable: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<Omit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").TableHTMLAttributes<HTMLTableElement>, HTMLTableElement>, never>, "ref"> & {
56
+ export declare const ActionsTable: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<Omit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").TableHTMLAttributes<HTMLTableElement>, HTMLTableElement>, never>, "ref"> & {
57
57
  ref?: ((instance: HTMLTableElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLTableElement> | null | undefined;
58
- }, never>> & string;
58
+ }, {
59
+ $hasScrollbar?: boolean;
60
+ }>> & string;
@@ -1,4 +1,4 @@
1
- import r, { css as n } from "styled-components";
1
+ import r, { css as e } from "styled-components";
2
2
  import { Scrollbar as s } from "../../styles/Scrollbar.styles.js";
3
3
  r.button`
4
4
  background: none;
@@ -52,7 +52,7 @@ const a = r.div`
52
52
  color: ${({ theme: o }) => o.colors.grey.n600};
53
53
 
54
54
  &:hover {
55
- background-color: ${({ theme: o, $disabled: e }) => e ? "transparent" : o.colors.primary.purple.n100};
55
+ background-color: ${({ theme: o, $disabled: n }) => n ? "transparent" : o.colors.primary.purple.n100};
56
56
  }
57
57
 
58
58
  svg {
@@ -62,7 +62,7 @@ const a = r.div`
62
62
  width: 100%;
63
63
  position: relative;
64
64
  border-radius: ${({ theme: o }) => o.borderRadius.md};
65
- box-shadow: ${({ theme: o }) => o.boxShadow.s2};
65
+ /* box-shadow: ${({ theme: o }) => o.boxShadow.s2}; */
66
66
  background-color: ${({ theme: o }) => o.colors.grey.n50};
67
67
  overflow-x: hidden;
68
68
  overflow-y: auto;
@@ -79,7 +79,7 @@ r(s)`
79
79
  -webkit-overflow-scrolling: touch;
80
80
  `;
81
81
  const u = r.thead`
82
- ${({ $sticky: o }) => o && n`
82
+ ${({ $sticky: o }) => o && e`
83
83
  top: 0;
84
84
  `}
85
85
  `, $ = r.tr`
@@ -99,61 +99,73 @@ const u = r.thead`
99
99
  height: 3.5rem;
100
100
 
101
101
  /* Apply sticky positioning for first and last columns */
102
- ${({ $isFirstColumn: o }) => o && n`
102
+ ${({ $isFirstColumn: o }) => o && e`
103
103
  left: 0;
104
104
  /* z-index: 2; */
105
105
  `}
106
106
 
107
- ${({ $isLastColumn: o }) => o && n`
107
+ ${({ $isLastColumn: o }) => o && e`
108
108
  right: 0;
109
109
  /* z-index: 2; */
110
110
  text-align: end;
111
111
  `}
112
- ${({ $isActionCell: o }) => o && n`
113
- padding: ${({ theme: e }) => e.spacing.sm} 0;
112
+ ${({ $isActionCell: o }) => o && e`
113
+ padding: ${({ theme: n }) => n.spacing.sm} 0;
114
114
  text-align: center;
115
115
  `}
116
116
 
117
117
  &:hover {
118
- ${({ $sortable: o }) => o && n`
119
- background-color: ${({ theme: e }) => e.colors.grey.n150};
118
+ ${({ $sortable: o }) => o && e`
119
+ background-color: ${({ theme: n }) => n.colors.grey.n150};
120
120
  `}
121
121
  }
122
- `, y = r.tbody``, x = r.tr`
123
- background-color: ${({ theme: o, $selected: e }) => e ? o.colors.primary.purple.n100 : o.colors.grey.n50};
122
+ `, y = r.tbody``, m = r.tr`
123
+ background-color: ${({ theme: o, $selected: n }) => n ? o.colors.primary.purple.n100 : o.colors.grey.n50};
124
124
  height: 3.5rem;
125
- ${({ $disabled: o }) => o && n`
125
+ transition: background-color 0.2s;
126
+
127
+ ${({ $disabled: o }) => o && e`
126
128
  opacity: 0.6;
127
129
  pointer-events: none;
128
130
  `}
129
131
 
130
- ${({ $clickable: o }) => o && n`
132
+ ${({ $clickable: o }) => o && e`
131
133
  cursor: pointer;
132
134
  `}
133
- `, h = r.td`
135
+
136
+ &:hover {
137
+ ${({ $disabled: o }) => !o && e`
138
+ background-color: ${({ theme: n }) => n.colors.grey.n100};
139
+
140
+ td {
141
+ background-color: ${({ theme: n }) => n.colors.grey.n100};
142
+ }
143
+ `}
144
+ }
145
+ `, x = r.td`
134
146
  padding: ${({ theme: o }) => o.spacing.s} ${({ theme: o }) => o.spacing.sm};
135
147
  text-align: ${({ $align: o }) => o ?? "left"};
136
- /* border-bottom: 1px solid ${({ theme: o }) => o.colors.grey.n150}; */
148
+ border-bottom: 1px solid ${({ theme: o }) => o.colors.grey.n150};
137
149
  color: ${({ theme: o }) => o.colors.grey.n700};
138
150
  /* min-height: 3.5rem;
139
151
  max-height: 3.5rem; */
140
152
  background-color: ${({ theme: o }) => o.colors.grey.n50};
141
153
  /* height: 3.5rem; */
142
154
  /* Apply sticky positioning for first and last columns */
143
- ${({ $isFirstColumn: o }) => o && n`
155
+ ${({ $isFirstColumn: o }) => o && e`
144
156
  z-index: 1;
145
157
  left: 0;
146
158
  `}
147
159
 
148
- ${({ $isLastColumn: o }) => o && n`
160
+ ${({ $isLastColumn: o }) => o && e`
149
161
  right: 0;
150
162
  width: 0px;
151
163
  z-index: 1;
152
164
  background-color: transparent;
153
165
  `}
154
166
 
155
- ${({ $isActionCell: o }) => o && n`
156
- padding: 0 ${({ theme: e }) => e.spacing.sm};
167
+ ${({ $isActionCell: o }) => o && e`
168
+ padding: 0 ${({ theme: n }) => n.spacing.sm};
157
169
  `}
158
170
  `;
159
171
  r.span`
@@ -161,7 +173,7 @@ r.span`
161
173
  align-items: center;
162
174
  margin-left: ${({ theme: o }) => o.spacing.xxs};
163
175
  `;
164
- const m = r.div`
176
+ const h = r.div`
165
177
  display: flex;
166
178
  justify-content: center;
167
179
  align-items: center;
@@ -192,30 +204,30 @@ r.span`
192
204
  font-size: ${({ theme: o }) => o.typography.sizes.s2};
193
205
  font-weight: ${({ theme: o }) => o.typography.weights.semiBold};
194
206
 
195
- ${({ theme: o, $variant: e }) => {
196
- switch (e) {
207
+ ${({ theme: o, $variant: n }) => {
208
+ switch (n) {
197
209
  case "primary":
198
- return n`
210
+ return e`
199
211
  background-color: ${o.colors.primary.purple.n100};
200
212
  color: ${o.colors.primary.purple.n500};
201
213
  `;
202
214
  case "success":
203
- return n`
215
+ return e`
204
216
  background-color: ${o.colors.state.success.n100};
205
217
  color: ${o.colors.state.success.n500};
206
218
  `;
207
219
  case "warning":
208
- return n`
220
+ return e`
209
221
  background-color: ${o.colors.secondary.yellow.n200};
210
222
  color: ${o.colors.secondary.yellow.n600};
211
223
  `;
212
224
  case "error":
213
- return n`
225
+ return e`
214
226
  background-color: ${o.colors.state.error.n100};
215
227
  color: ${o.colors.state.error.n500};
216
228
  `;
217
229
  default:
218
- return n`
230
+ return e`
219
231
  background-color: ${o.colors.grey.n200};
220
232
  color: ${o.colors.grey.n600};
221
233
  `;
@@ -228,8 +240,8 @@ r.span`
228
240
  height: 0.5rem;
229
241
  border-radius: 50%;
230
242
  margin-right: ${({ theme: o }) => o.spacing.xxs};
231
- background-color: ${({ theme: o, $status: e }) => {
232
- switch (e) {
243
+ background-color: ${({ theme: o, $status: n }) => {
244
+ switch (n) {
233
245
  case "success":
234
246
  return o.colors.state.success.n500;
235
247
  case "warning":
@@ -245,9 +257,11 @@ const k = r.div`
245
257
  display: flex;
246
258
  position: relative;
247
259
  width: 100%;
260
+ gap: 0;
248
261
  `, v = r(s)`
249
262
  flex: 1 1 auto;
250
263
  overflow-x: auto;
264
+ overflow-y: hidden;
251
265
  min-width: 0;
252
266
  &::-webkit-scrollbar {
253
267
  height: ${({ theme: o }) => o.spacing.s};
@@ -256,12 +270,11 @@ const k = r.div`
256
270
  height: ${({ theme: o }) => o.spacing.s};
257
271
  }
258
272
  `, T = r(t)`
259
- /* position: sticky;
260
- right: 0; */
261
273
  flex: 0 0 auto;
262
- width: 6rem; /* adjust to your icon width */
274
+ width: auto;
263
275
  table-layout: fixed;
264
276
  background-color: ${({ theme: o }) => o.colors.grey.n50};
277
+ margin-bottom: ${({ theme: o, $hasScrollbar: n }) => n ? o.spacing.s : "0"};
265
278
  `;
266
279
  export {
267
280
  T as ActionsTable,
@@ -275,11 +288,11 @@ export {
275
288
  t as StyledTable,
276
289
  u as StyledTableHead,
277
290
  y as TableBody,
278
- h as TableCellContainer,
291
+ x as TableCellContainer,
279
292
  g as TableContainer,
280
- m as TableFooter,
293
+ h as TableFooter,
281
294
  b as TableHeaderCell,
282
295
  $ as TableHeaderRow,
283
- x as TableRow,
296
+ m as TableRow,
284
297
  k as TablesWrapper
285
298
  };
@@ -4,6 +4,7 @@ export type TableColumn<T> = {
4
4
  id: string;
5
5
  header: string | React.ReactNode;
6
6
  accessor: keyof T | ((row: T) => React.ReactNode);
7
+ className?: string;
7
8
  width?: string;
8
9
  minWidth?: string;
9
10
  maxWidth?: string;
@@ -49,6 +50,7 @@ export type TableProps<T> = {
49
50
  onItemsPerPageChange?: (itemsPerPage: number) => void;
50
51
  };
51
52
  onRowClick?: (row: T) => void;
53
+ onClickView?: (row: T) => void;
52
54
  rowClassName?: (row: T, index: number) => string;
53
55
  isRowDisabled?: (row: T) => boolean;
54
56
  breakpoint?: string;
@@ -25,7 +25,7 @@ const i = g.div`
25
25
  duplicate: /* @__PURE__ */ r.jsx(j, {}),
26
26
  approve: /* @__PURE__ */ r.jsx(u, {}),
27
27
  print: /* @__PURE__ */ r.jsx(u, {})
28
- }, R = (e) => E[e.toLowerCase()] ?? null, D = ({ data: e, type: t, width: s, maxWidth: n, minWidth: o }) => /* @__PURE__ */ r.jsx(i, { width: s, maxWidth: n, minWidth: o, children: e && /* @__PURE__ */ r.jsx(d, { data: e, type: t, width: s }) }), L = ({ data: e, type: t, width: s, maxWidth: n, minWidth: o }) => /* @__PURE__ */ r.jsx(i, { width: s, maxWidth: n, minWidth: o, children: e && /* @__PURE__ */ r.jsx(d, { data: e, type: t, width: s }) }), M = ({ data: e, type: t, width: s, maxWidth: n, minWidth: o }) => /* @__PURE__ */ r.jsx(i, { width: s, maxWidth: n, minWidth: o, children: e && /* @__PURE__ */ r.jsx(d, { data: e, type: t, width: s }) }), S = ({ data: e, type: t, width: s, maxWidth: n, minWidth: o }) => /* @__PURE__ */ r.jsx(i, { width: s, maxWidth: n, minWidth: o, children: e && /* @__PURE__ */ r.jsx(d, { data: e, type: t, width: s }) }), V = ({ data: e, type: t, width: s, maxWidth: n, minWidth: o }) => /* @__PURE__ */ r.jsx(i, { width: s, maxWidth: n, minWidth: o, children: e && /* @__PURE__ */ r.jsx(b, { data: e, type: t, width: s }) }), H = ({ data: e, width: t, maxWidth: s, minWidth: n }) => /* @__PURE__ */ r.jsx(i, { width: t, maxWidth: s, minWidth: n, children: /* @__PURE__ */ r.jsx($, { value: e.value, direction: e.transactionType }) }), K = ({ checkBoxOptions: e, width: t, maxWidth: s, minWidth: n }) => {
28
+ }, R = (e) => E[e.toLowerCase()] ?? null, D = ({ data: e, type: t, width: s, maxWidth: n, minWidth: o }) => /* @__PURE__ */ r.jsx(i, { width: s, maxWidth: n, minWidth: o, children: e && /* @__PURE__ */ r.jsx(d, { data: e, type: t, width: s }) }), L = ({ data: e, type: t, width: s, maxWidth: n, minWidth: o }) => /* @__PURE__ */ r.jsx(i, { width: s, maxWidth: n, minWidth: o, children: e && /* @__PURE__ */ r.jsx(d, { data: e, type: t, width: s }) }), M = ({ data: e, type: t, width: s, maxWidth: n, minWidth: o }) => /* @__PURE__ */ r.jsx(i, { width: s, maxWidth: n, minWidth: o, children: e && /* @__PURE__ */ r.jsx(d, { data: e, type: t, width: s }) }), S = ({ data: e, type: t, width: s, maxWidth: n, minWidth: o, className: c }) => /* @__PURE__ */ r.jsx(i, { className: c, width: s, maxWidth: n, minWidth: o, children: e && /* @__PURE__ */ r.jsx(d, { data: e, type: t, width: s }) }), V = ({ data: e, type: t, width: s, maxWidth: n, minWidth: o }) => /* @__PURE__ */ r.jsx(i, { width: s, maxWidth: n, minWidth: o, children: e && /* @__PURE__ */ r.jsx(b, { data: e, type: t, width: s }) }), H = ({ data: e, width: t, maxWidth: s, minWidth: n }) => /* @__PURE__ */ r.jsx(i, { width: t, maxWidth: s, minWidth: n, children: /* @__PURE__ */ r.jsx($, { value: e.value, direction: e.transactionType }) }), K = ({ checkBoxOptions: e, width: t, maxWidth: s, minWidth: n }) => {
29
29
  const o = e ? { ...e, name: e.name ?? "" } : void 0;
30
30
  return /* @__PURE__ */ r.jsx(i, { width: t, maxWidth: s, minWidth: n, children: /* @__PURE__ */ r.jsx(F, { ...o }) });
31
31
  }, P = ({ radioButtonOptions: e, width: t, maxWidth: s, minWidth: n }) => {
@@ -22,6 +22,9 @@ function u(t) {
22
22
  return r({ attr: { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "line", attr: { x1: "12", y1: "5", x2: "12", y2: "19" }, child: [] }, { tag: "line", attr: { x1: "5", y1: "12", x2: "19", y2: "12" }, child: [] }] })(t);
23
23
  }
24
24
  function s(t) {
25
+ return r({ attr: { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "circle", attr: { cx: "11", cy: "11", r: "8" }, child: [] }, { tag: "line", attr: { x1: "21", y1: "21", x2: "16.65", y2: "16.65" }, child: [] }] })(t);
26
+ }
27
+ function h(t) {
25
28
  return r({ attr: { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "line", attr: { x1: "18", y1: "6", x2: "6", y2: "18" }, child: [] }, { tag: "line", attr: { x1: "6", y1: "6", x2: "18", y2: "18" }, child: [] }] })(t);
26
29
  }
27
30
  export {
@@ -32,5 +35,6 @@ export {
32
35
  a as FiMinus,
33
36
  d as FiMoreHorizontal,
34
37
  u as FiPlus,
35
- s as FiX
38
+ s as FiSearch,
39
+ h as FiX
36
40
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "qaema-ui",
3
3
  "private": false,
4
- "version": "0.0.60",
4
+ "version": "0.0.62",
5
5
  "type": "module",
6
6
  "publishConfig": {
7
7
  "access": "public"