@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.
- package/dist/components/atoms/typography/typography.js +5 -5
- package/dist/components/molecules/select/search-select.js +43 -43
- package/dist/components/organisms/aggregated-table/aggregated-table.js +31 -31
- package/dist/components/organisms/filter/filter.js +69 -68
- package/dist/components/organisms/filter-dropdown/filter-dropdown.js +1 -1
- package/dist/dashboard-design-system.css +1 -1
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/use-direction.d.ts +2 -0
- package/dist/hooks/use-direction.js +7 -0
- package/dist/index.css +1 -1
- package/dist/index.esm.min.js +5063 -5052
- package/dist/index.js +6 -4
- package/dist/index.umd.min.js +23 -23
- package/dist/lib/utils.d.ts +4 -0
- package/dist/lib/utils.js +17 -11
- package/dist/vendor/shadcn/calendar.js +15 -14
- package/dist/vendor/shadcn/dropdown-menu.js +15 -15
- package/dist/vendor/shadcn/pagination.js +2 -2
- package/dist/vendor/shadcn/select.d.ts +1 -1
- package/dist/vendor/shadcn/select.js +51 -51
- package/dist/vendor/shadcn/table.js +2 -2
- package/package.json +1 -1
|
@@ -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-
|
|
19
|
-
list: "my-6
|
|
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, ...
|
|
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:
|
|
60
|
-
...
|
|
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
|
|
3
|
-
import { cn as a } from "../../../lib/utils.js";
|
|
4
|
-
import { FieldLabel as
|
|
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
|
|
7
|
-
import { Command as
|
|
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
|
|
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:
|
|
16
|
+
value: r,
|
|
17
17
|
defaultValue: p,
|
|
18
18
|
onChange: h,
|
|
19
19
|
disabled: f = !1,
|
|
20
20
|
options: c = [],
|
|
21
|
-
groups:
|
|
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 [
|
|
28
|
-
if (!
|
|
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
|
|
31
|
-
const n = s.options.find((t) => t.value ===
|
|
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 ===
|
|
35
|
+
const s = c.find((n) => n.value === r);
|
|
36
36
|
if (s) return s.label;
|
|
37
37
|
}
|
|
38
38
|
return null;
|
|
39
|
-
}, [
|
|
39
|
+
}, [r, i, c, d, w]), R = l.useCallback(
|
|
40
40
|
(s) => {
|
|
41
41
|
if (!s)
|
|
42
|
-
return { filteredOptions: c, filteredGroups:
|
|
42
|
+
return { filteredOptions: c, filteredGroups: i };
|
|
43
43
|
const n = s.toLowerCase();
|
|
44
44
|
if (d) {
|
|
45
|
-
const t =
|
|
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,
|
|
58
|
-
), { filteredOptions:
|
|
59
|
-
|
|
60
|
-
|
|
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
|
-
}, [
|
|
66
|
-
|
|
67
|
-
}, [
|
|
68
|
-
p && !
|
|
69
|
-
}, [p,
|
|
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 =
|
|
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
|
-
|
|
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(
|
|
97
|
-
/* @__PURE__ */ e.jsx(
|
|
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":
|
|
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(
|
|
133
|
+
/* @__PURE__ */ e.jsx(K, { className: "p-0", align: "start", children: /* @__PURE__ */ e.jsxs(M, { shouldFilter: !1, children: [
|
|
134
134
|
/* @__PURE__ */ e.jsx(
|
|
135
|
-
|
|
135
|
+
P,
|
|
136
136
|
{
|
|
137
137
|
placeholder: z,
|
|
138
138
|
value: v,
|
|
139
139
|
onValueChange: S
|
|
140
140
|
}
|
|
141
141
|
),
|
|
142
|
-
/* @__PURE__ */ e.jsxs(
|
|
143
|
-
/* @__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 ?
|
|
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
|
-
|
|
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
|
-
|
|
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)) :
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
205
|
+
X.displayName = "SearchSelect";
|
|
206
206
|
export {
|
|
207
|
-
|
|
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
|
|
3
|
-
import { useReactTable as v, flexRender as
|
|
4
|
-
import { cn as
|
|
5
|
-
import { TableHeader as C, TableRow as
|
|
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:
|
|
10
|
-
columns:
|
|
11
|
-
aggregationLabel:
|
|
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 =
|
|
17
|
-
() =>
|
|
18
|
-
[
|
|
19
|
-
), u =
|
|
20
|
-
data:
|
|
21
|
-
columns:
|
|
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:
|
|
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
|
-
|
|
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:
|
|
48
|
+
className: l(
|
|
49
49
|
"h-12 px-4 text-sm font-medium text-muted-foreground bg-muted",
|
|
50
|
-
s === 0 && "
|
|
50
|
+
s === 0 && "ps-6",
|
|
51
51
|
o?.headerAlign === "right" && "text-right",
|
|
52
|
-
a && "sticky
|
|
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 :
|
|
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
|
-
|
|
71
|
+
c,
|
|
72
72
|
{
|
|
73
|
-
className:
|
|
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
|
-
|
|
82
|
+
h,
|
|
83
83
|
{
|
|
84
|
-
className:
|
|
84
|
+
className: l(
|
|
85
85
|
"px-4 text-sm",
|
|
86
|
-
s === 0 && "
|
|
86
|
+
s === 0 && "ps-6",
|
|
87
87
|
o?.headerAlign === "right" && "text-right",
|
|
88
|
-
a && "sticky
|
|
88
|
+
a && "sticky end-0 bg-card px-0"
|
|
89
89
|
),
|
|
90
90
|
...a ? { "data-column": "actions" } : {},
|
|
91
|
-
children:
|
|
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(
|
|
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
|
-
|
|
104
|
+
h,
|
|
105
105
|
{
|
|
106
|
-
className:
|
|
106
|
+
className: l(
|
|
107
107
|
"px-4 text-sm font-bold bg-muted",
|
|
108
|
-
e === 0 && "
|
|
108
|
+
e === 0 && "ps-6",
|
|
109
109
|
T?.headerAlign === "right" && "text-right",
|
|
110
|
-
s && "sticky
|
|
110
|
+
s && "sticky end-0 px-0"
|
|
111
111
|
),
|
|
112
112
|
children: a ?? ""
|
|
113
113
|
},
|