@fabio.caffarello/react-design-system 3.11.0 → 3.12.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.
- package/dist/granular/index.js +356 -354
- package/dist/granular/index.js.map +1 -1
- package/dist/granular/ui/components/HeroSection/HeroSection.js +176 -0
- package/dist/granular/ui/components/HeroSection/HeroSection.js.map +1 -0
- package/dist/index.cjs +58 -58
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +837 -692
- package/dist/index.js.map +1 -1
- package/dist/react-design-system.css +1 -1
- package/dist/server/index.cjs +10 -10
- package/dist/server/index.cjs.map +1 -1
- package/dist/server/index.js +505 -360
- package/dist/server/index.js.map +1 -1
- package/dist/ui/components/HeroSection/HeroSection.d.ts +101 -0
- package/dist/ui/components/HeroSection/index.d.ts +2 -0
- package/dist/ui/components/index.d.ts +2 -0
- package/dist/ui/server.d.ts +2 -0
- package/package.json +1 -1
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import type { HTMLAttributes, ReactNode } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Visual treatment of the hero surface.
|
|
4
|
+
*
|
|
5
|
+
* - `plain` — no decorative background; the hero is text + padding on
|
|
6
|
+
* whatever surface it sits on.
|
|
7
|
+
* - `gradient` — a soft brand→secondary wash (theme-aware, see
|
|
8
|
+
* `utilities/gradients.css`).
|
|
9
|
+
* - `gradient-glow` — the same wash plus a brand-colored outer glow for
|
|
10
|
+
* top-of-funnel emphasis (landing / home).
|
|
11
|
+
*/
|
|
12
|
+
export type HeroSectionVariant = "plain" | "gradient" | "gradient-glow";
|
|
13
|
+
/** Block alignment of the hero content. */
|
|
14
|
+
export type HeroSectionAlign = "start" | "center";
|
|
15
|
+
export interface HeroSectionProps extends Omit<HTMLAttributes<HTMLElement>, "title"> {
|
|
16
|
+
/** Eyebrow / kicker above the title (rendered uppercase, brand-colored). */
|
|
17
|
+
kicker?: ReactNode;
|
|
18
|
+
/**
|
|
19
|
+
* The hero title. Rendered as the section's `<h1>`. **Required.**
|
|
20
|
+
*
|
|
21
|
+
* When `title` is a plain string it also becomes the accessible name of
|
|
22
|
+
* the hero `<section>` landmark (the FilterChips `label` pattern). When it
|
|
23
|
+
* is a non-string `ReactNode`, supply `aria-label` or `aria-labelledby`
|
|
24
|
+
* yourself — otherwise the landmark renders without an accessible name and
|
|
25
|
+
* the component emits a dev-only warning.
|
|
26
|
+
*/
|
|
27
|
+
title: ReactNode;
|
|
28
|
+
/** Supporting copy below the title (constrained to a readable measure). */
|
|
29
|
+
description?: ReactNode;
|
|
30
|
+
/** Call-to-action slot — typically one or more `<Button>`s. */
|
|
31
|
+
actions?: ReactNode;
|
|
32
|
+
/** Metrics slot — typically a `<StatGroup>` of `<Stat>`s. Spans full width. */
|
|
33
|
+
kpis?: ReactNode;
|
|
34
|
+
/** A line of metadata below everything else (low emphasis). */
|
|
35
|
+
meta?: ReactNode;
|
|
36
|
+
/**
|
|
37
|
+
* Visual treatment of the hero surface.
|
|
38
|
+
* @default 'plain'
|
|
39
|
+
*/
|
|
40
|
+
variant?: HeroSectionVariant;
|
|
41
|
+
/**
|
|
42
|
+
* Block alignment of the content.
|
|
43
|
+
* @default 'start'
|
|
44
|
+
*/
|
|
45
|
+
align?: HeroSectionAlign;
|
|
46
|
+
/** Additional CSS classes merged onto the root `<section>`. */
|
|
47
|
+
className?: string;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* `HeroSection` — top-of-page hero: kicker + title + description + actions +
|
|
51
|
+
* kpis + meta, in three visual treatments (`plain` / `gradient` /
|
|
52
|
+
* `gradient-glow`) and two alignments (`start` / `center`).
|
|
53
|
+
*
|
|
54
|
+
* Distinct from `PageHeader` (contextual navigation: breadcrumb + title +
|
|
55
|
+
* actions). The hero is a page/landing **introduction** with a visual
|
|
56
|
+
* identity and slots for KPIs and metadata.
|
|
57
|
+
*
|
|
58
|
+
* ### Slots
|
|
59
|
+
*
|
|
60
|
+
* Every slot except `title` is optional and collapses cleanly when absent —
|
|
61
|
+
* no empty wrapper leaks into the DOM. `kpis` is an opaque slot: pass a
|
|
62
|
+
* `<StatGroup>` (or any node); the consumer chooses the metric layout.
|
|
63
|
+
*
|
|
64
|
+
* ### Landmark & accessible name
|
|
65
|
+
*
|
|
66
|
+
* Renders as a `<section>`. A `<section>` is only exposed as a navigable
|
|
67
|
+
* region when it has an accessible name, so the component derives one:
|
|
68
|
+
* - a string `title` becomes the `aria-label` automatically;
|
|
69
|
+
* - an explicit `aria-label` / `aria-labelledby` from the consumer always
|
|
70
|
+
* wins (and `aria-labelledby` suppresses the derived label to avoid a
|
|
71
|
+
* redundant name);
|
|
72
|
+
* - a non-string `title` with no consumer-supplied name triggers a dev-only
|
|
73
|
+
* `console.warn` (dead-code-eliminated in production builds).
|
|
74
|
+
*
|
|
75
|
+
* ### Server-safe
|
|
76
|
+
*
|
|
77
|
+
* Pure presentation — no hooks, no event handlers on the DOM. Ships in the
|
|
78
|
+
* `./server` entry. Interactive children supplied via `actions` (e.g.
|
|
79
|
+
* `<Button onClick>`) cross the RSC boundary as client references normally.
|
|
80
|
+
*
|
|
81
|
+
* @example
|
|
82
|
+
* ```tsx
|
|
83
|
+
* <HeroSection
|
|
84
|
+
* variant="gradient-glow"
|
|
85
|
+
* align="center"
|
|
86
|
+
* kicker="Transparência"
|
|
87
|
+
* title="Acompanhe o Congresso em tempo real"
|
|
88
|
+
* description="Proposições, votações e parlamentares — tudo em um só lugar."
|
|
89
|
+
* actions={<Button variant="primary">Começar</Button>}
|
|
90
|
+
* kpis={
|
|
91
|
+
* <StatGroup layout="strip">
|
|
92
|
+
* <Stat value="9,4 mil" label="Parlamentares" align="center" />
|
|
93
|
+
* <Stat value="3,2 mil" label="Proposições" align="center" />
|
|
94
|
+
* </StatGroup>
|
|
95
|
+
* }
|
|
96
|
+
* meta="Atualizado diariamente"
|
|
97
|
+
* />
|
|
98
|
+
* ```
|
|
99
|
+
*/
|
|
100
|
+
declare const HeroSection: import("react").ForwardRefExoticComponent<HeroSectionProps & import("react").RefAttributes<HTMLElement>>;
|
|
101
|
+
export default HeroSection;
|
|
@@ -81,5 +81,7 @@ export { DataTablePattern, type DataTablePatternProps, type DataTableColumn, } f
|
|
|
81
81
|
export { FormWizardPattern, type FormWizardPatternProps, type FormWizardStep, } from "./FormWizardPattern";
|
|
82
82
|
export { SearchAndFilterPattern, type SearchAndFilterPatternProps, type FilterConfig, type FilterOption, } from "./SearchAndFilterPattern";
|
|
83
83
|
export { DashboardLayout, type DashboardLayoutProps } from "./DashboardLayout";
|
|
84
|
+
export { default as HeroSection } from "./HeroSection";
|
|
85
|
+
export type { HeroSectionProps, HeroSectionVariant, HeroSectionAlign, } from "./HeroSection";
|
|
84
86
|
export { default as TabsAsLinks } from "./TabsAsLinks";
|
|
85
87
|
export type { TabsAsLinksProps, TabAsLink, TabsAsLinksVariant, } from "./TabsAsLinks";
|
package/dist/ui/server.d.ts
CHANGED
|
@@ -49,6 +49,8 @@ export { HeaderActions } from "./components/Header/components/HeaderActions";
|
|
|
49
49
|
export type { HeaderActionsProps } from "./components/Header/components/HeaderActions";
|
|
50
50
|
export { HeaderNavigation } from "./components/Header/components/HeaderNavigation";
|
|
51
51
|
export type { HeaderNavigationProps } from "./components/Header/components/HeaderNavigation";
|
|
52
|
+
export { default as HeroSection } from "./components/HeroSection/HeroSection";
|
|
53
|
+
export type { HeroSectionProps, HeroSectionVariant, HeroSectionAlign, } from "./components/HeroSection/HeroSection";
|
|
52
54
|
export { default as MenuSeparator } from "./components/Menu/MenuSeparator";
|
|
53
55
|
export type { MenuSeparatorProps } from "./components/Menu/MenuSeparator";
|
|
54
56
|
export { default as NavbarSeparator } from "./components/SideNavbar/components/Navbar/NavbarSeparator";
|