@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.
Files changed (29) hide show
  1. package/dist/components/atoms/filter/filter-date-range.js +136 -87
  2. package/dist/components/atoms/filter/filter.js +9 -9
  3. package/dist/components/atoms/filter-dropdown/filter-dropdown.js +84 -87
  4. package/dist/components/atoms/icon/icon-list.d.ts +0 -3
  5. package/dist/components/atoms/icon/icon-list.js +392 -398
  6. package/dist/components/atoms/multi-values-field/multi-values-field.js +28 -28
  7. package/dist/components/atoms/radio-group/radio-group-option.js +7 -7
  8. package/dist/components/atoms/search-field/search-field.js +9 -9
  9. package/dist/components/atoms/switch/switch.js +13 -13
  10. package/dist/components/molecules/empty/empty-icon.js +6 -6
  11. package/dist/components/organisms/data-table/data-table.d.ts +1 -19
  12. package/dist/components/organisms/data-table/data-table.js +88 -98
  13. package/dist/components/organisms/data-table/data-table.types.d.ts +0 -19
  14. package/dist/components/organisms/data-table/hooks/use-data-table-state.d.ts +2 -7
  15. package/dist/components/organisms/data-table/hooks/use-data-table-state.js +46 -80
  16. package/dist/components/organisms/data-table/utils/data-table-constants.d.ts +2 -2
  17. package/dist/components/organisms/data-table/utils/data-table-constants.js +11 -11
  18. package/dist/index.css +1 -1
  19. package/dist/vendor/shadcn/badge.js +17 -17
  20. package/dist/vendor/shadcn/card.js +7 -7
  21. package/dist/vendor/shadcn/input.js +7 -7
  22. package/dist/vendor/shadcn/table.js +18 -18
  23. package/package.json +1 -1
  24. package/dist/components/atoms/icon/aida-logo.d.ts +0 -3
  25. package/dist/components/atoms/icon/aida-logo.js +0 -64
  26. package/dist/node_modules/@phosphor-icons/react/dist/csr/File.es.js +0 -8
  27. package/dist/node_modules/@phosphor-icons/react/dist/csr/Table.es.js +0 -8
  28. package/dist/node_modules/@phosphor-icons/react/dist/defs/File.es.js +0 -30
  29. package/dist/node_modules/@phosphor-icons/react/dist/defs/Table.es.js +0 -30
@@ -1,51 +1,51 @@
1
1
  import { j as t } from "../../../_virtual/jsx-runtime.js";
2
- import { forwardRef as j, useState as I, useRef as _, useCallback as K, useEffect as X } from "react";
3
- import { Button as E } from "../../../vendor/shadcn/button.js";
4
- import { Separator as S } from "../../../vendor/shadcn/separator.js";
2
+ import { forwardRef as j, useState as F, useRef as _, useCallback as K, useEffect as X } from "react";
3
+ import { Button as I } from "../../../vendor/shadcn/button.js";
4
+ import { Separator as E } from "../../../vendor/shadcn/separator.js";
5
5
  import { Badge as k } from "../../../vendor/shadcn/badge.js";
6
6
  import { Icon as b } from "../icon/icon.js";
7
- import { FilterSection as M } from "../filter/filter.js";
7
+ import { FilterSection as S } from "../filter/filter.js";
8
8
  import { FilterDateRange as Y, FilterDateRangeValue as g } from "../filter/filter-date-range.js";
