@yuno-payments/dashboard-design-system 0.0.135 → 0.0.137
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/filter/filter-date-range.js +136 -87
- package/dist/components/atoms/filter/filter.js +9 -9
- package/dist/components/atoms/filter-dropdown/filter-dropdown.js +84 -87
- package/dist/components/atoms/icon/icon-list.d.ts +0 -3
- package/dist/components/atoms/icon/icon-list.js +392 -398
- package/dist/components/atoms/multi-values-field/multi-values-field.js +28 -28
- package/dist/components/atoms/radio-group/radio-group-option.js +7 -7
- package/dist/components/atoms/search-field/search-field.js +9 -9
- package/dist/components/atoms/switch/switch.js +13 -13
- package/dist/components/molecules/empty/empty-icon.js +6 -6
- package/dist/components/organisms/data-table/data-table.d.ts +1 -19
- package/dist/components/organisms/data-table/data-table.js +88 -98
- package/dist/components/organisms/data-table/data-table.types.d.ts +0 -19
- package/dist/components/organisms/data-table/hooks/use-data-table-state.d.ts +2 -7
- package/dist/components/organisms/data-table/hooks/use-data-table-state.js +46 -80
- package/dist/components/organisms/data-table/utils/data-table-constants.d.ts +2 -2
- package/dist/components/organisms/data-table/utils/data-table-constants.js +11 -11
- package/dist/index.css +1 -1
- package/dist/vendor/shadcn/badge.js +17 -17
- package/dist/vendor/shadcn/card.js +7 -7
- package/dist/vendor/shadcn/input.js +7 -7
- package/dist/vendor/shadcn/table.js +18 -18
- package/package.json +1 -1
- package/dist/components/atoms/icon/aida-logo.d.ts +0 -3
- package/dist/components/atoms/icon/aida-logo.js +0 -64
- package/dist/node_modules/@phosphor-icons/react/dist/csr/File.es.js +0 -8
- package/dist/node_modules/@phosphor-icons/react/dist/csr/Table.es.js +0 -8
- package/dist/node_modules/@phosphor-icons/react/dist/defs/File.es.js +0 -30
- package/dist/node_modules/@phosphor-icons/react/dist/defs/Table.es.js +0 -30
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { j as e } from "../../../_virtual/jsx-runtime.js";
|
|
2
|
-
import { forwardRef as T } from "react";
|
|
3
|
-
import { RadioGroup as S, RadioGroupItem as
|
|
2
|
+
import { forwardRef as T, useMemo as b } from "react";
|
|
3
|
+
import { RadioGroup as S, RadioGroupItem as C } from "../../../vendor/shadcn/radio-group.js";
|
|
4
4
|
import { cn as _ } from "../../../lib/utils.js";
|
|
5
|
-
import { DatePicker as
|
|
6
|
-
import { TimePicker as
|
|
7
|
-
const
|
|
5
|
+
import { DatePicker as D } from "../date-picker/date-picker.js";
|
|
6
|
+
import { TimePicker as p } from "../time-picker/time-picker.js";
|
|
7
|
+
const c = {
|
|
8
8
|
CUSTOM: "CUSTOM",
|
|
9
9
|
TODAY: "TODAY",
|
|
10
10
|
LAST_3_DAYS: "LAST_3_DAYS",
|
|
@@ -12,142 +12,191 @@ const l = {
|
|
|
12
12
|
LAST_30_DAYS: "LAST_30_DAYS",
|
|
13
13
|
THIS_MONTH: "THIS_MONTH",
|
|
14
14
|
ALL_TIME: "ALL_TIME"
|
|
15
|
-
},
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
}, r = (s) => {
|
|
16
|
+
const l = s.getDate();
|
|
17
|
+
return `${[
|
|
18
|
+
"Jan",
|
|
19
|
+
"Feb",
|
|
20
|
+
"Mar",
|
|
21
|
+
"Apr",
|
|
22
|
+
"May",
|
|
23
|
+
"Jun",
|
|
24
|
+
"Jul",
|
|
25
|
+
"Aug",
|
|
26
|
+
"Sep",
|
|
27
|
+
"Oct",
|
|
28
|
+
"Nov",
|
|
29
|
+
"Dec"
|
|
30
|
+
][s.getMonth()]} ${l}`;
|
|
31
|
+
}, R = (s) => {
|
|
32
|
+
const a = [
|
|
33
|
+
"Jan",
|
|
34
|
+
"Feb",
|
|
35
|
+
"Mar",
|
|
36
|
+
"Apr",
|
|
37
|
+
"May",
|
|
38
|
+
"Jun",
|
|
39
|
+
"Jul",
|
|
40
|
+
"Aug",
|
|
41
|
+
"Sep",
|
|
42
|
+
"Oct",
|
|
43
|
+
"Nov",
|
|
44
|
+
"Dec"
|
|
45
|
+
][s.getMonth()], n = s.getFullYear();
|
|
46
|
+
return `${a} ${n}`;
|
|
47
|
+
}, F = (s) => ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"][s.getDay()], H = () => {
|
|
48
|
+
const s = /* @__PURE__ */ new Date();
|
|
49
|
+
s.setHours(0, 0, 0, 0);
|
|
50
|
+
const l = `${F(s)}, ${r(s)}`, a = new Date(s);
|
|
51
|
+
a.setDate(a.getDate() - 2);
|
|
52
|
+
const n = `${r(a)} - ${r(s)}`, o = new Date(s);
|
|
53
|
+
o.setDate(o.getDate() - 6);
|
|
54
|
+
const d = `${r(o)} - ${r(s)}`, t = new Date(s);
|
|
55
|
+
t.setDate(t.getDate() - 29);
|
|
56
|
+
const m = `${r(t)} - ${r(s)}`, f = R(s);
|
|
57
|
+
return {
|
|
58
|
+
today: l,
|
|
59
|
+
last3Days: n,
|
|
60
|
+
last7Days: d,
|
|
61
|
+
last30Days: m,
|
|
62
|
+
thisMonth: f
|
|
63
|
+
};
|
|
64
|
+
}, i = T(
|
|
65
|
+
({ label: s, description: l, value: a, className: n, ...o }, d) => {
|
|
66
|
+
const t = `date-range-${a}`;
|
|
67
|
+
return /* @__PURE__ */ e.jsxs("div", { className: "flex items-start gap-4 w-full py-1", children: [
|
|
19
68
|
/* @__PURE__ */ e.jsxs(
|
|
20
69
|
"label",
|
|
21
70
|
{
|
|
22
|
-
ref:
|
|
71
|
+
ref: d,
|
|
23
72
|
className: _(
|
|
24
73
|
"flex-1 flex items-start gap-3 cursor-pointer",
|
|
25
|
-
|
|
74
|
+
n
|
|
26
75
|
),
|
|
27
76
|
...o,
|
|
28
77
|
children: [
|
|
29
|
-
/* @__PURE__ */ e.jsx(
|
|
30
|
-
/* @__PURE__ */ e.jsx("div", { className: "flex flex-col gap-1.5 items-start justify-center pb-0 pt-px px-0", children: /* @__PURE__ */ e.jsx("span", { className: "text-sm font-medium leading-none text-foreground", children:
|
|
78
|
+
/* @__PURE__ */ e.jsx(C, { id: t, value: a, className: "mt-px" }),
|
|
79
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex flex-col gap-1.5 items-start justify-center pb-0 pt-px px-0", children: /* @__PURE__ */ e.jsx("span", { className: "text-sm font-medium leading-none text-foreground", children: s }) })
|
|
31
80
|
]
|
|
32
81
|
}
|
|
33
82
|
),
|
|
34
|
-
|
|
83
|
+
l && /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ e.jsx("span", { className: "text-xs font-normal leading-none text-muted-foreground whitespace-nowrap", children: l }) })
|
|
35
84
|
] });
|
|
36
85
|
}
|
|
37
86
|
);
|
|
38
|
-
|
|
39
|
-
const
|
|
87
|
+
i.displayName = "FilterDateRangeOption";
|
|
88
|
+
const I = T(
|
|
40
89
|
({
|
|
41
|
-
showCustomFields:
|
|
42
|
-
onCustomFieldsChange:
|
|
43
|
-
startDate:
|
|
44
|
-
endDate:
|
|
90
|
+
showCustomFields: s = !1,
|
|
91
|
+
onCustomFieldsChange: l,
|
|
92
|
+
startDate: a,
|
|
93
|
+
endDate: n,
|
|
45
94
|
startTime: o = "",
|
|
46
|
-
endTime:
|
|
47
|
-
onStartDateChange:
|
|
48
|
-
onEndDateChange:
|
|
49
|
-
onStartTimeChange:
|
|
50
|
-
onEndTimeChange:
|
|
51
|
-
mode:
|
|
52
|
-
singleDayLabel:
|
|
95
|
+
endTime: d = "",
|
|
96
|
+
onStartDateChange: t,
|
|
97
|
+
onEndDateChange: m,
|
|
98
|
+
onStartTimeChange: f,
|
|
99
|
+
onEndTimeChange: g,
|
|
100
|
+
mode: u = "range",
|
|
101
|
+
singleDayLabel: M = "Select date",
|
|
53
102
|
showAllTime: L = !1,
|
|
54
103
|
className: O,
|
|
55
|
-
value:
|
|
104
|
+
value: y,
|
|
56
105
|
onValueChange: Y,
|
|
57
106
|
...N
|
|
58
|
-
},
|
|
59
|
-
const
|
|
60
|
-
Y?.(
|
|
61
|
-
},
|
|
62
|
-
if (
|
|
63
|
-
const v = new Date(
|
|
107
|
+
}, w) => {
|
|
108
|
+
const h = b(() => H(), []), j = (x) => {
|
|
109
|
+
Y?.(x), l?.(x === c.CUSTOM);
|
|
110
|
+
}, $ = (x) => {
|
|
111
|
+
if (x) {
|
|
112
|
+
const v = new Date(x);
|
|
64
113
|
v.setHours(0, 0, 0, 0);
|
|
65
|
-
const A = new Date(
|
|
66
|
-
A.setHours(23, 59, 59, 999),
|
|
114
|
+
const A = new Date(x);
|
|
115
|
+
A.setHours(23, 59, 59, 999), t?.(v), m?.(A);
|
|
67
116
|
} else
|
|
68
|
-
|
|
117
|
+
t?.(void 0), m?.(void 0);
|
|
69
118
|
};
|
|
70
119
|
return /* @__PURE__ */ e.jsxs(
|
|
71
120
|
"div",
|
|
72
121
|
{
|
|
73
|
-
ref:
|
|
122
|
+
ref: w,
|
|
74
123
|
className: _("flex flex-col gap-4 w-full", O),
|
|
75
124
|
children: [
|
|
76
125
|
/* @__PURE__ */ e.jsx(
|
|
77
126
|
S,
|
|
78
127
|
{
|
|
79
|
-
value:
|
|
80
|
-
onValueChange:
|
|
128
|
+
value: y,
|
|
129
|
+
onValueChange: j,
|
|
81
130
|
...N,
|
|
82
|
-
children: /* @__PURE__ */ e.jsx(
|
|
131
|
+
children: /* @__PURE__ */ e.jsx(i, { label: "Custom", value: c.CUSTOM })
|
|
83
132
|
}
|
|
84
133
|
),
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
134
|
+
s && /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-4", children: [
|
|
135
|
+
u === "single" ? /* @__PURE__ */ e.jsx("div", { className: "flex flex-col gap-3", children: /* @__PURE__ */ e.jsx(
|
|
136
|
+
D,
|
|
88
137
|
{
|
|
89
|
-
date:
|
|
90
|
-
onChange:
|
|
91
|
-
placeholder:
|
|
138
|
+
date: a,
|
|
139
|
+
onChange: $,
|
|
140
|
+
placeholder: M,
|
|
92
141
|
className: "h-9",
|
|
93
142
|
iconPosition: "none"
|
|
94
143
|
}
|
|
95
144
|
) }) : /* @__PURE__ */ e.jsxs("div", { className: "flex gap-4 items-start w-full", children: [
|
|
96
145
|
/* @__PURE__ */ e.jsx("div", { className: "flex-1 flex flex-col gap-3", children: /* @__PURE__ */ e.jsx(
|
|
97
|
-
|
|
146
|
+
D,
|
|
98
147
|
{
|
|
99
|
-
date:
|
|
100
|
-
onChange:
|
|
148
|
+
date: a,
|
|
149
|
+
onChange: t,
|
|
101
150
|
placeholder: "Start date",
|
|
102
151
|
className: "h-9",
|
|
103
152
|
iconPosition: "none"
|
|
104
153
|
}
|
|
105
154
|
) }),
|
|
106
155
|
/* @__PURE__ */ e.jsx("div", { className: "flex-1 flex flex-col gap-3", children: /* @__PURE__ */ e.jsx(
|
|
107
|
-
|
|
156
|
+
D,
|
|
108
157
|
{
|
|
109
|
-
date:
|
|
110
|
-
onChange:
|
|
158
|
+
date: n,
|
|
159
|
+
onChange: m,
|
|
111
160
|
placeholder: "End date",
|
|
112
161
|
className: "h-9",
|
|
113
162
|
iconPosition: "none"
|
|
114
163
|
}
|
|
115
164
|
) })
|
|
116
165
|
] }),
|
|
117
|
-
|
|
166
|
+
u === "single" ? /* @__PURE__ */ e.jsxs("div", { className: "flex gap-4 items-start w-full", children: [
|
|
118
167
|
/* @__PURE__ */ e.jsx("div", { className: "flex-1 flex flex-col gap-3", children: /* @__PURE__ */ e.jsx(
|
|
119
|
-
|
|
168
|
+
p,
|
|
120
169
|
{
|
|
121
170
|
value: o,
|
|
122
|
-
onChange:
|
|
171
|
+
onChange: f,
|
|
123
172
|
placeholder: "10:30:00",
|
|
124
173
|
className: "h-9"
|
|
125
174
|
}
|
|
126
175
|
) }),
|
|
127
176
|
/* @__PURE__ */ e.jsx("div", { className: "flex-1 flex flex-col gap-3", children: /* @__PURE__ */ e.jsx(
|
|
128
|
-
|
|
177
|
+
p,
|
|
129
178
|
{
|
|
130
|
-
value:
|
|
131
|
-
onChange:
|
|
179
|
+
value: d,
|
|
180
|
+
onChange: g,
|
|
132
181
|
placeholder: "10:30:00",
|
|
133
182
|
className: "h-9"
|
|
134
183
|
}
|
|
135
184
|
) })
|
|
136
185
|
] }) : /* @__PURE__ */ e.jsxs("div", { className: "flex gap-4 items-start w-full", children: [
|
|
137
186
|
/* @__PURE__ */ e.jsx("div", { className: "flex-1 flex flex-col gap-3", children: /* @__PURE__ */ e.jsx(
|
|
138
|
-
|
|
187
|
+
p,
|
|
139
188
|
{
|
|
140
189
|
value: o,
|
|
141
|
-
onChange:
|
|
190
|
+
onChange: f,
|
|
142
191
|
placeholder: "10:30:00",
|
|
143
192
|
className: "h-9"
|
|
144
193
|
}
|
|
145
194
|
) }),
|
|
146
195
|
/* @__PURE__ */ e.jsx("div", { className: "flex-1 flex flex-col gap-3", children: /* @__PURE__ */ e.jsx(
|
|
147
|
-
|
|
196
|
+
p,
|
|
148
197
|
{
|
|
149
|
-
value:
|
|
150
|
-
onChange:
|
|
198
|
+
value: d,
|
|
199
|
+
onChange: g,
|
|
151
200
|
placeholder: "10:30:00",
|
|
152
201
|
className: "h-9"
|
|
153
202
|
}
|
|
@@ -157,51 +206,51 @@ const b = T(
|
|
|
157
206
|
/* @__PURE__ */ e.jsx(
|
|
158
207
|
S,
|
|
159
208
|
{
|
|
160
|
-
value:
|
|
161
|
-
onValueChange:
|
|
209
|
+
value: y,
|
|
210
|
+
onValueChange: j,
|
|
162
211
|
...N,
|
|
163
|
-
children: /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-
|
|
212
|
+
children: /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-2", children: [
|
|
164
213
|
/* @__PURE__ */ e.jsx(
|
|
165
|
-
|
|
214
|
+
i,
|
|
166
215
|
{
|
|
167
216
|
label: "Today",
|
|
168
|
-
value:
|
|
169
|
-
description:
|
|
217
|
+
value: c.TODAY,
|
|
218
|
+
description: h.today
|
|
170
219
|
}
|
|
171
220
|
),
|
|
172
221
|
/* @__PURE__ */ e.jsx(
|
|
173
|
-
|
|
222
|
+
i,
|
|
174
223
|
{
|
|
175
224
|
label: "Last 3 days",
|
|
176
|
-
value:
|
|
177
|
-
description:
|
|
225
|
+
value: c.LAST_3_DAYS,
|
|
226
|
+
description: h.last3Days
|
|
178
227
|
}
|
|
179
228
|
),
|
|
180
229
|
/* @__PURE__ */ e.jsx(
|
|
181
|
-
|
|
230
|
+
i,
|
|
182
231
|
{
|
|
183
232
|
label: "Last 7 days",
|
|
184
|
-
value:
|
|
185
|
-
description:
|
|
233
|
+
value: c.LAST_7_DAYS,
|
|
234
|
+
description: h.last7Days
|
|
186
235
|
}
|
|
187
236
|
),
|
|
188
237
|
/* @__PURE__ */ e.jsx(
|
|
189
|
-
|
|
238
|
+
i,
|
|
190
239
|
{
|
|
191
240
|
label: "Last 30 days",
|
|
192
|
-
value:
|
|
193
|
-
description:
|
|
241
|
+
value: c.LAST_30_DAYS,
|
|
242
|
+
description: h.last30Days
|
|
194
243
|
}
|
|
195
244
|
),
|
|
196
245
|
/* @__PURE__ */ e.jsx(
|
|
197
|
-
|
|
246
|
+
i,
|
|
198
247
|
{
|
|
199
248
|
label: "This month",
|
|
200
|
-
value:
|
|
201
|
-
description:
|
|
249
|
+
value: c.THIS_MONTH,
|
|
250
|
+
description: h.thisMonth
|
|
202
251
|
}
|
|
203
252
|
),
|
|
204
|
-
L && /* @__PURE__ */ e.jsx(
|
|
253
|
+
L && /* @__PURE__ */ e.jsx(i, { label: "All time", value: c.ALL_TIME })
|
|
205
254
|
] })
|
|
206
255
|
}
|
|
207
256
|
)
|
|
@@ -210,9 +259,9 @@ const b = T(
|
|
|
210
259
|
);
|
|
211
260
|
}
|
|
212
261
|
);
|
|
213
|
-
|
|
262
|
+
I.displayName = "FilterDateRange";
|
|
214
263
|
export {
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
264
|
+
I as FilterDateRange,
|
|
265
|
+
i as FilterDateRangeOption,
|
|
266
|
+
c as FilterDateRangeValue
|
|
218
267
|
};
|
|
@@ -106,7 +106,7 @@ const X = x(
|
|
|
106
106
|
enableSelectAll: h = !0,
|
|
107
107
|
enableInverse: j = !0,
|
|
108
108
|
enableNone: f = !0
|
|
109
|
-
} = s, o = s.type || "checkbox",
|
|
109
|
+
} = s, o = s.type || "checkbox", w = o === "radio", z = o === "checkbox" || !s.type, [N, I] = A(""), b = M(() => N ? l.filter(
|
|
110
110
|
(a) => a.label.toLowerCase().includes(N.toLowerCase())
|
|
111
111
|
) : l, [l, N]), R = () => {
|
|
112
112
|
if (o === "checkbox" && "selectedValues" in s) {
|
|
@@ -173,14 +173,14 @@ const X = x(
|
|
|
173
173
|
] })
|
|
174
174
|
] }),
|
|
175
175
|
/* @__PURE__ */ e.jsx(p, { className: "w-full mb-6" }),
|
|
176
|
-
|
|
176
|
+
w && "selectedValue" in s ? /* @__PURE__ */ e.jsx(
|
|
177
177
|
E,
|
|
178
178
|
{
|
|
179
179
|
value: s.selectedValue,
|
|
180
180
|
onValueChange: s.onChange,
|
|
181
|
-
className: "grid grid-cols-2 gap-4 overflow-y-auto",
|
|
181
|
+
className: "grid grid-cols-2 gap-x-4 gap-y-5 overflow-y-auto",
|
|
182
182
|
children: b.map((a) => /* @__PURE__ */ e.jsx(
|
|
183
|
-
|
|
183
|
+
S,
|
|
184
184
|
{
|
|
185
185
|
label: a.label,
|
|
186
186
|
value: a.value,
|
|
@@ -189,7 +189,7 @@ const X = x(
|
|
|
189
189
|
a.value
|
|
190
190
|
))
|
|
191
191
|
}
|
|
192
|
-
) : z && "selectedValues" in s ? /* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-2 gap-4 overflow-y-auto", children: b.map((a) => /* @__PURE__ */ e.jsx(
|
|
192
|
+
) : z && "selectedValues" in s ? /* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-2 gap-x-4 gap-y-5 overflow-y-auto", children: b.map((a) => /* @__PURE__ */ e.jsx(
|
|
193
193
|
V,
|
|
194
194
|
{
|
|
195
195
|
label: a.label,
|
|
@@ -214,7 +214,7 @@ const V = x(({ label: s, checked: t, onCheckedChange: n, description: l, classNa
|
|
|
214
214
|
] });
|
|
215
215
|
});
|
|
216
216
|
V.displayName = "FilterCheckboxOption";
|
|
217
|
-
const
|
|
217
|
+
const S = x(
|
|
218
218
|
({ label: s, value: t, description: n, className: l }, i) => /* @__PURE__ */ e.jsxs("div", { className: u("flex items-start gap-3", l), children: [
|
|
219
219
|
/* @__PURE__ */ e.jsx(L, { ref: i, value: t, id: `radio-${t}` }),
|
|
220
220
|
/* @__PURE__ */ e.jsxs(
|
|
@@ -230,7 +230,7 @@ const w = x(
|
|
|
230
230
|
)
|
|
231
231
|
] })
|
|
232
232
|
);
|
|
233
|
-
|
|
233
|
+
S.displayName = "FilterRadioOption";
|
|
234
234
|
const q = x(
|
|
235
235
|
({
|
|
236
236
|
children: s,
|
|
@@ -244,7 +244,7 @@ const q = x(
|
|
|
244
244
|
{
|
|
245
245
|
ref: d,
|
|
246
246
|
className: u(
|
|
247
|
-
"flex flex-col gap-6 bg-
|
|
247
|
+
"flex flex-col gap-6 bg-background rounded-md p-6 min-w-[448px]",
|
|
248
248
|
r
|
|
249
249
|
),
|
|
250
250
|
children: [
|
|
@@ -276,7 +276,7 @@ export {
|
|
|
276
276
|
P as FilterButton,
|
|
277
277
|
V as FilterCheckboxOption,
|
|
278
278
|
q as FilterContent,
|
|
279
|
-
|
|
279
|
+
S as FilterRadioOption,
|
|
280
280
|
X as FilterSection,
|
|
281
281
|
F as FilterTag
|
|
282
282
|
};
|