@yuno-payments/dashboard-design-system 2.4.2-rtl.7 → 2.4.2-rtl.8

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.
@@ -1,10 +1,10 @@
1
1
  import { j as e } from "../../../_virtual/jsx-runtime.js";
2
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 "../../atoms/alert/alert.js";
7
- import { DatePicker as A } from "../../atoms/date-picker/date-picker.js";
3
+ import { RadioGroup as k, RadioGroupItem as E } from "../../../vendor/shadcn/radio-group.js";
4
+ import { cn as O, getDirection as Y } from "../../../lib/utils.js";
5
+ import { getFilterTranslations as G, getDayNames as V, getMonthAbbreviations as q } from "./filter-translations.js";
6
+ import { Alert as z } from "../../atoms/alert/alert.js";
7
+ import { DatePicker as v } from "../../atoms/date-picker/date-picker.js";
8
8
  import { TimePicker as w } from "../../molecules/time-picker/time-picker.js";
9
9
  const c = {
10
10
  CUSTOM: "CUSTOM",
@@ -14,44 +14,45 @@ const c = {
14
14
  LAST_30_DAYS: "LAST_30_DAYS",
15
15
  THIS_MONTH: "THIS_MONTH",
16
16
  ALL_TIME: "ALL_TIME"
17
- }, D = (l, t) => {
17
+ }, f = (l, t) => {
18
18
  const s = l.getDate();
19
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) => {
20
+ }, B = (l, t) => {
21
+ const s = t[l.getMonth()], r = l.getFullYear();
22
+ return `${s} ${r}`;
23
+ }, J = (l, t) => t[l.getDay()], K = (l, t) => {
24
24
  const s = /* @__PURE__ */ new Date();
25
25
  s.setHours(0, 0, 0, 0);
26
- const i = `${B(s, l)}, ${D(s, t)}`, x = new Date(s);
26
+ const r = `${J(s, l)}, ${f(s, t)}`, x = new Date(s);
27
27
  x.setDate(x.getDate() - 2);
28
- const f = `${D(x, t)} - ${D(s, t)}`, o = new Date(s);
28
+ const p = `${f(x, t)} - ${f(s, t)}`, o = new Date(s);
29
29
  o.setDate(o.getDate() - 6);
30
- const p = `${D(o, t)} - ${D(s, t)}`, m = new Date(s);
30
+ const D = `${f(o, t)} - ${f(s, t)}`, m = new Date(s);
31
31
  m.setDate(m.getDate() - 29);
32
- const y = `${D(m, t)} - ${D(s, t)}`, j = z(s, t);
32
+ const y = `${f(m, t)} - ${f(s, t)}`, j = B(s, t);
33
33
  return {
34
- today: i,
35
- last3Days: f,
36
- last7Days: p,
34
+ today: r,
35
+ last3Days: p,
36
+ last7Days: D,
37
37
  last30Days: y,
38
38
  thisMonth: j
39
39
  };
40
40
  }, d = L(
41
- ({ label: l, description: t, value: s, className: i, ...x }, f) => {
42
- const o = `date-range-${s}`;
41
+ ({ label: l, description: t, value: s, className: r, ...x }, p) => {
42
+ const o = `date-range-${s}`, D = Y() === "rtl";
43
43
  return /* @__PURE__ */ e.jsxs("div", { className: "flex items-start gap-4 w-full py-1", children: [
44
44
  /* @__PURE__ */ e.jsxs(
45
45
  "label",
46
46
  {
47
- ref: f,
47
+ ref: p,
48
48
  className: O(
49
- "flex-1 flex items-start gap-3 cursor-pointer rtl:flex-row-reverse",
50
- i
49
+ "flex-1 flex items-start gap-3 cursor-pointer",
50
+ D && "flex-row-reverse",
51
+ r
51
52
  ),
52
53
  ...x,
53
54
  children: [
54
- /* @__PURE__ */ e.jsx(k, { id: o, value: s, className: "mt-px" }),
55
+ /* @__PURE__ */ e.jsx(E, { id: o, value: s, className: "mt-px" }),
55
56
  /* @__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 }) })
56
57
  ]
57
58
  }
@@ -61,61 +62,62 @@ const c = {
61
62
  }
62
63
  );
63
64
  d.displayName = "FilterDateRangeOption";
64
- const K = L(
65
+ const Q = L(
65
66
  ({
66
67
  showCustomFields: l = !1,
67
68
  onCustomFieldsChange: t,
68
69
  startDate: s,
69
- endDate: i,
70
+ endDate: r,
70
71
  startTime: x = "",
71
- endTime: f = "",
72
+ endTime: p = "",
72
73
  onStartDateChange: o,
73
- onEndDateChange: p,
74
+ onEndDateChange: D,
74
75
  onStartTimeChange: m,
75
76
  onEndTimeChange: y,
76
77
  mode: j = "range",
77
- singleDayLabel: Y,
78
- showAllTime: $ = !1,
79
- className: H,
80
- value: R,
81
- onValueChange: C,
78
+ singleDayLabel: $,
79
+ showAllTime: H = !1,
80
+ className: R,
81
+ value: C,
82
+ onValueChange: F,
82
83
  announcement: h,
83
84
  labels: n,
84
- lang: v,
85
- translations: T,
86
- ...F
87
- }, I) => {
85
+ lang: T,
86
+ translations: A,
87
+ ...I
88
+ }, b) => {
88
89
  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, _),
90
+ const i = G(T);
91
+ return A ? { ...i, ...A } : i;
92
+ }, [T, A]), S = u(() => V(a), [a]), _ = u(() => q(a), [a]), g = u(
93
+ () => K(S, _),
93
94
  [S, _]
94
- ), b = (r) => {
95
- C?.(r), t?.(r === c.CUSTOM);
96
- }, P = (r) => {
97
- if (r) {
98
- const N = new Date(r);
95
+ ), P = (i) => {
96
+ F?.(i), t?.(i === c.CUSTOM);
97
+ }, U = (i) => {
98
+ if (i) {
99
+ const N = new Date(i);
99
100
  N.setHours(0, 0, 0, 0);
100
- const M = new Date(r);
101
- M.setHours(23, 59, 59, 999), o?.(N), p?.(M);
101
+ const M = new Date(i);
102
+ M.setHours(23, 59, 59, 999), o?.(N), D?.(M);
102
103
  } else
103
- o?.(void 0), p?.(void 0);
104
+ o?.(void 0), D?.(void 0);
104
105
  };
105
106
  return /* @__PURE__ */ e.jsxs(
106
107
  "div",
107
108
  {
108
- ref: I,
109
- className: O("flex flex-col gap-4 w-full", H),
109
+ ref: b,
110
+ dir: Y(T),
111
+ className: O("flex flex-col gap-4 w-full", R),
110
112
  children: [
111
- h && (typeof h == "string" ? /* @__PURE__ */ e.jsx(q, { icon: "Info", description: h }) : h),
113
+ h && (typeof h == "string" ? /* @__PURE__ */ e.jsx(z, { icon: "Info", description: h }) : h),
112
114
  /* @__PURE__ */ e.jsxs(
113
- U,
115
+ k,
114
116
  {
115
- value: R,
116
- onValueChange: b,
117
+ value: C,
118
+ onValueChange: P,
117
119
  className: "gap-2",
118
- ...F,
120
+ ...I,
119
121
  children: [
120
122
  /* @__PURE__ */ e.jsx(
121
123
  d,
@@ -126,17 +128,17 @@ const K = L(
126
128
  ),
127
129
  l && /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-4 ps-7 mb-2", children: [
128
130
  j === "single" ? /* @__PURE__ */ e.jsx("div", { className: "flex flex-col gap-3", children: /* @__PURE__ */ e.jsx(
129
- A,
131
+ v,
130
132
  {
131
133
  date: s,
132
- onChange: P,
133
- placeholder: Y ?? a.selectDate,
134
+ onChange: U,
135
+ placeholder: $ ?? a.selectDate,
134
136
  className: "h-9",
135
137
  iconPosition: "none"
136
138
  }
137
139
  ) }) : /* @__PURE__ */ e.jsxs("div", { className: "flex gap-4 items-start w-full", children: [
138
140
  /* @__PURE__ */ e.jsx("div", { className: "flex-1 flex flex-col gap-3", children: /* @__PURE__ */ e.jsx(
139
- A,
141
+ v,
140
142
  {
141
143
  date: s,
142
144
  onChange: o,
@@ -146,10 +148,10 @@ const K = L(
146
148
  }
147
149
  ) }),
148
150
  /* @__PURE__ */ e.jsx("div", { className: "flex-1 flex flex-col gap-3", children: /* @__PURE__ */ e.jsx(
149
- A,
151
+ v,
150
152
  {
151
- date: i,
152
- onChange: p,
153
+ date: r,
154
+ onChange: D,
153
155
  placeholder: n?.endDate ?? a.endDate,
154
156
  className: "h-9",
155
157
  iconPosition: "none"
@@ -170,7 +172,7 @@ const K = L(
170
172
  /* @__PURE__ */ e.jsx("div", { className: "flex-1 flex flex-col gap-3", children: /* @__PURE__ */ e.jsx(
171
173
  w,
172
174
  {
173
- value: f,
175
+ value: p,
174
176
  onChange: y,
175
177
  mode: "dropdown",
176
178
  use24Hour: !0,
@@ -220,7 +222,7 @@ const K = L(
220
222
  description: g.thisMonth
221
223
  }
222
224
  ),
223
- $ && /* @__PURE__ */ e.jsx(
225
+ H && /* @__PURE__ */ e.jsx(
224
226
  d,
225
227
  {
226
228
  label: n?.allTime ?? a.allTime,
@@ -236,9 +238,9 @@ const K = L(
236
238
  );
237
239
  }
238
240
  );
239
- K.displayName = "FilterDateRange";
241
+ Q.displayName = "FilterDateRange";
240
242
  export {
241
- K as FilterDateRange,
243
+ Q as FilterDateRange,
242
244
  d as FilterDateRangeOption,
243
245
  c as FilterDateRangeValue
244
246
  };
@@ -1,23 +1,23 @@
1
1
  import { j as e } from "../../../_virtual/jsx-runtime.js";
2
- import { forwardRef as v, useMemo as k, useState as Q } from "react";
2
+ import { forwardRef as y, useMemo as k, useState as Q } from "react";
3
3
  import { Button as w } from "../../../vendor/shadcn/button.js";
4
- import { Badge as I } from "../../../vendor/shadcn/badge.js";
5
- import { Separator as S } from "../../../vendor/shadcn/separator.js";
4
+ import { Badge as z } from "../../../vendor/shadcn/badge.js";
5
+ import { Separator as R } from "../../../vendor/shadcn/separator.js";
6
6
  import { Checkbox as U } from "../../../vendor/shadcn/checkbox.js";
7
7
  import { RadioGroupItem as X, RadioGroup as q } from "../../../vendor/shadcn/radio-group.js";
8
- import { Icon as R } from "../../atoms/icon/icon.js";
9
- import { cn as y, getDirection as z } from "../../../lib/utils.js";
10
- import { getFilterTranslations as T, formatMoreFilters as H } from "./filter-translations.js";
8
+ import { Icon as T } from "../../atoms/icon/icon.js";
9
+ import { cn as b, getDirection as S } from "../../../lib/utils.js";
10
+ import { getFilterTranslations as I, formatMoreFilters as H } from "./filter-translations.js";
11
11
  import { DEFAULT_FILTER_TRANSLATIONS as xe, FILTER_TRANSLATIONS as ue } from "./filter-translations.js";
12
12
  import { Tooltip as V } from "../../atoms/tooltip/tooltip.js";
13
13
  import { Field as A } from "../../molecules/field/field.js";
14
- const L = v(
14
+ const L = y(
15
15
  ({ label: s, onRemove: l, className: n, ...a }, r) => /* @__PURE__ */ e.jsxs(
16
- I,
16
+ z,
17
17
  {
18
18
  ref: r,
19
19
  variant: "secondary",
20
- className: y("h-8 gap-2 px-3 py-2 shadow-xs", n),
20
+ className: b("h-8 gap-2 px-3 py-2 shadow-xs", n),
21
21
  ...a,
22
22
  children: [
23
23
  /* @__PURE__ */ e.jsx("span", { className: "text-xs font-medium leading-none", children: s }),
@@ -27,7 +27,7 @@ const L = v(
27
27
  onClick: l,
28
28
  className: "inline-flex items-center justify-center",
29
29
  "aria-label": `Remove ${s} filter`,
30
- children: /* @__PURE__ */ e.jsx(R, { name: "X", className: "size-4" })
30
+ children: /* @__PURE__ */ e.jsx(T, { name: "X", className: "size-4" })
31
31
  }
32
32
  )
33
33
  ]
@@ -35,48 +35,48 @@ const L = v(
35
35
  )
36
36
  );
37
37
  L.displayName = "FilterTag";
38
- const J = v(
38
+ const J = y(
39
39
  ({
40
40
  appliedFilters: s = [],
41
41
  onRemoveFilter: l,
42
42
  onClearAll: n,
43
43
  maxVisibleTags: a = 4,
44
44
  className: r,
45
- lang: m,
46
- translations: c,
45
+ lang: c,
46
+ translations: o,
47
47
  ...d
48
- }, b) => {
48
+ }, j) => {
49
49
  const f = k(() => {
50
- const o = T(m);
51
- return c ? { ...o, ...c } : o;
52
- }, [m, c]), x = s.length > 0, F = s.slice(0, a), N = s.length - a;
50
+ const m = I(c);
51
+ return o ? { ...m, ...o } : m;
52
+ }, [c, o]), x = s.length > 0, F = s.slice(0, a), p = s.length - a;
53
53
  return /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-4", children: [
54
54
  /* @__PURE__ */ e.jsxs(
55
55
  w,
56
56
  {
57
- ref: b,
57
+ ref: j,
58
58
  variant: "outline",
59
59
  size: "sm",
60
- className: y("h-8 gap-2 px-3 py-2", r),
60
+ className: b("h-8 gap-2 px-3 py-2", r),
61
61
  ...d,
62
62
  children: [
63
- /* @__PURE__ */ e.jsx(R, { name: "FunnelSimple", className: "size-4" }),
63
+ /* @__PURE__ */ e.jsx(T, { name: "FunnelSimple", className: "size-4" }),
64
64
  /* @__PURE__ */ e.jsx("span", { className: "text-xs font-medium leading-none", children: f.addFilter })
65
65
  ]
66
66
  }
67
67
  ),
68
68
  x && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
69
- /* @__PURE__ */ e.jsx(S, { orientation: "vertical", className: "h-5" }),
69
+ /* @__PURE__ */ e.jsx(R, { orientation: "vertical", className: "h-5" }),
70
70
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
71
- F.map((o) => /* @__PURE__ */ e.jsx(
71
+ F.map((m) => /* @__PURE__ */ e.jsx(
72
72
  L,
73
73
  {
74
- label: o.label,
75
- onRemove: () => l?.(o.id)
74
+ label: m.label,
75
+ onRemove: () => l?.(m.id)
76
76
  },
77
- o.id
77
+ m.id
78
78
  )),
79
- N > 0 && /* @__PURE__ */ e.jsx(I, { variant: "default", className: "h-8 px-3 py-2 shadow-xs", children: /* @__PURE__ */ e.jsx("span", { className: "text-xs font-medium leading-none", children: H(f, N) }) }),
79
+ p > 0 && /* @__PURE__ */ e.jsx(z, { variant: "default", className: "h-8 px-3 py-2 shadow-xs", children: /* @__PURE__ */ e.jsx("span", { className: "text-xs font-medium leading-none", children: H(f, p) }) }),
80
80
  n && /* @__PURE__ */ e.jsx(
81
81
  w,
82
82
  {
@@ -90,44 +90,44 @@ const J = v(
90
90
  ] })
91
91
  ] }),
92
92
  !x && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
93
- /* @__PURE__ */ e.jsx(S, { orientation: "vertical", className: "h-5" }),
93
+ /* @__PURE__ */ e.jsx(R, { orientation: "vertical", className: "h-5" }),
94
94
  /* @__PURE__ */ e.jsx("span", { className: "text-sm font-normal text-muted-foreground", children: f.noFiltersApplied })
95
95
  ] })
96
96
  ] });
97
97
  }
98
98
  );
99
99
  J.displayName = "FilterButton";
100
- const K = v(
100
+ const K = y(
101
101
  (s, l) => {
102
102
  const {
103
103
  title: n,
104
104
  items: a,
105
105
  className: r,
106
- searchable: m = !1,
107
- searchPlaceholder: c,
106
+ searchable: c = !1,
107
+ searchPlaceholder: o,
108
108
  showActions: d = !1,
109
- enableSelectAll: b = !0,
109
+ enableSelectAll: j = !0,
110
110
  enableInverse: f = !0,
111
111
  enableNone: x = !0,
112
112
  description: F,
113
- lang: N,
114
- translations: o
113
+ lang: p,
114
+ translations: m
115
115
  } = s, C = k(() => {
116
- const t = T(N);
117
- return o ? { ...t, ...o } : t;
118
- }, [N, o]), g = s.type || "checkbox", P = g === "radio", B = g === "checkbox" || !s.type, [j, G] = Q(""), p = k(() => j ? a.filter(
119
- (t) => t.label.toLowerCase().includes(j.toLowerCase())
120
- ) : a, [a, j]), M = () => {
116
+ const t = I(p);
117
+ return m ? { ...t, ...m } : t;
118
+ }, [p, m]), g = s.type || "checkbox", P = g === "radio", B = g === "checkbox" || !s.type, [N, G] = Q(""), v = k(() => N ? a.filter(
119
+ (t) => t.label.toLowerCase().includes(N.toLowerCase())
120
+ ) : a, [a, N]), M = () => {
121
121
  if (g === "checkbox" && "selectedValues" in s) {
122
- const t = p.map((u) => u.value), i = j ? [.../* @__PURE__ */ new Set([...s.selectedValues, ...t])] : t;
122
+ const t = v.map((u) => u.value), i = N ? [.../* @__PURE__ */ new Set([...s.selectedValues, ...t])] : t;
123
123
  s.onChange(i);
124
124
  }
125
125
  }, _ = () => {
126
126
  if (g === "checkbox" && "selectedValues" in s)
127
- if (j) {
128
- const t = new Set(p.map((h) => h.value)), i = s.selectedValues.filter(
127
+ if (N) {
128
+ const t = new Set(v.map((h) => h.value)), i = s.selectedValues.filter(
129
129
  (h) => !t.has(h)
130
- ), u = p.filter((h) => !s.selectedValues.includes(h.value)).map((h) => h.value);
130
+ ), u = v.filter((h) => !s.selectedValues.includes(h.value)).map((h) => h.value);
131
131
  s.onChange([...i, ...u]);
132
132
  } else {
133
133
  const t = a.filter((i) => !s.selectedValues.includes(i.value)).map((i) => i.value);
@@ -135,8 +135,8 @@ const K = v(
135
135
  }
136
136
  }, $ = () => {
137
137
  if (g === "checkbox" && "selectedValues" in s)
138
- if (j) {
139
- const t = new Set(p.map((u) => u.value)), i = s.selectedValues.filter(
138
+ if (N) {
139
+ const t = new Set(v.map((u) => u.value)), i = s.selectedValues.filter(
140
140
  (u) => !t.has(u)
141
141
  );
142
142
  s.onChange(i);
@@ -149,12 +149,12 @@ const K = v(
149
149
  s.onChange(u);
150
150
  }
151
151
  };
152
- return /* @__PURE__ */ e.jsxs("div", { ref: l, dir: z(N), className: y("flex flex-col h-full", r), children: [
153
- m && /* @__PURE__ */ e.jsx(
152
+ return /* @__PURE__ */ e.jsxs("div", { ref: l, dir: S(p), className: b("flex flex-col h-full", r), children: [
153
+ c && /* @__PURE__ */ e.jsx(
154
154
  A,
155
155
  {
156
- placeholder: c ?? C.search,
157
- value: j,
156
+ placeholder: o ?? C.search,
157
+ value: N,
158
158
  onChange: (t) => G(t.target.value),
159
159
  startIcon: "MagnifyingGlass",
160
160
  className: "mb-4"
@@ -164,7 +164,7 @@ const K = v(
164
164
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between mb-1", children: [
165
165
  /* @__PURE__ */ e.jsx("span", { className: "text-sm font-normal text-foreground", children: n }),
166
166
  d && g === "checkbox" && /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-end gap-4", children: [
167
- b && /* @__PURE__ */ e.jsx(
167
+ j && /* @__PURE__ */ e.jsx(
168
168
  w,
169
169
  {
170
170
  variant: "link",
@@ -196,14 +196,14 @@ const K = v(
196
196
  )
197
197
  ] })
198
198
  ] }),
199
- /* @__PURE__ */ e.jsx(S, { className: "w-full mb-6" }),
199
+ /* @__PURE__ */ e.jsx(R, { className: "w-full mb-6" }),
200
200
  P && "selectedValue" in s ? /* @__PURE__ */ e.jsx(
201
201
  q,
202
202
  {
203
203
  value: s.selectedValue,
204
204
  onValueChange: s.onChange,
205
205
  className: "grid grid-cols-2 gap-x-4 gap-y-5 overflow-y-auto",
206
- children: p.map((t) => /* @__PURE__ */ e.jsx(
206
+ children: v.map((t) => /* @__PURE__ */ e.jsx(
207
207
  E,
208
208
  {
209
209
  label: t.label,
@@ -213,7 +213,7 @@ const K = v(
213
213
  t.value
214
214
  ))
215
215
  }
216
- ) : B && "selectedValues" in s ? /* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-2 gap-x-4 gap-y-5 overflow-y-auto", children: p.map((t) => /* @__PURE__ */ e.jsx(
216
+ ) : B && "selectedValues" in s ? /* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-2 gap-x-4 gap-y-5 overflow-y-auto", children: v.map((t) => /* @__PURE__ */ e.jsx(
217
217
  O,
218
218
  {
219
219
  label: t.label,
@@ -228,70 +228,76 @@ const K = v(
228
228
  }
229
229
  );
230
230
  K.displayName = "FilterSection";
231
- const O = v(({ label: s, checked: l, onCheckedChange: n, description: a, className: r, icon: m }, c) => /* @__PURE__ */ e.jsxs("label", { className: y("flex items-start gap-2 cursor-pointer rtl:flex-row-reverse", r), children: [
232
- /* @__PURE__ */ e.jsx(U, { ref: c, checked: l, onCheckedChange: n }),
233
- m && /* @__PURE__ */ e.jsx(
234
- "img",
235
- {
236
- src: m,
237
- alt: "",
238
- className: "size-4 object-contain shrink-0",
239
- onError: (d) => {
240
- d.currentTarget.style.display = "none";
241
- }
242
- }
243
- ),
244
- /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-0.5 min-w-0 flex-1", children: [
245
- /* @__PURE__ */ e.jsx(V, { content: s, triggerProps: { className: "w-fit" }, children: /* @__PURE__ */ e.jsx("p", { className: "text-sm font-medium leading-4 truncate max-w-[165px]", children: s }) }),
246
- a && /* @__PURE__ */ e.jsx(V, { content: a, triggerProps: { className: "w-fit mt-2" }, children: /* @__PURE__ */ e.jsx("p", { className: "text-sm font-normal leading-5 text-muted-foreground truncate max-w-[165px]", children: a }) })
247
- ] })
248
- ] }));
249
- O.displayName = "FilterCheckboxOption";
250
- const E = v(
251
- ({ label: s, value: l, description: n, className: a }, r) => /* @__PURE__ */ e.jsxs("div", { className: y("flex items-start gap-3 rtl:flex-row-reverse", a), children: [
252
- /* @__PURE__ */ e.jsx(X, { ref: r, value: l, id: `radio-${l}` }),
253
- /* @__PURE__ */ e.jsxs(
254
- "label",
231
+ const O = y(({ label: s, checked: l, onCheckedChange: n, description: a, className: r, icon: c }, o) => {
232
+ const d = S() === "rtl";
233
+ return /* @__PURE__ */ e.jsxs("label", { className: b("flex items-start gap-2 cursor-pointer", d && "flex-row-reverse", r), children: [
234
+ /* @__PURE__ */ e.jsx(U, { ref: o, checked: l, onCheckedChange: n }),
235
+ c && /* @__PURE__ */ e.jsx(
236
+ "img",
255
237
  {
256
- htmlFor: `radio-${l}`,
257
- className: "flex flex-col gap-0.5 cursor-pointer flex-1 truncate",
258
- children: [
259
- /* @__PURE__ */ e.jsx(V, { content: s, triggerProps: { className: "w-fit" }, children: /* @__PURE__ */ e.jsx("p", { className: "text-sm font-medium leading-4 truncate max-w-[165px]", children: s }) }),
260
- n && /* @__PURE__ */ e.jsx(V, { content: n, triggerProps: { className: "w-fit mt-2" }, children: /* @__PURE__ */ e.jsx("p", { className: "w-fittext-sm font-normal leading-4 text-muted-foreground truncate max-w-[165px]", children: n }) })
261
- ]
238
+ src: c,
239
+ alt: "",
240
+ className: "size-4 object-contain shrink-0",
241
+ onError: (j) => {
242
+ j.currentTarget.style.display = "none";
243
+ }
262
244
  }
263
- )
264
- ] })
245
+ ),
246
+ /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-0.5 min-w-0 flex-1", children: [
247
+ /* @__PURE__ */ e.jsx(V, { content: s, triggerProps: { className: "w-fit" }, children: /* @__PURE__ */ e.jsx("p", { className: "text-sm font-medium leading-4 truncate max-w-[165px]", children: s }) }),
248
+ a && /* @__PURE__ */ e.jsx(V, { content: a, triggerProps: { className: "w-fit mt-2" }, children: /* @__PURE__ */ e.jsx("p", { className: "text-sm font-normal leading-5 text-muted-foreground truncate max-w-[165px]", children: a }) })
249
+ ] })
250
+ ] });
251
+ });
252
+ O.displayName = "FilterCheckboxOption";
253
+ const E = y(
254
+ ({ label: s, value: l, description: n, className: a }, r) => {
255
+ const c = S() === "rtl";
256
+ return /* @__PURE__ */ e.jsxs("div", { className: b("flex items-start gap-3", c && "flex-row-reverse", a), children: [
257
+ /* @__PURE__ */ e.jsx(X, { ref: r, value: l, id: `radio-${l}` }),
258
+ /* @__PURE__ */ e.jsxs(
259
+ "label",
260
+ {
261
+ htmlFor: `radio-${l}`,
262
+ className: "flex flex-col gap-0.5 cursor-pointer flex-1 truncate",
263
+ children: [
264
+ /* @__PURE__ */ e.jsx(V, { content: s, triggerProps: { className: "w-fit" }, children: /* @__PURE__ */ e.jsx("p", { className: "text-sm font-medium leading-4 truncate max-w-[165px]", children: s }) }),
265
+ n && /* @__PURE__ */ e.jsx(V, { content: n, triggerProps: { className: "w-fit mt-2" }, children: /* @__PURE__ */ e.jsx("p", { className: "w-fittext-sm font-normal leading-4 text-muted-foreground truncate max-w-[165px]", children: n }) })
266
+ ]
267
+ }
268
+ )
269
+ ] });
270
+ }
265
271
  );
266
272
  E.displayName = "FilterRadioOption";
267
- const W = v(
273
+ const W = y(
268
274
  ({
269
275
  children: s,
270
276
  showSearch: l = !1,
271
277
  searchPlaceholder: n,
272
278
  searchValue: a,
273
279
  onSearchChange: r,
274
- className: m,
275
- lang: c,
280
+ className: c,
281
+ lang: o,
276
282
  translations: d
277
- }, b) => {
283
+ }, j) => {
278
284
  const f = k(() => {
279
- const x = T(c);
285
+ const x = I(o);
280
286
  return d ? { ...x, ...d } : x;
281
- }, [c, d]);
287
+ }, [o, d]);
282
288
  return /* @__PURE__ */ e.jsxs(
283
289
  "div",
284
290
  {
285
- ref: b,
286
- dir: z(c),
287
- className: y(
291
+ ref: j,
292
+ dir: S(o),
293
+ className: b(
288
294
  "flex flex-col gap-6 bg-input rounded-md p-6 min-w-[448px]",
289
- m
295
+ c
290
296
  ),
291
297
  children: [
292
298
  l && /* @__PURE__ */ e.jsx("div", { className: "flex flex-col gap-2", children: /* @__PURE__ */ e.jsxs("div", { className: "relative", children: [
293
299
  /* @__PURE__ */ e.jsx(
294
- R,
300
+ T,
295
301
  {
296
302
  name: "MagnifyingGlass",
297
303
  className: "absolute start-3 top-1/2 -translate-y-1/2 size-4 text-muted-foreground"
@@ -324,5 +330,5 @@ export {
324
330
  K as FilterSection,
325
331
  L as FilterTag,
326
332
  H as formatMoreFilters,
327
- T as getFilterTranslations
333
+ I as getFilterTranslations
328
334
  };