@yuno-payments/dashboard-design-system 2.2.0 → 2.2.1-beta.2

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 (54) hide show
  1. package/dist/components/atoms/checkbox/checkbox.js +16 -16
  2. package/dist/components/atoms/filter/filter-date-range.d.ts +31 -1
  3. package/dist/components/atoms/filter/filter-date-range.js +140 -144
  4. package/dist/components/atoms/filter/filter-multi-input.d.ts +11 -0
  5. package/dist/components/atoms/filter/filter-multi-input.js +42 -36
  6. package/dist/components/atoms/filter/filter-translations.d.ts +75 -0
  7. package/dist/components/atoms/filter/filter-translations.js +450 -0
  8. package/dist/components/atoms/filter/filter.d.ts +30 -0
  9. package/dist/components/atoms/filter/filter.js +191 -171
  10. package/dist/components/atoms/filter/index.d.ts +2 -2
  11. package/dist/components/atoms/filter-dropdown/filter-dropdown.d.ts +17 -2
  12. package/dist/components/atoms/filter-dropdown/filter-dropdown.js +160 -151
  13. package/dist/components/atoms/icon/directional-icons.d.ts +12 -0
  14. package/dist/components/atoms/icon/directional-icons.js +38 -0
  15. package/dist/components/atoms/icon/icon.d.ts +6 -0
  16. package/dist/components/atoms/icon/icon.js +27 -21
  17. package/dist/components/atoms/icon/index.d.ts +1 -0
  18. package/dist/components/atoms/index.d.ts +1 -1
  19. package/dist/components/atoms/radio-group/radio-group-option.js +2 -2
  20. package/dist/components/atoms/select/select.js +2 -2
  21. package/dist/components/molecules/dialog-header/dialog-header.d.ts +1 -1
  22. package/dist/components/molecules/pagination/index.d.ts +1 -0
  23. package/dist/components/molecules/pagination/page-numbers.d.ts +3 -1
  24. package/dist/components/molecules/pagination/page-numbers.js +10 -9
  25. package/dist/components/molecules/pagination/pagination-translations.d.ts +33 -0
  26. package/dist/components/molecules/pagination/pagination-translations.js +82 -0
  27. package/dist/components/molecules/pagination/pagination.d.ts +9 -0
  28. package/dist/components/molecules/pagination/pagination.js +46 -38
  29. package/dist/components/organisms/data-table/components/column-header/data-table-column-header-menu.d.ts +3 -1
  30. package/dist/components/organisms/data-table/components/column-header/data-table-column-header-menu.js +28 -27
  31. package/dist/components/organisms/data-table/components/column-header/data-table-column-header.js +44 -41
  32. package/dist/components/organisms/data-table/components/data-table-header.js +11 -12
  33. package/dist/components/organisms/data-table/components/dialogs/data-table-manage-columns-dialog.d.ts +3 -1
  34. package/dist/components/organisms/data-table/components/dialogs/data-table-manage-columns-dialog.js +45 -44
  35. package/dist/components/organisms/data-table/data-table.d.ts +27 -2
  36. package/dist/components/organisms/data-table/data-table.js +146 -134
  37. package/dist/components/organisms/data-table/data-table.types.d.ts +68 -0
  38. package/dist/components/organisms/data-table/data-table.types.js +252 -0
  39. package/dist/components/organisms/data-table/index.d.ts +2 -1
  40. package/dist/components/organisms/data-table/utils/data-table-utils.js +11 -8
  41. package/dist/dashboard-design-system.css +1 -1
  42. package/dist/index.css +1 -1
  43. package/dist/index.d.ts +2 -1
  44. package/dist/index.esm.min.js +9394 -8512
  45. package/dist/index.js +208 -202
  46. package/dist/index.umd.min.js +25 -25
  47. package/dist/lib/utils.d.ts +13 -0
  48. package/dist/lib/utils.js +34 -10
  49. package/dist/vendor/shadcn/pagination.d.ts +19 -3
  50. package/dist/vendor/shadcn/pagination.js +41 -37
  51. package/dist/vendor/shadcn/select.js +33 -33
  52. package/dist/vendor/shadcn/switch.js +1 -1
  53. package/package.json +4 -2
  54. package/registry/components-registry.json +38 -12
