@yuno-payments/dashboard-design-system 0.0.166 → 0.0.170
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/access-denied-alert/access-denied-alert.d.ts +0 -16
- package/dist/components/atoms/accordion/accordion.d.ts +0 -66
- package/dist/components/atoms/alert/alert.d.ts +1 -26
- package/dist/components/atoms/alert/alert.js +8 -9
- package/dist/components/atoms/avatar/avatar-group.d.ts +0 -28
- package/dist/components/atoms/avatar/avatar.d.ts +0 -25
- package/dist/components/atoms/avatar/avatar.js +9 -9
- package/dist/components/atoms/badge/badge.d.ts +2 -30
- package/dist/components/atoms/badge/badge.js +11 -27
- package/dist/components/atoms/button/button.d.ts +0 -44
- package/dist/components/atoms/card/card.d.ts +3 -137
- package/dist/components/atoms/card/card.js +28 -56
- package/dist/components/atoms/checkbox/checkbox.d.ts +2 -38
- package/dist/components/atoms/checkbox/checkbox.js +27 -61
- package/dist/components/atoms/combobox/combobox.d.ts +0 -18
- package/dist/components/atoms/combobox/combobox.js +41 -41
- package/dist/components/atoms/combobox/types.d.ts +1 -90
- package/dist/components/atoms/currency-field/currency-field.d.ts +0 -38
- package/dist/components/atoms/currency-field/currency-field.js +19 -22
- package/dist/components/atoms/date-picker/date-picker.d.ts +0 -15
- package/dist/components/atoms/date-range-picker/date-range-picker.d.ts +0 -15
- package/dist/components/atoms/dots-menu/dots-menu.d.ts +0 -16
- package/dist/components/atoms/dots-menu/dots-menu.js +8 -8
- package/dist/components/atoms/dots-menu/dots-menu.types.d.ts +0 -52
- package/dist/components/atoms/dropdown-menu/dropdown-menu.d.ts +0 -50
- package/dist/components/atoms/field/field.d.ts +0 -55
- package/dist/components/atoms/field/field.js +46 -53
- package/dist/components/atoms/filter/filter-date-range.d.ts +2 -12
- package/dist/components/atoms/filter/filter-date-range.js +168 -203
- package/dist/components/atoms/filter/filter.d.ts +0 -6
- package/dist/components/atoms/filter/filter.js +76 -91
- package/dist/components/atoms/filter/index.d.ts +1 -1
- package/dist/components/atoms/filter-dropdown/filter-dropdown.d.ts +2 -208
- package/dist/components/atoms/filter-dropdown/filter-dropdown.js +160 -214
- package/dist/components/atoms/icon/icon-list.d.ts +0 -5
- package/dist/components/atoms/icon/icon-list.js +384 -394
- package/dist/components/atoms/icon/icon.d.ts +0 -29
- package/dist/components/atoms/index.d.ts +2 -3
- package/dist/components/atoms/label/index.d.ts +1 -1
- package/dist/components/atoms/link/link.d.ts +0 -20
- package/dist/components/atoms/multi-select/multi-select.d.ts +1 -1
- package/dist/components/atoms/multi-select/multi-select.js +6 -6
- package/dist/components/atoms/multi-values-field/multi-values-field.d.ts +0 -16
- package/dist/components/atoms/multi-values-field/multi-values-field.js +87 -109
- package/dist/components/atoms/multi-values-field/multi-values-field.types.d.ts +0 -81
- package/dist/components/atoms/otp-field/otp-field.d.ts +0 -32
- package/dist/components/atoms/password-field/password-field.d.ts +0 -23
- package/dist/components/atoms/password-field/password-field.js +1 -1
- package/dist/components/atoms/progress/progress.d.ts +0 -15
- package/dist/components/atoms/protected-field/protected-field.d.ts +0 -10
- package/dist/components/atoms/protected-field/protected-field.types.d.ts +0 -14
- package/dist/components/atoms/radio-group/radio-group-option.js +11 -11
- package/dist/components/atoms/radio-group/radio-group.d.ts +1 -50
- package/dist/components/atoms/radio-group/radio-group.js +12 -13
- package/dist/components/atoms/search-field/search-field.d.ts +0 -14
- package/dist/components/atoms/search-field/search-field.js +17 -17
- package/dist/components/atoms/search-field/search-field.types.d.ts +0 -57
- package/dist/components/atoms/select/index.d.ts +0 -2
- package/dist/components/atoms/select/select.d.ts +1 -83
- package/dist/components/atoms/select/select.js +21 -21
- package/dist/components/atoms/separator/separator.d.ts +0 -17
- package/dist/components/atoms/skeleton/index.d.ts +0 -9
- package/dist/components/atoms/switch/switch.d.ts +2 -56
- package/dist/components/atoms/switch/switch.js +32 -64
- package/dist/components/atoms/tabs/index.d.ts +0 -16
- package/dist/components/atoms/textarea/textarea.d.ts +0 -32
- package/dist/components/atoms/textarea/textarea.js +1 -1
- package/dist/components/atoms/time-picker/time-picker.d.ts +2 -73
- package/dist/components/atoms/time-picker/time-picker.js +3 -218
- package/dist/components/atoms/toaster/index.d.ts +0 -15
- package/dist/components/atoms/toggle-group/toggle-group.d.ts +1 -26
- package/dist/components/atoms/toggle-group/toggle-group.js +14 -15
- package/dist/components/atoms/tooltip/tooltip.d.ts +2 -53
- package/dist/components/atoms/typography/typography.d.ts +0 -18
- package/dist/components/molecules/breadcrumb/breadcrumb.d.ts +0 -50
- package/dist/components/molecules/breadcrumb/breadcrumb.js +17 -17
- package/dist/components/molecules/dialog-content/dialog-content.d.ts +0 -16
- package/dist/components/molecules/dialog-footer/dialog-footer.d.ts +0 -20
- package/dist/components/molecules/dialog-header/dialog-header.d.ts +0 -31
- package/dist/components/molecules/empty/empty-icon.js +6 -6
- package/dist/components/molecules/empty/empty.d.ts +1 -16
- package/dist/components/molecules/empty/empty.js +34 -37
- package/dist/components/molecules/highlight-banner/highlight-banner.d.ts +0 -17
- package/dist/components/molecules/pagination/pagination.d.ts +0 -49
- package/dist/components/organisms/data-table/components/cells/data-table-list-cell.d.ts +0 -41
- package/dist/components/organisms/data-table/components/column-header/data-table-column-header-content.js +1 -1
- package/dist/components/organisms/data-table/components/column-header/data-table-column-header-menu.js +18 -18
- package/dist/components/organisms/data-table/components/column-header/data-table-column-header.d.ts +0 -18
- package/dist/components/organisms/data-table/components/column-header/data-table-column-header.js +10 -10
- package/dist/components/organisms/data-table/components/data-table-body.d.ts +0 -18
- package/dist/components/organisms/data-table/components/data-table-header.d.ts +0 -12
- package/dist/components/organisms/data-table/components/data-table-header.js +7 -7
- package/dist/components/organisms/data-table/components/states/data-table-loading.d.ts +0 -24
- package/dist/components/organisms/data-table/components/states/data-table-loading.js +6 -6
- package/dist/components/organisms/data-table/data-table.d.ts +3 -115
- package/dist/components/organisms/data-table/data-table.js +104 -131
- package/dist/components/organisms/data-table/data-table.types.d.ts +24 -23
- package/dist/components/organisms/data-table/hooks/use-data-table-columns.js +41 -57
- package/dist/components/organisms/data-table/hooks/use-data-table-state.d.ts +2 -7
- package/dist/components/organisms/data-table/hooks/use-data-table-state.js +46 -80
- package/dist/components/organisms/data-table/utils/data-table-constants.d.ts +2 -8
- package/dist/components/organisms/data-table/utils/data-table-constants.js +10 -16
- package/dist/components/organisms/data-table/utils/data-table-styles.d.ts +0 -1652
- package/dist/components/organisms/data-table/utils/data-table-styles.js +14 -29
- package/dist/components/organisms/dialog/dialog.d.ts +1 -67
- package/dist/components/organisms/dialog/dialog.js +61 -78
- package/dist/components/organisms/index.d.ts +0 -2
- package/dist/components/organisms/sheet/sheet.d.ts +0 -69
- package/dist/components/organisms/sheet/sheet.js +33 -34
- package/dist/index.css +1 -1
- package/dist/index.d.ts +0 -2
- package/dist/index.js +162 -173
- package/dist/vendor/shadcn/avatar.js +19 -19
- package/dist/vendor/shadcn/badge.js +15 -15
- package/dist/vendor/shadcn/card.js +7 -7
- package/dist/vendor/shadcn/date-picker.d.ts +2 -2
- package/dist/vendor/shadcn/date-picker.js +1 -1
- package/dist/vendor/shadcn/date-range-picker.d.ts +2 -2
- package/dist/vendor/shadcn/date-range-picker.js +1 -1
- package/dist/vendor/shadcn/dialog.js +2 -2
- package/dist/vendor/shadcn/input-group.js +17 -17
- package/dist/vendor/shadcn/input.js +7 -7
- package/dist/vendor/shadcn/popover.js +1 -1
- package/dist/vendor/shadcn/select.js +2 -2
- package/dist/vendor/shadcn/sonner.d.ts +1 -26
- package/dist/vendor/shadcn/sonner.js +8 -12
- package/dist/vendor/shadcn/table.js +30 -30
- package/dist/vendor/shadcn/textarea.js +9 -9
- package/dist/vendor/shadcn/time-picker.d.ts +2 -1
- package/dist/vendor/shadcn/time-picker.js +23 -17
- package/dist/vendor/shadcn/toggle.js +13 -13
- package/dist/vendor/shadcn/tooltip.js +15 -25
- package/package.json +1 -1
- package/dist/components/atoms/icon/aida-logo.d.ts +0 -3
- package/dist/components/atoms/icon/aida-logo.js +0 -64
- package/dist/components/atoms/label/label.d.ts +0 -11
- package/dist/components/atoms/label/label.js +0 -28
- package/dist/components/atoms/loading/index.d.ts +0 -1
- package/dist/components/atoms/loading/loading.d.ts +0 -39
- package/dist/components/atoms/loading/loading.js +0 -37
- package/dist/components/atoms/select/search-select.d.ts +0 -22
- package/dist/components/atoms/select/search-select.js +0 -201
- package/dist/components/organisms/tutorial/index.d.ts +0 -2
- package/dist/components/organisms/tutorial/tutorial.d.ts +0 -16
- package/dist/components/organisms/tutorial/tutorial.js +0 -114
- package/dist/components/organisms/tutorial/tutorial.types.d.ts +0 -15
- package/dist/hooks/index.d.ts +0 -3
- package/dist/hooks/use-body-scroll-lock.d.ts +0 -13
- package/dist/hooks/use-escape-key.d.ts +0 -14
- package/dist/hooks/use-media-query.d.ts +0 -20
- package/dist/hooks/use-media-query.js +0 -21
- package/dist/lib/notification-alert.d.ts +0 -42
- package/dist/lib/notification-alert.js +0 -75
- package/dist/node_modules/@phosphor-icons/react/dist/csr/File.es.js +0 -8
- package/dist/node_modules/@phosphor-icons/react/dist/csr/Microphone.es.js +0 -8
- package/dist/node_modules/@phosphor-icons/react/dist/csr/Stop.es.js +0 -8
- package/dist/node_modules/@phosphor-icons/react/dist/csr/Table.es.js +0 -8
- package/dist/node_modules/@phosphor-icons/react/dist/defs/File.es.js +0 -30
- package/dist/node_modules/@phosphor-icons/react/dist/defs/Microphone.es.js +0 -36
- package/dist/node_modules/@phosphor-icons/react/dist/defs/Stop.es.js +0 -36
- package/dist/node_modules/@phosphor-icons/react/dist/defs/Table.es.js +0 -30
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { j as e } from "../../../_virtual/jsx-runtime.js";
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { Button as
|
|
2
|
+
import { forwardRef as m, useState as M, useMemo as $ } from "react";
|
|
3
|
+
import { Button as f } from "../../../vendor/shadcn/button.js";
|
|
4
4
|
import { Badge as C } from "../../../vendor/shadcn/badge.js";
|
|
5
5
|
import { Separator as p } from "../../../vendor/shadcn/separator.js";
|
|
6
|
-
import { Checkbox as
|
|
7
|
-
import { RadioGroup as Q, RadioGroupItem as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
6
|
+
import { Checkbox as L } from "../../../vendor/shadcn/checkbox.js";
|
|
7
|
+
import { RadioGroup as Q, RadioGroupItem as E } from "../../../vendor/shadcn/radio-group.js";
|
|
8
|
+
import { cn as x } from "../../../lib/utils.js";
|
|
9
|
+
import { Icon as v } from "../icon/icon.js";
|
|
10
10
|
import { Field as k } from "../field/field.js";
|
|
11
|
-
import { Tooltip as
|
|
12
|
-
const F =
|
|
11
|
+
import { Tooltip as b } from "../tooltip/tooltip.js";
|
|
12
|
+
const F = m(
|
|
13
13
|
({ label: s, onRemove: t, className: n, ...l }, i) => /* @__PURE__ */ e.jsxs(
|
|
14
14
|
C,
|
|
15
15
|
{
|
|
16
16
|
ref: i,
|
|
17
17
|
variant: "secondary",
|
|
18
|
-
className:
|
|
18
|
+
className: x("h-8 gap-2 px-3 py-2 shadow-xs", n),
|
|
19
19
|
...l,
|
|
20
20
|
children: [
|
|
21
21
|
/* @__PURE__ */ e.jsx("span", { className: "text-xs font-medium leading-none", children: s }),
|
|
@@ -25,7 +25,7 @@ const F = f(
|
|
|
25
25
|
onClick: t,
|
|
26
26
|
className: "inline-flex items-center justify-center",
|
|
27
27
|
"aria-label": `Remove ${s} filter`,
|
|
28
|
-
children: /* @__PURE__ */ e.jsx(
|
|
28
|
+
children: /* @__PURE__ */ e.jsx(v, { name: "X", className: "size-4" })
|
|
29
29
|
}
|
|
30
30
|
)
|
|
31
31
|
]
|
|
@@ -33,27 +33,27 @@ const F = f(
|
|
|
33
33
|
)
|
|
34
34
|
);
|
|
35
35
|
F.displayName = "FilterTag";
|
|
36
|
-
const P =
|
|
36
|
+
const P = m(
|
|
37
37
|
({
|
|
38
38
|
appliedFilters: s = [],
|
|
39
39
|
onRemoveFilter: t,
|
|
40
40
|
onClearAll: n,
|
|
41
41
|
maxVisibleTags: l = 4,
|
|
42
42
|
className: i,
|
|
43
|
-
...
|
|
44
|
-
},
|
|
45
|
-
const o = s.length > 0,
|
|
43
|
+
...r
|
|
44
|
+
}, h) => {
|
|
45
|
+
const o = s.length > 0, N = s.slice(0, l), g = s.length - l;
|
|
46
46
|
return /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-4", children: [
|
|
47
47
|
/* @__PURE__ */ e.jsxs(
|
|
48
|
-
|
|
48
|
+
f,
|
|
49
49
|
{
|
|
50
|
-
ref:
|
|
50
|
+
ref: h,
|
|
51
51
|
variant: "outline",
|
|
52
52
|
size: "sm",
|
|
53
|
-
className:
|
|
54
|
-
...
|
|
53
|
+
className: x("h-8 gap-2 px-3 py-2", i),
|
|
54
|
+
...r,
|
|
55
55
|
children: [
|
|
56
|
-
/* @__PURE__ */ e.jsx(
|
|
56
|
+
/* @__PURE__ */ e.jsx(v, { name: "FunnelSimple", className: "size-4" }),
|
|
57
57
|
/* @__PURE__ */ e.jsx("span", { className: "text-xs font-medium leading-none", children: "Add filter" })
|
|
58
58
|
]
|
|
59
59
|
}
|
|
@@ -61,21 +61,21 @@ const P = f(
|
|
|
61
61
|
o && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
62
62
|
/* @__PURE__ */ e.jsx(p, { orientation: "vertical", className: "h-5" }),
|
|
63
63
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
64
|
-
|
|
64
|
+
N.map((u) => /* @__PURE__ */ e.jsx(
|
|
65
65
|
F,
|
|
66
66
|
{
|
|
67
|
-
label:
|
|
68
|
-
onRemove: () => t?.(
|
|
67
|
+
label: u.label,
|
|
68
|
+
onRemove: () => t?.(u.id)
|
|
69
69
|
},
|
|
70
|
-
|
|
70
|
+
u.id
|
|
71
71
|
)),
|
|
72
|
-
|
|
72
|
+
g > 0 && /* @__PURE__ */ e.jsx(C, { 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
73
|
"+",
|
|
74
|
-
|
|
74
|
+
g,
|
|
75
75
|
" more"
|
|
76
76
|
] }) }),
|
|
77
77
|
n && /* @__PURE__ */ e.jsx(
|
|
78
|
-
|
|
78
|
+
f,
|
|
79
79
|
{
|
|
80
80
|
variant: "ghost",
|
|
81
81
|
size: "sm",
|
|
@@ -94,44 +94,44 @@ const P = f(
|
|
|
94
94
|
}
|
|
95
95
|
);
|
|
96
96
|
P.displayName = "FilterButton";
|
|
97
|
-
const X =
|
|
97
|
+
const X = m(
|
|
98
98
|
(s, t) => {
|
|
99
99
|
const {
|
|
100
100
|
title: n,
|
|
101
101
|
items: l,
|
|
102
102
|
className: i,
|
|
103
|
-
searchable:
|
|
104
|
-
searchPlaceholder:
|
|
103
|
+
searchable: r = !1,
|
|
104
|
+
searchPlaceholder: h = "Search...",
|
|
105
105
|
showActions: o = !1,
|
|
106
|
-
enableSelectAll:
|
|
107
|
-
enableInverse:
|
|
108
|
-
enableNone:
|
|
109
|
-
} = s,
|
|
110
|
-
(a) => a.label.toLowerCase().includes(
|
|
111
|
-
) : l, [l,
|
|
112
|
-
if (
|
|
113
|
-
const a = l.map((
|
|
106
|
+
enableSelectAll: N = !0,
|
|
107
|
+
enableInverse: g = !0,
|
|
108
|
+
enableNone: u = !0
|
|
109
|
+
} = s, c = s.type || "checkbox", w = c === "radio", z = c === "checkbox" || !s.type, [j, I] = M(""), y = $(() => j ? l.filter(
|
|
110
|
+
(a) => a.label.toLowerCase().includes(j.toLowerCase())
|
|
111
|
+
) : l, [l, j]), R = () => {
|
|
112
|
+
if (c === "checkbox" && "selectedValues" in s) {
|
|
113
|
+
const a = l.map((d) => d.value);
|
|
114
114
|
s.onChange(a);
|
|
115
115
|
}
|
|
116
116
|
}, T = () => {
|
|
117
|
-
if (
|
|
118
|
-
const a = l.filter((
|
|
117
|
+
if (c === "checkbox" && "selectedValues" in s) {
|
|
118
|
+
const a = l.filter((d) => !s.selectedValues.includes(d.value)).map((d) => d.value);
|
|
119
119
|
s.onChange(a);
|
|
120
120
|
}
|
|
121
121
|
}, B = () => {
|
|
122
|
-
|
|
122
|
+
c === "checkbox" && "selectedValues" in s ? s.onChange([]) : c === "radio" && "selectedValue" in s && s.onChange("");
|
|
123
123
|
}, G = (a) => {
|
|
124
|
-
if (
|
|
125
|
-
const O = s.selectedValues.includes(a) ? s.selectedValues.filter((
|
|
124
|
+
if (c === "checkbox" && "selectedValues" in s) {
|
|
125
|
+
const O = s.selectedValues.includes(a) ? s.selectedValues.filter((A) => A !== a) : [...s.selectedValues, a];
|
|
126
126
|
s.onChange(O);
|
|
127
127
|
}
|
|
128
128
|
};
|
|
129
|
-
return /* @__PURE__ */ e.jsxs("div", { ref: t, className:
|
|
130
|
-
|
|
129
|
+
return /* @__PURE__ */ e.jsxs("div", { ref: t, className: x("flex flex-col h-full", i), children: [
|
|
130
|
+
r && /* @__PURE__ */ e.jsx(
|
|
131
131
|
k,
|
|
132
132
|
{
|
|
133
|
-
placeholder:
|
|
134
|
-
value:
|
|
133
|
+
placeholder: h,
|
|
134
|
+
value: j,
|
|
135
135
|
onChange: (a) => I(a.target.value),
|
|
136
136
|
startIcon: "MagnifyingGlass",
|
|
137
137
|
className: "mb-4"
|
|
@@ -139,9 +139,9 @@ const X = f(
|
|
|
139
139
|
),
|
|
140
140
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between mb-1", children: [
|
|
141
141
|
/* @__PURE__ */ e.jsx("span", { className: "text-sm font-normal text-foreground", children: n }),
|
|
142
|
-
o &&
|
|
143
|
-
|
|
144
|
-
|
|
142
|
+
o && c === "checkbox" && /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-end gap-2", children: [
|
|
143
|
+
N && /* @__PURE__ */ e.jsx(
|
|
144
|
+
f,
|
|
145
145
|
{
|
|
146
146
|
variant: "link",
|
|
147
147
|
size: "sm",
|
|
@@ -150,8 +150,8 @@ const X = f(
|
|
|
150
150
|
children: "Select all"
|
|
151
151
|
}
|
|
152
152
|
),
|
|
153
|
-
|
|
154
|
-
|
|
153
|
+
g && /* @__PURE__ */ e.jsx(
|
|
154
|
+
f,
|
|
155
155
|
{
|
|
156
156
|
variant: "link",
|
|
157
157
|
size: "sm",
|
|
@@ -160,8 +160,8 @@ const X = f(
|
|
|
160
160
|
children: "Inverse"
|
|
161
161
|
}
|
|
162
162
|
),
|
|
163
|
-
|
|
164
|
-
|
|
163
|
+
u && /* @__PURE__ */ e.jsx(
|
|
164
|
+
f,
|
|
165
165
|
{
|
|
166
166
|
variant: "link",
|
|
167
167
|
size: "sm",
|
|
@@ -178,8 +178,8 @@ const X = f(
|
|
|
178
178
|
{
|
|
179
179
|
value: s.selectedValue,
|
|
180
180
|
onValueChange: s.onChange,
|
|
181
|
-
className: "grid grid-cols-2 gap-
|
|
182
|
-
children:
|
|
181
|
+
className: "grid grid-cols-2 gap-4 overflow-y-auto",
|
|
182
|
+
children: y.map((a) => /* @__PURE__ */ e.jsx(
|
|
183
183
|
S,
|
|
184
184
|
{
|
|
185
185
|
label: a.label,
|
|
@@ -189,12 +189,11 @@ const X = f(
|
|
|
189
189
|
a.value
|
|
190
190
|
))
|
|
191
191
|
}
|
|
192
|
-
) : z && "selectedValues" in s ? /* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-2 gap-
|
|
192
|
+
) : z && "selectedValues" in s ? /* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-2 gap-4 overflow-y-auto", children: y.map((a) => /* @__PURE__ */ e.jsx(
|
|
193
193
|
V,
|
|
194
194
|
{
|
|
195
195
|
label: a.label,
|
|
196
196
|
description: a.description,
|
|
197
|
-
icon: a.icon,
|
|
198
197
|
checked: s.selectedValues.includes(a.value),
|
|
199
198
|
onCheckedChange: () => G(a.value)
|
|
200
199
|
},
|
|
@@ -204,65 +203,51 @@ const X = f(
|
|
|
204
203
|
}
|
|
205
204
|
);
|
|
206
205
|
X.displayName = "FilterSection";
|
|
207
|
-
const V =
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
/* @__PURE__ */ e.jsx(
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
src: r,
|
|
215
|
-
alt: "",
|
|
216
|
-
className: "size-4 object-contain shrink-0",
|
|
217
|
-
onError: (m) => {
|
|
218
|
-
m.currentTarget.style.display = "none";
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
),
|
|
222
|
-
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-1.5 min-w-0 flex-1", children: [
|
|
223
|
-
/* @__PURE__ */ e.jsx(v, { content: x ? s : "", children: /* @__PURE__ */ e.jsx("span", { className: "text-sm font-medium leading-4 truncate", children: u }) }),
|
|
224
|
-
l && /* @__PURE__ */ e.jsx("span", { className: "text-sm font-normal leading-5 text-muted-foreground truncate", children: l })
|
|
225
|
-
] })
|
|
226
|
-
] });
|
|
227
|
-
});
|
|
206
|
+
const V = m(({ label: s, checked: t, onCheckedChange: n, description: l, className: i }, r) => /* @__PURE__ */ e.jsxs("label", { className: x("flex items-start gap-2 cursor-pointer", i), children: [
|
|
207
|
+
/* @__PURE__ */ e.jsx(L, { ref: r, checked: t, onCheckedChange: n }),
|
|
208
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-1.5", children: [
|
|
209
|
+
/* @__PURE__ */ e.jsx("span", { className: "text-sm font-medium leading-none", children: s }),
|
|
210
|
+
l && /* @__PURE__ */ e.jsx("span", { className: "text-sm font-normal leading-5 text-muted-foreground", children: l })
|
|
211
|
+
] })
|
|
212
|
+
] }));
|
|
228
213
|
V.displayName = "FilterCheckboxOption";
|
|
229
|
-
const S =
|
|
230
|
-
({ label: s, value: t, description: n, className: l }, i) => /* @__PURE__ */ e.jsxs("div", { className:
|
|
231
|
-
/* @__PURE__ */ e.jsx(
|
|
214
|
+
const S = m(
|
|
215
|
+
({ label: s, value: t, description: n, className: l }, i) => /* @__PURE__ */ e.jsxs("div", { className: x("flex items-start gap-3", l), children: [
|
|
216
|
+
/* @__PURE__ */ e.jsx(E, { ref: i, value: t, id: `radio-${t}` }),
|
|
232
217
|
/* @__PURE__ */ e.jsxs(
|
|
233
218
|
"label",
|
|
234
219
|
{
|
|
235
220
|
htmlFor: `radio-${t}`,
|
|
236
221
|
className: "flex flex-col gap-1.5 cursor-pointer flex-1 truncate",
|
|
237
222
|
children: [
|
|
238
|
-
/* @__PURE__ */ e.jsx(
|
|
239
|
-
n && /* @__PURE__ */ e.jsx(
|
|
223
|
+
/* @__PURE__ */ e.jsx(b, { content: s, children: /* @__PURE__ */ e.jsx("span", { className: "text-sm font-medium leading-none truncate", children: s }) }),
|
|
224
|
+
n && /* @__PURE__ */ e.jsx(b, { content: n, children: /* @__PURE__ */ e.jsx("span", { className: "text-sm font-normal leading-5 text-muted-foreground truncate", children: n }) })
|
|
240
225
|
]
|
|
241
226
|
}
|
|
242
227
|
)
|
|
243
228
|
] })
|
|
244
229
|
);
|
|
245
230
|
S.displayName = "FilterRadioOption";
|
|
246
|
-
const q =
|
|
231
|
+
const q = m(
|
|
247
232
|
({
|
|
248
233
|
children: s,
|
|
249
234
|
showSearch: t = !1,
|
|
250
235
|
searchPlaceholder: n = "Search...",
|
|
251
236
|
searchValue: l,
|
|
252
237
|
onSearchChange: i,
|
|
253
|
-
className:
|
|
254
|
-
},
|
|
238
|
+
className: r
|
|
239
|
+
}, h) => /* @__PURE__ */ e.jsxs(
|
|
255
240
|
"div",
|
|
256
241
|
{
|
|
257
|
-
ref:
|
|
258
|
-
className:
|
|
259
|
-
"flex flex-col gap-6 bg-
|
|
260
|
-
|
|
242
|
+
ref: h,
|
|
243
|
+
className: x(
|
|
244
|
+
"flex flex-col gap-6 bg-white rounded-md p-6 min-w-[448px]",
|
|
245
|
+
r
|
|
261
246
|
),
|
|
262
247
|
children: [
|
|
263
248
|
t && /* @__PURE__ */ e.jsx("div", { className: "flex flex-col gap-2", children: /* @__PURE__ */ e.jsxs("div", { className: "relative", children: [
|
|
264
249
|
/* @__PURE__ */ e.jsx(
|
|
265
|
-
|
|
250
|
+
v,
|
|
266
251
|
{
|
|
267
252
|
name: "MagnifyingGlass",
|
|
268
253
|
className: "absolute left-3 top-1/2 -translate-y-1/2 size-4 text-muted-foreground"
|
|
@@ -1,2 +1,2 @@
|
|
|
1
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,
|
|
2
|
+
export { FilterDateRange, FilterDateRangeOption, type FilterDateRangeProps, type FilterDateRangeOptionProps, } from './filter-date-range';
|
|
@@ -1,274 +1,68 @@
|
|
|
1
1
|
import { ReactNode, ComponentProps } from 'react';
|
|
2
2
|
import { IconName } from '../icon';
|
|
3
3
|
import { FilterSectionItem } from '../filter/filter';
|
|
4
|
-
/**
|
|
5
|
-
* Props for the FilterMenuItem component
|
|
6
|
-
*/
|
|
7
4
|
interface FilterMenuItemProps extends ComponentProps<"button"> {
|
|
8
|
-
/**
|
|
9
|
-
* Optional icon to display at the start of the menu item
|
|
10
|
-
*/
|
|
11
5
|
icon?: IconName;
|
|
12
|
-
/**
|
|
13
|
-
* Label text to display in the menu item
|
|
14
|
-
*/
|
|
15
6
|
label: string;
|
|
16
|
-
/**
|
|
17
|
-
* Whether the menu item is currently active/selected
|
|
18
|
-
* @default false
|
|
19
|
-
*/
|
|
20
7
|
isActive?: boolean;
|
|
21
|
-
/**
|
|
22
|
-
* Whether to show a chevron icon at the end of the menu item
|
|
23
|
-
* @default false
|
|
24
|
-
*/
|
|
25
8
|
showChevron?: boolean;
|
|
26
9
|
}
|
|
27
|
-
/**
|
|
28
|
-
* A single menu item in the filter sidebar
|
|
29
|
-
*/
|
|
30
10
|
declare const FilterMenuItem: import('react').ForwardRefExoticComponent<Omit<FilterMenuItemProps, "ref"> & import('react').RefAttributes<HTMLButtonElement>>;
|
|
31
|
-
/**
|
|
32
|
-
* Props for the FilterMenu component (Sidebar)
|
|
33
|
-
*/
|
|
34
11
|
interface FilterMenuProps {
|
|
35
|
-
/**
|
|
36
|
-
* Array of menu items to display in the sidebar
|
|
37
|
-
*/
|
|
38
12
|
items: Array<{
|
|
39
|
-
/**
|
|
40
|
-
* Unique identifier for the menu item
|
|
41
|
-
*/
|
|
42
13
|
id: string;
|
|
43
|
-
/**
|
|
44
|
-
* Optional icon to display in the menu item
|
|
45
|
-
*/
|
|
46
14
|
icon?: IconName;
|
|
47
|
-
/**
|
|
48
|
-
* Label text for the menu item
|
|
49
|
-
*/
|
|
50
15
|
label: string;
|
|
51
|
-
/**
|
|
52
|
-
* Whether to show a chevron icon
|
|
53
|
-
*/
|
|
54
16
|
showChevron?: boolean;
|
|
55
17
|
}>;
|
|
56
|
-
/**
|
|
57
|
-
* ID of the currently active/selected menu item
|
|
58
|
-
*/
|
|
59
18
|
activeItemId?: string;
|
|
60
|
-
/**
|
|
61
|
-
* Callback fired when a menu item is clicked
|
|
62
|
-
*/
|
|
63
19
|
onItemClick?: (itemId: string) => void;
|
|
64
|
-
/**
|
|
65
|
-
* Optional CSS class name
|
|
66
|
-
*/
|
|
67
20
|
className?: string;
|
|
68
21
|
}
|
|
69
|
-
/**
|
|
70
|
-
* Sidebar menu displaying available filter options
|
|
71
|
-
*/
|
|
72
22
|
declare const FilterMenu: import('react').ForwardRefExoticComponent<FilterMenuProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
73
|
-
/**
|
|
74
|
-
* Configuration for a single filter in the FilterDropdown
|
|
75
|
-
*/
|
|
76
23
|
interface FilterConfig {
|
|
77
|
-
/**
|
|
78
|
-
* Unique identifier for the filter
|
|
79
|
-
*/
|
|
80
24
|
id: string;
|
|
81
|
-
/**
|
|
82
|
-
* Optional icon to display in the filter menu
|
|
83
|
-
*/
|
|
84
25
|
icon?: IconName;
|
|
85
|
-
/**
|
|
86
|
-
* Label text for the filter
|
|
87
|
-
*/
|
|
88
26
|
label: string;
|
|
89
|
-
|
|
90
|
-
* Type of filter to render
|
|
91
|
-
*/
|
|
92
|
-
type: "checkbox" | "radio" | "custom" | "date";
|
|
93
|
-
/**
|
|
94
|
-
* Items for checkbox/radio type filters
|
|
95
|
-
*/
|
|
27
|
+
type: 'checkbox' | 'radio' | 'custom' | 'date';
|
|
96
28
|
items?: FilterSectionItem[];
|
|
97
|
-
/**
|
|
98
|
-
* Selected values for checkbox type filters
|
|
99
|
-
*/
|
|
100
29
|
selectedValues?: string[];
|
|
101
|
-
/**
|
|
102
|
-
* Callback fired when checkbox selections change
|
|
103
|
-
*/
|
|
104
30
|
onChange?: (values: string[]) => void;
|
|
105
|
-
/**
|
|
106
|
-
* Selected value for radio type filters
|
|
107
|
-
*/
|
|
108
31
|
selectedValue?: string;
|
|
109
|
-
/**
|
|
110
|
-
* Callback fired when radio selection changes
|
|
111
|
-
*/
|
|
112
32
|
onValueChange?: (value: string) => void;
|
|
113
|
-
/**
|
|
114
|
-
* Current date range selection value (e.g., "last-7-days", "custom")
|
|
115
|
-
*/
|
|
116
33
|
dateValue?: string;
|
|
117
|
-
/**
|
|
118
|
-
* Start date for date type filters
|
|
119
|
-
*/
|
|
120
34
|
dateInit?: Date;
|
|
121
|
-
/**
|
|
122
|
-
* End date for date type filters
|
|
123
|
-
*/
|
|
124
35
|
dateEnd?: Date;
|
|
125
|
-
/**
|
|
126
|
-
* Start time in HH:mm:ss format
|
|
127
|
-
*/
|
|
128
36
|
startTime?: string;
|
|
129
|
-
/**
|
|
130
|
-
* End time in HH:mm:ss format
|
|
131
|
-
*/
|
|
132
37
|
endTime?: string;
|
|
133
|
-
|
|
134
|
-
* Date picker mode: 'range' shows two date pickers, 'single' shows one
|
|
135
|
-
* @default 'range'
|
|
136
|
-
*/
|
|
137
|
-
dateMode?: "range" | "single";
|
|
138
|
-
/**
|
|
139
|
-
* Label for single day picker when dateMode is 'single'
|
|
140
|
-
*/
|
|
38
|
+
dateMode?: 'range' | 'single';
|
|
141
39
|
singleDayLabel?: string;
|
|
142
|
-
/**
|
|
143
|
-
* Whether to show "All time" option in date filter
|
|
144
|
-
* @default false
|
|
145
|
-
*/
|
|
146
40
|
showAllTime?: boolean;
|
|
147
|
-
/**
|
|
148
|
-
* Callback fired when date range selection changes
|
|
149
|
-
*/
|
|
150
41
|
onDateValueChange?: (value: string) => void;
|
|
151
|
-
/**
|
|
152
|
-
* Callback fired when start date changes
|
|
153
|
-
*/
|
|
154
42
|
onDateInitChange?: (date: Date | undefined) => void;
|
|
155
|
-
/**
|
|
156
|
-
* Callback fired when end date changes
|
|
157
|
-
*/
|
|
158
43
|
onDateEndChange?: (date: Date | undefined) => void;
|
|
159
|
-
/**
|
|
160
|
-
* Callback fired when start time changes
|
|
161
|
-
*/
|
|
162
44
|
onStartTimeChange?: (time: string) => void;
|
|
163
|
-
/**
|
|
164
|
-
* Callback fired when end time changes
|
|
165
|
-
*/
|
|
166
45
|
onEndTimeChange?: (time: string) => void;
|
|
167
|
-
/**
|
|
168
|
-
* Whether the filter items are searchable
|
|
169
|
-
*/
|
|
170
46
|
searchable?: boolean;
|
|
171
|
-
/**
|
|
172
|
-
* Placeholder text for the search input
|
|
173
|
-
*/
|
|
174
47
|
searchPlaceholder?: string;
|
|
175
|
-
/**
|
|
176
|
-
* Whether to show action buttons (Select All, Inverse, None)
|
|
177
|
-
*/
|
|
178
48
|
showActions?: boolean;
|
|
179
|
-
/**
|
|
180
|
-
* Whether to enable "Select All" action
|
|
181
|
-
*/
|
|
182
49
|
enableSelectAll?: boolean;
|
|
183
|
-
/**
|
|
184
|
-
* Whether to enable "Inverse" action
|
|
185
|
-
*/
|
|
186
50
|
enableInverse?: boolean;
|
|
187
|
-
/**
|
|
188
|
-
* Whether to enable "None" action
|
|
189
|
-
*/
|
|
190
51
|
enableNone?: boolean;
|
|
191
|
-
/**
|
|
192
|
-
* Whether this filter can be cleared from applied filters
|
|
193
|
-
* @default true
|
|
194
|
-
*/
|
|
195
52
|
clearable?: boolean;
|
|
196
|
-
/**
|
|
197
|
-
* Custom render function for 'custom' type filters
|
|
198
|
-
*/
|
|
199
53
|
renderContent?: () => ReactNode;
|
|
200
54
|
}
|
|
201
|
-
/**
|
|
202
|
-
* Props for the FilterDropdown component
|
|
203
|
-
*/
|
|
204
55
|
interface FilterDropdownProps {
|
|
205
|
-
/**
|
|
206
|
-
* Array of filter configurations to display
|
|
207
|
-
*/
|
|
208
56
|
filters: FilterConfig[];
|
|
209
|
-
/**
|
|
210
|
-
* Array of currently applied filters to display as badges
|
|
211
|
-
*/
|
|
212
57
|
appliedFilters?: Array<{
|
|
213
|
-
/**
|
|
214
|
-
* ID of the applied filter (should match a FilterConfig id)
|
|
215
|
-
*/
|
|
216
58
|
id: string;
|
|
217
|
-
/**
|
|
218
|
-
* Label to display in the badge
|
|
219
|
-
*/
|
|
220
59
|
label: string;
|
|
221
60
|
}>;
|
|
222
|
-
/**
|
|
223
|
-
* Callback fired when a filter badge is removed
|
|
224
|
-
*/
|
|
225
61
|
onRemoveFilter?: (filterId: string) => void;
|
|
226
|
-
/**
|
|
227
|
-
* Callback fired when "Clear filters" button is clicked
|
|
228
|
-
*/
|
|
229
62
|
onClearAllFilters?: () => void;
|
|
230
|
-
/**
|
|
231
|
-
* Text to display in the trigger button
|
|
232
|
-
* @default "Add filter"
|
|
233
|
-
*/
|
|
234
63
|
buttonText?: string;
|
|
235
|
-
/**
|
|
236
|
-
* Maximum number of filter badges to show before displaying "+X more"
|
|
237
|
-
* @default 4
|
|
238
|
-
*/
|
|
239
64
|
maxVisibleTags?: number;
|
|
240
|
-
/**
|
|
241
|
-
* Optional CSS class name for the root element
|
|
242
|
-
*/
|
|
243
65
|
className?: string;
|
|
244
|
-
/**
|
|
245
|
-
* Whether the filter dropdown is disabled
|
|
246
|
-
* @default false
|
|
247
|
-
*/
|
|
248
|
-
disabled?: boolean;
|
|
249
66
|
}
|
|
250
|
-
/**
|
|
251
|
-
* Advanced filter dropdown component with sidebar navigation and multiple filter types.
|
|
252
|
-
* Supports checkbox, radio, date range, and custom filters with applied filter badges.
|
|
253
|
-
*
|
|
254
|
-
* @example
|
|
255
|
-
* ```tsx
|
|
256
|
-
* <FilterDropdown
|
|
257
|
-
* filters={[
|
|
258
|
-
* {
|
|
259
|
-
* id: 'status',
|
|
260
|
-
* label: 'Status',
|
|
261
|
-
* type: 'checkbox',
|
|
262
|
-
* items: [{ value: 'active', label: 'Active' }],
|
|
263
|
-
* selectedValues: ['active'],
|
|
264
|
-
* onChange: (values) => console.log(values)
|
|
265
|
-
* }
|
|
266
|
-
* ]}
|
|
267
|
-
* appliedFilters={[{ id: 'status', label: 'Status: Active' }]}
|
|
268
|
-
* onRemoveFilter={(id) => console.log('Remove', id)}
|
|
269
|
-
* onClearAllFilters={() => console.log('Clear all')}
|
|
270
|
-
* />
|
|
271
|
-
* ```
|
|
272
|
-
*/
|
|
273
67
|
declare const FilterDropdown: import('react').ForwardRefExoticComponent<FilterDropdownProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
274
68
|
export { FilterDropdown, FilterMenu, FilterMenuItem, type FilterDropdownProps, type FilterConfig, type FilterMenuProps, type FilterMenuItemProps, };
|