@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.
Files changed (33) hide show
  1. package/dist/components/atoms/filter/filter-date-range.js +185 -161
  2. package/dist/components/atoms/filter/filter.d.ts +4 -0
  3. package/dist/components/atoms/filter/filter.js +82 -70
  4. package/dist/components/atoms/filter-dropdown/filter-dropdown.js +84 -87
  5. package/dist/components/atoms/icon/icon-list.d.ts +0 -3
  6. package/dist/components/atoms/icon/icon-list.js +392 -398
  7. package/dist/components/atoms/multi-values-field/multi-values-field.js +28 -28
  8. package/dist/components/atoms/radio-group/radio-group-option.js +7 -7
  9. package/dist/components/atoms/search-field/search-field.js +9 -9
  10. package/dist/components/atoms/switch/switch.js +13 -13
  11. package/dist/components/atoms/time-picker/time-picker.d.ts +5 -0
  12. package/dist/components/atoms/time-picker/time-picker.js +123 -115
  13. package/dist/components/molecules/empty/empty-icon.js +6 -6
  14. package/dist/components/organisms/data-table/data-table.d.ts +1 -24
  15. package/dist/components/organisms/data-table/data-table.js +93 -104
  16. package/dist/components/organisms/data-table/data-table.types.d.ts +0 -20
  17. package/dist/components/organisms/data-table/hooks/use-data-table-state.d.ts +2 -7
  18. package/dist/components/organisms/data-table/hooks/use-data-table-state.js +46 -80
  19. package/dist/components/organisms/data-table/utils/data-table-constants.d.ts +2 -2
  20. package/dist/components/organisms/data-table/utils/data-table-constants.js +11 -11
  21. package/dist/index.css +1 -1
  22. package/dist/vendor/shadcn/badge.js +17 -17
  23. package/dist/vendor/shadcn/card.js +7 -7
  24. package/dist/vendor/shadcn/input.js +7 -7
  25. package/dist/vendor/shadcn/select.js +1 -1
  26. package/dist/vendor/shadcn/table.js +18 -18
  27. package/package.json +1 -1
  28. package/dist/components/atoms/icon/aida-logo.d.ts +0 -3
  29. package/dist/components/atoms/icon/aida-logo.js +0 -64
  30. package/dist/node_modules/@phosphor-icons/react/dist/csr/File.es.js +0 -8
  31. package/dist/node_modules/@phosphor-icons/react/dist/csr/Table.es.js +0 -8
  32. package/dist/node_modules/@phosphor-icons/react/dist/defs/File.es.js +0 -30
  33. 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 M } from "../../../vendor/shadcn/radio-group.js";
