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