@yuno-payments/dashboard-design-system 0.0.136 → 0.0.138-beta.1
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 +185 -161
- package/dist/components/atoms/filter/filter.d.ts +4 -0
- package/dist/components/atoms/filter/filter.js +82 -70
- 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/atoms/time-picker/time-picker.d.ts +5 -0
- package/dist/components/atoms/time-picker/time-picker.js +123 -115
- package/dist/components/molecules/empty/empty-icon.js +6 -6
- package/dist/components/organisms/data-table/data-table.d.ts +1 -24
- package/dist/components/organisms/data-table/data-table.js +93 -104
- package/dist/components/organisms/data-table/data-table.types.d.ts +0 -20
- 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/select.js +1 -1
- 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
|
|
3
|
-
import { RadioGroup as
|
|
4
|
-
import { cn as
|
|
5
|
-
import { DatePicker as
|
|
6
|
-
import { TimePicker as
|
|
7
|
-
const
|
|
2
|
+
import { forwardRef as y, useMemo as $ } from "react";
|
|
3
|
+
import { RadioGroup as b, RadioGroupItem as H } from "../../../vendor/shadcn/radio-group.js";
|
|
4
|
+
import { cn as N } from "../../../lib/utils.js";
|
|
5
|
+
import { DatePicker as f } from "../date-picker/date-picker.js";
|
|
6
|
+
import { TimePicker as g } from "../time-picker/time-picker.js";
|
|
7
|
+
const o = {
|
|
8
8
|
CUSTOM: "CUSTOM",
|
|
9
9
|
TODAY: "TODAY",
|
|
10
10
|
LAST_3_DAYS: "LAST_3_DAYS",
|
|
@@ -12,207 +12,231 @@ 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
|
+
}, i = (s) => {
|
|
16
|
+
const t = 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()]} ${t}`;
|
|
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
|
+
}, C = (s) => ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"][s.getDay()], F = () => {
|
|
48
|
+
const s = /* @__PURE__ */ new Date();
|
|
49
|
+
s.setHours(0, 0, 0, 0);
|
|
50
|
+
const t = `${C(s)}, ${i(s)}`, a = new Date(s);
|
|
51
|
+
a.setDate(a.getDate() - 2);
|
|
52
|
+
const n = `${i(a)} - ${i(s)}`, r = new Date(s);
|
|
53
|
+
r.setDate(r.getDate() - 6);
|
|
54
|
+
const m = `${i(r)} - ${i(s)}`, l = new Date(s);
|
|
55
|
+
l.setDate(l.getDate() - 29);
|
|
56
|
+
const x = `${i(l)} - ${i(s)}`, D = R(s);
|
|
57
|
+
return {
|
|
58
|
+
today: t,
|
|
59
|
+
last3Days: n,
|
|
60
|
+
last7Days: m,
|
|
61
|
+
last30Days: x,
|
|
62
|
+
thisMonth: D
|
|
63
|
+
};
|
|
64
|
+
}, c = y(
|
|
65
|
+
({ label: s, description: t, value: a, className: n, ...r }, m) => {
|
|
66
|
+
const l = `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:
|
|
23
|
-
className:
|
|
71
|
+
ref: m,
|
|
72
|
+
className: N(
|
|
24
73
|
"flex-1 flex items-start gap-3 cursor-pointer",
|
|
25
|
-
|
|
74
|
+
n
|
|
26
75
|
),
|
|
27
|
-
...
|
|
76
|
+
...r,
|
|
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(H, { id: l, 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
|
+
t && /* @__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: t }) })
|
|
35
84
|
] });
|
|
36
85
|
}
|
|
37
86
|
);
|
|
38
|
-
|
|
39
|
-
const
|
|
87
|
+
c.displayName = "FilterDateRangeOption";
|
|
88
|
+
const I = y(
|
|
40
89
|
({
|
|
41
|
-
showCustomFields:
|
|
42
|
-
onCustomFieldsChange:
|
|
43
|
-
startDate:
|
|
44
|
-
endDate:
|
|
45
|
-
startTime:
|
|
46
|
-
endTime:
|
|
47
|
-
onStartDateChange:
|
|
48
|
-
onEndDateChange:
|
|
49
|
-
onStartTimeChange:
|
|
50
|
-
onEndTimeChange:
|
|
51
|
-
mode:
|
|
52
|
-
singleDayLabel:
|
|
53
|
-
showAllTime:
|
|
54
|
-
className:
|
|
55
|
-
value:
|
|
56
|
-
onValueChange:
|
|
57
|
-
...
|
|
58
|
-
},
|
|
59
|
-
const
|
|
60
|
-
|
|
61
|
-
},
|
|
62
|
-
if (
|
|
63
|
-
const
|
|
64
|
-
|
|
65
|
-
const
|
|
66
|
-
|
|
90
|
+
showCustomFields: s = !1,
|
|
91
|
+
onCustomFieldsChange: t,
|
|
92
|
+
startDate: a,
|
|
93
|
+
endDate: n,
|
|
94
|
+
startTime: r = "",
|
|
95
|
+
endTime: m = "",
|
|
96
|
+
onStartDateChange: l,
|
|
97
|
+
onEndDateChange: x,
|
|
98
|
+
onStartTimeChange: D,
|
|
99
|
+
onEndTimeChange: j,
|
|
100
|
+
mode: S = "range",
|
|
101
|
+
singleDayLabel: T = "Select date",
|
|
102
|
+
showAllTime: A = !1,
|
|
103
|
+
className: v,
|
|
104
|
+
value: _,
|
|
105
|
+
onValueChange: M,
|
|
106
|
+
...L
|
|
107
|
+
}, w) => {
|
|
108
|
+
const p = $(() => F(), []), O = (d) => {
|
|
109
|
+
M?.(d), t?.(d === o.CUSTOM);
|
|
110
|
+
}, Y = (d) => {
|
|
111
|
+
if (d) {
|
|
112
|
+
const h = new Date(d);
|
|
113
|
+
h.setHours(0, 0, 0, 0);
|
|
114
|
+
const u = new Date(d);
|
|
115
|
+
u.setHours(23, 59, 59, 999), l?.(h), x?.(u);
|
|
67
116
|
} else
|
|
68
|
-
|
|
117
|
+
l?.(void 0), x?.(void 0);
|
|
69
118
|
};
|
|
70
|
-
return /* @__PURE__ */ e.
|
|
119
|
+
return /* @__PURE__ */ e.jsx(
|
|
71
120
|
"div",
|
|
72
121
|
{
|
|
73
|
-
ref:
|
|
74
|
-
className:
|
|
75
|
-
children:
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
{
|
|
140
|
-
value: o,
|
|
141
|
-
onChange: p,
|
|
142
|
-
placeholder: "10:30:00",
|
|
143
|
-
className: "h-9"
|
|
144
|
-
}
|
|
145
|
-
) }),
|
|
146
|
-
/* @__PURE__ */ e.jsx("div", { className: "flex-1 flex flex-col gap-3", children: /* @__PURE__ */ e.jsx(
|
|
147
|
-
x,
|
|
148
|
-
{
|
|
149
|
-
value: t,
|
|
150
|
-
onChange: h,
|
|
151
|
-
placeholder: "10:30:00",
|
|
152
|
-
className: "h-9"
|
|
153
|
-
}
|
|
154
|
-
) })
|
|
155
|
-
] })
|
|
156
|
-
] }),
|
|
157
|
-
/* @__PURE__ */ e.jsx(
|
|
158
|
-
S,
|
|
159
|
-
{
|
|
160
|
-
value: g,
|
|
161
|
-
onValueChange: u,
|
|
162
|
-
...N,
|
|
163
|
-
children: /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-4", children: [
|
|
122
|
+
ref: w,
|
|
123
|
+
className: N("flex flex-col gap-4 w-full", v),
|
|
124
|
+
children: /* @__PURE__ */ e.jsxs(
|
|
125
|
+
b,
|
|
126
|
+
{
|
|
127
|
+
value: _,
|
|
128
|
+
onValueChange: O,
|
|
129
|
+
...L,
|
|
130
|
+
children: [
|
|
131
|
+
/* @__PURE__ */ e.jsx(c, { label: "Custom", value: o.CUSTOM }),
|
|
132
|
+
s && /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-4 pl-7", children: [
|
|
133
|
+
S === "single" ? /* @__PURE__ */ e.jsx("div", { className: "flex flex-col gap-3", children: /* @__PURE__ */ e.jsx(
|
|
134
|
+
f,
|
|
135
|
+
{
|
|
136
|
+
date: a,
|
|
137
|
+
onChange: Y,
|
|
138
|
+
placeholder: T,
|
|
139
|
+
className: "h-9",
|
|
140
|
+
iconPosition: "none"
|
|
141
|
+
}
|
|
142
|
+
) }) : /* @__PURE__ */ e.jsxs("div", { className: "flex gap-4 items-start w-full", children: [
|
|
143
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex-1 flex flex-col gap-3", children: /* @__PURE__ */ e.jsx(
|
|
144
|
+
f,
|
|
145
|
+
{
|
|
146
|
+
date: a,
|
|
147
|
+
onChange: l,
|
|
148
|
+
placeholder: "Start date",
|
|
149
|
+
className: "h-9",
|
|
150
|
+
iconPosition: "none"
|
|
151
|
+
}
|
|
152
|
+
) }),
|
|
153
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex-1 flex flex-col gap-3", children: /* @__PURE__ */ e.jsx(
|
|
154
|
+
f,
|
|
155
|
+
{
|
|
156
|
+
date: n,
|
|
157
|
+
onChange: x,
|
|
158
|
+
placeholder: "End date",
|
|
159
|
+
className: "h-9",
|
|
160
|
+
iconPosition: "none"
|
|
161
|
+
}
|
|
162
|
+
) })
|
|
163
|
+
] }),
|
|
164
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex gap-4 items-start w-full", children: [
|
|
165
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex-1 flex flex-col gap-3", children: /* @__PURE__ */ e.jsx(
|
|
166
|
+
g,
|
|
167
|
+
{
|
|
168
|
+
value: r,
|
|
169
|
+
onChange: D,
|
|
170
|
+
mode: "dropdown",
|
|
171
|
+
use24Hour: !0,
|
|
172
|
+
width: "100%"
|
|
173
|
+
}
|
|
174
|
+
) }),
|
|
175
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex-1 flex flex-col gap-3", children: /* @__PURE__ */ e.jsx(
|
|
176
|
+
g,
|
|
177
|
+
{
|
|
178
|
+
value: m,
|
|
179
|
+
onChange: j,
|
|
180
|
+
mode: "dropdown",
|
|
181
|
+
use24Hour: !0,
|
|
182
|
+
width: "100%"
|
|
183
|
+
}
|
|
184
|
+
) })
|
|
185
|
+
] })
|
|
186
|
+
] }),
|
|
187
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-2", children: [
|
|
164
188
|
/* @__PURE__ */ e.jsx(
|
|
165
|
-
|
|
189
|
+
c,
|
|
166
190
|
{
|
|
167
191
|
label: "Today",
|
|
168
|
-
value:
|
|
169
|
-
description:
|
|
192
|
+
value: o.TODAY,
|
|
193
|
+
description: p.today
|
|
170
194
|
}
|
|
171
195
|
),
|
|
172
196
|
/* @__PURE__ */ e.jsx(
|
|
173
|
-
|
|
197
|
+
c,
|
|
174
198
|
{
|
|
175
199
|
label: "Last 3 days",
|
|
176
|
-
value:
|
|
177
|
-
description:
|
|
200
|
+
value: o.LAST_3_DAYS,
|
|
201
|
+
description: p.last3Days
|
|
178
202
|
}
|
|
179
203
|
),
|
|
180
204
|
/* @__PURE__ */ e.jsx(
|
|
181
|
-
|
|
205
|
+
c,
|
|
182
206
|
{
|
|
183
207
|
label: "Last 7 days",
|
|
184
|
-
value:
|
|
185
|
-
description:
|
|
208
|
+
value: o.LAST_7_DAYS,
|
|
209
|
+
description: p.last7Days
|
|
186
210
|
}
|
|
187
211
|
),
|
|
188
212
|
/* @__PURE__ */ e.jsx(
|
|
189
|
-
|
|
213
|
+
c,
|
|
190
214
|
{
|
|
191
215
|
label: "Last 30 days",
|
|
192
|
-
value:
|
|
193
|
-
description:
|
|
216
|
+
value: o.LAST_30_DAYS,
|
|
217
|
+
description: p.last30Days
|
|
194
218
|
}
|
|
195
219
|
),
|
|
196
220
|
/* @__PURE__ */ e.jsx(
|
|
197
|
-
|
|
221
|
+
c,
|
|
198
222
|
{
|
|
199
223
|
label: "This month",
|
|
200
|
-
value:
|
|
201
|
-
description:
|
|
224
|
+
value: o.THIS_MONTH,
|
|
225
|
+
description: p.thisMonth
|
|
202
226
|
}
|
|
203
227
|
),
|
|
204
|
-
|
|
228
|
+
A && /* @__PURE__ */ e.jsx(c, { label: "All time", value: o.ALL_TIME })
|
|
205
229
|
] })
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
230
|
+
]
|
|
231
|
+
}
|
|
232
|
+
)
|
|
209
233
|
}
|
|
210
234
|
);
|
|
211
235
|
}
|
|
212
236
|
);
|
|
213
|
-
|
|
237
|
+
I.displayName = "FilterDateRange";
|
|
214
238
|
export {
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
239
|
+
I as FilterDateRange,
|
|
240
|
+
c as FilterDateRangeOption,
|
|
241
|
+
o as FilterDateRangeValue
|
|
218
242
|
};
|
|
@@ -20,6 +20,8 @@ interface FilterSectionItem {
|
|
|
20
20
|
value: string;
|
|
21
21
|
label: string;
|
|
22
22
|
description?: string;
|
|
23
|
+
/** Optional icon URL to display before the label */
|
|
24
|
+
icon?: string;
|
|
23
25
|
}
|
|
24
26
|
interface FilterSectionPropsBase {
|
|
25
27
|
title: string;
|
|
@@ -52,6 +54,8 @@ interface FilterCheckboxOptionProps {
|
|
|
52
54
|
className?: string;
|
|
53
55
|
/** Maximum label length before truncating (default: 14) */
|
|
54
56
|
maxLabelLength?: number;
|
|
57
|
+
/** Optional icon URL to display before the label */
|
|
58
|
+
icon?: string;
|
|
55
59
|
}
|
|
56
60
|
declare const FilterCheckboxOption: import('react').ForwardRefExoticComponent<FilterCheckboxOptionProps & import('react').RefAttributes<HTMLButtonElement>>;
|
|
57
61
|
interface FilterRadioOptionProps {
|