@raulaguila/maat-ui 0.6.0 → 0.6.1
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/README.md +1 -1
- package/dist/empty-state.d.ts +3 -1
- package/dist/empty-state.js +2 -2
- package/dist/error-screens.js +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@ O pacote **@raulaguila/maat-ui** é a biblioteca de componentes da família Maat
|
|
|
7
7
|
O pacote público requer React 19, React DOM 19 e Tailwind CSS 4. Escolha a versão em cada frontend:
|
|
8
8
|
|
|
9
9
|
```sh
|
|
10
|
-
pnpm add --save-exact @raulaguila/maat-ui@0.6.
|
|
10
|
+
pnpm add --save-exact @raulaguila/maat-ui@0.6.1
|
|
11
11
|
```
|
|
12
12
|
|
|
13
13
|
Inclua o `package.json` e o `pnpm-lock.yaml` no mesmo commit.
|
package/dist/empty-state.d.ts
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import type { LucideIcon } from "lucide-react";
|
|
2
2
|
/** Canonical empty list: icon + title + one sentence + optional CTA. compact is
|
|
3
3
|
* the one-line form for a list inside a form section. */
|
|
4
|
-
export declare function EmptyState({ icon: Icon, title, description, action, compact, className, }: {
|
|
4
|
+
export declare function EmptyState({ icon: Icon, title, description, action, compact, heading, className, }: {
|
|
5
5
|
icon?: LucideIcon;
|
|
6
6
|
title: string;
|
|
7
7
|
description?: string;
|
|
8
8
|
action?: React.ReactNode;
|
|
9
9
|
compact?: boolean;
|
|
10
|
+
/** The title is the page's h1 (a full-page screen such as not-found). */
|
|
11
|
+
heading?: boolean;
|
|
10
12
|
className?: string;
|
|
11
13
|
}): import("react").JSX.Element;
|
package/dist/empty-state.js
CHANGED
|
@@ -2,9 +2,9 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { cn } from "./cn.js";
|
|
3
3
|
/** Canonical empty list: icon + title + one sentence + optional CTA. compact is
|
|
4
4
|
* the one-line form for a list inside a form section. */
|
|
5
|
-
export function EmptyState({ icon: Icon, title, description, action, compact = false, className, }) {
|
|
5
|
+
export function EmptyState({ icon: Icon, title, description, action, compact = false, heading = false, className, }) {
|
|
6
6
|
if (compact) {
|
|
7
7
|
return _jsx("p", { role: "status", className: cn("rounded-md border border-dashed px-3 py-4 text-center text-sm text-muted-foreground", className), children: title });
|
|
8
8
|
}
|
|
9
|
-
return (_jsxs("div", { role: "status", className: cn("flex flex-col items-center justify-center rounded-xl border border-dashed px-6 py-14 text-center", className), children: [Icon && (_jsx("div", { className: "mb-4 flex size-12 items-center justify-center rounded-lg bg-muted text-muted-foreground", children: _jsx(Icon, { className: "size-5" }) })), _jsx("p", { className: "font-medium", children: title }), description && (_jsx("p", { className: "mt-1 max-w-sm text-sm text-muted-foreground", children: description })), action && _jsx("div", { className: "mt-4", children: action })] }));
|
|
9
|
+
return (_jsxs("div", { role: "status", className: cn("flex flex-col items-center justify-center rounded-xl border border-dashed px-6 py-14 text-center", className), children: [Icon && (_jsx("div", { className: "mb-4 flex size-12 items-center justify-center rounded-lg bg-muted text-muted-foreground", children: _jsx(Icon, { className: "size-5" }) })), heading ? _jsx("h1", { className: "font-medium", children: title }) : _jsx("p", { className: "font-medium", children: title }), description && (_jsx("p", { className: "mt-1 max-w-sm text-sm text-muted-foreground", children: description })), action && _jsx("div", { className: "mt-4", children: action })] }));
|
|
10
10
|
}
|
package/dist/error-screens.js
CHANGED
|
@@ -8,11 +8,11 @@ import { useFamilyLabels, useFamilyUI } from "./labels.js";
|
|
|
8
8
|
export function NotFoundScreen({ homeHref = "/", title, description }) {
|
|
9
9
|
const labels = useFamilyLabels();
|
|
10
10
|
const { link: Link } = useFamilyUI();
|
|
11
|
-
return (_jsx("div", { className: "flex flex-1 items-center justify-center p-6", children: _jsx(EmptyState, { icon: Compass, title: title ?? labels.pageNotFound, description: description ?? labels.pageNotFoundDescription, className: "w-full max-w-md", action: _jsx(Button, { nativeButton: false, render: _jsx(Link, { href: homeHref }), children: labels.goHome }) }) }));
|
|
11
|
+
return (_jsx("div", { className: "flex flex-1 items-center justify-center p-6", children: _jsx(EmptyState, { icon: Compass, title: title ?? labels.pageNotFound, description: description ?? labels.pageNotFoundDescription, heading: true, className: "w-full max-w-md", action: _jsx(Button, { nativeButton: false, render: _jsx(Link, { href: homeHref }), children: labels.goHome }) }) }));
|
|
12
12
|
}
|
|
13
13
|
/** A screen that crashed while rendering (Next's error boundary): say so and offer a way out. `error` is accepted, never shown. */
|
|
14
14
|
export function ErrorScreen({ reset, homeHref = "/", title, description }) {
|
|
15
15
|
const labels = useFamilyLabels();
|
|
16
16
|
const { link: Link } = useFamilyUI();
|
|
17
|
-
return (_jsx("div", { className: "flex flex-1 items-center justify-center p-6", children: _jsx(EmptyState, { icon: AlertTriangle, title: title ?? labels.errorTitle, description: description ?? labels.errorDescription, className: "w-full max-w-md", action: _jsxs("div", { className: "flex flex-wrap justify-center gap-2", children: [_jsx(Button, { variant: "outline", onClick: reset, children: labels.retry }), _jsx(Button, { nativeButton: false, render: _jsx(Link, { href: homeHref }), children: labels.goHome })] }) }) }));
|
|
17
|
+
return (_jsx("div", { className: "flex flex-1 items-center justify-center p-6", children: _jsx(EmptyState, { icon: AlertTriangle, title: title ?? labels.errorTitle, description: description ?? labels.errorDescription, heading: true, className: "w-full max-w-md", action: _jsxs("div", { className: "flex flex-wrap justify-center gap-2", children: [_jsx(Button, { variant: "outline", onClick: reset, children: labels.retry }), _jsx(Button, { nativeButton: false, render: _jsx(Link, { href: homeHref }), children: labels.goHome })] }) }) }));
|
|
18
18
|
}
|