@wellingtonhlc/shared-ui 0.25.8 → 0.25.9
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Filter.d.ts","sourceRoot":"","sources":["../../src/components/Filter.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA4B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAOjE,MAAM,WAAW,eAAe;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,SAAS,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,SAAS,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,iBAAS,YAAY,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,iBAAiB,+
|
|
1
|
+
{"version":3,"file":"Filter.d.ts","sourceRoot":"","sources":["../../src/components/Filter.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA4B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAOjE,MAAM,WAAW,eAAe;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,SAAS,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,SAAS,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,iBAAS,YAAY,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,iBAAiB,+BAM/D;AAED,iBAAS,UAAU,CAAC,EAClB,KAAiB,EACjB,WAAqE,EACrE,QAAQ,EACR,SAAS,EACT,aAAa,EACb,gBAAgB,EAChB,kBAAuB,GACxB,EAAE,eAAe,+BAsCjB;AAED,eAAO,MAAM,MAAM;;;CAGlB,CAAC"}
|
|
@@ -1,20 +1,16 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Children, isValidElement } from
|
|
3
|
-
import { FilterIcon } from
|
|
4
|
-
import { cn } from
|
|
5
|
-
import { Card } from
|
|
2
|
+
import { Children, isValidElement } from "react";
|
|
3
|
+
import { FilterIcon } from "lucide-react";
|
|
4
|
+
import { cn } from "../utils/cn";
|
|
5
|
+
import { Card } from "./Card";
|
|
6
6
|
function FilterFooter({ children, className }) {
|
|
7
|
-
return _jsx("div", { className: cn(
|
|
7
|
+
return (_jsx("div", { className: cn("border-app-border shrink-0 border-t pt-3", className), children: children }));
|
|
8
8
|
}
|
|
9
|
-
function FilterRoot({ title =
|
|
9
|
+
function FilterRoot({ title = "Filtros", description = "Refine os critérios antes de consultar os resultados.", children, className, bodyClassName, contentClassName, maxHeightClassName = "", }) {
|
|
10
10
|
const childrenArray = Children.toArray(children);
|
|
11
|
-
const footerChildren = childrenArray.filter(child => isValidElement(child) && child.type === FilterFooter);
|
|
12
|
-
const contentChildren = childrenArray.filter(child => !(isValidElement(child) && child.type === FilterFooter));
|
|
13
|
-
return (
|
|
14
|
-
// Altura natural (content) por padrao — seguro em pilhas verticais (nao empurra irmaos).
|
|
15
|
-
// O preenchimento da coluna e a rolagem interna sao impostos pelo container
|
|
16
|
-
// (ex.: `Workspace.Root` forca o filho a `h-full`/`min-h-0`; em grids o item estica).
|
|
17
|
-
_jsxs(Card.Root, { className: cn('flex w-full min-w-0 flex-col overflow-hidden', maxHeightClassName, className), children: [_jsxs(Card.Title, { children: [_jsx(FilterIcon, { className: "text-primary h-4 w-4" }), title] }), _jsx(Card.Body, { className: cn('flex min-h-0 flex-1 flex-col', bodyClassName), children: _jsxs("div", { className: "flex min-h-0 flex-1 flex-col gap-3", children: [_jsx("div", { className: cn('min-h-0 flex-1 overflow-y-auto', contentClassName), children: _jsxs("div", { className: "flex flex-col gap-1", children: [_jsx("p", { className: "text-foreground-muted text-xs leading-5", children: description }), contentChildren] }) }), footerChildren] }) })] }));
|
|
11
|
+
const footerChildren = childrenArray.filter((child) => isValidElement(child) && child.type === FilterFooter);
|
|
12
|
+
const contentChildren = childrenArray.filter((child) => !(isValidElement(child) && child.type === FilterFooter));
|
|
13
|
+
return (_jsxs(Card.Root, { className: cn("flex h-full w-full min-w-0 flex-col overflow-hidden", maxHeightClassName, className), children: [_jsxs(Card.Title, { children: [_jsx(FilterIcon, { className: "text-primary h-4 w-4" }), title] }), _jsx(Card.Body, { className: cn("flex min-h-0 flex-1 flex-col", bodyClassName), children: _jsxs("div", { className: "flex min-h-0 flex-1 flex-col gap-3", children: [_jsx("div", { className: cn("min-h-0 flex-1 overflow-y-auto", contentClassName), children: _jsxs("div", { className: "flex flex-col gap-1", children: [_jsx("p", { className: "text-foreground-muted text-xs leading-5", children: description }), contentChildren] }) }), footerChildren] }) })] }));
|
|
18
14
|
}
|
|
19
15
|
export const Filter = {
|
|
20
16
|
Root: FilterRoot,
|