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