9
- import { cn as d } from "../../../lib/utils.js";
10
- const A = j(
11
- ({ icon: r, label: u, isActive: l = !1, showChevron: m = !1, className: h, ...o }, C) => /* @__PURE__ */ t.jsxs(
9
+ import { cn as c } from "../../../lib/utils.js";
10
+ const M = j(
11
+ ({ icon: s, label: u, isActive: r = !1, showChevron: m = !1, className: h, ...l }, C) => /* @__PURE__ */ t.jsxs(
12
12
  "button",
13
13
  {
14
14
  ref: C,
15
- className: d(
15
+ className: c(
16
16
  "flex items-center gap-2 h-8 px-2 rounded-md w-full transition-colors",
17
17
  "hover:bg-secondary",
18
18
  h
19
19
  ),
20
- ...o,
20
+ ...l,
21
21
  children: [
22
- r && /* @__PURE__ */ t.jsx(
22
+ s && /* @__PURE__ */ t.jsx(
23
23
  b,
24
24
  {
25
- name: r,
26
- className: d(
25
+ name: s,
26
+ className: c(
27
27
  "size-4 shrink-0",
28
- l ? "text-primary" : "text-foreground"
28
+ r ? "text-primary" : "text-foreground"
29
29
  )
30
30
  }
31
31
  ),
32
32
  /* @__PURE__ */ t.jsx(
33
33
  "span",
34
34
  {
35
- className: d(
35
+ className: c(
36
36
  "flex-1 text-sm font-normal text-left truncate",
37
- l ? "font-medium text-primary" : "text-foreground"
37
+ r ? "font-medium text-primary" : "text-foreground"
38
38
  ),
39
39
  children: u
40
40
  }
41
41
  ),
42
- (l || m) && /* @__PURE__ */ t.jsx(
42
+ (r || m) && /* @__PURE__ */ t.jsx(
43
43
  b,
44
44
  {
45
45
  name: "CaretRight",
46
- className: d(
46
+ className: c(
47
47
  "size-4 shrink-0",
48
- l ? "text-primary" : "text-foreground"
48
+ r ? "text-primary" : "text-foreground"
49
49
  )
50
50
  }
51
51
  )
@@ -53,94 +53,91 @@ const A = j(
53
53
  }
54
54
  )
55
55
  );
56
- A.displayName = "FilterMenuItem";
57
- const V = j(
58
- ({ items: r, activeItemId: u, onItemClick: l, className: m }, h) => /* @__PURE__ */ t.jsx(
56
+ M.displayName = "FilterMenuItem";
57
+ const A = j(
58
+ ({ items: s, activeItemId: u, onItemClick: r, className: m }, h) => /* @__PURE__ */ t.jsx(
59
59
  "div",
60
60
  {
61
61
  ref: h,
62
- className: d(
62
+ className: c(
63
63
  "flex flex-col gap-2 w-64 h-full p-2 bg-surface border border-border rounded-md",
64
64
  m
65
65
  ),
66
- children: r.map((o) => /* @__PURE__ */ t.jsx(
67
- A,
66
+ children: s.map((l) => /* @__PURE__ */ t.jsx(
67
+ M,
68
68
  {
69
- icon: o.icon,
70
- label: o.label,
71
- isActive: u === o.id,
72
- showChevron: o.showChevron,
73
- onClick: () => l?.(o.id)
69
+ icon: l.icon,
70
+ label: l.label,
71
+ isActive: u === l.id,
72
+ showChevron: l.showChevron,
73
+ onClick: () => r?.(l.id)
74
74
  },
75
- o.id
75
+ l.id
76
76
  ))
77
77
  }
78
78
  )
79
79
  );
80
- V.displayName = "FilterMenu";
80
+ A.displayName = "FilterMenu";
81
81
  const $ = j(
82
82
  ({
83
- filters: r,
83
+ filters: s,
84
84
  buttonText: u = "Add filter",
85
- appliedFilters: l = [],
85
+ appliedFilters: r = [],
86
86
  onRemoveFilter: m,
87
87
  onClearAllFilters: h,
88
- maxVisibleTags: o = 4,
88
+ maxVisibleTags: l = 4,
89
89
  className: C,
90
- disabled: O = !1
90
+ disabled: V = !1
91
91
  }, x) => {
92
- const [f, p] = I(!1), [v, N] = I(
93
- r.length > 0 && r[0]?.id || ""
94
- ), w = _(null), R = K(
92
+ const [f, p] = F(!1), [v, w] = F(
93
+ s.length > 0 && s[0]?.id || ""
94
+ ), N = _(null), O = K(
95
95
  (n) => {
96
- w.current = n, typeof x == "function" ? x(n) : x && (x.current = n);
96
+ N.current = n, typeof x == "function" ? x(n) : x && (x.current = n);
97
97
  },
98
98
  [x]
99
99
  );
100
100
  X(() => {
101
101
  if (!f) return;
102
- const n = (s) => {
103
- const c = s.target;
104
- w.current?.contains(c) || c.closest?.(
102
+ const n = (i) => {
103
+ const d = i.target;
104
+ N.current?.contains(d) || d.closest?.(
105
105
  "[data-radix-popper-content-wrapper], [data-radix-portal]"
106
- ) || c.closest?.(
106
+ ) || d.closest?.(
107
107
  ".rdp, .rdp-root, [data-calendar]"
108
108
  ) || p(!1);
109
- }, a = (s) => {
110
- s.key === "Escape" && p(!1);
111
- }, i = setTimeout(() => {
109
+ }, a = (i) => {
110
+ i.key === "Escape" && p(!1);
111
+ }, o = setTimeout(() => {
112
112
  document.addEventListener("mousedown", n), document.addEventListener("keydown", a);
113
113
  }, 0);
114
114
  return () => {
115
- clearTimeout(i), document.removeEventListener("mousedown", n), document.removeEventListener("keydown", a);
115
+ clearTimeout(o), document.removeEventListener("mousedown", n), document.removeEventListener("keydown", a);
116
116
  };
117
117
  }, [f]);
118
- const z = l.length > 0, L = l.slice(0, o), y = l.length - o, T = (n) => {
119
- if (r.find((s) => s.id === n)) return n;
120
- const i = n.split("-");
121
- if (i.length > 1) {
122
- const s = i[0];
123
- if (r.find((F) => F.id === s)) return s;
118
+ const R = r.length > 0, z = r.slice(0, l), y = r.length - l, T = (n) => s.find((o) => o.id === n)?.clearable !== !1, L = (n) => {
119
+ if (s.find((i) => i.id === n)) return n;
120
+ const o = n.split("-");
121
+ if (o.length > 1) {
122
+ const i = o[0];
123
+ if (s.find((D) => D.id === i)) return i;
124
124
  }
125
125
  return n;
126
- }, D = (n) => {
127
- const a = T(n);
128
- return r.find((s) => s.id === a)?.clearable !== !1;
129
126
  }, P = (n) => {
130
- const a = T(n);
131
- N(a), p(!0);
132
- }, B = l.some(
133
- (n) => D(n.id)
134
- ), U = r.map((n) => ({
127
+ const a = L(n);
128
+ w(a), p(!0);
129
+ }, B = r.some(
130
+ (n) => T(n.id)
131
+ ), U = s.map((n) => ({
135
132
  id: n.id,
136
133
  icon: n.icon,
137
134
  label: n.label
138
- })), e = r.find((n) => n.id === v), H = () => {
135
+ })), e = s.find((n) => n.id === v), H = () => {
139
136
  if (!e) return null;
140
137
  switch (e.type) {
141
138
  case "checkbox":
142
139
  return /* @__PURE__ */ t.jsx(
143
- M,
140
+ S,
144
141
  {
145
142
  title: e.label,
146
143
  items: e.items || [],
@@ -157,7 +154,7 @@ const $ = j(
157
154
  );
158
155
  case "radio":
159
156
  return /* @__PURE__ */ t.jsx(
160
- M,
157
+ S,
161
158
  {
162
159
  type: "radio",
163
160
  title: e.label,
@@ -176,10 +173,10 @@ const $ = j(
176
173
  case "date": {
177
174
  const n = (a) => {
178
175
  if (e.onDateValueChange?.(a), a === g.CUSTOM && !e.dateInit && !e.dateEnd) {
179
- const i = /* @__PURE__ */ new Date(), s = new Date(i);
180
- s.setHours(23, 59, 59, 999);
181
- const c = new Date(i);
182
- c.setHours(0, 0, 0, 0), e.onDateInitChange?.(c), e.onDateEndChange?.(s), e.startTime || e.onStartTimeChange?.("00:00:00"), e.endTime || e.onEndTimeChange?.("23:59:59");
176
+ const o = /* @__PURE__ */ new Date(), i = new Date(o);
177
+ i.setHours(23, 59, 59, 999);
178
+ const d = new Date(o);
179
+ d.setHours(0, 0, 0, 0), e.onDateInitChange?.(d), e.onDateEndChange?.(i), e.startTime || e.onStartTimeChange?.("00:00:00"), e.endTime || e.onEndTimeChange?.("23:59:59");
183
180
  }
184
181
  };
185
182
  return /* @__PURE__ */ t.jsx(
@@ -214,42 +211,42 @@ const $ = j(
214
211
  return /* @__PURE__ */ t.jsxs(
215
212
  "div",
216
213
  {
217
- ref: R,
218
- className: d("flex flex-col gap-1 relative", C),
214
+ ref: O,
215
+ className: c("flex flex-col gap-1 relative", C),
219
216
  children: [
220
217
  /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-4", children: [
221
218
  /* @__PURE__ */ t.jsxs(
222
- E,
219
+ I,
223
220
  {
224
221
  variant: "outline",
225
222
  size: "sm",
226
- className: "h-8 gap-2 px-3 py-2",
223
+ className: "h-8 gap-2 px-3 py-2 border-border dark:bg-white/[0.045]",
227
224
  onClick: () => p(!f),
228
- disabled: O,
225
+ disabled: V,
229
226
  children: [
230
227
  /* @__PURE__ */ t.jsx(b, { name: "FunnelSimple", className: "size-4" }),
231
228
  /* @__PURE__ */ t.jsx("span", { className: "text-xs font-medium leading-none", children: u })
232
229
  ]
233
230
  }
234
231
  ),
235
- z ? /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
236
- /* @__PURE__ */ t.jsx(S, { orientation: "vertical", className: "h-5" }),
232
+ R ? /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
233
+ /* @__PURE__ */ t.jsx(E, { orientation: "vertical", className: "h-5" }),
237
234
  /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-2", children: [
238
- L.map((n) => {
239
- const a = D(n.id);
235
+ z.map((n) => {
236
+ const a = T(n.id);
240
237
  return /* @__PURE__ */ t.jsxs(
241
238
  k,
242
239
  {
243
240
  variant: "secondary",
244
- className: "h-8 gap-2 px-3 py-2 shadow-xs cursor-pointer",
241
+ className: "h-8 gap-2 px-3 py-2 shadow-xs cursor-pointer border-border dark:bg-white/[0.045]",
245
242
  onClick: () => P(n.id),
246
243
  children: [
247
244
  /* @__PURE__ */ t.jsx("span", { className: "text-xs font-medium leading-none", children: n.label }),
248
245
  m && a && /* @__PURE__ */ t.jsx(
249
246
  "button",
250
247
  {
251
- onClick: (i) => {
252
- i.stopPropagation(), m(n.id);
248
+ onClick: (o) => {
249
+ o.stopPropagation(), m(n.id);
253
250
  },
254
251
  className: "inline-flex items-center justify-center",
255
252
  "aria-label": `Remove ${n.label} filter`,
@@ -267,7 +264,7 @@ const $ = j(
267
264
  " more"
268
265
  ] }) }),
269
266
  h && B && /* @__PURE__ */ t.jsx(
270
- E,
267
+ I,
271
268
  {
272
269
  variant: "ghost",
273
270
  size: "sm",
@@ -278,14 +275,14 @@ const $ = j(
278
275
  )
279
276
  ] })
280
277
  ] }) : /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
281
- /* @__PURE__ */ t.jsx(S, { orientation: "vertical", className: "h-5" }),
278
+ /* @__PURE__ */ t.jsx(E, { orientation: "vertical", className: "h-5" }),
282
279
  /* @__PURE__ */ t.jsx("span", { className: "text-sm font-normal text-muted-foreground", children: "No filters applied" })
283
280
  ] })
284
281
  ] }),
285
282
  f && /* @__PURE__ */ t.jsxs(
286
283
  "div",
287
284
  {
288
- className: d(
285
+ className: c(
289
286
  "z-50 shadow-lg",
290
287
  "absolute top-full left-0 mt-1",
291
288
  "flex flex-row gap-2",
@@ -294,11 +291,11 @@ const $ = j(
294
291
  ),
295
292
  children: [
296
293
  /* @__PURE__ */ t.jsx(
297
- V,
294
+ A,
298
295
  {
299
296
  items: U,
300
297
  activeItemId: v,
301
- onItemClick: N
298
+ onItemClick: w
302
299
  }
303
300
  ),
304
301
  /* @__PURE__ */ t.jsx("div", { className: "flex flex-col gap-4 p-6 bg-popover w-[448px] h-full rounded-md overflow-y-auto", children: H() })
@@ -313,6 +310,6 @@ const $ = j(
313
310
  $.displayName = "FilterDropdown";
314
311
  export {
315
312
  $ as FilterDropdown,
316
- V as FilterMenu,
317
- A as FilterMenuItem
313
+ A as FilterMenu,
314
+ M as FilterMenuItem
318
315
  };
@@ -1,5 +1,4 @@
1
1
  declare const IconList: {
2
- AidaLogo: ({ size, ...props }: import('@phosphor-icons/react').IconProps) => import("react/jsx-runtime").JSX.Element;
3
2
  Activity: import('@phosphor-icons/react').Icon;
4
3
  FileSearch: import('@phosphor-icons/react').Icon;
5
4
  MagnifyingGlass: import('@phosphor-icons/react').Icon;
@@ -143,8 +142,6 @@ declare const IconList: {
143
142
  ToggleRight: import('@phosphor-icons/react').Icon;
144
143
  ArrowCircleUp: import('@phosphor-icons/react').Icon;
145
144
  ArrowUp: import('@phosphor-icons/react').Icon;
146
- File: import('@phosphor-icons/react').Icon;
147
- Table: import('@phosphor-icons/react').Icon;
148
145
  ArrowDown: import('@phosphor-icons/react').Icon;
149
146
  ArrowUpRight: import('@phosphor-icons/react').Icon;
150
147
  PlayCircle: import('@phosphor-icons/react').Icon;