4
- import { cn as _ } from "../../../lib/utils.js";
5
- import { DatePicker as m } from "../date-picker/date-picker.js";
6
- import { TimePicker as x } from "../time-picker/time-picker.js";
7
- const l = {
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
- }, a = T(
16
- ({ label: r, description: c, value: i, className: d, ...o }, t) => {
17
- const n = `date-range-${i}`;
18
- return /* @__PURE__ */ e.jsxs("div", { className: "flex items-start gap-4 w-full", children: [
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: t,
23
- className: _(
71
+ ref: m,
72
+ className: N(
24
73
  "flex-1 flex items-start gap-3 cursor-pointer",
25
- d
74
+ n
26
75
  ),
27
- ...o,
76
+ ...r,
28
77
  children: [
29
- /* @__PURE__ */ e.jsx(M, { id: n, value: i, className: "mt-px" }),
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: r }) })
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
- c && /* @__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: c }) })
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
- a.displayName = "FilterDateRangeOption";
39
- const b = T(
87
+ c.displayName = "FilterDateRangeOption";
88
+ const I = y(
40
89
  ({
41
- showCustomFields: r = !1,
42
- onCustomFieldsChange: c,
43
- startDate: i,
44
- endDate: d,
45
- startTime: o = "",
46
- endTime: t = "",
47
- onStartDateChange: n,
48
- onEndDateChange: f,
49
- onStartTimeChange: p,
50
- onEndTimeChange: h,
51
- mode: j = "range",
52
- singleDayLabel: D = "Select date",
53
- showAllTime: L = !1,
54
- className: O,
55
- value: g,
56
- onValueChange: Y,
57
- ...N
58
- }, y) => {
59
- const u = (s) => {
60
- Y?.(s), c?.(s === l.CUSTOM);
61
- }, C = (s) => {
62
- if (s) {
63
- const v = new Date(s);
64
- v.setHours(0, 0, 0, 0);
65
- const A = new Date(s);
66
- A.setHours(23, 59, 59, 999), n?.(v), f?.(A);
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
- n?.(void 0), f?.(void 0);
117
+ l?.(void 0), x?.(void 0);
69
118
  };
70
- return /* @__PURE__ */ e.jsxs(
119
+ return /* @__PURE__ */ e.jsx(
71
120
  "div",
72
121
  {
73
- ref: y,
74
- className: _("flex flex-col gap-4 w-full", O),
75
- children: [
76
- /* @__PURE__ */ e.jsx(
77
- S,
78
- {
79
- value: g,
80
- onValueChange: u,
81
- ...N,
82
- children: /* @__PURE__ */ e.jsx(a, { label: "Custom", value: l.CUSTOM })
83
- }
84
- ),
85
- r && /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-4", children: [
86
- j === "single" ? /* @__PURE__ */ e.jsx("div", { className: "flex flex-col gap-3", children: /* @__PURE__ */ e.jsx(
87
- m,
88
- {
89
- date: i,
90
- onChange: C,
91
- placeholder: D,
92
- className: "h-9",
93
- iconPosition: "none"
94
- }
95
- ) }) : /* @__PURE__ */ e.jsxs("div", { className: "flex gap-4 items-start w-full", children: [
96
- /* @__PURE__ */ e.jsx("div", { className: "flex-1 flex flex-col gap-3", children: /* @__PURE__ */ e.jsx(
97
- m,
98
- {
99
- date: i,
100
- onChange: n,
101
- placeholder: "Start date",
102
- className: "h-9",
103
- iconPosition: "none"
104
- }
105
- ) }),
106
- /* @__PURE__ */ e.jsx("div", { className: "flex-1 flex flex-col gap-3", children: /* @__PURE__ */ e.jsx(
107
- m,
108
- {
109
- date: d,
110
- onChange: f,
111
- placeholder: "End date",
112
- className: "h-9",
113
- iconPosition: "none"
114
- }
115
- ) })
116
- ] }),
117
- j === "single" ? /* @__PURE__ */ e.jsxs("div", { className: "flex gap-4 items-start w-full", children: [
118
- /* @__PURE__ */ e.jsx("div", { className: "flex-1 flex flex-col gap-3", children: /* @__PURE__ */ e.jsx(
119
- x,
120
- {
121
- value: o,
122
- onChange: p,
123
- placeholder: "10:30:00",
124
- className: "h-9"
125
- }
126
- ) }),
127
- /* @__PURE__ */ e.jsx("div", { className: "flex-1 flex flex-col gap-3", children: /* @__PURE__ */ e.jsx(
128
- x,
129
- {
130
- value: t,
131
- onChange: h,
132
- placeholder: "10:30:00",
133
- className: "h-9"
134
- }
135
- ) })
136
- ] }) : /* @__PURE__ */ e.jsxs("div", { className: "flex gap-4 items-start w-full", children: [
137
- /* @__PURE__ */ e.jsx("div", { className: "flex-1 flex flex-col gap-3", children: /* @__PURE__ */ e.jsx(
138
- x,
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
- a,
189
+ c,
166
190
  {
167
191
  label: "Today",
168
- value: l.TODAY,
169
- description: "Today"
192
+ value: o.TODAY,
193
+ description: p.today
170
194
  }
171
195
  ),
172
196
  /* @__PURE__ */ e.jsx(
173
- a,
197
+ c,
174
198
  {
175
199
  label: "Last 3 days",
176
- value: l.LAST_3_DAYS,
177
- description: "Friday, Jan 3"
200
+ value: o.LAST_3_DAYS,
201
+ description: p.last3Days
178
202
  }
179
203
  ),
180
204
  /* @__PURE__ */ e.jsx(
181
- a,
205
+ c,
182
206
  {
183
207
  label: "Last 7 days",
184
- value: l.LAST_7_DAYS,
185
- description: "Dic 29 - Jan 3"
208
+ value: o.LAST_7_DAYS,
209
+ description: p.last7Days
186
210
  }
187
211
  ),
188
212
  /* @__PURE__ */ e.jsx(
189
- a,
213
+ c,
190
214
  {
191
215
  label: "Last 30 days",
192
- value: l.LAST_30_DAYS,
193
- description: "Dic 3 - Jan 3"
216
+ value: o.LAST_30_DAYS,
217
+ description: p.last30Days
194
218
  }
195
219
  ),
196
220
  /* @__PURE__ */ e.jsx(
197
- a,
221
+ c,
198
222
  {
199
223
  label: "This month",
200
- value: l.THIS_MONTH,
201
- description: "Jan 2026"
224
+ value: o.THIS_MONTH,
225
+ description: p.thisMonth
202
226
  }
203
227
  ),
204
- L && /* @__PURE__ */ e.jsx(a, { label: "All time", value: l.ALL_TIME })
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
- b.displayName = "FilterDateRange";
237
+ I.displayName = "FilterDateRange";
214
238
  export {
215
- b as FilterDateRange,
216
- a as FilterDateRangeOption,
217
- l as FilterDateRangeValue
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 {