@fabio.caffarello/react-design-system 4.8.0 → 4.9.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.
@@ -0,0 +1,52 @@
1
+ import { type HTMLAttributes, type ReactNode } from "react";
2
+ export interface EmptyStateBaseProps extends Omit<HTMLAttributes<HTMLDivElement>, "children"> {
3
+ title: string;
4
+ /**
5
+ * Descriptive message below the title. Optional — several empty states
6
+ * have only a title. When absent, `aria-label` is just the title and no
7
+ * `<p>` element is rendered.
8
+ */
9
+ message?: string;
10
+ /**
11
+ * Optional decorative illustration (icon, SVG, image). Rendered
12
+ * `aria-hidden` above the title.
13
+ */
14
+ illustration?: ReactNode;
15
+ /**
16
+ * Action slot — any ReactNode (link, button, custom CTA). Rendered
17
+ * below the message (or title when message is absent).
18
+ *
19
+ * Use a plain `<a href>` or `next/link` here to keep the component
20
+ * zero-JS in Server Components; the slot is passed through with no
21
+ * wrapper or event handler added.
22
+ *
23
+ * @example
24
+ * // Zero-JS link — Server Component safe
25
+ * <EmptyStateBase
26
+ * title="Sem resultados"
27
+ * action={<a href="/">Limpar filtros</a>}
28
+ * />
29
+ */
30
+ action?: ReactNode;
31
+ }
32
+ /**
33
+ * EmptyStateBase — the **server-safe presentational core** of `EmptyState`
34
+ * (issue #252 follow-up).
35
+ *
36
+ * It holds no React client state (no hooks, no `"use client"` directive), so
37
+ * it can be imported from `@fabio.caffarello/react-design-system/server` and
38
+ * rendered inside React Server Components and zero-JS routes.
39
+ *
40
+ * ### Trade-off vs `EmptyState`
41
+ *
42
+ * | Feature | EmptyStateBase | EmptyState |
43
+ * |------------------------------|----------------------|-----------------------------|
44
+ * | `action` ReactNode slot | ✅ | ✅ |
45
+ * | `onAction` callback button | ❌ (needs client JS) | ✅ |
46
+ * | `./server` exportable | ✅ | ❌ (barrel pulls Input/useId)|
47
+ *
48
+ * Use `EmptyState` when you need a client-driven callback button (`onAction`).
49
+ * Use `EmptyStateBase` in Server Components where the CTA is a zero-JS link.
50
+ */
51
+ declare const EmptyStateBase: import("react").ForwardRefExoticComponent<EmptyStateBaseProps & import("react").RefAttributes<HTMLDivElement>>;
52
+ export default EmptyStateBase;
@@ -1,2 +1,4 @@
1
1
  export { default } from "./EmptyState";
2
2
  export type { EmptyStateProps } from "./EmptyState";
3
+ export { default as EmptyStateBase } from "./EmptyStateBase";
4
+ export type { EmptyStateBaseProps } from "./EmptyStateBase";
@@ -31,6 +31,8 @@ export { Stack } from "./layouts/Stack/Stack";
31
31
  export type { StackProps } from "./layouts/Stack/Stack";
32
32
  export { default as Breadcrumb } from "./components/Breadcrumb/Breadcrumb";
33
33
  export type { BreadcrumbItem } from "./components/Breadcrumb/Breadcrumb";
34
+ export { default as EmptyStateBase } from "./components/EmptyState/EmptyStateBase";
35
+ export type { EmptyStateBaseProps } from "./components/EmptyState/EmptyStateBase";
34
36
  export { default as Card } from "./components/Card/Card";
35
37
  export type { CardProps } from "./components/Card/Card";
36
38
  export { CardHeader } from "./components/Card/CardHeader";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@fabio.caffarello/react-design-system",
3
3
  "private": false,
4
- "version": "4.8.0",
4
+ "version": "4.9.0",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",