@wellingtonhlc/shared-ui 0.26.0 → 0.26.2
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.
|
@@ -8,7 +8,7 @@ export function EmptyState({ title = 'Nada por aqui.', description, icon = _jsx(
|
|
|
8
8
|
className: cn('h-10 w-10 text-foreground-muted', icon.props.className),
|
|
9
9
|
})
|
|
10
10
|
: icon;
|
|
11
|
-
return (_jsx("div", { className: cn('flex min-h-0 w-full items-center justify-center rounded-md border border-dashed border-[color-mix(in_srgb,var(--foreground-muted)_24%,transparent)] bg-surface text-center text-foreground-muted', isCompact ? 'px-4 py-6' : 'h-full flex-1 px-5 py-10', withMargin && 'm-2', className), children: _jsxs("div", { className: cn('mx-auto grid justify-items-center', isCompact ? 'max-w-xs gap-1.5' : 'max-w-sm gap-2'), children: [showIcon && styledIcon ? (_jsx("div", { className: "text-foreground-muted mb-1 flex h-11 w-11 items-center justify-center", children: styledIcon })) : null, _jsx("strong", { className: "text-foreground text-sm font-semibold", children: title }), description ? _jsx("p", { className: "text-foreground-muted text-xs leading-5", children: description }) : null, children ? _jsx("div", { className: cn('mt-2 flex flex-wrap items-center justify-center gap-2', isCompact ? 'text-xs' : 'text-sm'), children: children }) : null] }) }));
|
|
11
|
+
return (_jsx("div", { className: cn('flex min-h-0 w-full items-center justify-center rounded-md border border-dashed border-[color-mix(in_srgb,var(--foreground-muted)_24%,transparent)] bg-surface text-center text-foreground-muted', isCompact ? 'px-4 py-6' : 'h-full flex-1 px-5 py-10', withMargin && 'm-2 w-auto', className), children: _jsxs("div", { className: cn('mx-auto grid justify-items-center', isCompact ? 'max-w-xs gap-1.5' : 'max-w-sm gap-2'), children: [showIcon && styledIcon ? (_jsx("div", { className: "text-foreground-muted mb-1 flex h-11 w-11 items-center justify-center", children: styledIcon })) : null, _jsx("strong", { className: "text-foreground text-sm font-semibold", children: title }), description ? _jsx("p", { className: "text-foreground-muted text-xs leading-5", children: description }) : null, children ? _jsx("div", { className: cn('mt-2 flex flex-wrap items-center justify-center gap-2', isCompact ? 'text-xs' : 'text-sm'), children: children }) : null] }) }));
|
|
12
12
|
}
|
|
13
13
|
function DefaultEmptyIcon() {
|
|
14
14
|
return (_jsx("svg", { "aria-hidden": "true", className: "h-10 w-10", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: "1.8", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3.75 8.75 6.2 5.4A2 2 0 0 1 7.82 4.6h8.36a2 2 0 0 1 1.62.8l2.45 3.35M3.75 8.75v6.9A3.75 3.75 0 0 0 7.5 19.4h9a3.75 3.75 0 0 0 3.75-3.75v-6.9M3.75 8.75h4.92a1.5 1.5 0 0 1 1.34.83l.28.56a1.5 1.5 0 0 0 1.34.83h.74a1.5 1.5 0 0 0 1.34-.83l.28-.56a1.5 1.5 0 0 1 1.34-.83h4.92" }) }));
|
|
@@ -43,7 +43,7 @@ function FilterActions({ clearLabel, submitLabel, onClear, onSubmit, isSubmittin
|
|
|
43
43
|
function handleClear() {
|
|
44
44
|
onClear?.();
|
|
45
45
|
}
|
|
46
|
-
return (_jsxs(FilterFooter, { children: [_jsx(RenderIf, { when: Boolean(onClear), children: _jsx(Button, { type: "button", variant: "outline", onClick: handleClear, disabled: actionsDisabled, children: clearLabel ?? 'Redefinir' }) }), _jsx(RenderIf, { when: Boolean(onSubmit), children: _jsx(Button, { type: "submit", className: "flex-1", isLoading: isSubmitting, disabled: actionsDisabled, children: submitLabel ?? 'Pesquisar' }) })] }));
|
|
46
|
+
return (_jsxs(FilterFooter, { children: [_jsx(RenderIf, { when: Boolean(onClear), children: _jsx(Button, { type: "button", variant: "outline", size: "sm", onClick: handleClear, disabled: actionsDisabled, children: clearLabel ?? 'Redefinir' }) }), _jsx(RenderIf, { when: Boolean(onSubmit), children: _jsx(Button, { type: "submit", size: "sm", className: "flex-1", isLoading: isSubmitting, disabled: actionsDisabled, children: submitLabel ?? 'Pesquisar' }) })] }));
|
|
47
47
|
}
|
|
48
48
|
function FilterRoot({ title = 'Filtros', description = '', children, className, bodyClassName, contentClassName, maxHeightClassName = '', onSubmit, onClear, submitLabel, clearLabel, isSubmitting = false, actionsDisabled = false, fieldsClassName, }) {
|
|
49
49
|
const visibility = useContext(FilterVisibilityContext);
|
package/dist/components/Table.js
CHANGED
|
@@ -19,7 +19,7 @@ const Footer = forwardRef(({ className, ...props }, ref) => (_jsx("tfoot", { ref
|
|
|
19
19
|
Footer.displayName = 'Table.Footer';
|
|
20
20
|
const Row = forwardRef(({ className, isInteractive = true, ...props }, ref) => (_jsx("tr", { ref: ref, className: cn('transition-colors hover:bg-[color-mix(in_srgb,var(--brand)_5%,transparent)] last:[&>td]:border-b-0', isInteractive && 'cursor-pointer', className), ...props })));
|
|
21
21
|
Row.displayName = 'Table.Row';
|
|
22
|
-
const Head = forwardRef(({ className, ...props }, ref) => (_jsx("th", { ref: ref, className: cn('border-app-border bg-background-secondary sticky top-0 z-[2] whitespace-nowrap border-b px-3 py-2.5 text-left align-middle text-xs font-extrabold tracking-[0.045em] text-foreground-muted uppercase', className), ...props })));
|
|
22
|
+
const Head = forwardRef(({ className, ...props }, ref) => (_jsx("th", { ref: ref, className: cn('border-app-border bg-background-secondary sticky top-0 z-[2] h-10 whitespace-nowrap border-b px-3 py-2.5 text-left align-middle text-xs font-extrabold tracking-[0.045em] text-foreground-muted uppercase', className), ...props })));
|
|
23
23
|
Head.displayName = 'Table.Head';
|
|
24
24
|
const Cell = forwardRef(({ className, ...props }, ref) => (_jsx("td", { ref: ref, className: cn('border-app-border border-b px-3 py-2.5 align-middle text-foreground', className), ...props })));
|
|
25
25
|
Cell.displayName = 'Table.Cell';
|
|
@@ -11,7 +11,7 @@ function WorkspaceRoot({ filters, children, className, appearance = 'separated'
|
|
|
11
11
|
const isJoined = appearance === 'joined';
|
|
12
12
|
const isFilterOpen = visibility?.open ?? true;
|
|
13
13
|
return (_jsxs("div", { className: cn('grid min-h-0 flex-1 xl:grid-rows-[minmax(0,1fr)]', isJoined
|
|
14
|
-
? 'gap-0 overflow-hidden rounded-[var(--radius)] border border-app-border [&_[data-slot=filter-root]]:rounded-none [&_[data-slot=filter-root]]:border-0 [&_[data-slot=table-root]]:rounded-none [&_[data-slot=table-root]]:border-0'
|
|
14
|
+
? 'gap-0 overflow-hidden rounded-[var(--radius)] border border-app-border [&_[data-slot=filter-root]]:rounded-none [&_[data-slot=filter-root]]:border-0 [&_[data-slot=filter-root]]:!border-r [&_[data-slot=filter-root]]:!border-app-border [&_[data-slot=table-root]]:rounded-none [&_[data-slot=table-root]]:border-0'
|
|
15
15
|
: 'gap-3', isFilterOpen ? 'xl:grid-cols-[280px_minmax(0,1fr)]' : 'xl:grid-cols-[minmax(0,1fr)]', className), children: [_jsx(RenderIf, { when: isFilterOpen, children: _jsx("aside", { className: "min-h-0 xl:self-stretch xl:[&>*]:h-full xl:[&>*]:min-h-0", children: filters }) }), _jsx("section", { className: "flex min-h-0 flex-1 flex-col", children: _jsxs(RenderCase.Root, { children: [_jsx(RenderCase.If, { when: Boolean(children && (Array.isArray(children) ? children.length > 0 : true)), children: children }), _jsx(RenderCase.Else, { children: _jsx(Card.Root, { className: "flex flex-1 items-center justify-center bg-surface/60 p-8 shadow-sm", children: _jsx(EmptyState, { title: "Nenhum resultado", description: "Ajuste os filtros e pesquise novamente." }) }) })] }) })] }));
|
|
16
16
|
}
|
|
17
17
|
export const Workspace = {
|
package/dist/styles.css
CHANGED
|
@@ -4114,6 +4114,17 @@ h2.react-datepicker__current-month {
|
|
|
4114
4114
|
border-width: 0px;
|
|
4115
4115
|
}
|
|
4116
4116
|
}
|
|
4117
|
+
.\[\&_\[data-slot\=filter-root\]\]\:\!border-r {
|
|
4118
|
+
& [data-slot=filter-root] {
|
|
4119
|
+
border-right-style: var(--tw-border-style) !important;
|
|
4120
|
+
border-right-width: 1px !important;
|
|
4121
|
+
}
|
|
4122
|
+
}
|
|
4123
|
+
.\[\&_\[data-slot\=filter-root\]\]\:\!border-app-border {
|
|
4124
|
+
& [data-slot=filter-root] {
|
|
4125
|
+
border-color: var(--color-app-border) !important;
|
|
4126
|
+
}
|
|
4127
|
+
}
|
|
4117
4128
|
.\[\&_\[data-slot\=modal-description\]\]\:text-sm {
|
|
4118
4129
|
& [data-slot=modal-description] {
|
|
4119
4130
|
font-size: var(--text-sm);
|