@yuno-payments/dashboard-design-system 2.4.2-rtl.4 → 2.4.2-rtl.7

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.
@@ -15,8 +15,8 @@ const d = s("font-sans", {
15
15
  xs: "text-xs font-medium leading-none",
16
16
  sm: "text-sm font-medium leading-none",
17
17
  muted: "text-sm text-muted-foreground",
18
- blockquote: "mt-6 border-l-2 pl-6 italic",
19
- list: "my-6 ml-6 list-disc [&>li]:mt-2"
18
+ blockquote: "mt-6 border-s-2 ps-6 italic",
19
+ list: "my-6 ms-6 list-disc [&>li]:mt-2"
20
20
  },
21
21
  weight: {
22
22
  regular: "font-normal",
@@ -52,12 +52,12 @@ function u(t) {
52
52
  }
53
53
  }
54
54
  const x = m(
55
- ({ className: t, variant: e = "p", weight: r, as: o, ...l }, a) => {
55
+ ({ className: t, variant: e = "p", weight: r, as: o, ...a }, l) => {
56
56
  const n = o || u(e ?? "p");
57
57
  return c(n, {
58
58
  className: i(d(r !== void 0 ? { variant: e, weight: r } : { variant: e }), t),
59
- ref: a,
60
- ...l
59
+ ref: l,
60
+ ...a
61
61
  });
62
62
  }
63
63
  );
@@ -1,48 +1,48 @@
1
1
  import { j as e } from "../../../_virtual/jsx-runtime.js";
2
- import * as r from "react";
3
- import { cn as a } from "../../../lib/utils.js";
4
- import { FieldLabel as A } from "../../../vendor/shadcn/field.js";
2
+ import * as l from "react";
3
+ import { cn as a, getDirection as A } from "../../../lib/utils.js";
4
+ import { FieldLabel as B } from "../../../vendor/shadcn/field.js";
5
5
  import { Icon as b } from "../../atoms/icon/icon.js";
6
- import { Combobox as B, ComboboxTrigger as H, ComboboxContent as J } from "../../../vendor/shadcn/combobox.js";
7
- import { Command as K, CommandInput as M, CommandList as P, CommandEmpty as Q, CommandGroup as U, CommandItem as G } from "../../../vendor/shadcn/command.js";
6
+ import { Combobox as H, ComboboxTrigger as J, ComboboxContent as K } from "../../../vendor/shadcn/combobox.js";
7
+ import { Command as M, CommandInput as P, CommandList as Q, CommandEmpty as U, CommandGroup as W, CommandItem as G } from "../../../vendor/shadcn/command.js";
8
8
  import { Typography as x } from "../../atoms/typography/typography.js";
9
- const W = r.forwardRef(
9
+ const X = l.forwardRef(
10
10
  ({
11
11
  label: j,
12
12
  description: N,
13
13
  error: u,
14
14
  optional: L = !1,
15
15
  placeholder: k = "Select an option",
16
- value: l,
16
+ value: r,
17
17
  defaultValue: p,
18
18
  onChange: h,
19
19
  disabled: f = !1,
20
20
  options: c = [],
21
- groups: o = [],
21
+ groups: i = [],
22
22
  className: E,
23
23
  id: g,
24
24
  searchPlaceholder: z = "Search",
25
25
  maxHeight: F = 300
26
26
  }, I) => {
27
- const [i, C] = r.useState(!1), [v, S] = r.useState(""), d = o.length > 0, w = c.length > 0, R = r.useCallback(() => {
28
- if (!l) return null;
27
+ const [o, C] = l.useState(!1), [v, S] = l.useState(""), d = i.length > 0, w = c.length > 0, D = l.useCallback(() => {
28
+ if (!r) return null;
29
29
  if (d)
30
- for (const s of o) {
31
- const n = s.options.find((t) => t.value === l);
30
+ for (const s of i) {
31
+ const n = s.options.find((t) => t.value === r);
32
32
  if (n) return n.label;
33
33
  }
34
34
  else if (w) {
35
- const s = c.find((n) => n.value === l);
35
+ const s = c.find((n) => n.value === r);
36
36
  if (s) return s.label;
37
37
  }
38
38
  return null;
39
- }, [l, o, c, d, w]), T = r.useCallback(
39
+ }, [r, i, c, d, w]), R = l.useCallback(
40
40
  (s) => {
41
41
  if (!s)
42
- return { filteredOptions: c, filteredGroups: o };
42
+ return { filteredOptions: c, filteredGroups: i };
43
43
  const n = s.toLowerCase();
44
44
  if (d) {
45
- const t = o.map((m) => ({
45
+ const t = i.map((m) => ({
46
46
  ...m,
47
47
  options: m.options.filter(
48
48
  (V) => V.label.toLowerCase().includes(n)
@@ -54,26 +54,26 @@ const W = r.forwardRef(
54
54
  (m) => m.label.toLowerCase().includes(n)
55
55
  ), filteredGroups: [] };
56
56
  },
57
- [c, o, d]
58
- ), { filteredOptions: q, filteredGroups: D } = T(v);
59
- r.useEffect(() => {
60
- i && setTimeout(() => {
57
+ [c, i, d]
58
+ ), { filteredOptions: T, filteredGroups: q } = R(v);
59
+ l.useEffect(() => {
60
+ o && setTimeout(() => {
61
61
  document.querySelector(
62
62
  '[data-slot="command-input"]'
63
63
  )?.focus();
64
64
  }, 0);
65
- }, [i]), r.useEffect(() => {
66
- i || S("");
67
- }, [i]), r.useEffect(() => {
68
- p && !l && h?.(p);
69
- }, [p, l, h]);
65
+ }, [o]), l.useEffect(() => {
66
+ o || S("");
67
+ }, [o]), l.useEffect(() => {
68
+ p && !r && h?.(p);
69
+ }, [p, r, h]);
70
70
  const y = (s) => {
71
71
  f || (h?.(s), C(!1));
72
- }, O = R();
73
- return /* @__PURE__ */ e.jsxs("div", { className: a("w-full", E), children: [
72
+ }, O = D();
73
+ return /* @__PURE__ */ e.jsxs("div", { dir: A(), className: a("w-full", E), children: [
74
74
  j && /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-1 mb-2", children: [
75
75
  /* @__PURE__ */ e.jsx(
76
- A,
76
+ B,
77
77
  {
78
78
  htmlFor: g,
79
79
  className: a(f && "text-muted-foreground"),
@@ -93,8 +93,8 @@ const W = r.forwardRef(
93
93
  children: N
94
94
  }
95
95
  ),
96
- /* @__PURE__ */ e.jsxs(B, { open: i, onOpenChange: C, children: [
97
- /* @__PURE__ */ e.jsx(H, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
96
+ /* @__PURE__ */ e.jsxs(H, { open: o, onOpenChange: C, children: [
97
+ /* @__PURE__ */ e.jsx(J, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
98
98
  "button",
99
99
  {
100
100
  ref: I,
@@ -102,7 +102,7 @@ const W = r.forwardRef(
102
102
  type: "button",
103
103
  disabled: f,
104
104
  role: "combobox",
105
- "aria-expanded": i,
105
+ "aria-expanded": o,
106
106
  "aria-haspopup": "listbox",
107
107
  className: a(
108
108
  "flex h-9 w-full items-center justify-between gap-2 rounded-md border border-input bg-input px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:text-muted- shadow-xs [&>span]:min-w-0 [&>span]:truncate",
@@ -130,17 +130,17 @@ const W = r.forwardRef(
130
130
  ]
131
131
  }
132
132
  ) }),
133
- /* @__PURE__ */ e.jsx(J, { className: "p-0", align: "start", children: /* @__PURE__ */ e.jsxs(K, { shouldFilter: !1, children: [
133
+ /* @__PURE__ */ e.jsx(K, { className: "p-0", align: "start", children: /* @__PURE__ */ e.jsxs(M, { shouldFilter: !1, children: [
134
134
  /* @__PURE__ */ e.jsx(
135
- M,
135
+ P,
136
136
  {
137
137
  placeholder: z,
138
138
  value: v,
139
139
  onValueChange: S
140
140
  }
141
141
  ),
142
- /* @__PURE__ */ e.jsxs(P, { style: { maxHeight: F }, children: [
143
- /* @__PURE__ */ e.jsx(Q, { children: /* @__PURE__ */ e.jsx(
142
+ /* @__PURE__ */ e.jsxs(Q, { style: { maxHeight: F }, children: [
143
+ /* @__PURE__ */ e.jsx(U, { children: /* @__PURE__ */ e.jsx(
144
144
  x,
145
145
  {
146
146
  variant: "sm",
@@ -148,7 +148,7 @@ const W = r.forwardRef(
148
148
  children: "No results found."
149
149
  }
150
150
  ) }),
151
- d ? D.map((s, n) => /* @__PURE__ */ e.jsxs(U, { children: [
151
+ d ? q.map((s, n) => /* @__PURE__ */ e.jsxs(W, { children: [
152
152
  s.label && /* @__PURE__ */ e.jsx("div", { className: "px-2 py-1.5 text-xs font-medium text-muted-foreground", children: s.label }),
153
153
  s.options.map((t) => /* @__PURE__ */ e.jsxs(
154
154
  G,
@@ -157,14 +157,14 @@ const W = r.forwardRef(
157
157
  onSelect: () => y(t.value),
158
158
  className: a(
159
159
  "cursor-pointer",
160
- l === t.value && "bg-accent"
160
+ r === t.value && "bg-accent"
161
161
  ),
162
162
  children: [
163
163
  /* @__PURE__ */ e.jsxs("span", { className: "flex items-center", children: [
164
164
  t.icon && /* @__PURE__ */ e.jsx("span", { className: "mr-2 inline-flex items-center", children: t.icon }),
165
165
  t.label
166
166
  ] }),
167
- l === t.value && /* @__PURE__ */ e.jsx(
167
+ r === t.value && /* @__PURE__ */ e.jsx(
168
168
  b,
169
169
  {
170
170
  name: "Check",
@@ -176,21 +176,21 @@ const W = r.forwardRef(
176
176
  },
177
177
  t.value
178
178
  ))
179
- ] }, n)) : q.map((s) => /* @__PURE__ */ e.jsxs(
179
+ ] }, n)) : T.map((s) => /* @__PURE__ */ e.jsxs(
180
180
  G,
181
181
  {
182
182
  value: s.value,
183
183
  onSelect: () => y(s.value),
184
184
  className: a(
185
185
  "cursor-pointer",
186
- l === s.value && "bg-accent"
186
+ r === s.value && "bg-accent"
187
187
  ),
188
188
  children: [
189
189
  /* @__PURE__ */ e.jsxs("span", { className: "flex items-center", children: [
190
190
  s.icon && /* @__PURE__ */ e.jsx("span", { className: "mr-2 inline-flex items-center", children: s.icon }),
191
191
  s.label
192
192
  ] }),
193
- l === s.value && /* @__PURE__ */ e.jsx(b, { name: "Check", size: "sm", className: "ml-auto" })
193
+ r === s.value && /* @__PURE__ */ e.jsx(b, { name: "Check", size: "sm", className: "ml-auto" })
194
194
  ]
195
195
  },
196
196
  s.value
@@ -202,7 +202,7 @@ const W = r.forwardRef(
202
202
  ] });
203
203
  }
204
204
  );
205
- W.displayName = "SearchSelect";
205
+ X.displayName = "SearchSelect";
206
206
  export {
207
- W as SearchSelect
207
+ X as SearchSelect
208
208
  };
@@ -1,24 +1,24 @@
1
1
  import { j as r } from "../../../_virtual/jsx-runtime.js";
2
- import { forwardRef as N, useMemo as h, useCallback as R } from "react";
3
- import { useReactTable as v, flexRender as x } from "../../../node_modules/@tanstack/react-table/build/lib/index.js";
4
- import { cn as n } from "../../../lib/utils.js";
5
- import { TableHeader as C, TableRow as m, TableHead as k, TableBody as D, TableCell as f, TableFooter as w } from "../../../vendor/shadcn/table.js";
2
+ import { forwardRef as N, useMemo as x, useCallback as R } from "react";
3
+ import { useReactTable as v, flexRender as f } from "../../../node_modules/@tanstack/react-table/build/lib/index.js";
4
+ import { cn as l } from "../../../lib/utils.js";
5
+ import { TableHeader as C, TableRow as c, TableHead as k, TableBody as D, TableCell as h, TableFooter as w } from "../../../vendor/shadcn/table.js";
6
6
  import { calculateTotalsRow as z, isActionsColumn as M } from "./aggregated-table.helpers.js";
7
7
  import { getCoreRowModel as H } from "../../../node_modules/@tanstack/table-core/build/lib/index.js";
8
8
  function K({
9
- rows: c,
10
- columns: l,
11
- aggregationLabel: d = "Total",
9
+ rows: d,
10
+ columns: n,
11
+ aggregationLabel: m = "Total",
12
12
  onRowClick: i,
13
13
  className: p,
14
14
  ...j
15
15
  }, y) {
16
- const g = h(
17
- () => l.some((t) => t.aggregationFn),
18
- [l]
19
- ), u = h(() => g ? z({ rows: c, columns: l, aggregationLabel: d }) : null, [c, l, d, g]), b = v({
20
- data: c,
21
- columns: l,
16
+ const g = x(
17
+ () => n.some((t) => t.aggregationFn),
18
+ [n]
19
+ ), u = x(() => g ? z({ rows: d, columns: n, aggregationLabel: m }) : null, [d, n, m, g]), b = v({
20
+ data: d,
21
+ columns: n,
22
22
  getCoreRowModel: H()
23
23
  }), A = R(
24
24
  (t, e) => {
@@ -30,14 +30,14 @@ function K({
30
30
  "div",
31
31
  {
32
32
  ref: y,
33
- className: n(
33
+ className: l(
34
34
  "h-full rounded-lg border border-border overflow-auto",
35
35
  p
36
36
  ),
37
37
  ...j,
38
38
  children: /* @__PURE__ */ r.jsxs("table", { className: "w-full h-full border-collapse", children: [
39
39
  /* @__PURE__ */ r.jsx(C, { className: "sticky top-0 z-10", children: b.getHeaderGroups().map((t) => /* @__PURE__ */ r.jsx(
40
- m,
40
+ c,
41
41
  {
42
42
  className: "border-b border-border bg-muted hover:bg-muted",
43
43
  children: t.headers.map((e, s) => {
@@ -45,17 +45,17 @@ function K({
45
45
  return /* @__PURE__ */ r.jsx(
46
46
  k,
47
47
  {
48
- className: n(
48
+ className: l(
49
49
  "h-12 px-4 text-sm font-medium text-muted-foreground bg-muted",
50
- s === 0 && "pl-6",
50
+ s === 0 && "ps-6",
51
51
  o?.headerAlign === "right" && "text-right",
52
- a && "sticky right-0 px-0"
52
+ a && "sticky end-0 px-0"
53
53
  ),
54
54
  style: {
55
55
  minWidth: e.column.columnDef.minSize,
56
56
  width: e.column.columnDef.size
57
57
  },
58
- children: e.isPlaceholder ? null : x(
58
+ children: e.isPlaceholder ? null : f(
59
59
  e.column.columnDef.header,
60
60
  e.getContext()
61
61
  )
@@ -68,9 +68,9 @@ function K({
68
68
  )) }),
69
69
  /* @__PURE__ */ r.jsxs(D, { children: [
70
70
  b.getRowModel().rows.map((t) => /* @__PURE__ */ r.jsx(
71
- m,
71
+ c,
72
72
  {
73
- className: n(
73
+ className: l(
74
74
  "h-12 border-b border-border bg-card text-foreground",
75
75
  "hover:bg-muted",
76
76
  i && "cursor-pointer"
@@ -79,16 +79,16 @@ function K({
79
79
  children: t.getVisibleCells().map((e, s) => {
80
80
  const o = e.column.columnDef.meta, a = o?.isActions;
81
81
  return /* @__PURE__ */ r.jsx(
82
- f,
82
+ h,
83
83
  {
84
- className: n(
84
+ className: l(
85
85
  "px-4 text-sm",
86
- s === 0 && "pl-6",
86
+ s === 0 && "ps-6",
87
87
  o?.headerAlign === "right" && "text-right",
88
- a && "sticky right-0 bg-card px-0"
88
+ a && "sticky end-0 bg-card px-0"
89
89
  ),
90
90
  ...a ? { "data-column": "actions" } : {},
91
- children: x(e.column.columnDef.cell, e.getContext())
91
+ children: f(e.column.columnDef.cell, e.getContext())
92
92
  },
93
93
  e.id
94
94
  );
@@ -98,16 +98,16 @@ function K({
98
98
  )),
99
99
  /* @__PURE__ */ r.jsx("tr", { "aria-hidden": "true" })
100
100
  ] }),
101
- u && /* @__PURE__ */ r.jsx(w, { className: "sticky bottom-0 z-10 bg-muted", children: /* @__PURE__ */ r.jsx(m, { className: "h-12 bg-muted text-foreground hover:bg-muted", children: l.map((t, e) => {
101
+ u && /* @__PURE__ */ r.jsx(w, { className: "sticky bottom-0 z-10 bg-muted", children: /* @__PURE__ */ r.jsx(c, { className: "h-12 bg-muted text-foreground hover:bg-muted", children: n.map((t, e) => {
102
102
  const s = M(t), o = ("accessorKey" in t && typeof t.accessorKey == "string" ? t.accessorKey : t.id) || String(e), a = s ? null : u[o], T = t.meta;
103
103
  return /* @__PURE__ */ r.jsx(
104
- f,
104
+ h,
105
105
  {
106
- className: n(
106
+ className: l(
107
107
  "px-4 text-sm font-bold bg-muted",
108
- e === 0 && "pl-6",
108
+ e === 0 && "ps-6",
109
109
  T?.headerAlign === "right" && "text-right",
110
- s && "sticky right-0 px-0"
110
+ s && "sticky end-0 px-0"
111
111
  ),
112
112
  children: a ?? ""
113
113
  },