@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,9 +1,9 @@
1
1
  import { j as e } from "../../../_virtual/jsx-runtime.js";
2
- import { forwardRef as g, useId as C } from "react";
3
- import { Checkbox as j } from "../../../vendor/shadcn/checkbox.js";
4
- import { cn as x } from "../../../lib/utils.js";
5
- import { Label as k } from "../label/label.js";
6
- const v = g(
2
+ import { forwardRef as g, useId as v } from "react";
3
+ import { Checkbox as C } from "../../../vendor/shadcn/checkbox.js";
4
+ import { cn as m } from "../../../lib/utils.js";
5
+ import { Label as j } from "../label/label.js";
6
+ const k = g(
7
7
  ({
8
8
  label: n,
9
9
  description: c,
@@ -15,7 +15,7 @@ const v = g(
15
15
  info: l,
16
16
  ...p
17
17
  }, h) => {
18
- const u = C(), o = i || t || u, d = (r) => {
18
+ const u = v(), o = i || t || u, d = (r) => {
19
19
  if (!a) return;
20
20
  a({
21
21
  target: {
@@ -35,8 +35,8 @@ const v = g(
35
35
  stopPropagation: () => {
36
36
  }
37
37
  });
38
- }, m = /* @__PURE__ */ e.jsx(
39
- j,
38
+ }, x = /* @__PURE__ */ e.jsx(
39
+ C,
40
40
  {
41
41
  ref: h,
42
42
  id: o,
@@ -47,15 +47,15 @@ const v = g(
47
47
  className: "size-3.5 cursor-pointer"
48
48
  }
49
49
  );
50
- return n ? /* @__PURE__ */ e.jsxs("div", { className: "flex items-start gap-2", children: [
51
- m,
50
+ return n ? /* @__PURE__ */ e.jsxs("div", { className: "flex items-start gap-2 rtl:flex-row-reverse", children: [
51
+ x,
52
52
  /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-1.5", children: [
53
53
  /* @__PURE__ */ e.jsx(
54
- k,
54
+ j,
55
55
  {
56
56
  htmlFor: o,
57
57
  info: l,
58
- className: x(
58
+ className: m(
59
59
  "text-sm leading-none cursor-pointer",
60
60
  s && "text-muted-foreground",
61
61
  f
@@ -66,7 +66,7 @@ const v = g(
66
66
  c && /* @__PURE__ */ e.jsx(
67
67
  "p",
68
68
  {
69
- className: x(
69
+ className: m(
70
70
  "text-sm text-muted-foreground",
71
71
  s && "opacity-50"
72
72
  ),
@@ -74,10 +74,10 @@ const v = g(
74
74
  }
75
75
  )
76
76
  ] })
77
- ] }) : m;
77
+ ] }) : x;
78
78
  }
79
79
  );
80
- v.displayName = "Checkbox";
80
+ k.displayName = "Checkbox";
81
81
  export {
82
- v as Checkbox
82
+ k as Checkbox
83
83
  };
@@ -1,5 +1,6 @@
1
1
  import { ComponentProps, ReactNode } from 'react';
2
2
  import { RadioGroup } from '../../../vendor/shadcn/radio-group';
3
+ import { FilterLanguage, FilterTranslations } from './filter-translations';
3
4
  export declare const FilterDateRangeValue: {
4
5
  readonly CUSTOM: "CUSTOM";
5
6
  readonly TODAY: "TODAY";
@@ -16,6 +17,21 @@ interface FilterDateRangeOptionProps extends ComponentProps<"label"> {
16
17
  value: string;
17
18
  }
18
19
  declare const FilterDateRangeOption: import('react').ForwardRefExoticComponent<Omit<FilterDateRangeOptionProps, "ref"> & import('react').RefAttributes<HTMLLabelElement>>;
20
+ /**
21
+ * Labels for date range filter options - allows i18n/translation support
22
+ * @deprecated Use `lang` prop or `translations` prop instead
23
+ */
24
+ interface FilterDateRangeLabels {
25
+ custom?: string;
26
+ today?: string;
27
+ last3Days?: string;
28
+ last7Days?: string;
29
+ last30Days?: string;
30
+ thisMonth?: string;
31
+ allTime?: string;
32
+ startDate?: string;
33
+ endDate?: string;
34
+ }
19
35
  interface FilterDateRangeProps extends ComponentProps<typeof RadioGroup> {
20
36
  showCustomFields?: boolean;
21
37
  onCustomFieldsChange?: (show: boolean) => void;
@@ -35,6 +51,20 @@ interface FilterDateRangeProps extends ComponentProps<typeof RadioGroup> {
35
51
  * Announcement text to display at the top of the filter (e.g., timezone info)
36
52
  */
37
53
  announcement?: ReactNode;
54
+ /**
55
+ * Labels for date preset options - enables i18n/translation support.
56
+ * @deprecated Use `lang` prop or `translations` prop instead
57
+ */
58
+ labels?: FilterDateRangeLabels;
59
+ /**
60
+ * Language code for translations
61
+ * @default "en"
62
+ */
63
+ lang?: FilterLanguage;
64
+ /**
65
+ * Custom translations (overrides lang-based translations)
66
+ */
67
+ translations?: FilterTranslations;
38
68
  }
39
69
  declare const FilterDateRange: import('react').ForwardRefExoticComponent<Omit<FilterDateRangeProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
40
- export { FilterDateRange, FilterDateRangeOption, type FilterDateRangeProps, type FilterDateRangeOptionProps, };
70
+ export { FilterDateRange, FilterDateRangeOption, type FilterDateRangeProps, type FilterDateRangeOptionProps, type FilterDateRangeLabels, };
@@ -1,11 +1,12 @@
1
1
  import { j as e } from "../../../_virtual/jsx-runtime.js";
2
- import { forwardRef as N, useMemo as b } from "react";
3
- import { RadioGroup as H, RadioGroupItem as R } from "../../../vendor/shadcn/radio-group.js";
4
- import { cn as j } from "../../../lib/utils.js";
5
- import { Alert as C } from "../alert/alert.js";
6
- import { DatePicker as h } from "../date-picker/date-picker.js";
7
- import { TimePicker as y } from "../time-picker/time-picker.js";
8
- const n = {
2
+ import { forwardRef as L, useMemo as u } from "react";
3
+ import { RadioGroup as U, RadioGroupItem as k } from "../../../vendor/shadcn/radio-group.js";
4
+ import { cn as O } from "../../../lib/utils.js";
5
+ import { getFilterTranslations as E, getDayNames as G, getMonthAbbreviations as V } from "./filter-translations.js";
6
+ import { Alert as q } from "../alert/alert.js";
7
+ import { DatePicker as A } from "../date-picker/date-picker.js";
8
+ import { TimePicker as w } from "../time-picker/time-picker.js";
9
+ const c = {
9
10
  CUSTOM: "CUSTOM",
10
11
  TODAY: "TODAY",
11
12
  LAST_3_DAYS: "LAST_3_DAYS",
@@ -13,71 +14,45 @@ const n = {
13
14
  LAST_30_DAYS: "LAST_30_DAYS",
14
15
  THIS_MONTH: "THIS_MONTH",
15
16
  ALL_TIME: "ALL_TIME"
16
- }, i = (s) => {
17
- const t = s.getDate();
18
- return `${[
19
- "Jan",
20
- "Feb",
21
- "Mar",
22
- "Apr",
23
- "May",
24
- "Jun",
25
- "Jul",
26
- "Aug",
27
- "Sep",
28
- "Oct",
29
- "Nov",
30
- "Dec"
31
- ][s.getMonth()]} ${t}`;
32
- }, F = (s) => {
33
- const a = [
34
- "Jan",
35
- "Feb",
36
- "Mar",
37
- "Apr",
38
- "May",
39
- "Jun",
40
- "Jul",
41
- "Aug",
42
- "Sep",
43
- "Oct",
44
- "Nov",
45
- "Dec"
46
- ][s.getMonth()], o = s.getFullYear();
47
- return `${a} ${o}`;
48
- }, I = (s) => ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"][s.getDay()], J = () => {
17
+ }, D = (l, t) => {
18
+ const s = l.getDate();
19
+ return `${t[l.getMonth()]} ${s}`;
20
+ }, z = (l, t) => {
21
+ const s = t[l.getMonth()], i = l.getFullYear();
22
+ return `${s} ${i}`;
23
+ }, B = (l, t) => t[l.getDay()], J = (l, t) => {
49
24
  const s = /* @__PURE__ */ new Date();
50
25
  s.setHours(0, 0, 0, 0);
51
- const t = `${I(s)}, ${i(s)}`, a = new Date(s);
52
- a.setDate(a.getDate() - 2);
53
- const o = `${i(a)} - ${i(s)}`, c = new Date(s);
54
- c.setDate(c.getDate() - 6);
55
- const m = `${i(c)} - ${i(s)}`, l = new Date(s);
56
- l.setDate(l.getDate() - 29);
57
- const x = `${i(l)} - ${i(s)}`, D = F(s);
26
+ const i = `${B(s, l)}, ${D(s, t)}`, x = new Date(s);
27
+ x.setDate(x.getDate() - 2);
28
+ const f = `${D(x, t)} - ${D(s, t)}`, o = new Date(s);
29
+ o.setDate(o.getDate() - 6);
30
+ const p = `${D(o, t)} - ${D(s, t)}`, m = new Date(s);
31
+ m.setDate(m.getDate() - 29);
32
+ const y = `${D(m, t)} - ${D(s, t)}`, j = z(s, t);
58
33
  return {
59
- today: t,
60
- last3Days: o,
61
- last7Days: m,
62
- last30Days: x,
63
- thisMonth: D
34
+ today: i,
35
+ last3Days: f,
36
+ last7Days: p,
37
+ last30Days: y,
38
+ thisMonth: j
64
39
  };
65
- }, r = N(
66
- ({ label: s, description: t, value: a, className: o, ...c }, m) => {
67
- const l = `date-range-${a}`;
40
+ }, d = L(
41
+ ({ label: l, description: t, value: s, className: i, ...x }, f) => {
42
+ const o = `date-range-${s}`;
68
43
  return /* @__PURE__ */ e.jsxs("div", { className: "flex items-start gap-4 w-full py-1", children: [
69
44
  /* @__PURE__ */ e.jsxs(
70
45
  "label",
71
46
  {
72
- ref: m,
73
- className: j(
74
- "flex-1 flex items-start gap-3 cursor-pointer",
75
- o
47
+ ref: f,
48
+ className: O(
49
+ "flex-1 flex items-start gap-3 cursor-pointer rtl:flex-row-reverse",
50
+ i
76
51
  ),
77
- ...c,
52
+ ...x,
78
53
  children: [
79
- /* @__PURE__ */ e.jsx(R, { id: l, value: a, className: "mt-px" }),
80
- /* @__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 }) })
54
+ /* @__PURE__ */ e.jsx(k, { id: o, value: s, className: "mt-px" }),
55
+ /* @__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: l }) })
81
56
  ]
82
57
  }
83
58
  ),
@@ -85,82 +60,97 @@ const n = {
85
60
  ] });
86
61
  }
87
62
  );
88
- r.displayName = "FilterDateRangeOption";
89
- const P = N(
63
+ d.displayName = "FilterDateRangeOption";
64
+ const K = L(
90
65
  ({
91
- showCustomFields: s = !1,
66
+ showCustomFields: l = !1,
92
67
  onCustomFieldsChange: t,
93
- startDate: a,
94
- endDate: o,
95
- startTime: c = "",
96
- endTime: m = "",
97
- onStartDateChange: l,
98
- onEndDateChange: x,
99
- onStartTimeChange: D,
100
- onEndTimeChange: A,
101
- mode: S = "range",
102
- singleDayLabel: T = "Select date",
103
- showAllTime: v = !1,
104
- className: _,
105
- value: M,
106
- onValueChange: L,
107
- announcement: f,
108
- ...w
109
- }, O) => {
110
- const p = b(() => J(), []), Y = (d) => {
111
- L?.(d), t?.(d === n.CUSTOM);
112
- }, $ = (d) => {
113
- if (d) {
114
- const u = new Date(d);
115
- u.setHours(0, 0, 0, 0);
116
- const g = new Date(d);
117
- g.setHours(23, 59, 59, 999), l?.(u), x?.(g);
68
+ startDate: s,
69
+ endDate: i,
70
+ startTime: x = "",
71
+ endTime: f = "",
72
+ onStartDateChange: o,
73
+ onEndDateChange: p,
74
+ onStartTimeChange: m,
75
+ onEndTimeChange: y,
76
+ mode: j = "range",
77
+ singleDayLabel: Y,
78
+ showAllTime: $ = !1,
79
+ className: H,
80
+ value: R,
81
+ onValueChange: C,
82
+ announcement: h,
83
+ labels: n,
84
+ lang: v,
85
+ translations: T,
86
+ ...F
87
+ }, I) => {
88
+ const a = u(() => {
89
+ const r = E(v);
90
+ return T ? { ...r, ...T } : r;
91
+ }, [v, T]), S = u(() => G(a), [a]), _ = u(() => V(a), [a]), g = u(
92
+ () => J(S, _),
93
+ [S, _]
94
+ ), b = (r) => {
95
+ C?.(r), t?.(r === c.CUSTOM);
96
+ }, P = (r) => {
97
+ if (r) {
98
+ const N = new Date(r);
99
+ N.setHours(0, 0, 0, 0);
100
+ const M = new Date(r);
101
+ M.setHours(23, 59, 59, 999), o?.(N), p?.(M);
118
102
  } else
119
- l?.(void 0), x?.(void 0);
103
+ o?.(void 0), p?.(void 0);
120
104
  };
121
105
  return /* @__PURE__ */ e.jsxs(
122
106
  "div",
123
107
  {
124
- ref: O,
125
- className: j("flex flex-col gap-4 w-full", _),
108
+ ref: I,
109
+ className: O("flex flex-col gap-4 w-full", H),
126
110
  children: [
127
- f && (typeof f == "string" ? /* @__PURE__ */ e.jsx(C, { icon: "Info", description: f }) : f),
111
+ h && (typeof h == "string" ? /* @__PURE__ */ e.jsx(q, { icon: "Info", description: h }) : h),
128
112
  /* @__PURE__ */ e.jsxs(
129
- H,
113
+ U,
130
114
  {
131
- value: M,
132
- onValueChange: Y,
115
+ value: R,
116
+ onValueChange: b,
133
117
  className: "gap-2",
134
- ...w,
118
+ ...F,
135
119
  children: [
136
- /* @__PURE__ */ e.jsx(r, { label: "Custom", value: n.CUSTOM }),
137
- s && /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-4 pl-7 mb-2", children: [
138
- S === "single" ? /* @__PURE__ */ e.jsx("div", { className: "flex flex-col gap-3", children: /* @__PURE__ */ e.jsx(
139
- h,
120
+ /* @__PURE__ */ e.jsx(
121
+ d,
122
+ {
123
+ label: n?.custom ?? a.custom,
124
+ value: c.CUSTOM
125
+ }
126
+ ),
127
+ l && /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-4 ps-7 mb-2", children: [
128
+ j === "single" ? /* @__PURE__ */ e.jsx("div", { className: "flex flex-col gap-3", children: /* @__PURE__ */ e.jsx(
129
+ A,
140
130
  {
141
- date: a,
142
- onChange: $,
143
- placeholder: T,
131
+ date: s,
132
+ onChange: P,
133
+ placeholder: Y ?? a.selectDate,
144
134
  className: "h-9",
145
135
  iconPosition: "none"
146
136
  }
147
137
  ) }) : /* @__PURE__ */ e.jsxs("div", { className: "flex gap-4 items-start w-full", children: [
148
138
  /* @__PURE__ */ e.jsx("div", { className: "flex-1 flex flex-col gap-3", children: /* @__PURE__ */ e.jsx(
149
- h,
139
+ A,
150
140
  {
151
- date: a,
152
- onChange: l,
153
- placeholder: "Start date",
141
+ date: s,
142
+ onChange: o,
143
+ placeholder: n?.startDate ?? a.startDate,
154
144
  className: "h-9",
155
145
  iconPosition: "none"
156
146
  }
157
147
  ) }),
158
148
  /* @__PURE__ */ e.jsx("div", { className: "flex-1 flex flex-col gap-3", children: /* @__PURE__ */ e.jsx(
159
- h,
149
+ A,
160
150
  {
161
- date: o,
162
- onChange: x,
163
- placeholder: "End date",
151
+ date: i,
152
+ onChange: p,
153
+ placeholder: n?.endDate ?? a.endDate,
164
154
  className: "h-9",
165
155
  iconPosition: "none"
166
156
  }
@@ -168,20 +158,20 @@ const P = N(
168
158
  ] }),
169
159
  /* @__PURE__ */ e.jsxs("div", { className: "flex gap-4 items-start w-full", children: [
170
160
  /* @__PURE__ */ e.jsx("div", { className: "flex-1 flex flex-col gap-3", children: /* @__PURE__ */ e.jsx(
171
- y,
161
+ w,
172
162
  {
173
- value: c,
174
- onChange: D,
163
+ value: x,
164
+ onChange: m,
175
165
  mode: "dropdown",
176
166
  use24Hour: !0,
177
167
  width: "100%"
178
168
  }
179
169
  ) }),
180
170
  /* @__PURE__ */ e.jsx("div", { className: "flex-1 flex flex-col gap-3", children: /* @__PURE__ */ e.jsx(
181
- y,
171
+ w,
182
172
  {
183
- value: m,
184
- onChange: A,
173
+ value: f,
174
+ onChange: y,
185
175
  mode: "dropdown",
186
176
  use24Hour: !0,
187
177
  width: "100%"
@@ -191,46 +181,52 @@ const P = N(
191
181
  ] }),
192
182
  /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-2", children: [
193
183
  /* @__PURE__ */ e.jsx(
194
- r,
184
+ d,
195
185
  {
196
- label: "Today",
197
- value: n.TODAY,
198
- description: p.today
186
+ label: n?.today ?? a.today,
187
+ value: c.TODAY,
188
+ description: g.today
199
189
  }
200
190
  ),
201
191
  /* @__PURE__ */ e.jsx(
202
- r,
192
+ d,
203
193
  {
204
- label: "Last 3 days",
205
- value: n.LAST_3_DAYS,
206
- description: p.last3Days
194
+ label: n?.last3Days ?? a.last3Days,
195
+ value: c.LAST_3_DAYS,
196
+ description: g.last3Days
207
197
  }
208
198
  ),
209
199
  /* @__PURE__ */ e.jsx(
210
- r,
200
+ d,
211
201
  {
212
- label: "Last 7 days",
213
- value: n.LAST_7_DAYS,
214
- description: p.last7Days
202
+ label: n?.last7Days ?? a.last7Days,
203
+ value: c.LAST_7_DAYS,
204
+ description: g.last7Days
215
205
  }
216
206
  ),
217
207
  /* @__PURE__ */ e.jsx(
218
- r,
208
+ d,
219
209
  {
220
- label: "Last 30 days",
221
- value: n.LAST_30_DAYS,
222
- description: p.last30Days
210
+ label: n?.last30Days ?? a.last30Days,
211
+ value: c.LAST_30_DAYS,
212
+ description: g.last30Days
223
213
  }
224
214
  ),
225
215
  /* @__PURE__ */ e.jsx(
226
- r,
216
+ d,
227
217
  {
228
- label: "This month",
229
- value: n.THIS_MONTH,
230
- description: p.thisMonth
218
+ label: n?.thisMonth ?? a.thisMonth,
219
+ value: c.THIS_MONTH,
220
+ description: g.thisMonth
231
221
  }
232
222
  ),
233
- v && /* @__PURE__ */ e.jsx(r, { label: "All time", value: n.ALL_TIME })
223
+ $ && /* @__PURE__ */ e.jsx(
224
+ d,
225
+ {
226
+ label: n?.allTime ?? a.allTime,
227
+ value: c.ALL_TIME
228
+ }
229
+ )
234
230
  ] })
235
231
  ]
236
232
  }
@@ -240,9 +236,9 @@ const P = N(
240
236
  );
241
237
  }
242
238
  );
243
- P.displayName = "FilterDateRange";
239
+ K.displayName = "FilterDateRange";
244
240
  export {
245
- P as FilterDateRange,
246
- r as FilterDateRangeOption,
247
- n as FilterDateRangeValue
241
+ K as FilterDateRange,
242
+ d as FilterDateRangeOption,
243
+ c as FilterDateRangeValue
248
244
  };
@@ -1,3 +1,4 @@
1
+ import { FilterLanguage, FilterTranslations } from './filter-translations';
1
2
  /**
2
3
  * Props for FilterMultiInput component
3
4
  */
@@ -49,6 +50,15 @@ export interface FilterMultiInputProps {
49
50
  * @default false
50
51
  */
51
52
  allowDuplicates?: boolean;
53
+ /**
54
+ * Language code for translations
55
+ * @default "en"
56
+ */
57
+ lang?: FilterLanguage;
58
+ /**
59
+ * Custom translations (overrides lang-based translations)
60
+ */
61
+ translations?: FilterTranslations;
52
62
  }
53
63
  /**
54
64
  * Filter section component for entering multiple values via an input field.
@@ -62,6 +72,7 @@ export interface FilterMultiInputProps {
62
72
  * onChange={setSelectedBins}
63
73
  * placeholder="Enter BIN(s) separated by comma"
64
74
  * numericOnly
75
+ * lang="es"
65
76
  * />
66
77
  * ```
67
78
  */
@@ -1,50 +1,56 @@
1
1
  import { j as e } from "../../../_virtual/jsx-runtime.js";
2
- import { forwardRef as x } from "react";
3
- import { cn as j } from "../../../lib/utils.js";
4
- import { Separator as b } from "../../../vendor/shadcn/separator.js";
5
- import { MultiValuesField as h } from "../multi-values-field/multi-values-field.js";
6
- const v = x(
2
+ import { forwardRef as h, useMemo as N } from "react";
3
+ import { cn as y } from "../../../lib/utils.js";
4
+ import { Separator as g } from "../../../vendor/shadcn/separator.js";
5
+ import { getFilterTranslations as v } from "./filter-translations.js";
6
+ import { MultiValuesField as w } from "../multi-values-field/multi-values-field.js";
7
+ const A = h(
7
8
  ({
8
- title: t,
9
- value: l,
10
- onChange: r,
11
- placeholder: s = "Type and press Enter...",
12
- description: a,
13
- error: i,
14
- numericOnly: o = !1,
15
- maxItems: m,
16
- disabled: n = !1,
17
- className: f,
18
- allowDuplicates: d = !1
19
- }, u) => {
20
- const c = o ? (p) => /^\d+$/.test(p) ? !0 : "Only numeric values are allowed" : void 0;
21
- return /* @__PURE__ */ e.jsxs("div", { ref: u, className: j("flex flex-col h-full", f), children: [
22
- /* @__PURE__ */ e.jsx("div", { className: "flex items-center justify-between mb-1", children: /* @__PURE__ */ e.jsx("span", { className: "text-sm font-normal text-foreground", children: t }) }),
23
- /* @__PURE__ */ e.jsx(b, { className: "w-full mb-6" }),
9
+ title: a,
10
+ value: s,
11
+ onChange: o,
12
+ placeholder: m,
13
+ description: n,
14
+ error: f,
15
+ numericOnly: d = !1,
16
+ maxItems: c,
17
+ disabled: p = !1,
18
+ className: u,
19
+ allowDuplicates: x = !1,
20
+ lang: i,
21
+ translations: r
22
+ }, j) => {
23
+ const l = N(() => {
24
+ const t = v(i);
25
+ return r ? { ...t, ...r } : t;
26
+ }, [i, r]), b = d ? (t) => /^\d+$/.test(t) ? !0 : l.onlyNumericAllowed : void 0;
27
+ return /* @__PURE__ */ e.jsxs("div", { ref: j, className: y("flex flex-col h-full", u), children: [
28
+ /* @__PURE__ */ e.jsx("div", { className: "flex items-center justify-between mb-1", children: /* @__PURE__ */ e.jsx("span", { className: "text-sm font-normal text-foreground", children: a }) }),
29
+ /* @__PURE__ */ e.jsx(g, { className: "w-full mb-6" }),
24
30
  /* @__PURE__ */ e.jsx(
25
- h,
31
+ w,
26
32
  {
27
- value: l,
28
- onChange: r,
29
- placeholder: s,
30
- description: a,
31
- error: i,
32
- disabled: n,
33
- maxItems: m,
34
- allowDuplicates: d,
35
- validate: c,
33
+ value: s,
34
+ onChange: o,
35
+ placeholder: m ?? l.typeAndPressEnter,
36
+ description: n,
37
+ error: f,
38
+ disabled: p,
39
+ maxItems: c,
40
+ allowDuplicates: x,
41
+ validate: b,
36
42
  triggerKeys: ["Enter", "Tab", "Comma"],
37
- deleteAll: l.length > 0 ? {
38
- label: "Clear all",
43
+ deleteAll: s.length > 0 ? {
44
+ label: l.clearAll,
39
45
  length: 1,
40
- onClick: () => r([])
46
+ onClick: () => o([])
41
47
  } : void 0
42
48
  }
43
49
  )
44
50
  ] });
45
51
  }
46
52
  );
47
- v.displayName = "FilterMultiInput";
53
+ A.displayName = "FilterMultiInput";
48
54
  export {
49
- v as FilterMultiInput
55
+ A as FilterMultiInput
50
56
  };