@rendra-ui/web 2.1.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.
Files changed (150) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +433 -0
  3. package/bin/rendra.mjs +114 -0
  4. package/dist/base.css +246 -0
  5. package/dist/button-DIcpJwK9.js +143 -0
  6. package/dist/button-DIcpJwK9.js.map +1 -0
  7. package/dist/chart.js +520 -0
  8. package/dist/chart.js.map +1 -0
  9. package/dist/cli/auditar.js +125 -0
  10. package/dist/cli/auditar.js.map +1 -0
  11. package/dist/cli/codigos.js +15 -0
  12. package/dist/cli/codigos.js.map +1 -0
  13. package/dist/cli/help.js +17 -0
  14. package/dist/cli/help.js.map +1 -0
  15. package/dist/cli/trocar.js +242 -0
  16. package/dist/cli/trocar.js.map +1 -0
  17. package/dist/cli/typescript-loader.js +27 -0
  18. package/dist/cli/typescript-loader.js.map +1 -0
  19. package/dist/cn-DVPheE99.js +22 -0
  20. package/dist/cn-DVPheE99.js.map +1 -0
  21. package/dist/components-Cm2ezlPT.js +800 -0
  22. package/dist/components-Cm2ezlPT.js.map +1 -0
  23. package/dist/components.css +3365 -0
  24. package/dist/document-viewer.js +204 -0
  25. package/dist/document-viewer.js.map +1 -0
  26. package/dist/empty-state-DtyZAfYb.js +168 -0
  27. package/dist/empty-state-DtyZAfYb.js.map +1 -0
  28. package/dist/index.js +10530 -0
  29. package/dist/index.js.map +1 -0
  30. package/dist/rendra-provider-cCnquOZy.js +88 -0
  31. package/dist/rendra-provider-cCnquOZy.js.map +1 -0
  32. package/dist/rich-text-editor.js +439 -0
  33. package/dist/rich-text-editor.js.map +1 -0
  34. package/dist/router-bridge.js +51 -0
  35. package/dist/router-bridge.js.map +1 -0
  36. package/dist/tokens.css +732 -0
  37. package/dist/tooltip-DyeuGPCc.js +105 -0
  38. package/dist/tooltip-DyeuGPCc.js.map +1 -0
  39. package/dist/types/brand/apply-theme.d.ts +9 -0
  40. package/dist/types/brand/brand-context.d.ts +21 -0
  41. package/dist/types/brand/brand-provider.d.ts +49 -0
  42. package/dist/types/brand/palette.d.ts +63 -0
  43. package/dist/types/brand/public.d.ts +6 -0
  44. package/dist/types/brand/theme.d.ts +80 -0
  45. package/dist/types/brand/types.d.ts +54 -0
  46. package/dist/types/brand/use-brand.d.ts +1 -0
  47. package/dist/types/catalog/components.d.ts +81 -0
  48. package/dist/types/chart.d.ts +1 -0
  49. package/dist/types/components/app-shell/app-shell.d.ts +36 -0
  50. package/dist/types/components/app-shell/command-search.d.ts +1 -0
  51. package/dist/types/components/app-shell/header.d.ts +1 -0
  52. package/dist/types/components/app-shell/layout.d.ts +53 -0
  53. package/dist/types/components/app-shell/mega-menu.d.ts +1 -0
  54. package/dist/types/components/app-shell/navigation-utils.d.ts +18 -0
  55. package/dist/types/components/app-shell/notifications.d.ts +6 -0
  56. package/dist/types/components/app-shell/shell-context.d.ts +48 -0
  57. package/dist/types/components/app-shell/sidebar.d.ts +1 -0
  58. package/dist/types/components/app-shell/types.d.ts +53 -0
  59. package/dist/types/components/layout/index.d.ts +4 -0
  60. package/dist/types/components/layout/page-header.d.ts +38 -0
  61. package/dist/types/components/layout/primitives.d.ts +71 -0
  62. package/dist/types/components/layout/tokens.d.ts +43 -0
  63. package/dist/types/components/rendra-provider.d.ts +48 -0
  64. package/dist/types/components/rendra-router-bridge.d.ts +18 -0
  65. package/dist/types/components/ui/accordion.d.ts +16 -0
  66. package/dist/types/components/ui/action-bar.d.ts +35 -0
  67. package/dist/types/components/ui/alert.d.ts +26 -0
  68. package/dist/types/components/ui/avatar.d.ts +23 -0
  69. package/dist/types/components/ui/badge.d.ts +15 -0
  70. package/dist/types/components/ui/brand-feedback-icon.d.ts +26 -0
  71. package/dist/types/components/ui/brand-logo.d.ts +8 -0
  72. package/dist/types/components/ui/breadcrumb.d.ts +19 -0
  73. package/dist/types/components/ui/button-group.d.ts +27 -0
  74. package/dist/types/components/ui/button.d.ts +30 -0
  75. package/dist/types/components/ui/calendar.d.ts +34 -0
  76. package/dist/types/components/ui/card.d.ts +32 -0
  77. package/dist/types/components/ui/chart.d.ts +57 -0
  78. package/dist/types/components/ui/chat.d.ts +137 -0
  79. package/dist/types/components/ui/checkbox.d.ts +37 -0
  80. package/dist/types/components/ui/checklist.d.ts +16 -0
  81. package/dist/types/components/ui/color-picker.d.ts +13 -0
  82. package/dist/types/components/ui/data-toolbar.d.ts +37 -0
  83. package/dist/types/components/ui/date-picker.d.ts +41 -0
  84. package/dist/types/components/ui/document-viewer.d.ts +19 -0
  85. package/dist/types/components/ui/drawer.d.ts +30 -0
  86. package/dist/types/components/ui/dropdown-menu.d.ts +20 -0
  87. package/dist/types/components/ui/empty-state.d.ts +15 -0
  88. package/dist/types/components/ui/error-page.d.ts +13 -0
  89. package/dist/types/components/ui/field.d.ts +42 -0
  90. package/dist/types/components/ui/form.d.ts +42 -0
  91. package/dist/types/components/ui/image-cropper.d.ts +55 -0
  92. package/dist/types/components/ui/image-viewer.d.ts +14 -0
  93. package/dist/types/components/ui/info-hint.d.ts +9 -0
  94. package/dist/types/components/ui/input.d.ts +91 -0
  95. package/dist/types/components/ui/kanban.d.ts +98 -0
  96. package/dist/types/components/ui/list.d.ts +31 -0
  97. package/dist/types/components/ui/modal.d.ts +27 -0
  98. package/dist/types/components/ui/otp-input.d.ts +17 -0
  99. package/dist/types/components/ui/overlay-shell.d.ts +14 -0
  100. package/dist/types/components/ui/pagination.d.ts +18 -0
  101. package/dist/types/components/ui/picker-panel.d.ts +24 -0
  102. package/dist/types/components/ui/popover.d.ts +12 -0
  103. package/dist/types/components/ui/progress.d.ts +16 -0
  104. package/dist/types/components/ui/qr-code.d.ts +13 -0
  105. package/dist/types/components/ui/radio-group.d.ts +27 -0
  106. package/dist/types/components/ui/rating.d.ts +19 -0
  107. package/dist/types/components/ui/rendra-credit.d.ts +12 -0
  108. package/dist/types/components/ui/repeatable-field.d.ts +22 -0
  109. package/dist/types/components/ui/rich-text-editor.d.ts +21 -0
  110. package/dist/types/components/ui/select.d.ts +65 -0
  111. package/dist/types/components/ui/separator.d.ts +7 -0
  112. package/dist/types/components/ui/skeleton.d.ts +3 -0
  113. package/dist/types/components/ui/slider.d.ts +18 -0
  114. package/dist/types/components/ui/sortable-handle.d.ts +16 -0
  115. package/dist/types/components/ui/spinner.d.ts +7 -0
  116. package/dist/types/components/ui/stat-card.d.ts +20 -0
  117. package/dist/types/components/ui/switch.d.ts +15 -0
  118. package/dist/types/components/ui/table.d.ts +134 -0
  119. package/dist/types/components/ui/tabs.d.ts +25 -0
  120. package/dist/types/components/ui/textarea.d.ts +10 -0
  121. package/dist/types/components/ui/timeline.d.ts +18 -0
  122. package/dist/types/components/ui/toast.d.ts +18 -0
  123. package/dist/types/components/ui/tooltip.d.ts +17 -0
  124. package/dist/types/components/ui/upload.d.ts +50 -0
  125. package/dist/types/components/ui/widget-grid.d.ts +22 -0
  126. package/dist/types/components/ui/wizard.d.ts +38 -0
  127. package/dist/types/document-viewer.d.ts +1 -0
  128. package/dist/types/hooks/use-breakpoint.d.ts +21 -0
  129. package/dist/types/hooks/use-debounced-value.d.ts +5 -0
  130. package/dist/types/hooks/use-fill-height.d.ts +6 -0
  131. package/dist/types/hooks/use-lookup.d.ts +30 -0
  132. package/dist/types/hooks/use-reduced-motion.d.ts +1 -0
  133. package/dist/types/index.d.ts +76 -0
  134. package/dist/types/lib/cn.d.ts +2 -0
  135. package/dist/types/lib/contrast.d.ts +2 -0
  136. package/dist/types/lib/control.d.ts +20 -0
  137. package/dist/types/lib/lookup.d.ts +22 -0
  138. package/dist/types/lib/masks.d.ts +46 -0
  139. package/dist/types/lib/qr-encode.d.ts +48 -0
  140. package/dist/types/lib/shape.d.ts +8 -0
  141. package/dist/types/lib/sortable.d.ts +72 -0
  142. package/dist/types/lib/validators.d.ts +14 -0
  143. package/dist/types/rendra-router-bridge.d.ts +1 -0
  144. package/dist/types/rich-text-editor.d.ts +1 -0
  145. package/dist/types/widget-grid.d.ts +1 -0
  146. package/dist/use-breakpoint-BmXOZtF9.js +49 -0
  147. package/dist/use-breakpoint-BmXOZtF9.js.map +1 -0
  148. package/dist/widget-grid.js +118 -0
  149. package/dist/widget-grid.js.map +1 -0
  150. package/package.json +182 -0
