@trackunit/react-filter-components 1.7.15 → 1.7.18
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 +3 -3
- package/index.esm.js +3 -3
- package/package.json +6 -6
package/index.cjs.js
CHANGED
|
@@ -52,9 +52,9 @@ const Filter = ({ title, asIcon, children, popoverProps, isActive, activeLabel,
|
|
|
52
52
|
cursor: "pointer",
|
|
53
53
|
className: [
|
|
54
54
|
className,
|
|
55
|
-
"
|
|
55
|
+
"grid list-none grid-flow-col items-center justify-between gap-1 rounded px-3 py-2 text-sm text-neutral-700 hover:text-neutral-800",
|
|
56
56
|
],
|
|
57
|
-
}), "data-testid": dataTestId, tabIndex: 0, children: [jsxRuntime.jsx("span", { className: tailwindMerge.twMerge("truncate", isActive && "font-semibold"), children: title }), jsxRuntime.jsxs("span", { className: "grid grid-flow-col items-center justify-between text-
|
|
57
|
+
}), "data-testid": dataTestId, tabIndex: 0, children: [jsxRuntime.jsx("span", { className: tailwindMerge.twMerge("truncate", isActive && "font-semibold"), children: title }), jsxRuntime.jsxs("span", { className: "grid grid-flow-col items-center justify-between text-neutral-900", children: [isActive && activeLabel ? (jsxRuntime.jsx(reactComponents.Badge, { className: !activeOptionsCount ? "mx-2" : "mx-1", compact: !activeOptionsCount, count: activeOptionsCount, ...(!activeOptionsCount ? {} : { size: "condensed" }) })) : null, readOnly ? null : jsxRuntime.jsx(reactComponents.Icon, { ariaHidden: true, color: "secondary", name: "ChevronRight", size: "small" })] })] })) : (renderButton()) }), jsxRuntime.jsx(reactComponents.PopoverContent, { children: children ? (jsxRuntime.jsx(reactComponents.MenuList, { className: cvaMenuListOverrides({ withStickyHeader }), dataTestId: dataTestId ? dataTestId : undefined, withStickyHeader: withStickyHeader, ...menuListProps, children: children })) : (jsxRuntime.jsx(jsxRuntime.Fragment, {})) })] }));
|
|
58
58
|
} }));
|
|
59
59
|
};
|
|
60
60
|
const cvaMenuListOverrides = cssClassVarianceUtilities.cvaMerge(["overflow-x-hidden", "relative", "!max-w-full", "p-0"], {
|
|
@@ -111,7 +111,7 @@ const cvaFilterFooter = cssClassVarianceUtilities.cvaMerge(["flex", "justify-end
|
|
|
111
111
|
* @returns {ReactElement} FilterHeader component
|
|
112
112
|
*/
|
|
113
113
|
const FilterHeader = ({ dataTestId, title, resetLabel, showReset, onReset, loading = false, children, searchComponent, className, ...rest }) => {
|
|
114
|
-
return (jsxRuntime.jsx("div", { className: tailwindMerge.twMerge(className, "p-1", "min-w-[280px]"), ...rest, "data-testid": dataTestId, children: title ? (jsxRuntime.jsxs("div", { className: "flex flex-col items-center justify-between gap-1 text-sm font-medium uppercase text-
|
|
114
|
+
return (jsxRuntime.jsx("div", { className: tailwindMerge.twMerge(className, "p-1", "min-w-[280px]"), ...rest, "data-testid": dataTestId, children: title ? (jsxRuntime.jsxs("div", { className: "flex flex-col items-center justify-between gap-1 text-sm font-medium uppercase text-neutral-600", children: [searchComponent, jsxRuntime.jsxs("div", { className: "flex w-full justify-between gap-1", children: [children, jsxRuntime.jsx("div", { className: "ml-auto", children: loading ? (jsxRuntime.jsx(reactComponents.Spinner, { size: "small" })) : (jsxRuntime.jsx(reactComponents.Button, { "data-testid": `${dataTestId}-reset-button`, disabled: !showReset, onClick: onReset, size: "small", variant: "ghost", children: resetLabel })) })] }), jsxRuntime.jsx("hr", { className: "w-full border-neutral-200" })] })) : null }));
|
|
115
115
|
};
|
|
116
116
|
const cvaFilterHeaderButton = cssClassVarianceUtilities.cvaMerge([], {
|
|
117
117
|
variants: {
|
package/index.esm.js
CHANGED
|
@@ -50,9 +50,9 @@ const Filter = ({ title, asIcon, children, popoverProps, isActive, activeLabel,
|
|
|
50
50
|
cursor: "pointer",
|
|
51
51
|
className: [
|
|
52
52
|
className,
|
|
53
|
-
"
|
|
53
|
+
"grid list-none grid-flow-col items-center justify-between gap-1 rounded px-3 py-2 text-sm text-neutral-700 hover:text-neutral-800",
|
|
54
54
|
],
|
|
55
|
-
}), "data-testid": dataTestId, tabIndex: 0, children: [jsx("span", { className: twMerge("truncate", isActive && "font-semibold"), children: title }), jsxs("span", { className: "grid grid-flow-col items-center justify-between text-
|
|
55
|
+
}), "data-testid": dataTestId, tabIndex: 0, children: [jsx("span", { className: twMerge("truncate", isActive && "font-semibold"), children: title }), jsxs("span", { className: "grid grid-flow-col items-center justify-between text-neutral-900", children: [isActive && activeLabel ? (jsx(Badge, { className: !activeOptionsCount ? "mx-2" : "mx-1", compact: !activeOptionsCount, count: activeOptionsCount, ...(!activeOptionsCount ? {} : { size: "condensed" }) })) : null, readOnly ? null : jsx(Icon, { ariaHidden: true, color: "secondary", name: "ChevronRight", size: "small" })] })] })) : (renderButton()) }), jsx(PopoverContent, { children: children ? (jsx(MenuList, { className: cvaMenuListOverrides({ withStickyHeader }), dataTestId: dataTestId ? dataTestId : undefined, withStickyHeader: withStickyHeader, ...menuListProps, children: children })) : (jsx(Fragment, {})) })] }));
|
|
56
56
|
} }));
|
|
57
57
|
};
|
|
58
58
|
const cvaMenuListOverrides = cvaMerge(["overflow-x-hidden", "relative", "!max-w-full", "p-0"], {
|
|
@@ -109,7 +109,7 @@ const cvaFilterFooter = cvaMerge(["flex", "justify-end", "p-1"]);
|
|
|
109
109
|
* @returns {ReactElement} FilterHeader component
|
|
110
110
|
*/
|
|
111
111
|
const FilterHeader = ({ dataTestId, title, resetLabel, showReset, onReset, loading = false, children, searchComponent, className, ...rest }) => {
|
|
112
|
-
return (jsx("div", { className: twMerge(className, "p-1", "min-w-[280px]"), ...rest, "data-testid": dataTestId, children: title ? (jsxs("div", { className: "flex flex-col items-center justify-between gap-1 text-sm font-medium uppercase text-
|
|
112
|
+
return (jsx("div", { className: twMerge(className, "p-1", "min-w-[280px]"), ...rest, "data-testid": dataTestId, children: title ? (jsxs("div", { className: "flex flex-col items-center justify-between gap-1 text-sm font-medium uppercase text-neutral-600", children: [searchComponent, jsxs("div", { className: "flex w-full justify-between gap-1", children: [children, jsx("div", { className: "ml-auto", children: loading ? (jsx(Spinner, { size: "small" })) : (jsx(Button, { "data-testid": `${dataTestId}-reset-button`, disabled: !showReset, onClick: onReset, size: "small", variant: "ghost", children: resetLabel })) })] }), jsx("hr", { className: "w-full border-neutral-200" })] })) : null }));
|
|
113
113
|
};
|
|
114
114
|
const cvaFilterHeaderButton = cvaMerge([], {
|
|
115
115
|
variants: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/react-filter-components",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.18",
|
|
4
4
|
"repository": "https://github.com/Trackunit/manager",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"engines": {
|
|
@@ -9,11 +9,11 @@
|
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"react": "19.0.0",
|
|
11
11
|
"tailwind-merge": "^2.0.0",
|
|
12
|
-
"@trackunit/ui-icons": "1.7.
|
|
13
|
-
"@trackunit/css-class-variance-utilities": "1.7.
|
|
14
|
-
"@trackunit/react-components": "1.9.
|
|
15
|
-
"@trackunit/react-form-components": "1.8.
|
|
16
|
-
"@trackunit/react-test-setup": "1.4.
|
|
12
|
+
"@trackunit/ui-icons": "1.7.12",
|
|
13
|
+
"@trackunit/css-class-variance-utilities": "1.7.10",
|
|
14
|
+
"@trackunit/react-components": "1.9.18",
|
|
15
|
+
"@trackunit/react-form-components": "1.8.18",
|
|
16
|
+
"@trackunit/react-test-setup": "1.4.10"
|
|
17
17
|
},
|
|
18
18
|
"module": "./index.esm.js",
|
|
19
19
|
"main": "./index.cjs.js",
|