@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.
- package/dist/components/atoms/checkbox/checkbox.js +16 -16
- package/dist/components/atoms/filter/filter-date-range.d.ts +31 -1
- package/dist/components/atoms/filter/filter-date-range.js +140 -144
- package/dist/components/atoms/filter/filter-multi-input.d.ts +11 -0
- package/dist/components/atoms/filter/filter-multi-input.js +42 -36
- package/dist/components/atoms/filter/filter-translations.d.ts +75 -0
- package/dist/components/atoms/filter/filter-translations.js +450 -0
- package/dist/components/atoms/filter/filter.d.ts +30 -0
- package/dist/components/atoms/filter/filter.js +191 -171
- package/dist/components/atoms/filter/index.d.ts +2 -2
- package/dist/components/atoms/filter-dropdown/filter-dropdown.d.ts +17 -2
- package/dist/components/atoms/filter-dropdown/filter-dropdown.js +160 -151
- package/dist/components/atoms/icon/directional-icons.d.ts +12 -0
- package/dist/components/atoms/icon/directional-icons.js +38 -0
- package/dist/components/atoms/icon/icon.d.ts +6 -0
- package/dist/components/atoms/icon/icon.js +27 -21
- package/dist/components/atoms/icon/index.d.ts +1 -0
- package/dist/components/atoms/index.d.ts +1 -1
- package/dist/components/atoms/radio-group/radio-group-option.js +2 -2
- package/dist/components/atoms/select/select.js +2 -2
- package/dist/components/molecules/dialog-header/dialog-header.d.ts +1 -1
- package/dist/components/molecules/pagination/index.d.ts +1 -0
- package/dist/components/molecules/pagination/page-numbers.d.ts +3 -1
- package/dist/components/molecules/pagination/page-numbers.js +10 -9
- package/dist/components/molecules/pagination/pagination-translations.d.ts +33 -0
- package/dist/components/molecules/pagination/pagination-translations.js +82 -0
- package/dist/components/molecules/pagination/pagination.d.ts +9 -0
- package/dist/components/molecules/pagination/pagination.js +46 -38
- package/dist/components/organisms/data-table/components/column-header/data-table-column-header-menu.d.ts +3 -1
- package/dist/components/organisms/data-table/components/column-header/data-table-column-header-menu.js +28 -27
- package/dist/components/organisms/data-table/components/column-header/data-table-column-header.js +44 -41
- package/dist/components/organisms/data-table/components/data-table-header.js +11 -12
- package/dist/components/organisms/data-table/components/dialogs/data-table-manage-columns-dialog.d.ts +3 -1
- package/dist/components/organisms/data-table/components/dialogs/data-table-manage-columns-dialog.js +45 -44
- package/dist/components/organisms/data-table/data-table.d.ts +27 -2
- package/dist/components/organisms/data-table/data-table.js +146 -134
- package/dist/components/organisms/data-table/data-table.types.d.ts +68 -0
- package/dist/components/organisms/data-table/data-table.types.js +252 -0
- package/dist/components/organisms/data-table/index.d.ts +2 -1
- package/dist/components/organisms/data-table/utils/data-table-utils.js +11 -8
- package/dist/dashboard-design-system.css +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.esm.min.js +9394 -8512
- package/dist/index.js +208 -202
- package/dist/index.umd.min.js +25 -25
- package/dist/lib/utils.d.ts +13 -0
- package/dist/lib/utils.js +34 -10
- package/dist/vendor/shadcn/pagination.d.ts +19 -3
- package/dist/vendor/shadcn/pagination.js +41 -37
- package/dist/vendor/shadcn/select.js +33 -33
- package/dist/vendor/shadcn/switch.js +1 -1
- package/package.json +4 -2
- package/registry/components-registry.json +38 -12
|
@@ -1,22 +1,24 @@
|
|
|
1
1
|
import { j as e } from "../../../_virtual/jsx-runtime.js";
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { Button as
|
|
4
|
-
import { Badge as
|
|
5
|
-
import { Separator as
|
|
6
|
-
import { Checkbox as
|
|
7
|
-
import { RadioGroupItem as
|
|
8
|
-
import { Icon as
|
|
9
|
-
import { cn as
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
2
|
+
import { forwardRef as p, useMemo as k, useState as Q } from "react";
|
|
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";
|
|
6
|
+
import { Checkbox as D } from "../../../vendor/shadcn/checkbox.js";
|
|
7
|
+
import { RadioGroupItem as U, RadioGroup as X } from "../../../vendor/shadcn/radio-group.js";
|
|
8
|
+
import { Icon as R } from "../icon/icon.js";
|
|
9
|
+
import { cn as v } from "../../../lib/utils.js";
|
|
10
|
+
import { getFilterTranslations as T, formatMoreFilters as q } from "./filter-translations.js";
|
|
11
|
+
import { DEFAULT_FILTER_TRANSLATIONS as de, FILTER_TRANSLATIONS as xe } from "./filter-translations.js";
|
|
12
|
+
import { Tooltip as V } from "../tooltip/tooltip.js";
|
|
13
|
+
import { Field as z } from "../field/field.js";
|
|
14
|
+
const A = p(
|
|
15
|
+
({ label: s, onRemove: l, className: n, ...a }, r) => /* @__PURE__ */ e.jsxs(
|
|
16
|
+
I,
|
|
15
17
|
{
|
|
16
|
-
ref:
|
|
18
|
+
ref: r,
|
|
17
19
|
variant: "secondary",
|
|
18
|
-
className:
|
|
19
|
-
...
|
|
20
|
+
className: v("h-8 gap-2 px-3 py-2 shadow-xs", n),
|
|
21
|
+
...a,
|
|
20
22
|
children: [
|
|
21
23
|
/* @__PURE__ */ e.jsx("span", { className: "text-xs font-medium leading-none", children: s }),
|
|
22
24
|
l && /* @__PURE__ */ e.jsx(
|
|
@@ -25,203 +27,209 @@ const S = g(
|
|
|
25
27
|
onClick: l,
|
|
26
28
|
className: "inline-flex items-center justify-center",
|
|
27
29
|
"aria-label": `Remove ${s} filter`,
|
|
28
|
-
children: /* @__PURE__ */ e.jsx(
|
|
30
|
+
children: /* @__PURE__ */ e.jsx(R, { name: "X", className: "size-4" })
|
|
29
31
|
}
|
|
30
32
|
)
|
|
31
33
|
]
|
|
32
34
|
}
|
|
33
35
|
)
|
|
34
36
|
);
|
|
35
|
-
|
|
36
|
-
const
|
|
37
|
+
A.displayName = "FilterTag";
|
|
38
|
+
const H = p(
|
|
37
39
|
({
|
|
38
40
|
appliedFilters: s = [],
|
|
39
41
|
onRemoveFilter: l,
|
|
40
42
|
onClearAll: n,
|
|
41
|
-
maxVisibleTags:
|
|
42
|
-
className:
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
43
|
+
maxVisibleTags: a = 4,
|
|
44
|
+
className: r,
|
|
45
|
+
lang: m,
|
|
46
|
+
translations: c,
|
|
47
|
+
...d
|
|
48
|
+
}, y) => {
|
|
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), b = s.length - a;
|
|
46
53
|
return /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-4", children: [
|
|
47
54
|
/* @__PURE__ */ e.jsxs(
|
|
48
|
-
|
|
55
|
+
w,
|
|
49
56
|
{
|
|
50
|
-
ref:
|
|
57
|
+
ref: y,
|
|
51
58
|
variant: "outline",
|
|
52
59
|
size: "sm",
|
|
53
|
-
className:
|
|
54
|
-
...
|
|
60
|
+
className: v("h-8 gap-2 px-3 py-2", r),
|
|
61
|
+
...d,
|
|
55
62
|
children: [
|
|
56
|
-
/* @__PURE__ */ e.jsx(
|
|
57
|
-
/* @__PURE__ */ e.jsx("span", { className: "text-xs font-medium leading-none", children:
|
|
63
|
+
/* @__PURE__ */ e.jsx(R, { name: "FunnelSimple", className: "size-4" }),
|
|
64
|
+
/* @__PURE__ */ e.jsx("span", { className: "text-xs font-medium leading-none", children: f.addFilter })
|
|
58
65
|
]
|
|
59
66
|
}
|
|
60
67
|
),
|
|
61
|
-
|
|
62
|
-
/* @__PURE__ */ e.jsx(
|
|
68
|
+
x && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
69
|
+
/* @__PURE__ */ e.jsx(S, { orientation: "vertical", className: "h-5" }),
|
|
63
70
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
64
|
-
|
|
65
|
-
|
|
71
|
+
F.map((o) => /* @__PURE__ */ e.jsx(
|
|
72
|
+
A,
|
|
66
73
|
{
|
|
67
|
-
label:
|
|
68
|
-
onRemove: () => l?.(
|
|
74
|
+
label: o.label,
|
|
75
|
+
onRemove: () => l?.(o.id)
|
|
69
76
|
},
|
|
70
|
-
|
|
77
|
+
o.id
|
|
71
78
|
)),
|
|
72
|
-
|
|
73
|
-
"+",
|
|
74
|
-
v,
|
|
75
|
-
" more"
|
|
76
|
-
] }) }),
|
|
79
|
+
b > 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: q(f, b) }) }),
|
|
77
80
|
n && /* @__PURE__ */ e.jsx(
|
|
78
|
-
|
|
81
|
+
w,
|
|
79
82
|
{
|
|
80
83
|
variant: "ghost",
|
|
81
84
|
size: "sm",
|
|
82
85
|
onClick: n,
|
|
83
86
|
className: "h-8 px-3 py-2",
|
|
84
|
-
children: /* @__PURE__ */ e.jsx("span", { className: "text-xs font-medium leading-none text-primary", children:
|
|
87
|
+
children: /* @__PURE__ */ e.jsx("span", { className: "text-xs font-medium leading-none text-primary", children: f.clearFilters })
|
|
85
88
|
}
|
|
86
89
|
)
|
|
87
90
|
] })
|
|
88
91
|
] }),
|
|
89
|
-
!
|
|
90
|
-
/* @__PURE__ */ e.jsx(
|
|
91
|
-
/* @__PURE__ */ e.jsx("span", { className: "text-sm font-normal text-muted-foreground", children:
|
|
92
|
+
!x && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
93
|
+
/* @__PURE__ */ e.jsx(S, { orientation: "vertical", className: "h-5" }),
|
|
94
|
+
/* @__PURE__ */ e.jsx("span", { className: "text-sm font-normal text-muted-foreground", children: f.noFiltersApplied })
|
|
92
95
|
] })
|
|
93
96
|
] });
|
|
94
97
|
}
|
|
95
98
|
);
|
|
96
|
-
|
|
97
|
-
const
|
|
99
|
+
H.displayName = "FilterButton";
|
|
100
|
+
const J = p(
|
|
98
101
|
(s, l) => {
|
|
99
102
|
const {
|
|
100
103
|
title: n,
|
|
101
|
-
items:
|
|
102
|
-
className:
|
|
104
|
+
items: a,
|
|
105
|
+
className: r,
|
|
103
106
|
searchable: m = !1,
|
|
104
|
-
searchPlaceholder:
|
|
107
|
+
searchPlaceholder: c,
|
|
105
108
|
showActions: d = !1,
|
|
106
|
-
enableSelectAll:
|
|
107
|
-
enableInverse:
|
|
108
|
-
enableNone:
|
|
109
|
-
description:
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
109
|
+
enableSelectAll: y = !0,
|
|
110
|
+
enableInverse: f = !0,
|
|
111
|
+
enableNone: x = !0,
|
|
112
|
+
description: F,
|
|
113
|
+
lang: b,
|
|
114
|
+
translations: o
|
|
115
|
+
} = s, C = k(() => {
|
|
116
|
+
const t = T(b);
|
|
117
|
+
return o ? { ...t, ...o } : t;
|
|
118
|
+
}, [b, o]), g = s.type || "checkbox", E = g === "radio", P = g === "checkbox" || !s.type, [j, B] = Q(""), N = k(() => j ? a.filter(
|
|
119
|
+
(t) => t.label.toLowerCase().includes(j.toLowerCase())
|
|
120
|
+
) : a, [a, j]), G = () => {
|
|
121
|
+
if (g === "checkbox" && "selectedValues" in s) {
|
|
122
|
+
const t = N.map((u) => u.value), i = j ? [.../* @__PURE__ */ new Set([...s.selectedValues, ...t])] : t;
|
|
115
123
|
s.onChange(i);
|
|
116
124
|
}
|
|
117
|
-
},
|
|
118
|
-
if (
|
|
119
|
-
if (
|
|
120
|
-
const
|
|
121
|
-
(
|
|
122
|
-
),
|
|
123
|
-
s.onChange([...i, ...
|
|
125
|
+
}, M = () => {
|
|
126
|
+
if (g === "checkbox" && "selectedValues" in s)
|
|
127
|
+
if (j) {
|
|
128
|
+
const t = new Set(N.map((h) => h.value)), i = s.selectedValues.filter(
|
|
129
|
+
(h) => !t.has(h)
|
|
130
|
+
), u = N.filter((h) => !s.selectedValues.includes(h.value)).map((h) => h.value);
|
|
131
|
+
s.onChange([...i, ...u]);
|
|
124
132
|
} else {
|
|
125
|
-
const
|
|
126
|
-
s.onChange(
|
|
133
|
+
const t = a.filter((i) => !s.selectedValues.includes(i.value)).map((i) => i.value);
|
|
134
|
+
s.onChange(t);
|
|
127
135
|
}
|
|
128
|
-
},
|
|
129
|
-
if (
|
|
130
|
-
if (
|
|
131
|
-
const
|
|
132
|
-
(
|
|
136
|
+
}, _ = () => {
|
|
137
|
+
if (g === "checkbox" && "selectedValues" in s)
|
|
138
|
+
if (j) {
|
|
139
|
+
const t = new Set(N.map((u) => u.value)), i = s.selectedValues.filter(
|
|
140
|
+
(u) => !t.has(u)
|
|
133
141
|
);
|
|
134
142
|
s.onChange(i);
|
|
135
143
|
} else
|
|
136
144
|
s.onChange([]);
|
|
137
|
-
else
|
|
138
|
-
},
|
|
139
|
-
if (
|
|
140
|
-
const
|
|
141
|
-
s.onChange(
|
|
145
|
+
else g === "radio" && "selectedValue" in s && s.onChange("");
|
|
146
|
+
}, $ = (t, i) => {
|
|
147
|
+
if (g === "checkbox" && "selectedValues" in s) {
|
|
148
|
+
const u = i ? [...s.selectedValues, t] : s.selectedValues.filter((h) => h !== t);
|
|
149
|
+
s.onChange(u);
|
|
142
150
|
}
|
|
143
151
|
};
|
|
144
|
-
return /* @__PURE__ */ e.jsxs("div", { ref: l, className:
|
|
152
|
+
return /* @__PURE__ */ e.jsxs("div", { ref: l, className: v("flex flex-col h-full", r), children: [
|
|
145
153
|
m && /* @__PURE__ */ e.jsx(
|
|
146
|
-
|
|
154
|
+
z,
|
|
147
155
|
{
|
|
148
|
-
placeholder:
|
|
149
|
-
value:
|
|
150
|
-
onChange: (
|
|
156
|
+
placeholder: c ?? C.search,
|
|
157
|
+
value: j,
|
|
158
|
+
onChange: (t) => B(t.target.value),
|
|
151
159
|
startIcon: "MagnifyingGlass",
|
|
152
160
|
className: "mb-4"
|
|
153
161
|
}
|
|
154
162
|
),
|
|
155
|
-
|
|
163
|
+
F && /* @__PURE__ */ e.jsx("p", { className: "text-xs font-normal text-muted-foreground mb-4", children: F }),
|
|
156
164
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between mb-1", children: [
|
|
157
165
|
/* @__PURE__ */ e.jsx("span", { className: "text-sm font-normal text-foreground", children: n }),
|
|
158
|
-
d &&
|
|
159
|
-
|
|
160
|
-
|
|
166
|
+
d && g === "checkbox" && /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-end gap-4", children: [
|
|
167
|
+
y && /* @__PURE__ */ e.jsx(
|
|
168
|
+
w,
|
|
161
169
|
{
|
|
162
170
|
variant: "link",
|
|
163
171
|
size: "sm",
|
|
164
|
-
onClick:
|
|
172
|
+
onClick: G,
|
|
165
173
|
className: "h-auto p-0 text-xs font-medium text-primary hover:text-primary/80",
|
|
166
|
-
children:
|
|
174
|
+
children: C.selectAll
|
|
167
175
|
}
|
|
168
176
|
),
|
|
169
|
-
|
|
170
|
-
|
|
177
|
+
f && /* @__PURE__ */ e.jsx(
|
|
178
|
+
w,
|
|
171
179
|
{
|
|
172
180
|
variant: "link",
|
|
173
181
|
size: "sm",
|
|
174
|
-
onClick:
|
|
182
|
+
onClick: M,
|
|
175
183
|
className: "h-auto p-0 text-xs font-medium text-primary hover:text-primary/80",
|
|
176
|
-
children:
|
|
184
|
+
children: C.inverse
|
|
177
185
|
}
|
|
178
186
|
),
|
|
179
|
-
|
|
180
|
-
|
|
187
|
+
x && /* @__PURE__ */ e.jsx(
|
|
188
|
+
w,
|
|
181
189
|
{
|
|
182
190
|
variant: "link",
|
|
183
191
|
size: "sm",
|
|
184
|
-
onClick:
|
|
192
|
+
onClick: _,
|
|
185
193
|
className: "h-auto p-0 text-xs font-medium text-primary hover:text-primary/80",
|
|
186
|
-
children:
|
|
194
|
+
children: C.none
|
|
187
195
|
}
|
|
188
196
|
)
|
|
189
197
|
] })
|
|
190
198
|
] }),
|
|
191
|
-
/* @__PURE__ */ e.jsx(
|
|
192
|
-
|
|
193
|
-
|
|
199
|
+
/* @__PURE__ */ e.jsx(S, { className: "w-full mb-6" }),
|
|
200
|
+
E && "selectedValue" in s ? /* @__PURE__ */ e.jsx(
|
|
201
|
+
X,
|
|
194
202
|
{
|
|
195
203
|
value: s.selectedValue,
|
|
196
204
|
onValueChange: s.onChange,
|
|
197
205
|
className: "grid grid-cols-2 gap-x-4 gap-y-5 overflow-y-auto",
|
|
198
|
-
children:
|
|
199
|
-
|
|
206
|
+
children: N.map((t) => /* @__PURE__ */ e.jsx(
|
|
207
|
+
O,
|
|
200
208
|
{
|
|
201
|
-
label:
|
|
202
|
-
value:
|
|
203
|
-
description:
|
|
209
|
+
label: t.label,
|
|
210
|
+
value: t.value,
|
|
211
|
+
description: t.description
|
|
204
212
|
},
|
|
205
|
-
|
|
213
|
+
t.value
|
|
206
214
|
))
|
|
207
215
|
}
|
|
208
|
-
) :
|
|
209
|
-
|
|
216
|
+
) : P && "selectedValues" in s ? /* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-2 gap-x-4 gap-y-5 overflow-y-auto", children: N.map((t) => /* @__PURE__ */ e.jsx(
|
|
217
|
+
L,
|
|
210
218
|
{
|
|
211
|
-
label:
|
|
212
|
-
description:
|
|
213
|
-
icon:
|
|
214
|
-
checked: s.selectedValues.includes(
|
|
215
|
-
onCheckedChange: (i) =>
|
|
219
|
+
label: t.label,
|
|
220
|
+
description: t.description,
|
|
221
|
+
icon: t.icon,
|
|
222
|
+
checked: s.selectedValues.includes(t.value),
|
|
223
|
+
onCheckedChange: (i) => $(t.value, i)
|
|
216
224
|
},
|
|
217
|
-
|
|
225
|
+
t.value
|
|
218
226
|
)) }) : null
|
|
219
227
|
] });
|
|
220
228
|
}
|
|
221
229
|
);
|
|
222
|
-
|
|
223
|
-
const
|
|
224
|
-
/* @__PURE__ */ e.jsx(
|
|
230
|
+
J.displayName = "FilterSection";
|
|
231
|
+
const L = p(({ label: s, checked: l, onCheckedChange: n, description: a, className: r, icon: m }, c) => /* @__PURE__ */ e.jsxs("label", { className: v("flex items-start gap-2 cursor-pointer rtl:flex-row-reverse", r), children: [
|
|
232
|
+
/* @__PURE__ */ e.jsx(D, { ref: c, checked: l, onCheckedChange: n }),
|
|
225
233
|
m && /* @__PURE__ */ e.jsx(
|
|
226
234
|
"img",
|
|
227
235
|
{
|
|
@@ -234,74 +242,86 @@ const z = g(({ label: s, checked: l, onCheckedChange: n, description: t, classNa
|
|
|
234
242
|
}
|
|
235
243
|
),
|
|
236
244
|
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-0.5 min-w-0 flex-1", children: [
|
|
237
|
-
/* @__PURE__ */ e.jsx(
|
|
238
|
-
|
|
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 }) })
|
|
239
247
|
] })
|
|
240
248
|
] }));
|
|
241
|
-
|
|
242
|
-
const
|
|
243
|
-
({ label: s, value: l, description: n, className:
|
|
244
|
-
/* @__PURE__ */ e.jsx(
|
|
249
|
+
L.displayName = "FilterCheckboxOption";
|
|
250
|
+
const O = p(
|
|
251
|
+
({ label: s, value: l, description: n, className: a }, r) => /* @__PURE__ */ e.jsxs("div", { className: v("flex items-start gap-3 rtl:flex-row-reverse", a), children: [
|
|
252
|
+
/* @__PURE__ */ e.jsx(U, { ref: r, value: l, id: `radio-${l}` }),
|
|
245
253
|
/* @__PURE__ */ e.jsxs(
|
|
246
254
|
"label",
|
|
247
255
|
{
|
|
248
256
|
htmlFor: `radio-${l}`,
|
|
249
257
|
className: "flex flex-col gap-0.5 cursor-pointer flex-1 truncate",
|
|
250
258
|
children: [
|
|
251
|
-
/* @__PURE__ */ e.jsx(
|
|
252
|
-
n && /* @__PURE__ */ e.jsx(
|
|
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 }) })
|
|
253
261
|
]
|
|
254
262
|
}
|
|
255
263
|
)
|
|
256
264
|
] })
|
|
257
265
|
);
|
|
258
|
-
|
|
259
|
-
const
|
|
266
|
+
O.displayName = "FilterRadioOption";
|
|
267
|
+
const K = p(
|
|
260
268
|
({
|
|
261
269
|
children: s,
|
|
262
270
|
showSearch: l = !1,
|
|
263
|
-
searchPlaceholder: n
|
|
264
|
-
searchValue:
|
|
265
|
-
onSearchChange:
|
|
266
|
-
className: m
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
271
|
+
searchPlaceholder: n,
|
|
272
|
+
searchValue: a,
|
|
273
|
+
onSearchChange: r,
|
|
274
|
+
className: m,
|
|
275
|
+
lang: c,
|
|
276
|
+
translations: d
|
|
277
|
+
}, y) => {
|
|
278
|
+
const f = k(() => {
|
|
279
|
+
const x = T(c);
|
|
280
|
+
return d ? { ...x, ...d } : x;
|
|
281
|
+
}, [c, d]);
|
|
282
|
+
return /* @__PURE__ */ e.jsxs(
|
|
283
|
+
"div",
|
|
284
|
+
{
|
|
285
|
+
ref: y,
|
|
286
|
+
className: v(
|
|
287
|
+
"flex flex-col gap-6 bg-input rounded-md p-6 min-w-[448px]",
|
|
288
|
+
m
|
|
289
|
+
),
|
|
290
|
+
children: [
|
|
291
|
+
l && /* @__PURE__ */ e.jsx("div", { className: "flex flex-col gap-2", children: /* @__PURE__ */ e.jsxs("div", { className: "relative", children: [
|
|
292
|
+
/* @__PURE__ */ e.jsx(
|
|
293
|
+
R,
|
|
294
|
+
{
|
|
295
|
+
name: "MagnifyingGlass",
|
|
296
|
+
className: "absolute start-3 top-1/2 -translate-y-1/2 size-4 text-muted-foreground"
|
|
297
|
+
}
|
|
298
|
+
),
|
|
299
|
+
/* @__PURE__ */ e.jsx(
|
|
300
|
+
z,
|
|
301
|
+
{
|
|
302
|
+
placeholder: n ?? f.search,
|
|
303
|
+
value: a,
|
|
304
|
+
onChange: (x) => r?.(x.target.value),
|
|
305
|
+
className: "ps-9"
|
|
306
|
+
}
|
|
307
|
+
)
|
|
308
|
+
] }) }),
|
|
309
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex flex-col gap-6", children: s })
|
|
310
|
+
]
|
|
311
|
+
}
|
|
312
|
+
);
|
|
313
|
+
}
|
|
298
314
|
);
|
|
299
|
-
|
|
315
|
+
K.displayName = "FilterContent";
|
|
300
316
|
export {
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
317
|
+
de as DEFAULT_FILTER_TRANSLATIONS,
|
|
318
|
+
xe as FILTER_TRANSLATIONS,
|
|
319
|
+
H as FilterButton,
|
|
320
|
+
L as FilterCheckboxOption,
|
|
321
|
+
K as FilterContent,
|
|
322
|
+
O as FilterRadioOption,
|
|
323
|
+
J as FilterSection,
|
|
324
|
+
A as FilterTag,
|
|
325
|
+
q as formatMoreFilters,
|
|
326
|
+
T as getFilterTranslations
|
|
307
327
|
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { FilterButton, FilterTag, FilterSection, FilterCheckboxOption, FilterRadioOption, FilterContent, type FilterButtonProps, type FilterTagProps, type FilterSectionProps, type FilterCheckboxOptionProps, type FilterRadioOptionProps, type FilterContentProps, } from './filter';
|
|
2
|
-
export { FilterDateRange, FilterDateRangeOption, FilterDateRangeValue, type FilterDateRangeProps, type FilterDateRangeOptionProps, } from './filter-date-range';
|
|
1
|
+
export { FilterButton, FilterTag, FilterSection, FilterCheckboxOption, FilterRadioOption, FilterContent, type FilterButtonProps, type FilterTagProps, type FilterSectionProps, type FilterCheckboxOptionProps, type FilterRadioOptionProps, type FilterContentProps, type FilterLanguage, type FilterTranslations, FILTER_TRANSLATIONS, DEFAULT_FILTER_TRANSLATIONS, getFilterTranslations, } from './filter';
|
|
2
|
+
export { FilterDateRange, FilterDateRangeOption, FilterDateRangeValue, type FilterDateRangeProps, type FilterDateRangeOptionProps, type FilterDateRangeLabels, } from './filter-date-range';
|
|
3
3
|
export { FilterMultiInput, type FilterMultiInputProps, } from './filter-multi-input';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ReactNode, ComponentProps } from 'react';
|
|
2
2
|
import { IconName } from '../icon';
|
|
3
|
-
import { FilterSectionItem } from '../filter/filter';
|
|
3
|
+
import { FilterSectionItem, FilterLanguage, FilterTranslations } from '../filter/filter';
|
|
4
|
+
import { FilterDateRangeLabels } from '../filter/filter-date-range';
|
|
4
5
|
/**
|
|
5
6
|
* Props for the FilterMenuItem component
|
|
6
7
|
*/
|
|
@@ -170,6 +171,11 @@ interface FilterConfig {
|
|
|
170
171
|
* Callback fired when end time changes
|
|
171
172
|
*/
|
|
172
173
|
onEndTimeChange?: (time: string) => void;
|
|
174
|
+
/**
|
|
175
|
+
* Labels for date range filter options - enables i18n/translation support.
|
|
176
|
+
* If not provided, defaults to English strings.
|
|
177
|
+
*/
|
|
178
|
+
dateLabels?: FilterDateRangeLabels;
|
|
173
179
|
/**
|
|
174
180
|
* Whether the filter items are searchable
|
|
175
181
|
*/
|
|
@@ -274,7 +280,7 @@ interface FilterDropdownProps {
|
|
|
274
280
|
onOpenChange?: (isOpen: boolean) => void;
|
|
275
281
|
/**
|
|
276
282
|
* Text to display in the trigger button
|
|
277
|
-
* @
|
|
283
|
+
* @deprecated Use `lang` or `translations` prop instead
|
|
278
284
|
*/
|
|
279
285
|
buttonText?: string;
|
|
280
286
|
/**
|
|
@@ -297,6 +303,15 @@ interface FilterDropdownProps {
|
|
|
297
303
|
* @default false
|
|
298
304
|
*/
|
|
299
305
|
applyOnClose?: boolean;
|
|
306
|
+
/**
|
|
307
|
+
* Language code for translations
|
|
308
|
+
* @default "en"
|
|
309
|
+
*/
|
|
310
|
+
lang?: FilterLanguage;
|
|
311
|
+
/**
|
|
312
|
+
* Custom translations (overrides lang-based translations)
|
|
313
|
+
*/
|
|
314
|
+
translations?: FilterTranslations;
|
|
300
315
|
}
|
|
301
316
|
declare const FilterDropdown: import('react').ForwardRefExoticComponent<FilterDropdownProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
302
317
|
export { FilterDropdown, FilterMenu, FilterMenuItem, type FilterDropdownProps, type FilterConfig, type FilterMenuProps, type FilterMenuItemProps, type FilterDeferredContext, };
|