@@ -0,0 +1,48 @@
1
+ import { type ReactNode } from 'react';
2
+ import type { ShellLayout } from './layout';
3
+ import type { NavigationTarget } from './navigation-utils';
4
+ import type { NavGroup, NavItem, ShellMenuItem, ShellNotificationsConfig, ShellUser } from './types';
5
+ export interface ShellContextValue {
6
+ /** Layout efetivo: padrão interno + prop `layout` do AppShell + escolha do usuário. */
7
+ layout: ShellLayout;
8
+ /** Altera uma opção de layout (guardada no navegador do usuário). */
9
+ setLayout: <K extends keyof ShellLayout>(key: K, value: ShellLayout[K]) => void;
10
+ /** Altera várias opções de uma vez (ex.: um código de menu M1 a M6). */
11
+ applyLayout: (partial: Partial<ShellLayout>) => void;
12
+ /** Volta ao layout padrão do projeto. */
13
+ resetLayout: () => void;
14
+ /** Gaveta de navegação aberta no mobile. */
15
+ mobileNavOpen: boolean;
16
+ setMobileNavOpen: (open: boolean) => void;
17
+ /**
18
+ * Espaço do rodapé fixo da página, entre o conteúdo e a barra inferior. A ActionBar
19
+ * sticky é desenhada aqui: fica sempre colada embaixo, na largura inteira.
20
+ */
21
+ footerSlot: HTMLElement | null;
22
+ /** Texto orientativo da tela (PageHeader help): o header mostra o ícone ao lado do título. */
23
+ pageHelp: ReactNode;
24
+ setPageHelp: (help: ReactNode) => void;
25
+ /** Busca global (Ctrl+K). */
26
+ searchOpen: boolean;
27
+ setSearchOpen: (open: boolean) => void;
28
+ /** Menu do sistema, recebido pela prop `navigation` do AppShell (obrigatória). */
29
+ navigation: NavGroup[];
30
+ /** Até 4 itens marcados `bottomNav`, calculados a partir de `navigation`. */
31
+ bottomNavItems: NavItem[];
32
+ /** Lista plana de destinos: busca global e cálculo do item ativo. */
33
+ navigationTargets: NavigationTarget[];
34
+ /** Usuário exibido no menu do avatar e no rodapé da sidebar. */
35
+ user: ShellUser;
36
+ /** Itens do menu do avatar (ex.: "Meu perfil", "Configurações"). */
37
+ userMenuItems: ShellMenuItem[];
38
+ /** Chamado ao selecionar "Sair". Sem ele, o botão não faz nada. */
39
+ onLogout?: () => void;
40
+ /** Rótulo do destino inicial na trilha do header. */
41
+ homeLabel: string;
42
+ /** Ações rápidas da busca global (ex.: "Novo cliente"). */
43
+ quickActions: ShellMenuItem[];
44
+ /** Notificações do sino do header. Sem esta prop, o sino não aparece. */
45
+ notifications?: ShellNotificationsConfig;
46
+ }
47
+ export declare const ShellContext: import("react").Context<ShellContextValue | null>;
48
+ export declare function useShell(): ShellContextValue;
@@ -0,0 +1 @@
1
+ export declare function Sidebar(): import("react").JSX.Element;
@@ -0,0 +1,53 @@
1
+ import type { LucideIcon } from 'lucide-react';
2
+ import type { FeedbackType } from '../../brand/types';
3
+ export interface NavItem {
4
+ title: string;
5
+ /** Rota. Item com children e sem rota só abre o submenu. */
6
+ to?: string;
7
+ icon: LucideIcon;
8
+ /** Contador exibido à direita (ex.: pendências). */
9
+ badge?: number;
10
+ /** Aparece na barra de navegação inferior do mobile (no máximo 4 itens no total). */
11
+ bottomNav?: boolean;
12
+ /** Rótulo curto para a barra inferior, quando o título não cabe. */
13
+ shortTitle?: string;
14
+ /** Frase curta exibida no mega menu. */
15
+ description?: string;
16
+ children?: NavChild[];
17
+ }
18
+ export interface NavChild {
19
+ title: string;
20
+ to: string;
21
+ description?: string;
22
+ }
23
+ export interface NavGroup {
24
+ title: string;
25
+ /** Frase curta da seção, exibida no mega menu. */
26
+ description?: string;
27
+ items: NavItem[];
28
+ }
29
+ /** Usuário exibido no menu do avatar e no rodapé da sidebar. */
30
+ export interface ShellUser {
31
+ name: string;
32
+ email?: string;
33
+ avatarUrl?: string;
34
+ }
35
+ /** Item do menu do usuário ou de ação rápida na busca global. */
36
+ export interface ShellMenuItem {
37
+ label: string;
38
+ to?: string;
39
+ onSelect?: () => void;
40
+ icon?: LucideIcon;
41
+ }
42
+ export interface ShellNotificationItem {
43
+ id: string;
44
+ type: FeedbackType;
45
+ title: string;
46
+ time: string;
47
+ read: boolean;
48
+ }
49
+ export interface ShellNotificationsConfig {
50
+ items: ShellNotificationItem[];
51
+ onMarkAllRead?: () => void;
52
+ onItemClick?: (id: string) => void;
53
+ }
@@ -0,0 +1,4 @@
1
+ export { Container, Grid, Inline, Section, Stack } from './primitives';
2
+ export type { ContainerProps, GridProps, InlineProps, SectionProps, StackProps } from './primitives';
3
+ export { PageHeader } from './page-header';
4
+ export type { PageHeaderProps } from './page-header';
@@ -0,0 +1,38 @@
1
+ import { type ReactNode } from 'react';
2
+ import { type BreadcrumbItem } from '../ui/breadcrumb';
3
+ export interface PageHeaderProps {
4
+ /** Título da página. Dentro do AppShell ele já aparece no header, então aqui fica oculto. */
5
+ title: ReactNode;
6
+ /**
7
+ * Mostra o título no corpo da página. Use só quando o título do corpo for diferente
8
+ * do header (ex.: no detalhe, o nome do cliente em vez de "Detalhe do cliente"),
9
+ * ou em telas fora do AppShell.
10
+ */
11
+ showTitle?: boolean;
12
+ /**
13
+ * Dado curto sobre o conteúdo (status, segmento, cidade). Nunca instrução de uso: texto
14
+ * orientativo vai em `help`.
15
+ */
16
+ description?: ReactNode;
17
+ /**
18
+ * Texto orientativo da tela (como usar, o que cada parte faz). Vira um ícone de informação
19
+ * ao lado do título, no header fixo, que abre um modal. Nunca um parágrafo no corpo.
20
+ */
21
+ help?: ReactNode;
22
+ /** Trilha própria. Dentro do AppShell a trilha já aparece no header, abaixo do título. */
23
+ breadcrumb?: BreadcrumbItem[];
24
+ /**
25
+ * Ação principal (e no máximo uma secundária). No mobile ficam abaixo da descrição,
26
+ * dividindo a largura; no desktop ficam à direita, com largura automática.
27
+ */
28
+ actions?: ReactNode;
29
+ /** Conteúdo abaixo, como abas ou metadados. */
30
+ children?: ReactNode;
31
+ className?: string;
32
+ }
33
+ /**
34
+ * Cabeçalho de conteúdo: descrição e ações da tela, logo abaixo do header.
35
+ * O título fica no header (com a trilha); aqui ele só é lido por leitores de tela,
36
+ * para que cada página tenha um único título principal (h1).
37
+ */
38
+ export declare function PageHeader({ title, showTitle, description, help, breadcrumb, actions, children, className, }: PageHeaderProps): import("react").JSX.Element;
@@ -0,0 +1,71 @@
1
+ import type { ElementType, HTMLAttributes, ReactNode } from 'react';
2
+ import { type Align, type Justify, type Space } from './tokens';
3
+ interface BaseProps extends HTMLAttributes<HTMLElement> {
4
+ as?: ElementType;
5
+ asChild?: boolean;
6
+ }
7
+ declare const containerSize: {
8
+ readonly narrow: "max-w-3xl";
9
+ readonly default: "max-w-none";
10
+ readonly full: "max-w-none";
11
+ };
12
+ export interface ContainerProps extends BaseProps {
13
+ /** narrow: leitura e formulários; default: telas de sistema; full: sem limite. */
14
+ size?: keyof typeof containerSize;
15
+ /** Respiro vertical de página (topo e base). Use no contêiner raiz de cada tela. */
16
+ padded?: boolean;
17
+ }
18
+ /** Largura máxima e padding lateral de página: 16px no mobile, 24px no tablet, 32px no desktop. */
19
+ export declare function Container({ size, padded, className, ...props }: ContainerProps): import("react").JSX.Element;
20
+ export interface StackProps extends BaseProps {
21
+ gap?: Space;
22
+ align?: Align;
23
+ }
24
+ /** Empilha na vertical. gap="section" para separar seções de página. */
25
+ export declare function Stack({ gap, align, className, ...props }: StackProps): import("react").JSX.Element;
26
+ export interface InlineProps extends BaseProps {
27
+ gap?: Space;
28
+ align?: Align;
29
+ justify?: Justify;
30
+ /** Quebra linha quando falta espaço (padrão). Com false, os filhos precisam poder encolher. */
31
+ wrap?: boolean;
32
+ /** Empilha no mobile e alinha em linha a partir de sm. */
33
+ stackOnMobile?: boolean;
34
+ }
35
+ /** Alinha na horizontal, quebrando linha por padrão para nunca estourar a largura. */
36
+ export declare function Inline({ gap, align, justify, wrap, stackOnMobile, className, ...props }: InlineProps): import("react").JSX.Element;
37
+ type Cols = 1 | 2 | 3 | 4 | 6;
38
+ export interface GridProps extends BaseProps {
39
+ /** Colunas por faixa. O padrão no mobile é sempre 1. */
40
+ cols?: {
41
+ base?: Cols;
42
+ sm?: Cols;
43
+ md?: Cols;
44
+ lg?: Cols;
45
+ xl?: Cols;
46
+ };
47
+ gap?: Space;
48
+ /**
49
+ * 'container' faz as colunas reagirem à largura do próprio bloco (@container),
50
+ * útil dentro de drawers, cards laterais e colunas estreitas.
51
+ */
52
+ responsive?: 'screen' | 'container';
53
+ /**
54
+ * Grade de formulário: 12 colunas pela largura do bloco, com a largura de cada Field no
55
+ * span (padrão 3 por linha). Ignora cols e responsive; o gap padrão vira "fields".
56
+ */
57
+ form?: boolean;
58
+ }
59
+ export declare function Grid({ cols, gap, responsive, form, className, children, ...props }: GridProps): import("react").JSX.Element;
60
+ export interface SectionProps extends Omit<BaseProps, 'title'> {
61
+ title?: ReactNode;
62
+ description?: ReactNode;
63
+ /** Ações do cabeçalho da seção, à direita no desktop e abaixo do título no mobile. */
64
+ actions?: ReactNode;
65
+ /** Nível do título. Padrão h2. */
66
+ level?: 2 | 3;
67
+ gap?: Space;
68
+ }
69
+ /** Seção de página com título, descrição e ações. Espaço interno padrão de 16px. */
70
+ export declare function Section({ title, description, actions, level, gap, className, children, id, ...props }: SectionProps): import("react").JSX.Element;
71
+ export {};
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Mapas de classes das primitivas de layout. Classes completas e estáticas,
3
+ * para o Tailwind encontrá-las. Só os degraus da escala permitida.
4
+ */
5
+ export type Space = '0' | '1' | '2' | '3' | '4' | '6' | '8' | '12' | '16' | '24' | 'section' | 'fields';
6
+ export declare const gapClass: Record<Space, string>;
7
+ /**
8
+ * Grade de formulário, pela largura do próprio bloco (container query), não da tela:
9
+ * 1 coluna estreito, 6 colunas a partir de 28rem, 12 colunas a partir de 48rem.
10
+ * No largo, o padrão é 3 campos por linha (md = 4/12). Nunca 2 por linha por padrão.
11
+ */
12
+ export declare const fieldGridClass = "grid grid-cols-1 @md:grid-cols-6 @3xl:grid-cols-12";
13
+ /** Largura do Field na grade de formulário (no largo, em 12 colunas). */
14
+ export declare const fieldSpanClass: {
15
+ /** 2/12, cerca de 17%: UF, número, DDD. */
16
+ readonly xs: "@md:col-span-2 @3xl:col-span-2";
17
+ /** 3/12 = 25%: CEP, CNPJ, CPF, datas curtas. */
18
+ readonly sm: "@md:col-span-2 @3xl:col-span-3";
19
+ /** 4/12 = 33%: o padrão, 3 campos por linha. */
20
+ readonly md: "@md:col-span-3 @3xl:col-span-4";
21
+ /** 6/12 = 50%. */
22
+ readonly lg: "@md:col-span-3 @3xl:col-span-6";
23
+ /** 8/12 = 67%: nome, logradouro longo. */
24
+ readonly xl: "@md:col-span-6 @3xl:col-span-8";
25
+ /** Linha inteira. */
26
+ readonly full: "@md:col-span-6 @3xl:col-span-12";
27
+ };
28
+ export type FieldSpan = keyof typeof fieldSpanClass;
29
+ export declare const alignClass: {
30
+ readonly start: "items-start";
31
+ readonly center: "items-center";
32
+ readonly end: "items-end";
33
+ readonly stretch: "items-stretch";
34
+ readonly baseline: "items-baseline";
35
+ };
36
+ export declare const justifyClass: {
37
+ readonly start: "justify-start";
38
+ readonly center: "justify-center";
39
+ readonly end: "justify-end";
40
+ readonly between: "justify-between";
41
+ };
42
+ export type Align = keyof typeof alignClass;
43
+ export type Justify = keyof typeof justifyClass;
@@ -0,0 +1,48 @@
1
+ import { type ComponentType, type ReactNode } from 'react';
2
+ /**
3
+ * Link com a mesma interface do `<a>`/`Link`: recebe `to`, `className`, `children`,
4
+ * `aria-*`, `onClick` e repassa o resto.
5
+ */
6
+ export interface RendraLinkProps {
7
+ to: string;
8
+ className?: string;
9
+ children?: ReactNode;
10
+ [key: string]: unknown;
11
+ }
12
+ export interface RendraBreadcrumbItem {
13
+ label: string;
14
+ to?: string;
15
+ }
16
+ export interface RendraNavigateOptions {
17
+ replace?: boolean;
18
+ }
19
+ export interface RendraProviderProps {
20
+ children: ReactNode;
21
+ /** Componente de link do roteador do host (ex.: `Link` do react-router). */
22
+ linkComponent: ComponentType<RendraLinkProps>;
23
+ /** Devolve o caminho atual (ex.: `useLocation().pathname`). */
24
+ useCurrentPath: () => string;
25
+ /** Navega para um caminho, com `replace` opcional. */
26
+ navigate: (to: string, options?: RendraNavigateOptions) => void;
27
+ /** Volta à tela anterior. */
28
+ goBack: () => void;
29
+ /** Trilha da rota atual (ex.: via `useMatches` e `handle.crumb`). Opcional. */
30
+ useBreadcrumbs?: () => RendraBreadcrumbItem[];
31
+ }
32
+ /**
33
+ * Única peça que sabe como navegar (`react-router`, outro roteador, ou nenhum).
34
+ * Sem `RendraProvider` na árvore, os hooks abaixo caem para um comportamento simples,
35
+ * baseado só em `window.location`/`history`, e os componentes continuam funcionando.
36
+ */
37
+ export declare function RendraProvider({ children, linkComponent, useCurrentPath: useCurrentPathProp, navigate, goBack, useBreadcrumbs, }: RendraProviderProps): import("react").JSX.Element;
38
+ /** Componente de link do provider ativo (ou `<a href>`, sem provider). */
39
+ export declare function useRendraLink(): ComponentType<RendraLinkProps>;
40
+ /** Caminho atual (ex.: `/clientes/novo`), do provider ativo ou de `window.location`. */
41
+ export declare function useCurrentPath(): string;
42
+ /** Navegar e voltar, do provider ativo ou de `window.location`/`history`. */
43
+ export declare function useRendraNavigate(): {
44
+ navigate: (to: string, options?: RendraNavigateOptions) => void;
45
+ goBack: () => void;
46
+ };
47
+ /** Trilha da rota atual, do provider ativo ou vazia, sem roteador. */
48
+ export declare function useRendraBreadcrumbs(): RendraBreadcrumbItem[];
@@ -0,0 +1,18 @@
1
+ import { type ReactNode } from 'react';
2
+ /**
3
+ * Metadados de rota lidos pela trilha: handle: { crumb: 'Clientes' }. Convenção do
4
+ * react-router (`handle`), que não existe em outros roteadores; por isso fica aqui, na
5
+ * ponte, e não em src/components/app-shell/header.tsx.
6
+ */
7
+ export interface RouteHandle {
8
+ crumb?: string | ((params: Record<string, string | undefined>) => string);
9
+ }
10
+ /**
11
+ * Liga o `RendraProvider` ao `react-router` do boilerplate: link, caminho atual, navegar
12
+ * e a trilha. É o único lugar do app que sabe que o roteador é o `react-router`; os
13
+ * componentes de `src/components/ui` e o `AppShell` não importam `react-router` diretamente.
14
+ * Sem `children`, renderiza `<Outlet />`, para ser usado como elemento raiz das rotas.
15
+ */
16
+ export declare function RendraRouterBridge({ children }?: {
17
+ children?: ReactNode;
18
+ }): import("react").JSX.Element;
@@ -0,0 +1,16 @@
1
+ import type { ReactNode } from 'react';
2
+ export interface AccordionItem {
3
+ value: string;
4
+ title: ReactNode;
5
+ content: ReactNode;
6
+ disabled?: boolean;
7
+ }
8
+ export interface AccordionProps {
9
+ items: AccordionItem[];
10
+ /** Permite abrir vários ao mesmo tempo. */
11
+ multiple?: boolean;
12
+ defaultValue?: string[];
13
+ className?: string;
14
+ }
15
+ /** Accordion único, com animação de altura e área de toque de 44px no mobile. */
16
+ export declare function Accordion({ items, multiple, defaultValue, className }: AccordionProps): import("react").JSX.Element;
@@ -0,0 +1,35 @@
1
+ import { type ReactNode } from 'react';
2
+ export interface ActionBarAction {
3
+ label: string;
4
+ onClick?: () => void;
5
+ icon?: ReactNode;
6
+ disabled?: boolean;
7
+ destructive?: boolean;
8
+ }
9
+ export interface ActionBarProps {
10
+ /** Ação principal: sempre primária (ou destrutiva), 70% da largura. */
11
+ primary: ActionBarAction & {
12
+ type?: 'button' | 'submit';
13
+ form?: string;
14
+ loading?: boolean;
15
+ loadingLabel?: string;
16
+ };
17
+ /** Cancelar: sempre outline, 30% à esquerda. Sem ele, a principal ocupa 100%. */
18
+ cancel?: ActionBarAction;
19
+ /** A partir da terceira ação: vão para o menu de três pontinhos. */
20
+ secondary?: ActionBarAction[];
21
+ /**
22
+ * sticky: rodapé fixo das telas de formulário. Fica sempre colado embaixo, na largura
23
+ * inteira, fora da área rolável (nunca sobe, mesmo com formulário curto). Em drawer e
24
+ * modal o rodapé já é fixo; no wizard os botões seguem junto do card. Como o botão fica
25
+ * fora do <form>, use primary.form com o id do formulário para enviar.
26
+ */
27
+ sticky?: boolean;
28
+ className?: string;
29
+ }
30
+ /**
31
+ * Barra de ações única, com a regra de botões do sistema:
32
+ * 1 botão = 100%; 2 botões = cancelar 30% + principal 70%; 3 ou mais = extras no menu.
33
+ * Vale para drawer, modal e formulário em página, em qualquer tamanho de tela.
34
+ */
35
+ export declare function ActionBar({ primary, cancel, secondary, sticky, className }: ActionBarProps): import("react").JSX.Element;
@@ -0,0 +1,26 @@
1
+ import { type VariantProps } from 'class-variance-authority';
2
+ import type { ReactNode } from 'react';
3
+ import type { FeedbackType } from '../../brand/types';
4
+ /**
5
+ * Alert único do sistema: ícone da marca à esquerda, título em destaque e descrição.
6
+ * O tipo é prop; o formato vem do template ativo (quadrado, meio-termo ou arredondado).
7
+ */
8
+ declare const alertVariants: (props?: ({
9
+ type?: "success" | "error" | "warning" | "info" | null | undefined;
10
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
11
+ export interface AlertProps extends VariantProps<typeof alertVariants> {
12
+ type: FeedbackType;
13
+ /** Título curto, em negrito. */
14
+ title: ReactNode;
15
+ /** Texto de apoio abaixo do título. */
16
+ description?: ReactNode;
17
+ /** Ação opcional à direita (ex.: botão "Desfazer"). */
18
+ action?: ReactNode;
19
+ /** Mostra botão de fechar. */
20
+ onDismiss?: () => void;
21
+ /** Anima o ícone na entrada (check se formando, X se riscando). */
22
+ animated?: boolean;
23
+ className?: string;
24
+ }
25
+ export declare function Alert({ type, title, description, action, onDismiss, animated, className, }: AlertProps): import("react").JSX.Element;
26
+ export {};
@@ -0,0 +1,23 @@
1
+ import { type VariantProps } from 'class-variance-authority';
2
+ declare const avatarVariants: (props?: ({
3
+ size?: "sm" | "lg" | "md" | null | undefined;
4
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
5
+ export interface AvatarProps extends VariantProps<typeof avatarVariants> {
6
+ name: string;
7
+ src?: string;
8
+ className?: string;
9
+ }
10
+ export declare function Avatar({ name, src, size, className }: AvatarProps): import("react").JSX.Element;
11
+ export interface AvatarGroupProps {
12
+ people: {
13
+ name: string;
14
+ src?: string;
15
+ }[];
16
+ /** Máximo visível antes de "+N". */
17
+ max?: number;
18
+ size?: AvatarProps['size'];
19
+ className?: string;
20
+ }
21
+ /** Avatares sobrepostos, com contador do excedente. */
22
+ export declare function AvatarGroup({ people, max, size, className }: AvatarGroupProps): import("react").JSX.Element;
23
+ export {};
@@ -0,0 +1,15 @@
1
+ import { type VariantProps } from 'class-variance-authority';
2
+ import type { HTMLAttributes, ReactNode } from 'react';
3
+ declare const badgeVariants: (props?: ({
4
+ tone?: "success" | "error" | "warning" | "info" | "primary" | "outline" | "neutral" | null | undefined;
5
+ solid?: boolean | null | undefined;
6
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
7
+ export interface BadgeProps extends HTMLAttributes<HTMLSpanElement>, VariantProps<typeof badgeVariants> {
8
+ /** Ícone antes do texto (fica fora do corte com reticências). */
9
+ icon?: ReactNode;
10
+ /** Bolinha de status à esquerda. */
11
+ dot?: boolean;
12
+ }
13
+ /** Badge único: tom semântico, suave ou sólido, com bolinha opcional. */
14
+ export declare function Badge({ tone, solid, dot, icon, className, children, ...props }: BadgeProps): import("react").JSX.Element;
15
+ export {};
@@ -0,0 +1,26 @@
1
+ import { type VariantProps } from 'class-variance-authority';
2
+ import type { FeedbackType } from '../../brand/types';
3
+ declare const iconVariants: (props?: ({
4
+ type?: "success" | "error" | "warning" | "info" | null | undefined;
5
+ size?: "sm" | "lg" | "xl" | "2xl" | "md" | null | undefined;
6
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
7
+ export declare const feedbackLabels: Record<FeedbackType, string>;
8
+ export interface BrandFeedbackIconProps extends Omit<VariantProps<typeof iconVariants>, 'type'> {
9
+ type: FeedbackType;
10
+ /** Texto para leitores de tela. Sem ele o ícone é decorativo (o texto ao lado informa). */
11
+ label?: string;
12
+ /**
13
+ * Anima a entrada: o símbolo entra com mola e o glifo se desenha (check se formando,
14
+ * X se riscando). O erro treme ao final. Respeita reduzir movimento.
15
+ * Troque a key do componente para repetir a animação.
16
+ */
17
+ animated?: boolean;
18
+ className?: string;
19
+ }
20
+ /**
21
+ * Ícone de feedback da marca: o símbolo da marca em currentColor, tingido pela cor
22
+ * semântica, com um selo de status para que o significado não dependa só da cor.
23
+ * Cada tipo pode ser substituído por um SVG próprio em brand.config.ts (feedbackIcons).
24
+ */
25
+ export declare function BrandFeedbackIcon({ type, size, label, animated, className, }: BrandFeedbackIconProps): import("react").JSX.Element;
26
+ export {};
@@ -0,0 +1,8 @@
1
+ export interface BrandLogoProps {
2
+ on?: 'sidebar' | 'surface' | 'brand';
3
+ /** Só o selo com o símbolo (sidebar recolhida, favicon). */
4
+ symbolOnly?: boolean;
5
+ size?: 'sm' | 'md';
6
+ className?: string;
7
+ }
8
+ export declare function BrandLogo({ on, symbolOnly, size, className }: BrandLogoProps): import("react").JSX.Element;
@@ -0,0 +1,19 @@
1
+ export interface BreadcrumbItem {
2
+ label: string;
3
+ to?: string;
4
+ }
5
+ interface BreadcrumbProps {
6
+ items: BreadcrumbItem[];
7
+ /**
8
+ * responsive: trilha no desktop e botão voltar no mobile (padrão, dentro das páginas).
9
+ * trail: sempre a trilha, em texto pequeno (usado no header, abaixo do título).
10
+ */
11
+ variant?: 'responsive' | 'trail';
12
+ className?: string;
13
+ }
14
+ /**
15
+ * Breadcrumb único. No desktop mostra a trilha completa. No mobile vira botão
16
+ * voltar para o nível anterior com o nome da tela atual (mesmo componente, mesma API).
17
+ */
18
+ export declare function Breadcrumb({ items, variant, className }: BreadcrumbProps): import("react").JSX.Element | null;
19
+ export {};
@@ -0,0 +1,27 @@
1
+ import type { ReactNode } from 'react';
2
+ interface ButtonGroupProps {
3
+ /** Botões encostados, com borda compartilhada. */
4
+ children?: ReactNode;
5
+ /**
6
+ * Modo seleção (segmentado): passe options, value e onChange.
7
+ * Se as opções não couberem, o grupo quebra linha em vez de rolar.
8
+ */
9
+ options?: {
10
+ value: string;
11
+ label: ReactNode;
12
+ icon?: ReactNode;
13
+ disabled?: boolean;
14
+ }[];
15
+ value?: string;
16
+ onChange?: (value: string) => void;
17
+ size?: 'sm' | 'md';
18
+ fullWidth?: boolean;
19
+ 'aria-label'?: string;
20
+ className?: string;
21
+ }
22
+ /**
23
+ * ButtonGroup único: agrupa botões de ação (children) ou funciona como controle
24
+ * segmentado de escolha única (options + value).
25
+ */
26
+ export declare function ButtonGroup({ children, options, value, onChange, size, fullWidth, className, ...aria }: ButtonGroupProps): import("react").JSX.Element;
27
+ export {};
@@ -0,0 +1,30 @@
1
+ import { type VariantProps } from 'class-variance-authority';
2
+ import { type ButtonHTMLAttributes, type ReactNode } from 'react';
3
+ /**
4
+ * Botão único do sistema. Variantes, tamanho, ícone, só ícone, carregamento e
5
+ * largura total são props: nunca crie outro arquivo de botão.
6
+ * Altura vem de h-control-*: 44px ou mais no mobile, compacta a partir de md.
7
+ */
8
+ export declare const buttonVariants: (props?: ({
9
+ variant?: "link" | "primary" | "secondary" | "outline" | "ghost" | "destructive" | null | undefined;
10
+ size?: "sm" | "lg" | "md" | null | undefined;
11
+ iconOnly?: boolean | null | undefined;
12
+ fullWidth?: boolean | null | undefined;
13
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
14
+ type Variants = VariantProps<typeof buttonVariants>;
15
+ export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement>, Omit<Variants, 'iconOnly' | 'fullWidth'> {
16
+ /** Ícone à esquerda do texto (ou o próprio conteúdo, com iconOnly). */
17
+ icon?: ReactNode;
18
+ /** Ícone à direita do texto. */
19
+ iconRight?: ReactNode;
20
+ /** Botão só com ícone: quadrado, e aria-label passa a ser obrigatório. */
21
+ iconOnly?: boolean;
22
+ /** Mostra indicador, bloqueia cliques e marca aria-busy. */
23
+ loading?: boolean;
24
+ /** Ocupa toda a largura do contêiner. */
25
+ fullWidth?: boolean;
26
+ /** Renderiza o filho (ex.: <Link>) com a aparência de botão. */
27
+ asChild?: boolean;
28
+ }
29
+ export declare const Button: import("react").ForwardRefExoticComponent<ButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
30
+ export {};
@@ -0,0 +1,34 @@
1
+ export type CalendarView = 'month' | 'week' | 'day' | 'agenda';
2
+ export type CalendarTone = 'primary' | 'success' | 'warning' | 'error' | 'info' | 'neutral';
3
+ export interface CalendarEvent {
4
+ id: string;
5
+ title: string;
6
+ start: Date;
7
+ /** Fim. Sem valor, o evento dura 1 hora. */
8
+ end?: Date;
9
+ /** Dia inteiro: aparece no topo do dia, sem horário. */
10
+ allDay?: boolean;
11
+ tone?: CalendarTone;
12
+ description?: string;
13
+ location?: string;
14
+ }
15
+ export interface CalendarProps {
16
+ events: CalendarEvent[];
17
+ view?: CalendarView;
18
+ defaultView?: CalendarView;
19
+ onViewChange?: (view: CalendarView) => void;
20
+ /** Visões oferecidas no seletor. Padrão: todas. */
21
+ views?: CalendarView[];
22
+ /** Data em foco (mês, semana ou dia mostrado). */
23
+ date?: Date;
24
+ defaultDate?: Date;
25
+ onDateChange?: (date: Date) => void;
26
+ onEventClick?: (event: CalendarEvent) => void;
27
+ /** Clique em um dia ou horário vazio (ex.: abrir o cadastro de evento já com a data). */
28
+ onDateClick?: (date: Date) => void;
29
+ /** Faixa de horas da semana e do dia. Padrão: 7h às 21h. */
30
+ hours?: [number, number];
31
+ 'aria-label'?: string;
32
+ className?: string;
33
+ }
34
+ export declare function Calendar({ events, view: viewProp, defaultView, onViewChange, views, date: dateProp, defaultDate, onDateChange, onEventClick, onDateClick, hours, className, ...aria }: CalendarProps): import("react").JSX.Element;
@@ -0,0 +1,32 @@
1
+ import type { HTMLAttributes, ReactNode } from 'react';
2
+ /**
3
+ * Card: agrupa conteúdo de página. Borda de 1px, sem sombra pesada.
4
+ * Nunca aninhe Card dentro de Card: para hierarquia interna use Separator ou título de seção.
5
+ * Nunca coloque rolagem dentro de Card.
6
+ */
7
+ export interface CardProps extends HTMLAttributes<HTMLDivElement> {
8
+ /**
9
+ * Uso interno: quando outro componente catalogado (Calendar, FormSection, StatCard,
10
+ * Table) usa o Card como o próprio elemento raiz, ele passa o seu código aqui para que
11
+ * o data-rendra mostre a variante certa, não CARD-001. Sem essa prop, o Card se
12
+ * identifica como CARD-001, o próprio código dele no catálogo.
13
+ */
14
+ 'data-rendra'?: string;
15
+ }
16
+ export declare function Card({ className, 'data-rendra': dataRendra, ...props }: CardProps): import("react").JSX.Element;
17
+ export interface CardHeaderProps extends HTMLAttributes<HTMLDivElement> {
18
+ /**
19
+ * Ações do card, no canto do cabeçalho (ex.: Ligar, Restaurar padrão). É o lugar das ações
20
+ * de um card: nunca um botão solto no meio do conteúdo.
21
+ */
22
+ actions?: ReactNode;
23
+ }
24
+ export declare function CardHeader({ className, actions, children, ...props }: CardHeaderProps): import("react").JSX.Element;
25
+ export interface CardTitleProps extends HTMLAttributes<HTMLHeadingElement> {
26
+ /** Texto orientativo da seção: ícone de informação ao lado do título, que abre um modal. */
27
+ help?: ReactNode;
28
+ }
29
+ export declare function CardTitle({ className, children, help, ...props }: CardTitleProps): import("react").JSX.Element;
30
+ export declare function CardDescription({ className, ...props }: HTMLAttributes<HTMLParagraphElement>): import("react").JSX.Element;
31
+ export declare function CardContent({ className, ...props }: HTMLAttributes<HTMLDivElement>): import("react").JSX.Element;
32
+ export declare function CardFooter({ className, ...props }: HTMLAttributes<HTMLDivElement>): import("react").JSX.Element;