@@ -1,16 +1,17 @@
1
1
  import { j as s } from "../../../_virtual/jsx-runtime.js";
2
- import { forwardRef as N, useState as E, useRef as p, useCallback as T, useEffect as q } from "react";
3
- import { Button as j } from "../../../vendor/shadcn/button.js";
4
- import { Separator as G } from "../../../vendor/shadcn/separator.js";
5
- import { Icon as w } from "../icon/icon.js";
6
- import { FilterSection as J } from "../filter/filter.js";
7
- import { FilterDateRangeValue as k, FilterDateRange as Ee } from "../filter/filter-date-range.js";
2
+ import { forwardRef as S, useMemo as Ne, useState as N, useRef as F, useCallback as p, useEffect as Q } from "react";
3
+ import { Button as T } from "../../../vendor/shadcn/button.js";
4
+ import { Separator as Z } from "../../../vendor/shadcn/separator.js";
5
+ import { Icon as k } from "../icon/icon.js";
6
+ import { FilterSection as O } from "../filter/filter.js";
7
+ import { FilterDateRangeValue as I, FilterDateRange as Fe } from "../filter/filter-date-range.js";
8
8
  import { cn as h } from "../../../lib/utils.js";
9
- const Q = N(
10
- ({ icon: d, label: C, isActive: u = !1, showChevron: x = !1, className: b, ...c }, v) => /* @__PURE__ */ s.jsxs(
9
+ import { getFilterTranslations as Ie, formatMoreFilters as Se } from "../filter/filter-translations.js";
10
+ const ee = S(
11
+ ({ icon: d, label: D, isActive: u = !1, showChevron: x = !1, className: b, ...c }, w) => /* @__PURE__ */ s.jsxs(
11
12
  "button",
12
13
  {
13
- ref: v,
14
+ ref: w,
14
15
  className: h(
15
16
  "flex items-center gap-2 h-8 px-2 rounded-md w-full transition-colors shrink-0 hover:bg-secondary",
16
17
  b
@@ -18,7 +19,7 @@ const Q = N(
18
19
  ...c,
19
20
  children: [
20
21
  d && /* @__PURE__ */ s.jsx(
21
- w,
22
+ k,
22
23
  {
23
24
  name: d,
24
25
  className: h(
@@ -34,11 +35,11 @@ const Q = N(
34
35
  "flex-1 text-sm font-normal text-left truncate",
35
36
  u ? "text-primary" : "text-foreground"
36
37
  ),
37
- children: C
38
+ children: D
38
39
  }
39
40
  ),
40
41
  (u || x) && /* @__PURE__ */ s.jsx(
41
- w,
42
+ k,
42
43
  {
43
44
  name: "CaretRight",
44
45
  className: h(
@@ -51,9 +52,9 @@ const Q = N(
51
52
  }
52
53
  )
53
54
  );
54
- Q.displayName = "FilterMenuItem";
55
- const Z = N(
56
- ({ items: d, activeItemId: C, onItemClick: u, className: x }, b) => /* @__PURE__ */ s.jsx(
55
+ ee.displayName = "FilterMenuItem";
56
+ const te = S(
57
+ ({ items: d, activeItemId: D, onItemClick: u, className: x }, b) => /* @__PURE__ */ s.jsx(
57
58
  "div",
58
59
  {
59
60
  ref: b,
@@ -62,11 +63,11 @@ const Z = N(
62
63
  x
63
64
  ),
64
65
  children: d.map((c) => /* @__PURE__ */ s.jsx(
65
- Q,
66
+ ee,
66
67
  {
67
68
  icon: c.icon,
68
69
  label: c.label,
69
- isActive: C === c.id,
70
+ isActive: D === c.id,
70
71
  showChevron: c.showChevron,
71
72
  onClick: () => u?.(c.id)
72
73
  },
@@ -75,125 +76,130 @@ const Z = N(
75
76
  }
76
77
  )
77
78
  );
78
- Z.displayName = "FilterMenu";
79
- const pe = N(
79
+ te.displayName = "FilterMenu";
80
+ const ye = S(
80
81
  ({
81
82
  filters: d,
82
- buttonText: C = "Add filter",
83
+ buttonText: D,
83
84
  appliedFilters: u = [],
84
85
  onRemoveFilter: x,
85
86
  onClearAllFilters: b,
86
87
  onOpenChange: c,
87
- maxVisibleTags: v = 4,
88
- className: O,
89
- disabled: ee = !1,
90
- applyOnClose: o = !1
91
- }, D) => {
92
- const [m, I] = E(!1), [f, te] = E({}), S = p({}), F = p(d), l = T(
88
+ maxVisibleTags: w = 4,
89
+ className: ne,
90
+ disabled: ae = !1,
91
+ applyOnClose: i = !1,
92
+ lang: V,
93
+ translations: g
94
+ }, v) => {
95
+ const E = Ne(() => {
96
+ const e = Ie(V);
97
+ return g ? { ...e, ...g } : e;
98
+ }, [V, g]), [m, y] = N(!1), [f, re] = N({}), B = F({}), M = F(d), l = p(
93
99
  (e) => {
94
- te((n) => {
100
+ re((n) => {
95
101
  const r = typeof e == "function" ? e(n) : e;
96
- return S.current = r, r;
102
+ return B.current = r, r;
97
103
  });
98
104
  },
99
105
  []
100
106
  );
101
- q(() => {
102
- F.current = d;
107
+ Q(() => {
108
+ M.current = d;
103
109
  }, [d]);
104
- const y = T(() => {
105
- if (!o) return;
106
- const e = S.current, n = F.current;
110
+ const R = p(() => {
111
+ if (!i) return;
112
+ const e = B.current, n = M.current;
107
113
  Object.entries(e).forEach(([r, a]) => {
108
- const i = n.find((g) => g.id === r);
109
- if (i)
114
+ const o = n.find((C) => C.id === r);
115
+ if (o)
110
116
  switch (a.type) {
111
117
  case "checkbox":
112
- a.checkboxValues !== void 0 && i.onChange?.(a.checkboxValues);
118
+ a.checkboxValues !== void 0 && o.onChange?.(a.checkboxValues);
113
119
  break;
114
120
  case "radio":
115
- a.radioValue !== void 0 && i.onValueChange?.(a.radioValue);
121
+ a.radioValue !== void 0 && o.onValueChange?.(a.radioValue);
116
122
  break;
117
123
  case "date":
118
- a.dateValue !== void 0 && i.onDateValueChange?.(a.dateValue), a.dateInit !== void 0 && i.onDateInitChange?.(a.dateInit), a.dateEnd !== void 0 && i.onDateEndChange?.(a.dateEnd), a.startTime !== void 0 && i.onStartTimeChange?.(a.startTime), a.endTime !== void 0 && i.onEndTimeChange?.(a.endTime);
124
+ a.dateValue !== void 0 && o.onDateValueChange?.(a.dateValue), a.dateInit !== void 0 && o.onDateInitChange?.(a.dateInit), a.dateEnd !== void 0 && o.onDateEndChange?.(a.dateEnd), a.startTime !== void 0 && o.onStartTimeChange?.(a.startTime), a.endTime !== void 0 && o.onEndTimeChange?.(a.endTime);
119
125
  break;
120
126
  case "custom":
121
- a.customValue !== void 0 && i.onCustomChange?.(a.customValue);
127
+ a.customValue !== void 0 && o.onCustomChange?.(a.customValue);
122
128
  break;
123
129
  }
124
130
  }), l({});
125
- }, [o, l]), V = T(
131
+ }, [i, l]), j = p(
126
132
  (e) => {
127
- if (!e && m && o) {
128
- c?.(e), y(), I(e);
133
+ if (!e && m && i) {
134
+ c?.(e), R(), y(e);
129
135
  return;
130
136
  }
131
- e && !m && o && l({}), I(e), c?.(e);
137
+ e && !m && i && l({}), y(e), c?.(e);
132
138
  },
133
139
  [
134
140
  c,
135
141
  m,
136
- o,
137
- y,
142
+ i,
143
+ R,
138
144
  l
139
145
  ]
140
- ), [B, M] = E(
146
+ ), [A, H] = N(
141
147
  d.length > 0 && d[0]?.id || ""
142
- ), R = p(null), ne = T(
148
+ ), z = F(null), se = p(
143
149
  (e) => {
144
- R.current = e, typeof D == "function" ? D(e) : D && (D.current = e);
150
+ z.current = e, typeof v == "function" ? v(e) : v && (v.current = e);
145
151
  },
146
- [D]
152
+ [v]
147
153
  );
148
- q(() => {
154
+ Q(() => {
149
155
  if (!m) return;
150
156
  const e = (a) => {
151
- const i = a.target;
152
- R.current?.contains(i) || i.closest?.(
157
+ const o = a.target;
158
+ z.current?.contains(o) || o.closest?.(
153
159
  "[data-radix-popper-content-wrapper], [data-radix-portal]"
154
- ) || i.closest?.(
160
+ ) || o.closest?.(
155
161
  ".rdp, .rdp-root, [data-calendar]"
156
- ) || V(!1);
162
+ ) || j(!1);
157
163
  }, n = (a) => {
158
- a.key === "Escape" && V(!1);
164
+ a.key === "Escape" && j(!1);
159
165
  }, r = setTimeout(() => {
160
166
  document.addEventListener("mousedown", e), document.addEventListener("keydown", n);
161
167
  }, 0);
162
168
  return () => {
163
169
  clearTimeout(r), document.removeEventListener("mousedown", e), document.removeEventListener("keydown", n);
164
170
  };
165
- }, [m, V]);
166
- const ae = u.length > 0, re = u.slice(0, v), A = u.length - v, H = (e) => {
171
+ }, [m, j]);
172
+ const ie = u.length > 0, oe = u.slice(0, w), L = u.length - w, P = (e) => {
167
173
  if (d.find((a) => a.id === e)) return e;
168
174
  const r = e.split("-");
169
175
  if (r.length > 1) {
170
176
  const a = r[0];
171
- if (d.find((g) => g.id === a)) return a;
177
+ if (d.find((C) => C.id === a)) return a;
172
178
  }
173
179
  return e;
174
- }, z = (e) => {
175
- const n = H(e);
180
+ }, U = (e) => {
181
+ const n = P(e);
176
182
  return d.find((a) => a.id === n)?.clearable !== !1;
177
- }, se = (e) => {
178
- const n = H(e);
179
- M(n), V(!0);
180
- }, oe = u.some(
181
- (e) => z(e.id)
182
- ), ie = d.map((e) => ({
183
+ }, de = (e) => {
184
+ const n = P(e);
185
+ H(n), j(!0);
186
+ }, ce = u.some(
187
+ (e) => U(e.id)
188
+ ), le = d.map((e) => ({
183
189
  id: e.id,
184
190
  icon: e.icon,
185
191
  label: e.label
186
- })), t = d.find((e) => e.id === B), de = (e, n) => o ? f[e]?.checkboxValues ?? n : n, ce = (e, n) => o ? f[e]?.radioValue ?? n : n, le = (e, n) => o ? f[e]?.dateValue ?? n : n, ue = (e, n) => o ? f[e]?.dateInit ?? n : n, fe = (e, n) => o ? f[e]?.dateEnd ?? n : n, me = (e, n) => o ? f[e]?.startTime ?? n : n, he = (e, n) => o ? f[e]?.endTime ?? n : n, xe = (e, n, r) => (a) => {
187
- r !== void 0 && r > 0 && a.length < r || (o ? l((i) => ({
188
- ...i,
192
+ })), t = d.find((e) => e.id === A), ue = (e, n) => i ? f[e]?.checkboxValues ?? n : n, fe = (e, n) => i ? f[e]?.radioValue ?? n : n, me = (e, n) => i ? f[e]?.dateValue ?? n : n, he = (e, n) => i ? f[e]?.dateInit ?? n : n, xe = (e, n) => i ? f[e]?.dateEnd ?? n : n, be = (e, n) => i ? f[e]?.startTime ?? n : n, ge = (e, n) => i ? f[e]?.endTime ?? n : n, Ce = (e, n, r) => (a) => {
193
+ r !== void 0 && r > 0 && a.length < r || (i ? l((o) => ({
194
+ ...o,
189
195
  [e]: {
190
- ...i[e],
196
+ ...o[e],
191
197
  type: "checkbox",
192
198
  checkboxValues: a
193
199
  }
194
200
  })) : n?.(a));
195
- }, be = (e, n) => (r) => {
196
- o ? l((a) => ({
201
+ }, De = (e, n) => (r) => {
202
+ i ? l((a) => ({
197
203
  ...a,
198
204
  [e]: {
199
205
  ...a[e],
@@ -201,8 +207,8 @@ const pe = N(
201
207
  radioValue: r
202
208
  }
203
209
  })) : n?.(r);
204
- }, ge = (e, n) => (r) => {
205
- o ? l((a) => ({
210
+ }, Ve = (e, n) => (r) => {
211
+ i ? l((a) => ({
206
212
  ...a,
207
213
  [e]: {
208
214
  ...a[e],
@@ -210,8 +216,8 @@ const pe = N(
210
216
  dateValue: r
211
217
  }
212
218
  })) : n?.(r);
213
- }, Ce = (e, n) => (r) => {
214
- o ? l((a) => ({
219
+ }, ve = (e, n) => (r) => {
220
+ i ? l((a) => ({
215
221
  ...a,
216
222
  [e]: {
217
223
  ...a[e],
@@ -219,8 +225,8 @@ const pe = N(
219
225
  dateInit: r
220
226
  }
221
227
  })) : n?.(r);
222
- }, De = (e, n) => (r) => {
223
- o ? l((a) => ({
228
+ }, je = (e, n) => (r) => {
229
+ i ? l((a) => ({
224
230
  ...a,
225
231
  [e]: {
226
232
  ...a[e],
@@ -228,8 +234,8 @@ const pe = N(
228
234
  dateEnd: r
229
235
  }
230
236
  })) : n?.(r);
231
- }, Ve = (e, n) => (r) => {
232
- o ? l((a) => ({
237
+ }, we = (e, n) => (r) => {
238
+ i ? l((a) => ({
233
239
  ...a,
234
240
  [e]: {
235
241
  ...a[e],
@@ -237,8 +243,8 @@ const pe = N(
237
243
  startTime: r
238
244
  }
239
245
  })) : n?.(r);
240
- }, ve = (e, n) => (r) => {
241
- o ? l((a) => ({
246
+ }, Ee = (e, n) => (r) => {
247
+ i ? l((a) => ({
242
248
  ...a,
243
249
  [e]: {
244
250
  ...a[e],
@@ -246,21 +252,21 @@ const pe = N(
246
252
  endTime: r
247
253
  }
248
254
  })) : n?.(r);
249
- }, Te = () => {
255
+ }, pe = () => {
250
256
  if (!t) return null;
251
257
  switch (t.type) {
252
258
  case "checkbox": {
253
- const e = de(
259
+ const e = ue(
254
260
  t.id,
255
261
  t.selectedValues || []
256
262
  ), n = t.description && (t.descriptionMinSelection === void 0 || e.length >= t.descriptionMinSelection);
257
263
  return /* @__PURE__ */ s.jsx(
258
- J,
264
+ O,
259
265
  {
260
266
  title: t.label,
261
267
  items: t.items || [],
262
268
  selectedValues: e,
263
- onChange: xe(
269
+ onChange: Ce(
264
270
  t.id,
265
271
  t.onChange,
266
272
  t.minSelection
@@ -271,22 +277,24 @@ const pe = N(
271
277
  enableSelectAll: t.enableSelectAll,
272
278
  enableInverse: t.enableInverse,
273
279
  enableNone: t.enableNone,
274
- description: n ? t.description : void 0
280
+ description: n ? t.description : void 0,
281
+ lang: V,
282
+ translations: g
275
283
  }
276
284
  );
277
285
  }
278
286
  case "radio":
279
287
  return /* @__PURE__ */ s.jsx(
280
- J,
288
+ O,
281
289
  {
282
290
  type: "radio",
283
291
  title: t.label,
284
292
  items: t.items || [],
285
- selectedValue: ce(
293
+ selectedValue: fe(
286
294
  t.id,
287
295
  t.selectedValue || ""
288
296
  ),
289
- onChange: be(
297
+ onChange: De(
290
298
  t.id,
291
299
  t.onValueChange
292
300
  ),
@@ -296,71 +304,76 @@ const pe = N(
296
304
  enableSelectAll: t.enableSelectAll,
297
305
  enableInverse: t.enableInverse,
298
306
  enableNone: t.enableNone,
299
- description: t.description
307
+ description: t.description,
308
+ lang: V,
309
+ translations: g
300
310
  }
301
311
  );
302
312
  case "date": {
303
- const e = le(
313
+ const e = me(
304
314
  t.id,
305
- t.dateValue || k.LAST_7_DAYS
306
- ), n = ue(
315
+ t.dateValue || I.LAST_7_DAYS
316
+ ), n = he(
307
317
  t.id,
308
318
  t.dateInit
309
- ), r = fe(
319
+ ), r = xe(
310
320
  t.id,
311
321
  t.dateEnd
312
- ), a = me(
322
+ ), a = be(
313
323
  t.id,
314
324
  t.startTime || ""
315
- ), i = he(
325
+ ), o = ge(
316
326
  t.id,
317
327
  t.endTime || ""
318
- ), g = o && f[t.id]?.dateInit !== void 0, L = o && f[t.id]?.dateEnd !== void 0, je = ge(
328
+ ), C = i && f[t.id]?.dateInit !== void 0, _ = i && f[t.id]?.dateEnd !== void 0, Te = Ve(
319
329
  t.id,
320
330
  t.onDateValueChange
321
- ), P = Ce(
331
+ ), K = ve(
322
332
  t.id,
323
333
  t.onDateInitChange
324
- ), U = De(
334
+ ), W = je(
325
335
  t.id,
326
336
  t.onDateEndChange
327
- ), _ = Ve(
337
+ ), X = we(
328
338
  t.id,
329
339
  t.onStartTimeChange
330
- ), K = ve(
340
+ ), Y = Ee(
331
341
  t.id,
332
342
  t.onEndTimeChange
333
- ), we = (W) => {
334
- if (je(W), W === k.CUSTOM && !g && !L) {
335
- const X = /* @__PURE__ */ new Date(), Y = new Date(X);
336
- Y.setHours(23, 59, 59, 999);
337
- const $ = new Date(X);
338
- $.setHours(0, 0, 0, 0), P($), U(Y), _("00:00:00"), K("23:59:59");
343
+ ), ke = ($) => {
344
+ if (Te($), $ === I.CUSTOM && !C && !_) {
345
+ const q = /* @__PURE__ */ new Date(), G = new Date(q);
346
+ G.setHours(23, 59, 59, 999);
347
+ const J = new Date(q);
348
+ J.setHours(0, 0, 0, 0), K(J), W(G), X("00:00:00"), Y("23:59:59");
339
349
  }
340
350
  };
341
351
  return /* @__PURE__ */ s.jsx(
342
- Ee,
352
+ Fe,
343
353
  {
344
354
  value: e,
345
- onValueChange: we,
346
- showCustomFields: e === k.CUSTOM,
355
+ onValueChange: ke,
356
+ showCustomFields: e === I.CUSTOM,
347
357
  startDate: n,
348
358
  endDate: r,
349
359
  startTime: a,
350
- endTime: i,
360
+ endTime: o,
351
361
  mode: t.dateMode || "range",
352
362
  singleDayLabel: t.singleDayLabel,
353
363
  showAllTime: t.showAllTime,
354
- onStartDateChange: P,
355
- onEndDateChange: U,
356
- onStartTimeChange: _,
357
- onEndTimeChange: K,
358
- announcement: t.description
364
+ onStartDateChange: K,
365
+ onEndDateChange: W,
366
+ onStartTimeChange: X,
367
+ onEndTimeChange: Y,
368
+ announcement: t.description,
369
+ labels: t.dateLabels,
370
+ lang: V,
371
+ translations: g
359
372
  }
360
373
  );
361
374
  }
362
375
  case "custom": {
363
- const e = o ? {
376
+ const e = i ? {
364
377
  bufferedValue: f[t.id]?.customValue,
365
378
  onDeferredChange: (n) => {
366
379
  l((r) => ({
@@ -383,34 +396,34 @@ const pe = N(
383
396
  return /* @__PURE__ */ s.jsxs(
384
397
  "div",
385
398
  {
386
- ref: ne,
387
- className: h("flex flex-col gap-1 relative", O),
399
+ ref: se,
400
+ className: h("flex flex-col gap-1 relative", ne),
388
401
  children: [
389
402
  /* @__PURE__ */ s.jsxs("div", { className: "flex items-center gap-4", children: [
390
403
  /* @__PURE__ */ s.jsxs(
391
- j,
404
+ T,
392
405
  {
393
406
  variant: "outline",
394
407
  size: "sm",
395
408
  className: "gap-2",
396
- onClick: () => V(!m),
397
- disabled: ee,
409
+ onClick: () => j(!m),
410
+ disabled: ae,
398
411
  children: [
399
- /* @__PURE__ */ s.jsx(w, { name: "FunnelSimple", className: "size-4" }),
400
- C
412
+ /* @__PURE__ */ s.jsx(k, { name: "FunnelSimple", className: "size-4" }),
413
+ D ?? E.addFilter
401
414
  ]
402
415
  }
403
416
  ),
404
- ae ? /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
405
- /* @__PURE__ */ s.jsx(G, { orientation: "vertical", className: "h-5" }),
417
+ ie ? /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
418
+ /* @__PURE__ */ s.jsx(Z, { orientation: "vertical", className: "h-5" }),
406
419
  /* @__PURE__ */ s.jsxs("div", { className: "flex items-center gap-2", children: [
407
- re.map((e) => {
408
- const n = z(e.id);
420
+ oe.map((e) => {
421
+ const n = U(e.id);
409
422
  return /* @__PURE__ */ s.jsxs(
410
- j,
423
+ T,
411
424
  {
412
425
  variant: "secondary",
413
- onClick: () => se(e.id),
426
+ onClick: () => de(e.id),
414
427
  className: "display-flex items-center gap-2",
415
428
  size: "sm",
416
429
  children: [
@@ -423,7 +436,7 @@ const pe = N(
423
436
  },
424
437
  className: "inline-flex items-center justify-center",
425
438
  "aria-label": `Remove ${e.label} filter`,
426
- children: /* @__PURE__ */ s.jsx(w, { name: "X", className: "size-4" })
439
+ children: /* @__PURE__ */ s.jsx(k, { name: "X", className: "size-4" })
427
440
  }
428
441
  )
429
442
  ]
@@ -431,25 +444,21 @@ const pe = N(
431
444
  e.id
432
445
  );
433
446
  }),
434
- A > 0 && /* @__PURE__ */ s.jsxs(j, { children: [
435
- "+",
436
- A,
437
- " more"
438
- ] }),
439
- b && oe && /* @__PURE__ */ s.jsx(
440
- j,
447
+ L > 0 && /* @__PURE__ */ s.jsx(T, { children: Se(E, L) }),
448
+ b && ce && /* @__PURE__ */ s.jsx(
449
+ T,
441
450
  {
442
451
  variant: "ghost",
443
452
  size: "sm",
444
453
  className: "h-8 px-3 py-2",
445
454
  onClick: b,
446
- children: /* @__PURE__ */ s.jsx("span", { className: "text-xs font-medium leading-none text-primary", children: "Clear filters" })
455
+ children: /* @__PURE__ */ s.jsx("span", { className: "text-xs font-medium leading-none text-primary", children: E.clearFilters })
447
456
  }
448
457
  )
449
458
  ] })
450
459
  ] }) : /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
451
- /* @__PURE__ */ s.jsx(G, { orientation: "vertical", className: "h-5" }),
452
- /* @__PURE__ */ s.jsx("span", { className: "text-sm font-normal text-muted-foreground", children: "No filters applied" })
460
+ /* @__PURE__ */ s.jsx(Z, { orientation: "vertical", className: "h-5" }),
461
+ /* @__PURE__ */ s.jsx("span", { className: "text-sm font-normal text-muted-foreground", children: E.noFiltersApplied })
453
462
  ] })
454
463
  ] }),
455
464
  m && /* @__PURE__ */ s.jsxs(
@@ -464,14 +473,14 @@ const pe = N(
464
473
  ),
465
474
  children: [
466
475
  /* @__PURE__ */ s.jsx(
467
- Z,
476
+ te,
468
477
  {
469
- items: ie,
470
- activeItemId: B,
471
- onItemClick: M
478
+ items: le,
479
+ activeItemId: A,
480
+ onItemClick: H
472
481
  }
473
482
  ),
474
- /* @__PURE__ */ s.jsx("div", { className: "flex flex-col gap-4 p-6 bg-popover w-[448px] h-full rounded-md overflow-y-auto", children: Te() })
483
+ /* @__PURE__ */ s.jsx("div", { className: "flex flex-col gap-4 p-6 bg-popover w-[448px] h-full rounded-md overflow-y-auto", children: pe() })
475
484
  ]
476
485
  }
477
486
  )
@@ -480,9 +489,9 @@ const pe = N(
480
489
  );
481
490
  }
482
491
  );
483
- pe.displayName = "FilterDropdown";
492
+ ye.displayName = "FilterDropdown";
484
493
  export {
485
- pe as FilterDropdown,
486
- Z as FilterMenu,
487
- Q as FilterMenuItem
494
+ ye as FilterDropdown,
495
+ te as FilterMenu,
496
+ ee as FilterMenuItem
488
497
  };
@@ -0,0 +1,12 @@
1
+ /**
2
+ * List of icon names that represent directional concepts and should be
3
+ * automatically mirrored in RTL (right-to-left) layouts.
4
+ *
5
+ * These icons point left/right or imply horizontal direction, so they need
6
+ * to be flipped when the UI direction changes from LTR to RTL.
7
+ *
8
+ * @example
9
+ * - ArrowLeft in LTR → points left (back)
10
+ * - ArrowLeft in RTL → should point right (still means "back")
11
+ */
12
+ export declare const DIRECTIONAL_ICONS: Set<string>;
@@ -0,0 +1,38 @@
1
+ const r = /* @__PURE__ */ new Set([
2
+ // Arrows - horizontal direction
3
+ "ArrowLeft",
4
+ "ArrowRight",
5
+ "ArrowCircleLeft",
6
+ "ArrowCircleRight",
7
+ "ArrowCircleUpLeft",
8
+ "ArrowBendUpLeft",
9
+ "ArrowBendUpRight",
10
+ "ArrowElbowDownRight",
11
+ "ArrowUpRight",
12
+ "ArrowSquareIn",
13
+ // Carets - horizontal direction
14
+ "CaretLeft",
15
+ "CaretRight",
16
+ "CaretDoubleLeft",
17
+ "CaretDoubleRight",
18
+ "CaretCircleRight",
19
+ // Actions with implied direction
20
+ "SignOut",
21
+ "Export",
22
+ "PhoneOutgoing",
23
+ // Toggle switches (thumb position implies direction)
24
+ "ToggleLeft",
25
+ "ToggleRight",
26
+ // Trend indicators (arrow direction)
27
+ "TrendUp",
28
+ "TrendDown",
29
+ // Sort indicators
30
+ "SortAscending",
31
+ "SortDescending",
32
+ // Play control (points right in LTR)
33
+ "Play",
34
+ "PlayCircle"
35
+ ]);
36
+ export {
37
+ r as DIRECTIONAL_ICONS
38
+ };
@@ -30,6 +30,12 @@ interface IconProps extends Omit<PhosphorIconProps, "size">, VariantProps<typeof
30
30
  * Additional props to pass to the Tooltip component
31
31
  */
32
32
  tooltipProps?: Partial<TooltipProps>;
33
+ /**
34
+ * Auto-mirror icon in RTL layouts.
35
+ * Defaults to `true` for directional icons (arrows, chevrons, carets, etc.)
36
+ * Set to `false` to disable auto-mirroring for a specific icon.
37
+ */
38
+ autoMirrorRtl?: boolean;
33
39
  }
34
40
  /**
35
41
  * Icon component using Phosphor Icons with size variants and optional tooltip.