@trackunit/react-filter-components 2.6.48 → 2.6.50-alpha-7317206cecd.0
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/index.cjs.js
CHANGED
|
@@ -6,7 +6,8 @@ var reactComponents = require('@trackunit/react-components');
|
|
|
6
6
|
var reactFormComponents = require('@trackunit/react-form-components');
|
|
7
7
|
var tailwindMerge = require('tailwind-merge');
|
|
8
8
|
|
|
9
|
-
const cvaFilterCustomButton = cssClassVarianceUtilities.
|
|
9
|
+
const cvaFilterCustomButton = cssClassVarianceUtilities.cva({
|
|
10
|
+
base: ["justify-normal"],
|
|
10
11
|
variants: {
|
|
11
12
|
isActive: {
|
|
12
13
|
true: "border-primary-600",
|
|
@@ -58,7 +59,8 @@ const Filter = ({ title = "", asIcon = undefined, children, popoverProps, isActi
|
|
|
58
59
|
// space is tight. Callers can still override via `popoverProps.sizing`.
|
|
59
60
|
sizing: popoverProps?.sizing ?? { minWidth: 280 }, children: [jsxRuntime.jsx(reactComponents.PopoverTrigger, { children: renderButton() }), jsxRuntime.jsx(reactComponents.PopoverContent, { children: renderSubmenuContent() })] }));
|
|
60
61
|
};
|
|
61
|
-
const cvaMenuShellOverrides = cssClassVarianceUtilities.
|
|
62
|
+
const cvaMenuShellOverrides = cssClassVarianceUtilities.cva({
|
|
63
|
+
base: ["overflow-x-hidden", "relative", "!max-w-full", "p-0"],
|
|
62
64
|
variants: {
|
|
63
65
|
withStickyHeader: {
|
|
64
66
|
// `grid-rows-[minmax(0,1fr)]` is the load-bearing part here: without it this shell's `max-h` only
|
|
@@ -71,7 +73,8 @@ const cvaMenuShellOverrides = cssClassVarianceUtilities.cvaMerge(["overflow-x-hi
|
|
|
71
73
|
},
|
|
72
74
|
},
|
|
73
75
|
});
|
|
74
|
-
const cvaMenuListOverrides = cssClassVarianceUtilities.
|
|
76
|
+
const cvaMenuListOverrides = cssClassVarianceUtilities.cva({
|
|
77
|
+
base: [],
|
|
75
78
|
variants: {
|
|
76
79
|
withStickyHeader: {
|
|
77
80
|
// `gap-y-0` cancels `cvaMenuList`'s default inter-item gap: with the header (`FilterHeader`,
|
|
@@ -104,7 +107,8 @@ const FilterBody = ({ children, className, "data-testid": dataTestId, limitSize
|
|
|
104
107
|
return (jsxRuntime.jsx("div", { className: cvaFilterBody({ limitSize, className }), ref: ref, style: style, ...rest, "data-testid": dataTestId, children: children }));
|
|
105
108
|
};
|
|
106
109
|
FilterBody.displayName = "FilterBody";
|
|
107
|
-
const cvaFilterBody = cssClassVarianceUtilities.
|
|
110
|
+
const cvaFilterBody = cssClassVarianceUtilities.cva({
|
|
111
|
+
base: ["grid", "gap-1", "w-full"],
|
|
108
112
|
variants: {
|
|
109
113
|
limitSize: {
|
|
110
114
|
true: "max-h-[50dvh] max-w-sm overflow-hidden",
|
|
@@ -126,7 +130,7 @@ const cvaFilterBody = cssClassVarianceUtilities.cvaMerge(["grid", "gap-1", "w-fu
|
|
|
126
130
|
const FilterFooter = ({ className, "data-testid": dataTestId, children, ref, style, ...rest }) => {
|
|
127
131
|
return (jsxRuntime.jsx("div", { className: cvaFilterFooter({ className }), "data-testid": dataTestId, ref: ref, style: style, ...rest, children: children }));
|
|
128
132
|
};
|
|
129
|
-
const cvaFilterFooter = cssClassVarianceUtilities.
|
|
133
|
+
const cvaFilterFooter = cssClassVarianceUtilities.cva({ base: ["flex", "justify-end", "border-t", "border-neutral-200", "p-1"] });
|
|
130
134
|
|
|
131
135
|
/**
|
|
132
136
|
* The FilterHeader component is used to display the title of the filter and a reset button.
|
|
@@ -141,7 +145,8 @@ const FilterHeader = ({ "data-testid": dataTestId, title, resetLabel, showReset,
|
|
|
141
145
|
// eslint-disable-next-line @trackunit/prefer-event-specific-callback-naming
|
|
142
146
|
onClick: onReset, size: "small", variant: "ghost", children: resetLabel })) })] })] }) }), jsxRuntime.jsx("hr", { className: "w-full border-neutral-200" })] })) : null }));
|
|
143
147
|
};
|
|
144
|
-
const cvaFilterHeaderButton = cssClassVarianceUtilities.
|
|
148
|
+
const cvaFilterHeaderButton = cssClassVarianceUtilities.cva({
|
|
149
|
+
base: [],
|
|
145
150
|
variants: {
|
|
146
151
|
isVisible: {
|
|
147
152
|
true: "visible",
|
package/index.esm.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
|
-
import {
|
|
2
|
+
import { cva } from '@trackunit/css-class-variance-utilities';
|
|
3
3
|
import { MenuItem, Badge, Icon, Popover, PopoverTrigger, PopoverContent, MenuContent, IconButton, Button, Spinner, cvaMenuItemSuffix, cvaInteractableItem } from '@trackunit/react-components';
|
|
4
4
|
import { Checkbox, useRadioItemChecked, RadioItem } from '@trackunit/react-form-components';
|
|
5
5
|
import { twMerge } from 'tailwind-merge';
|
|
6
6
|
|
|
7
|
-
const cvaFilterCustomButton =
|
|
7
|
+
const cvaFilterCustomButton = cva({
|
|
8
|
+
base: ["justify-normal"],
|
|
8
9
|
variants: {
|
|
9
10
|
isActive: {
|
|
10
11
|
true: "border-primary-600",
|
|
@@ -56,7 +57,8 @@ const Filter = ({ title = "", asIcon = undefined, children, popoverProps, isActi
|
|
|
56
57
|
// space is tight. Callers can still override via `popoverProps.sizing`.
|
|
57
58
|
sizing: popoverProps?.sizing ?? { minWidth: 280 }, children: [jsx(PopoverTrigger, { children: renderButton() }), jsx(PopoverContent, { children: renderSubmenuContent() })] }));
|
|
58
59
|
};
|
|
59
|
-
const cvaMenuShellOverrides =
|
|
60
|
+
const cvaMenuShellOverrides = cva({
|
|
61
|
+
base: ["overflow-x-hidden", "relative", "!max-w-full", "p-0"],
|
|
60
62
|
variants: {
|
|
61
63
|
withStickyHeader: {
|
|
62
64
|
// `grid-rows-[minmax(0,1fr)]` is the load-bearing part here: without it this shell's `max-h` only
|
|
@@ -69,7 +71,8 @@ const cvaMenuShellOverrides = cvaMerge(["overflow-x-hidden", "relative", "!max-w
|
|
|
69
71
|
},
|
|
70
72
|
},
|
|
71
73
|
});
|
|
72
|
-
const cvaMenuListOverrides =
|
|
74
|
+
const cvaMenuListOverrides = cva({
|
|
75
|
+
base: [],
|
|
73
76
|
variants: {
|
|
74
77
|
withStickyHeader: {
|
|
75
78
|
// `gap-y-0` cancels `cvaMenuList`'s default inter-item gap: with the header (`FilterHeader`,
|
|
@@ -102,7 +105,8 @@ const FilterBody = ({ children, className, "data-testid": dataTestId, limitSize
|
|
|
102
105
|
return (jsx("div", { className: cvaFilterBody({ limitSize, className }), ref: ref, style: style, ...rest, "data-testid": dataTestId, children: children }));
|
|
103
106
|
};
|
|
104
107
|
FilterBody.displayName = "FilterBody";
|
|
105
|
-
const cvaFilterBody =
|
|
108
|
+
const cvaFilterBody = cva({
|
|
109
|
+
base: ["grid", "gap-1", "w-full"],
|
|
106
110
|
variants: {
|
|
107
111
|
limitSize: {
|
|
108
112
|
true: "max-h-[50dvh] max-w-sm overflow-hidden",
|
|
@@ -124,7 +128,7 @@ const cvaFilterBody = cvaMerge(["grid", "gap-1", "w-full"], {
|
|
|
124
128
|
const FilterFooter = ({ className, "data-testid": dataTestId, children, ref, style, ...rest }) => {
|
|
125
129
|
return (jsx("div", { className: cvaFilterFooter({ className }), "data-testid": dataTestId, ref: ref, style: style, ...rest, children: children }));
|
|
126
130
|
};
|
|
127
|
-
const cvaFilterFooter =
|
|
131
|
+
const cvaFilterFooter = cva({ base: ["flex", "justify-end", "border-t", "border-neutral-200", "p-1"] });
|
|
128
132
|
|
|
129
133
|
/**
|
|
130
134
|
* The FilterHeader component is used to display the title of the filter and a reset button.
|
|
@@ -139,7 +143,8 @@ const FilterHeader = ({ "data-testid": dataTestId, title, resetLabel, showReset,
|
|
|
139
143
|
// eslint-disable-next-line @trackunit/prefer-event-specific-callback-naming
|
|
140
144
|
onClick: onReset, size: "small", variant: "ghost", children: resetLabel })) })] })] }) }), jsx("hr", { className: "w-full border-neutral-200" })] })) : null }));
|
|
141
145
|
};
|
|
142
|
-
const cvaFilterHeaderButton =
|
|
146
|
+
const cvaFilterHeaderButton = cva({
|
|
147
|
+
base: [],
|
|
143
148
|
variants: {
|
|
144
149
|
isVisible: {
|
|
145
150
|
true: "visible",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/react-filter-components",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.50-alpha-7317206cecd.0",
|
|
4
4
|
"repository": "https://github.com/Trackunit/manager",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"engines": {
|
|
@@ -8,10 +8,10 @@
|
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"tailwind-merge": "^2.0.0",
|
|
11
|
-
"@trackunit/ui-icons": "1.14.
|
|
12
|
-
"@trackunit/css-class-variance-utilities": "1.
|
|
13
|
-
"@trackunit/react-components": "2.13.0",
|
|
14
|
-
"@trackunit/react-form-components": "2.6.
|
|
11
|
+
"@trackunit/ui-icons": "1.14.30-alpha-7317206cecd.0",
|
|
12
|
+
"@trackunit/css-class-variance-utilities": "2.0.1-alpha-7317206cecd.0",
|
|
13
|
+
"@trackunit/react-components": "2.13.2-alpha-7317206cecd.0",
|
|
14
|
+
"@trackunit/react-form-components": "2.6.50-alpha-7317206cecd.0"
|
|
15
15
|
},
|
|
16
16
|
"peerDependencies": {
|
|
17
17
|
"@tanstack/react-router": "^1.114.29",
|
|
@@ -1,3 +1,27 @@
|
|
|
1
|
-
export declare const cvaFilterCustomButton: (
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
export declare const cvaFilterCustomButton: import("cva").CVAComponent<Omit<{
|
|
2
|
+
base: string[];
|
|
3
|
+
variants: {
|
|
4
|
+
isActive: {
|
|
5
|
+
true: string;
|
|
6
|
+
false: string;
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
defaultVariants: {
|
|
10
|
+
isActive: false;
|
|
11
|
+
};
|
|
12
|
+
}, "defaultVariants"> & {
|
|
13
|
+
variants: {
|
|
14
|
+
isActive: {
|
|
15
|
+
true: string;
|
|
16
|
+
false: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
defaultVariants: Omit<{}, "isActive"> & {
|
|
20
|
+
isActive: false;
|
|
21
|
+
};
|
|
22
|
+
}, {
|
|
23
|
+
isActive: {
|
|
24
|
+
true: string;
|
|
25
|
+
false: string;
|
|
26
|
+
};
|
|
27
|
+
}>;
|
|
@@ -14,4 +14,9 @@ export interface FilterFooterProps extends CommonProps, Refable<HTMLDivElement>,
|
|
|
14
14
|
* @returns {ReactElement} FilterFooter component
|
|
15
15
|
*/
|
|
16
16
|
export declare const FilterFooter: ({ className, "data-testid": dataTestId, children, ref, style, ...rest }: FilterFooterProps) => import("react/jsx-runtime").JSX.Element;
|
|
17
|
-
export declare const cvaFilterFooter:
|
|
17
|
+
export declare const cvaFilterFooter: import("cva").CVAComponent<Omit<{
|
|
18
|
+
base: string[];
|
|
19
|
+
}, "defaultVariants"> & {
|
|
20
|
+
variants: unknown;
|
|
21
|
+
defaultVariants: Omit<{}, never>;
|
|
22
|
+
}, unknown>;
|
|
@@ -37,6 +37,30 @@ export interface FilterHeaderProps extends CommonProps, Refable<HTMLDivElement>,
|
|
|
37
37
|
* @returns {ReactElement} FilterHeader component
|
|
38
38
|
*/
|
|
39
39
|
export declare const FilterHeader: ({ "data-testid": dataTestId, title, resetLabel, showReset, onReset, loading, children, searchComponent, className, ref, style, ...rest }: FilterHeaderProps) => ReactElement;
|
|
40
|
-
export declare const cvaFilterHeaderButton: (
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
export declare const cvaFilterHeaderButton: import("cva").CVAComponent<Omit<{
|
|
41
|
+
base: never[];
|
|
42
|
+
variants: {
|
|
43
|
+
isVisible: {
|
|
44
|
+
true: string;
|
|
45
|
+
false: string;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
defaultVariants: {
|
|
49
|
+
isVisible: true;
|
|
50
|
+
};
|
|
51
|
+
}, "defaultVariants"> & {
|
|
52
|
+
variants: {
|
|
53
|
+
isVisible: {
|
|
54
|
+
true: string;
|
|
55
|
+
false: string;
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
defaultVariants: Omit<{}, "isVisible"> & {
|
|
59
|
+
isVisible: true;
|
|
60
|
+
};
|
|
61
|
+
}, {
|
|
62
|
+
isVisible: {
|
|
63
|
+
true: string;
|
|
64
|
+
false: string;
|
|
65
|
+
};
|
|
66
|
+
}>;
|