@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.
- package/LICENSE +21 -0
- package/README.md +433 -0
- package/bin/rendra.mjs +114 -0
- package/dist/base.css +246 -0
- package/dist/button-DIcpJwK9.js +143 -0
- package/dist/button-DIcpJwK9.js.map +1 -0
- package/dist/chart.js +520 -0
- package/dist/chart.js.map +1 -0
- package/dist/cli/auditar.js +125 -0
- package/dist/cli/auditar.js.map +1 -0
- package/dist/cli/codigos.js +15 -0
- package/dist/cli/codigos.js.map +1 -0
- package/dist/cli/help.js +17 -0
- package/dist/cli/help.js.map +1 -0
- package/dist/cli/trocar.js +242 -0
- package/dist/cli/trocar.js.map +1 -0
- package/dist/cli/typescript-loader.js +27 -0
- package/dist/cli/typescript-loader.js.map +1 -0
- package/dist/cn-DVPheE99.js +22 -0
- package/dist/cn-DVPheE99.js.map +1 -0
- package/dist/components-Cm2ezlPT.js +800 -0
- package/dist/components-Cm2ezlPT.js.map +1 -0
- package/dist/components.css +3365 -0
- package/dist/document-viewer.js +204 -0
- package/dist/document-viewer.js.map +1 -0
- package/dist/empty-state-DtyZAfYb.js +168 -0
- package/dist/empty-state-DtyZAfYb.js.map +1 -0
- package/dist/index.js +10530 -0
- package/dist/index.js.map +1 -0
- package/dist/rendra-provider-cCnquOZy.js +88 -0
- package/dist/rendra-provider-cCnquOZy.js.map +1 -0
- package/dist/rich-text-editor.js +439 -0
- package/dist/rich-text-editor.js.map +1 -0
- package/dist/router-bridge.js +51 -0
- package/dist/router-bridge.js.map +1 -0
- package/dist/tokens.css +732 -0
- package/dist/tooltip-DyeuGPCc.js +105 -0
- package/dist/tooltip-DyeuGPCc.js.map +1 -0
- package/dist/types/brand/apply-theme.d.ts +9 -0
- package/dist/types/brand/brand-context.d.ts +21 -0
- package/dist/types/brand/brand-provider.d.ts +49 -0
- package/dist/types/brand/palette.d.ts +63 -0
- package/dist/types/brand/public.d.ts +6 -0
- package/dist/types/brand/theme.d.ts +80 -0
- package/dist/types/brand/types.d.ts +54 -0
- package/dist/types/brand/use-brand.d.ts +1 -0
- package/dist/types/catalog/components.d.ts +81 -0
- package/dist/types/chart.d.ts +1 -0
- package/dist/types/components/app-shell/app-shell.d.ts +36 -0
- package/dist/types/components/app-shell/command-search.d.ts +1 -0
- package/dist/types/components/app-shell/header.d.ts +1 -0
- package/dist/types/components/app-shell/layout.d.ts +53 -0
- package/dist/types/components/app-shell/mega-menu.d.ts +1 -0
- package/dist/types/components/app-shell/navigation-utils.d.ts +18 -0
- package/dist/types/components/app-shell/notifications.d.ts +6 -0
- package/dist/types/components/app-shell/shell-context.d.ts +48 -0
- package/dist/types/components/app-shell/sidebar.d.ts +1 -0
- package/dist/types/components/app-shell/types.d.ts +53 -0
- package/dist/types/components/layout/index.d.ts +4 -0
- package/dist/types/components/layout/page-header.d.ts +38 -0
- package/dist/types/components/layout/primitives.d.ts +71 -0
- package/dist/types/components/layout/tokens.d.ts +43 -0
- package/dist/types/components/rendra-provider.d.ts +48 -0
- package/dist/types/components/rendra-router-bridge.d.ts +18 -0
- package/dist/types/components/ui/accordion.d.ts +16 -0
- package/dist/types/components/ui/action-bar.d.ts +35 -0
- package/dist/types/components/ui/alert.d.ts +26 -0
- package/dist/types/components/ui/avatar.d.ts +23 -0
- package/dist/types/components/ui/badge.d.ts +15 -0
- package/dist/types/components/ui/brand-feedback-icon.d.ts +26 -0
- package/dist/types/components/ui/brand-logo.d.ts +8 -0
- package/dist/types/components/ui/breadcrumb.d.ts +19 -0
- package/dist/types/components/ui/button-group.d.ts +27 -0
- package/dist/types/components/ui/button.d.ts +30 -0
- package/dist/types/components/ui/calendar.d.ts +34 -0
- package/dist/types/components/ui/card.d.ts +32 -0
- package/dist/types/components/ui/chart.d.ts +57 -0
- package/dist/types/components/ui/chat.d.ts +137 -0
- package/dist/types/components/ui/checkbox.d.ts +37 -0
- package/dist/types/components/ui/checklist.d.ts +16 -0
- package/dist/types/components/ui/color-picker.d.ts +13 -0
- package/dist/types/components/ui/data-toolbar.d.ts +37 -0
- package/dist/types/components/ui/date-picker.d.ts +41 -0
- package/dist/types/components/ui/document-viewer.d.ts +19 -0
- package/dist/types/components/ui/drawer.d.ts +30 -0
- package/dist/types/components/ui/dropdown-menu.d.ts +20 -0
- package/dist/types/components/ui/empty-state.d.ts +15 -0
- package/dist/types/components/ui/error-page.d.ts +13 -0
- package/dist/types/components/ui/field.d.ts +42 -0
- package/dist/types/components/ui/form.d.ts +42 -0
- package/dist/types/components/ui/image-cropper.d.ts +55 -0
- package/dist/types/components/ui/image-viewer.d.ts +14 -0
- package/dist/types/components/ui/info-hint.d.ts +9 -0
- package/dist/types/components/ui/input.d.ts +91 -0
- package/dist/types/components/ui/kanban.d.ts +98 -0
- package/dist/types/components/ui/list.d.ts +31 -0
- package/dist/types/components/ui/modal.d.ts +27 -0
- package/dist/types/components/ui/otp-input.d.ts +17 -0
- package/dist/types/components/ui/overlay-shell.d.ts +14 -0
- package/dist/types/components/ui/pagination.d.ts +18 -0
- package/dist/types/components/ui/picker-panel.d.ts +24 -0
- package/dist/types/components/ui/popover.d.ts +12 -0
- package/dist/types/components/ui/progress.d.ts +16 -0
- package/dist/types/components/ui/qr-code.d.ts +13 -0
- package/dist/types/components/ui/radio-group.d.ts +27 -0
- package/dist/types/components/ui/rating.d.ts +19 -0
- package/dist/types/components/ui/rendra-credit.d.ts +12 -0
- package/dist/types/components/ui/repeatable-field.d.ts +22 -0
- package/dist/types/components/ui/rich-text-editor.d.ts +21 -0
- package/dist/types/components/ui/select.d.ts +65 -0
- package/dist/types/components/ui/separator.d.ts +7 -0
- package/dist/types/components/ui/skeleton.d.ts +3 -0
- package/dist/types/components/ui/slider.d.ts +18 -0
- package/dist/types/components/ui/sortable-handle.d.ts +16 -0
- package/dist/types/components/ui/spinner.d.ts +7 -0
- package/dist/types/components/ui/stat-card.d.ts +20 -0
- package/dist/types/components/ui/switch.d.ts +15 -0
- package/dist/types/components/ui/table.d.ts +134 -0
- package/dist/types/components/ui/tabs.d.ts +25 -0
- package/dist/types/components/ui/textarea.d.ts +10 -0
- package/dist/types/components/ui/timeline.d.ts +18 -0
- package/dist/types/components/ui/toast.d.ts +18 -0
- package/dist/types/components/ui/tooltip.d.ts +17 -0
- package/dist/types/components/ui/upload.d.ts +50 -0
- package/dist/types/components/ui/widget-grid.d.ts +22 -0
- package/dist/types/components/ui/wizard.d.ts +38 -0
- package/dist/types/document-viewer.d.ts +1 -0
- package/dist/types/hooks/use-breakpoint.d.ts +21 -0
- package/dist/types/hooks/use-debounced-value.d.ts +5 -0
- package/dist/types/hooks/use-fill-height.d.ts +6 -0
- package/dist/types/hooks/use-lookup.d.ts +30 -0
- package/dist/types/hooks/use-reduced-motion.d.ts +1 -0
- package/dist/types/index.d.ts +76 -0
- package/dist/types/lib/cn.d.ts +2 -0
- package/dist/types/lib/contrast.d.ts +2 -0
- package/dist/types/lib/control.d.ts +20 -0
- package/dist/types/lib/lookup.d.ts +22 -0
- package/dist/types/lib/masks.d.ts +46 -0
- package/dist/types/lib/qr-encode.d.ts +48 -0
- package/dist/types/lib/shape.d.ts +8 -0
- package/dist/types/lib/sortable.d.ts +72 -0
- package/dist/types/lib/validators.d.ts +14 -0
- package/dist/types/rendra-router-bridge.d.ts +1 -0
- package/dist/types/rich-text-editor.d.ts +1 -0
- package/dist/types/widget-grid.d.ts +1 -0
- package/dist/use-breakpoint-BmXOZtF9.js +49 -0
- package/dist/use-breakpoint-BmXOZtF9.js.map +1 -0
- package/dist/widget-grid.js +118 -0
- package/dist/widget-grid.js.map +1 -0
- package/package.json +182 -0
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
export interface ChartSeries {
|
|
2
|
+
/** Chave no objeto de dados. */
|
|
3
|
+
key: string;
|
|
4
|
+
label: string;
|
|
5
|
+
/** Índice da cor do template (1 a 5). Padrão: na ordem das séries. */
|
|
6
|
+
color?: 1 | 2 | 3 | 4 | 5;
|
|
7
|
+
/** No type="combo": desenha a série como barra (padrão) ou linha. */
|
|
8
|
+
kind?: 'bar' | 'line';
|
|
9
|
+
}
|
|
10
|
+
interface BaseProps {
|
|
11
|
+
valueFormatter?: (n: number) => string;
|
|
12
|
+
/** Altura: sm (12rem), md (16rem) ou fill (a altura do contêiner, como num widget). */
|
|
13
|
+
height?: 'sm' | 'md' | 'fill';
|
|
14
|
+
'aria-label': string;
|
|
15
|
+
className?: string;
|
|
16
|
+
}
|
|
17
|
+
export interface CartesianChartProps extends BaseProps {
|
|
18
|
+
type: 'line' | 'bar' | 'area' | 'pie' | 'combo';
|
|
19
|
+
data: Record<string, string | number>[];
|
|
20
|
+
/** Chave da categoria (eixo X ou fatias da pizza). */
|
|
21
|
+
xKey: string;
|
|
22
|
+
series: ChartSeries[];
|
|
23
|
+
/** Barras empilhadas (bar e combo). */
|
|
24
|
+
stacked?: boolean;
|
|
25
|
+
/** Barra de uma série só com uma cor por categoria. */
|
|
26
|
+
colorByCategory?: boolean;
|
|
27
|
+
/** Acima deste número de pontos, o mobile oferece ver como lista. */
|
|
28
|
+
listThreshold?: number;
|
|
29
|
+
}
|
|
30
|
+
export interface GaugeZone {
|
|
31
|
+
/** Fim da faixa, de 0 a 1 do máximo. */
|
|
32
|
+
to: number;
|
|
33
|
+
tone: 'error' | 'warning' | 'success' | 'primary' | 'neutral';
|
|
34
|
+
}
|
|
35
|
+
export interface GaugeChartProps extends BaseProps {
|
|
36
|
+
type: 'gauge';
|
|
37
|
+
value: number;
|
|
38
|
+
max: number;
|
|
39
|
+
min?: number;
|
|
40
|
+
/** Meta: marcada no arco e usada no percentual atingido. */
|
|
41
|
+
target?: number;
|
|
42
|
+
/** Faixas de cor do arco. Padrão: vermelho até 60%, amarelo até 90%, verde até o fim. */
|
|
43
|
+
zones?: GaugeZone[];
|
|
44
|
+
/** Texto abaixo do valor (ex.: "Receita do mês"). */
|
|
45
|
+
label?: string;
|
|
46
|
+
}
|
|
47
|
+
export interface FunnelStage {
|
|
48
|
+
label: string;
|
|
49
|
+
value: number;
|
|
50
|
+
}
|
|
51
|
+
export interface FunnelChartProps extends BaseProps {
|
|
52
|
+
type: 'funnel';
|
|
53
|
+
stages: FunnelStage[];
|
|
54
|
+
}
|
|
55
|
+
export type ChartProps = CartesianChartProps | GaugeChartProps | FunnelChartProps;
|
|
56
|
+
export declare function Chart(props: ChartProps): import("react").JSX.Element;
|
|
57
|
+
export {};
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { type LucideIcon } from 'lucide-react';
|
|
2
|
+
import { type ReactNode } from 'react';
|
|
3
|
+
import { type BadgeProps } from './badge';
|
|
4
|
+
export type ChatChannel = 'whatsapp' | 'whatsapp-web' | 'instagram' | 'facebook' | 'tiktok' | 'google' | 'reclameaqui' | 'site' | 'email' | 'sms';
|
|
5
|
+
export declare const chatChannels: Record<ChatChannel, {
|
|
6
|
+
label: string;
|
|
7
|
+
icon: LucideIcon;
|
|
8
|
+
/** Logotipo do canal (imagem redonda); sem ele, vale o ícone. */
|
|
9
|
+
logo?: string;
|
|
10
|
+
tone: NonNullable<BadgeProps['tone']>;
|
|
11
|
+
}>;
|
|
12
|
+
export declare function ChannelBadge({ channel }: {
|
|
13
|
+
channel: ChatChannel;
|
|
14
|
+
}): import("react").JSX.Element;
|
|
15
|
+
export interface ChatAttachment {
|
|
16
|
+
name: string;
|
|
17
|
+
/** Endereço do arquivo (ou blob: local, para prévia antes de enviar). */
|
|
18
|
+
url?: string;
|
|
19
|
+
type?: string;
|
|
20
|
+
size?: number;
|
|
21
|
+
/** Duração em segundos (áudio e vídeo). */
|
|
22
|
+
duration?: number;
|
|
23
|
+
}
|
|
24
|
+
export interface ChatMessage {
|
|
25
|
+
id: string;
|
|
26
|
+
/** Foto de quem enviou (cliente ou atendente). */
|
|
27
|
+
avatar?: string;
|
|
28
|
+
/** Quem enviou: o cliente, o atendente, o robô (URA/IA) ou um aviso do sistema. */
|
|
29
|
+
from: 'contact' | 'agent' | 'bot' | 'system';
|
|
30
|
+
text?: string;
|
|
31
|
+
time: Date;
|
|
32
|
+
/** Nome de quem enviou (atendente ou robô). */
|
|
33
|
+
author?: string;
|
|
34
|
+
/** Resposta a outra mensagem: mostra a citação acima do texto. */
|
|
35
|
+
/** Mensagem citada. Com o id, clicar na citação leva até a original. */
|
|
36
|
+
replyTo?: {
|
|
37
|
+
id?: string;
|
|
38
|
+
author?: string;
|
|
39
|
+
text?: string;
|
|
40
|
+
};
|
|
41
|
+
/** Reações com emoji. */
|
|
42
|
+
reactions?: string[];
|
|
43
|
+
/** Excluída: continua no chat, riscada e em vermelho claro. */
|
|
44
|
+
deleted?: boolean;
|
|
45
|
+
/** Texto antes da edição: a mensagem mostra o novo e o original. */
|
|
46
|
+
editedFrom?: string;
|
|
47
|
+
/** Situação da mensagem enviada: enviada, entregue, lida. */
|
|
48
|
+
status?: 'sent' | 'delivered' | 'read';
|
|
49
|
+
attachments?: ChatAttachment[];
|
|
50
|
+
}
|
|
51
|
+
export interface Conversation {
|
|
52
|
+
id: string;
|
|
53
|
+
name: string;
|
|
54
|
+
/** Foto do contato. */
|
|
55
|
+
avatar?: string;
|
|
56
|
+
channel: ChatChannel;
|
|
57
|
+
/** Conta ou número do canal que recebeu (ex.: "Comercial"). */
|
|
58
|
+
account?: string;
|
|
59
|
+
/** Departamento ou fila (ex.: "Suporte"). */
|
|
60
|
+
department?: string;
|
|
61
|
+
lastMessage: string;
|
|
62
|
+
time: Date;
|
|
63
|
+
unread?: number;
|
|
64
|
+
/** Esperando desde (fila): mostra o tempo de espera. */
|
|
65
|
+
waitingSince?: Date;
|
|
66
|
+
assignee?: string;
|
|
67
|
+
}
|
|
68
|
+
export interface ConversationListProps {
|
|
69
|
+
items: Conversation[];
|
|
70
|
+
activeId?: string | null;
|
|
71
|
+
onSelect: (id: string) => void;
|
|
72
|
+
/** Texto quando não há conversas (ex.: com os filtros aplicados). */
|
|
73
|
+
empty?: string;
|
|
74
|
+
className?: string;
|
|
75
|
+
}
|
|
76
|
+
export declare function ConversationList({ items, activeId, onSelect, empty, className, }: ConversationListProps): import("react").JSX.Element;
|
|
77
|
+
export interface ChatThreadProps {
|
|
78
|
+
messages: ChatMessage[];
|
|
79
|
+
/** Responder (citar) uma mensagem: a tela mostra a citação no campo de mensagem. */
|
|
80
|
+
onReply?: (message: ChatMessage) => void;
|
|
81
|
+
/** Reagir com emoji (clicar de novo na mesma reação a remove). */
|
|
82
|
+
onReact?: (message: ChatMessage, emoji: string) => void;
|
|
83
|
+
/** Editar uma mensagem do atendente. */
|
|
84
|
+
onEdit?: (message: ChatMessage) => void;
|
|
85
|
+
/** Excluir uma mensagem do atendente (continua no chat, riscada). */
|
|
86
|
+
onDelete?: (message: ChatMessage) => void;
|
|
87
|
+
className?: string;
|
|
88
|
+
}
|
|
89
|
+
export declare function ChatThread({ messages, onReply, onReact, onEdit, onDelete, className, }: ChatThreadProps): import("react").JSX.Element;
|
|
90
|
+
export interface QuickReply {
|
|
91
|
+
id: string;
|
|
92
|
+
/** Nome curto na lista (ex.: "Saudação"). */
|
|
93
|
+
title: string;
|
|
94
|
+
text: string;
|
|
95
|
+
}
|
|
96
|
+
export interface ChatComposerProps {
|
|
97
|
+
/** files inclui o áudio gravado (tipo audio/*), com a duração em segundos. */
|
|
98
|
+
onSend: (message: {
|
|
99
|
+
text: string;
|
|
100
|
+
files: File[];
|
|
101
|
+
audioSeconds?: number;
|
|
102
|
+
}) => void;
|
|
103
|
+
placeholder?: string;
|
|
104
|
+
disabled?: boolean;
|
|
105
|
+
/** Motivo de estar desativado, mostrado no lugar do campo (ex.: "Assuma a conversa"). */
|
|
106
|
+
disabledHint?: string;
|
|
107
|
+
/** Ação mostrada junto do motivo (ex.: botão "Assumir atendimento"). */
|
|
108
|
+
disabledAction?: ReactNode;
|
|
109
|
+
/** Tipos aceitos no botão de arquivo. Padrão: qualquer arquivo. */
|
|
110
|
+
accept?: string;
|
|
111
|
+
/**
|
|
112
|
+
* Mensagens rápidas cadastradas. Com elas, o raio ao lado do microfone abre a lista (com
|
|
113
|
+
* busca); a escolhida vai para o campo, para revisar antes de enviar.
|
|
114
|
+
*/
|
|
115
|
+
quickReplies?: QuickReply[];
|
|
116
|
+
/** Mensagem sendo respondida: aparece citada acima do campo. */
|
|
117
|
+
quote?: {
|
|
118
|
+
author?: string;
|
|
119
|
+
text?: string;
|
|
120
|
+
} | null;
|
|
121
|
+
onCancelQuote?: () => void;
|
|
122
|
+
/** Mensagem sendo editada: o campo vem com o texto dela. */
|
|
123
|
+
editing?: {
|
|
124
|
+
id: string;
|
|
125
|
+
text?: string;
|
|
126
|
+
} | null;
|
|
127
|
+
onCancelEdit?: () => void;
|
|
128
|
+
className?: string;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Campo de mensagem. Esquerda: arquivo, imagem ou vídeo e emoji. Centro: textarea de 2
|
|
132
|
+
* linhas que cresce com o texto (Enter envia, Shift+Enter quebra a linha); aceita arrastar e
|
|
133
|
+
* soltar e colar arquivos, prints e imagens. Direita: mensagens rápidas (quando cadastradas),
|
|
134
|
+
* gravar áudio (a gravação é simulada no demo: contador, ondas e ponto pulsando; cancelar ou
|
|
135
|
+
* enviar) e enviar.
|
|
136
|
+
*/
|
|
137
|
+
export declare function ChatComposer({ onSend, placeholder, disabled, disabledHint, disabledAction, accept, quickReplies, quote, onCancelQuote, editing, onCancelEdit, className, }: ChatComposerProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
export interface CheckboxProps {
|
|
3
|
+
checked?: boolean | 'indeterminate';
|
|
4
|
+
defaultChecked?: boolean;
|
|
5
|
+
onCheckedChange?: (checked: boolean) => void;
|
|
6
|
+
label?: ReactNode;
|
|
7
|
+
description?: ReactNode;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
invalid?: boolean;
|
|
10
|
+
id?: string;
|
|
11
|
+
name?: string;
|
|
12
|
+
className?: string;
|
|
13
|
+
'aria-label'?: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Checkbox único, com estado indeterminado (checked="indeterminate").
|
|
17
|
+
* Com label, a linha inteira é área de toque de 44px no mobile.
|
|
18
|
+
*/
|
|
19
|
+
export declare function Checkbox({ checked, defaultChecked, onCheckedChange, label, description, disabled, invalid, id, name, className, ...aria }: CheckboxProps): import("react").JSX.Element;
|
|
20
|
+
export interface CheckboxGroupProps {
|
|
21
|
+
options: {
|
|
22
|
+
value: string;
|
|
23
|
+
label: ReactNode;
|
|
24
|
+
description?: ReactNode;
|
|
25
|
+
disabled?: boolean;
|
|
26
|
+
}[];
|
|
27
|
+
value?: string[];
|
|
28
|
+
onChange?: (value: string[]) => void;
|
|
29
|
+
/** Checkbox "Selecionar todos" com estado indeterminado. */
|
|
30
|
+
selectAll?: boolean;
|
|
31
|
+
orientation?: 'vertical' | 'horizontal';
|
|
32
|
+
invalid?: boolean;
|
|
33
|
+
id?: string;
|
|
34
|
+
'aria-describedby'?: string;
|
|
35
|
+
label?: string;
|
|
36
|
+
}
|
|
37
|
+
export declare function CheckboxGroup({ options, value, onChange, selectAll, orientation, invalid, id, label, ...aria }: CheckboxGroupProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface ChecklistItem {
|
|
2
|
+
id: string;
|
|
3
|
+
label: string;
|
|
4
|
+
checked: boolean;
|
|
5
|
+
}
|
|
6
|
+
export interface ChecklistProps {
|
|
7
|
+
value: ChecklistItem[];
|
|
8
|
+
onChange: (value: ChecklistItem[]) => void;
|
|
9
|
+
addLabel?: string;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
id?: string;
|
|
12
|
+
className?: string;
|
|
13
|
+
'aria-label'?: string;
|
|
14
|
+
}
|
|
15
|
+
/** Uma lista de verificação por finalidade: itens de um checklist usam este componente. */
|
|
16
|
+
export declare function Checklist({ value, onChange, addLabel, disabled, id, className, ...aria }: ChecklistProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface ColorPickerProps {
|
|
2
|
+
/** Cor atual, #rrggbb. */
|
|
3
|
+
value?: string;
|
|
4
|
+
/** Só chama com hexadecimal válido, sempre em minúsculas. */
|
|
5
|
+
onChange?: (hex: string) => void;
|
|
6
|
+
/** Amostras fixas oferecidas antes da cor livre. */
|
|
7
|
+
swatches?: string[];
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
/** Nome acessível do grupo de amostras e do campo. */
|
|
10
|
+
'aria-label'?: string;
|
|
11
|
+
className?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare const ColorPicker: import("react").ForwardRefExoticComponent<ColorPickerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
export interface FilterChip {
|
|
3
|
+
id: string;
|
|
4
|
+
label: string;
|
|
5
|
+
onRemove: () => void;
|
|
6
|
+
}
|
|
7
|
+
export interface ToolbarColumn {
|
|
8
|
+
id: string;
|
|
9
|
+
label: string;
|
|
10
|
+
visible: boolean;
|
|
11
|
+
onToggle: (visible: boolean) => void;
|
|
12
|
+
}
|
|
13
|
+
export interface DataToolbarProps {
|
|
14
|
+
search?: {
|
|
15
|
+
value: string;
|
|
16
|
+
onChange: (v: string) => void;
|
|
17
|
+
placeholder?: string;
|
|
18
|
+
};
|
|
19
|
+
/** Conteúdo dos filtros: popover no desktop, drawer em tela cheia no mobile. */
|
|
20
|
+
filters?: ReactNode;
|
|
21
|
+
/** Quantos filtros estão aplicados (contador no botão). */
|
|
22
|
+
filterCount?: number;
|
|
23
|
+
onClearFilters?: () => void;
|
|
24
|
+
/** Chips dos filtros aplicados. */
|
|
25
|
+
chips?: FilterChip[];
|
|
26
|
+
/** Ordenação (vai para o drawer no mobile). */
|
|
27
|
+
sort?: ReactNode;
|
|
28
|
+
/** Colunas que o usuário pode mostrar ou ocultar. */
|
|
29
|
+
columns?: ToolbarColumn[];
|
|
30
|
+
/** Ações secundárias à direita (exportar etc.). No mobile, numa linha abaixo. */
|
|
31
|
+
actions?: ReactNode;
|
|
32
|
+
/** Ação principal da listagem (ex.: Novo cliente). Sempre a última à direita. */
|
|
33
|
+
primaryAction?: ReactNode;
|
|
34
|
+
/** Substitui a barra quando há itens selecionados (ações em massa, só desktop). */
|
|
35
|
+
selectionBar?: ReactNode;
|
|
36
|
+
}
|
|
37
|
+
export declare function DataToolbar({ search, filters, filterCount, onClearFilters, chips, sort, columns, actions, primaryAction, selectionBar, }: DataToolbarProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { type DateRange } from 'react-day-picker';
|
|
2
|
+
import { type ControlSize } from '../../lib/control';
|
|
3
|
+
export type { DateRange };
|
|
4
|
+
interface BaseProps {
|
|
5
|
+
placeholder?: string;
|
|
6
|
+
/** Título do painel no mobile. */
|
|
7
|
+
label?: string;
|
|
8
|
+
size?: ControlSize;
|
|
9
|
+
invalid?: boolean;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
/** Com horário (campo HH:MM no painel). */
|
|
12
|
+
time?: boolean;
|
|
13
|
+
minDate?: Date;
|
|
14
|
+
maxDate?: Date;
|
|
15
|
+
/**
|
|
16
|
+
* Seletores de mês e ano no topo do calendário (padrão: ligado), para chegar rápido
|
|
17
|
+
* a datas distantes, como data de nascimento, sem voltar mês a mês.
|
|
18
|
+
*/
|
|
19
|
+
dropdowns?: boolean;
|
|
20
|
+
clearable?: boolean;
|
|
21
|
+
id?: string;
|
|
22
|
+
className?: string;
|
|
23
|
+
'aria-describedby'?: string;
|
|
24
|
+
}
|
|
25
|
+
interface SingleProps extends BaseProps {
|
|
26
|
+
range?: false;
|
|
27
|
+
value?: Date | null;
|
|
28
|
+
onChange?: (value: Date | null) => void;
|
|
29
|
+
}
|
|
30
|
+
interface RangeProps extends BaseProps {
|
|
31
|
+
/** Seleção de período (início e fim). */
|
|
32
|
+
range: true;
|
|
33
|
+
value?: DateRange | null;
|
|
34
|
+
onChange?: (value: DateRange | null) => void;
|
|
35
|
+
}
|
|
36
|
+
export type DatePickerProps = SingleProps | RangeProps;
|
|
37
|
+
/**
|
|
38
|
+
* DatePicker único em pt-BR: data, período (range) e horário (time) são props.
|
|
39
|
+
* Desktop: calendário em popover (dois meses no período). Mobile: bottom sheet.
|
|
40
|
+
*/
|
|
41
|
+
export declare const DatePicker: import("react").ForwardRefExoticComponent<DatePickerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface DocumentViewerProps {
|
|
2
|
+
/** Endereço do PDF. null é o estado vazio legítimo (nenhum documento escolhido ainda). */
|
|
3
|
+
url: string | null;
|
|
4
|
+
/** Nome acessível do documento (aria-label do visualizador). */
|
|
5
|
+
title: string;
|
|
6
|
+
className?: string;
|
|
7
|
+
emptyTitle?: string;
|
|
8
|
+
emptyDescription?: string;
|
|
9
|
+
loadingLabel?: string;
|
|
10
|
+
errorTitle?: string;
|
|
11
|
+
errorDescription?: string;
|
|
12
|
+
openInNewTabLabel?: string;
|
|
13
|
+
zoomInLabel?: string;
|
|
14
|
+
zoomOutLabel?: string;
|
|
15
|
+
previousPageLabel?: string;
|
|
16
|
+
nextPageLabel?: string;
|
|
17
|
+
}
|
|
18
|
+
/** Um visualizador de documento por tela; nunca crie um segundo para PDF. */
|
|
19
|
+
export declare function DocumentViewer({ url, title, className, emptyTitle, emptyDescription, loadingLabel, errorTitle, errorDescription, openInNewTabLabel, zoomInLabel, zoomOutLabel, previousPageLabel, nextPageLabel, }: DocumentViewerProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
declare const sizes: {
|
|
3
|
+
readonly '30': "md:w-sheet-30";
|
|
4
|
+
readonly '40': "md:w-sheet-40";
|
|
5
|
+
readonly '50': "md:w-sheet-50";
|
|
6
|
+
readonly '75': "md:w-sheet-75";
|
|
7
|
+
readonly full: "md:w-full";
|
|
8
|
+
readonly sm: "md:w-sheet-30";
|
|
9
|
+
readonly md: "md:w-sheet-30";
|
|
10
|
+
readonly lg: "md:w-sheet-50";
|
|
11
|
+
readonly xl: "md:w-sheet-75";
|
|
12
|
+
};
|
|
13
|
+
export interface DrawerProps {
|
|
14
|
+
open: boolean;
|
|
15
|
+
onOpenChange: (open: boolean) => void;
|
|
16
|
+
title: ReactNode;
|
|
17
|
+
description?: ReactNode;
|
|
18
|
+
icon?: ReactNode;
|
|
19
|
+
size?: keyof typeof sizes;
|
|
20
|
+
children: ReactNode;
|
|
21
|
+
/** Rodapé fixo. Normalmente um <ActionBar>. */
|
|
22
|
+
footer?: ReactNode;
|
|
23
|
+
/** Há alterações não salvas: fechar pede confirmação. */
|
|
24
|
+
dirty?: boolean;
|
|
25
|
+
/** Textos da confirmação de descarte. */
|
|
26
|
+
discardTitle?: string;
|
|
27
|
+
discardDescription?: string;
|
|
28
|
+
}
|
|
29
|
+
export declare function Drawer({ open, onOpenChange, title, description, icon, size, children, footer, dirty, discardTitle, discardDescription, }: DrawerProps): import("react").JSX.Element;
|
|
30
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { DropdownMenu as D } from 'radix-ui';
|
|
2
|
+
import type { ComponentProps } from 'react';
|
|
3
|
+
export declare const DropdownMenu: import("react").FC<D.DropdownMenuProps>;
|
|
4
|
+
export declare const DropdownMenuTrigger: import("react").ForwardRefExoticComponent<D.DropdownMenuTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
5
|
+
export declare const DropdownMenuGroup: import("react").ForwardRefExoticComponent<D.DropdownMenuGroupProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
6
|
+
export declare const DropdownMenuSub: import("react").FC<D.DropdownMenuSubProps>;
|
|
7
|
+
export declare const DropdownMenuRadioGroup: import("react").ForwardRefExoticComponent<D.DropdownMenuRadioGroupProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
8
|
+
export declare function DropdownMenuContent({ className, sideOffset, ...props }: ComponentProps<typeof D.Content>): import("react").JSX.Element;
|
|
9
|
+
interface ItemProps extends ComponentProps<typeof D.Item> {
|
|
10
|
+
/** Item destrutivo (excluir, sair): texto na cor destrutiva. */
|
|
11
|
+
destructive?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export declare function DropdownMenuItem({ className, destructive, ...props }: ItemProps): import("react").JSX.Element;
|
|
14
|
+
export declare function DropdownMenuCheckboxItem({ className, children, ...props }: ComponentProps<typeof D.CheckboxItem>): import("react").JSX.Element;
|
|
15
|
+
export declare function DropdownMenuRadioItem({ className, children, ...props }: ComponentProps<typeof D.RadioItem>): import("react").JSX.Element;
|
|
16
|
+
export declare function DropdownMenuLabel({ className, ...props }: ComponentProps<typeof D.Label>): import("react").JSX.Element;
|
|
17
|
+
export declare function DropdownMenuSeparator({ className, ...props }: ComponentProps<typeof D.Separator>): import("react").JSX.Element;
|
|
18
|
+
export declare function DropdownMenuSubTrigger({ className, children, ...props }: ComponentProps<typeof D.SubTrigger>): import("react").JSX.Element;
|
|
19
|
+
export declare function DropdownMenuSubContent({ className, ...props }: ComponentProps<typeof D.SubContent>): import("react").JSX.Element;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { FeedbackType } from '../../brand/types';
|
|
3
|
+
export interface EmptyStateProps {
|
|
4
|
+
title: string;
|
|
5
|
+
description?: ReactNode;
|
|
6
|
+
/** Tipo do ícone de feedback da marca. info para "sem dados", error para falha. */
|
|
7
|
+
type?: FeedbackType;
|
|
8
|
+
/** Ações: no máximo uma principal e uma secundária. */
|
|
9
|
+
actions?: ReactNode;
|
|
10
|
+
/** compact: dentro de tabela ou card pequeno. */
|
|
11
|
+
size?: 'default' | 'compact';
|
|
12
|
+
className?: string;
|
|
13
|
+
}
|
|
14
|
+
/** Estado vazio (e de erro) com o ícone de feedback da marca. */
|
|
15
|
+
export declare function EmptyState({ title, description, type, actions, size, className, }: EmptyStateProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface ErrorPageProps {
|
|
2
|
+
code: 404 | 500;
|
|
3
|
+
/** Título próprio no lugar do padrão. */
|
|
4
|
+
title?: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
/** Ocupa a tela inteira (fora do AppShell). */
|
|
7
|
+
fullScreen?: boolean;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Tela de erro única (404 e 500), com o ícone de feedback da marca animado.
|
|
11
|
+
* Ações seguem a regra 30/70: secundária à esquerda, principal à direita.
|
|
12
|
+
*/
|
|
13
|
+
export declare function ErrorPage({ code, title, description, fullScreen }: ErrorPageProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { Label as L } from 'radix-ui';
|
|
2
|
+
import { type ComponentProps, type ReactNode } from 'react';
|
|
3
|
+
import { type FieldSpan } from '../layout/tokens';
|
|
4
|
+
export declare function Label({ className, required, children, ...props }: ComponentProps<typeof L.Root> & {
|
|
5
|
+
required?: boolean;
|
|
6
|
+
}): import("react").JSX.Element;
|
|
7
|
+
interface FieldContextValue {
|
|
8
|
+
id: string;
|
|
9
|
+
describedBy: string;
|
|
10
|
+
invalid: boolean;
|
|
11
|
+
}
|
|
12
|
+
/** Liga um controle ao Field mais próximo (id, aria-describedby, aria-invalid). */
|
|
13
|
+
export declare function useFieldControl(): FieldContextValue | null;
|
|
14
|
+
export interface FieldProps {
|
|
15
|
+
label?: ReactNode;
|
|
16
|
+
required?: boolean;
|
|
17
|
+
/** Texto de ajuda sempre visível (substitui tooltip no mobile). */
|
|
18
|
+
help?: ReactNode;
|
|
19
|
+
/** Mensagem de erro, abaixo do controle, no lugar da ajuda. */
|
|
20
|
+
error?: ReactNode;
|
|
21
|
+
/**
|
|
22
|
+
* Largura na grade de formulário (Grid form ou FormSection): xs (17%), sm (25%),
|
|
23
|
+
* md (33%, padrão: 3 por linha), lg (50%), xl (67%), full. half é o antigo e vale md.
|
|
24
|
+
*/
|
|
25
|
+
span?: FieldSpan | 'half';
|
|
26
|
+
/** Começa uma linha nova (ex.: os campos que vêm depois do CEP ou do CNPJ). */
|
|
27
|
+
newRow?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Reserva a linha da mensagem mesmo vazia, para o erro não empurrar o que vem abaixo
|
|
30
|
+
* (útil em formulários em grid de 2 colunas com validação ao digitar). Padrão: não
|
|
31
|
+
* reserva, e os campos ficam mais próximos.
|
|
32
|
+
*/
|
|
33
|
+
reserveMessage?: boolean;
|
|
34
|
+
/** Obsoleto: sem reserva já é o padrão. Mantido para não quebrar telas existentes. */
|
|
35
|
+
compact?: boolean;
|
|
36
|
+
/** id do controle; gerado automaticamente se omitido. */
|
|
37
|
+
id?: string;
|
|
38
|
+
className?: string;
|
|
39
|
+
children: ReactNode;
|
|
40
|
+
}
|
|
41
|
+
export declare function Field({ label, required, help, error, span, newRow, reserveMessage, id, className, children, }: FieldProps): import("react").JSX.Element;
|
|
42
|
+
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import { type FieldPath, type FieldValues, type SubmitHandler, type UseFormReturn } from 'react-hook-form';
|
|
3
|
+
import { type FieldProps } from './field';
|
|
4
|
+
interface FormProps<T extends FieldValues> {
|
|
5
|
+
form: UseFormReturn<T>;
|
|
6
|
+
onSubmit: SubmitHandler<T>;
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
id?: string;
|
|
9
|
+
className?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare function Form<T extends FieldValues>({ form, onSubmit, children, id, className, }: FormProps<T>): import("react").JSX.Element;
|
|
12
|
+
/** Props que o render recebe: prontas para espalhar em Input, Select, DatePicker etc. */
|
|
13
|
+
export interface FormControlProps<V = unknown> {
|
|
14
|
+
name: string;
|
|
15
|
+
value: V;
|
|
16
|
+
onChange: (value: V) => void;
|
|
17
|
+
onBlur: () => void;
|
|
18
|
+
invalid: boolean;
|
|
19
|
+
ref: (el: unknown) => void;
|
|
20
|
+
}
|
|
21
|
+
interface FormFieldProps<T extends FieldValues> extends Omit<FieldProps, 'children' | 'error'> {
|
|
22
|
+
name: FieldPath<T>;
|
|
23
|
+
render: (field: FormControlProps<any>) => ReactNode;
|
|
24
|
+
}
|
|
25
|
+
export declare function FormField<T extends FieldValues>({ name, render, ...fieldProps }: FormFieldProps<T>): import("react").JSX.Element;
|
|
26
|
+
interface FormSectionProps {
|
|
27
|
+
title: ReactNode;
|
|
28
|
+
/** Subtítulo curto da seção. Instrução de uso vai em `help`. */
|
|
29
|
+
description?: ReactNode;
|
|
30
|
+
/** Texto orientativo: ícone de informação ao lado do título, que abre um modal. */
|
|
31
|
+
help?: ReactNode;
|
|
32
|
+
/**
|
|
33
|
+
* 1: todos os campos em largura total (texto longo, cartões de seleção, anexos).
|
|
34
|
+
* Sem valor: grade de formulário, com a largura de cada campo no span do Field.
|
|
35
|
+
*/
|
|
36
|
+
columns?: 1 | 2;
|
|
37
|
+
children: ReactNode;
|
|
38
|
+
id?: string;
|
|
39
|
+
}
|
|
40
|
+
/** Seção de formulário: card com título e a grade de formulário (3 campos por linha no largo). */
|
|
41
|
+
export declare function FormSection({ title, description, help, columns, children, id }: FormSectionProps): import("react").JSX.Element;
|
|
42
|
+
export {};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Recorte de imagem (etapa A2 do plano da v2): entra um File, sai um File novo, na
|
|
3
|
+
* resolução original (ou até maxOutputWidth). A geometria é uma função pura, testada por
|
|
4
|
+
* proporção, para o arraste e o zoom nunca descolarem a imagem da moldura.
|
|
5
|
+
*/
|
|
6
|
+
export interface ImageCropperAspect {
|
|
7
|
+
id: string;
|
|
8
|
+
label: string;
|
|
9
|
+
/** Largura dividida pela altura (1 = quadrado, 16/9 = paisagem). */
|
|
10
|
+
ratio: number;
|
|
11
|
+
}
|
|
12
|
+
export interface ImageCropperProps {
|
|
13
|
+
file: File;
|
|
14
|
+
aspects: ImageCropperAspect[];
|
|
15
|
+
/** Teto de largura da saída, em pixels. Sem ele, sai na resolução original do recorte. */
|
|
16
|
+
maxOutputWidth?: number;
|
|
17
|
+
/** Chamado só quando o recorte deu certo, com o File novo. */
|
|
18
|
+
onConfirm: (file: File) => void;
|
|
19
|
+
onCancel: () => void;
|
|
20
|
+
className?: string;
|
|
21
|
+
}
|
|
22
|
+
export interface CropGeometryInput {
|
|
23
|
+
imageWidth: number;
|
|
24
|
+
imageHeight: number;
|
|
25
|
+
frameWidth: number;
|
|
26
|
+
frameHeight: number;
|
|
27
|
+
/** 1 = ajuste mínimo para cobrir a moldura; maior aproxima (zoom). */
|
|
28
|
+
zoom: number;
|
|
29
|
+
/** Deslocamento desejado do centro da imagem, em pixels de tela. */
|
|
30
|
+
offsetX: number;
|
|
31
|
+
offsetY: number;
|
|
32
|
+
}
|
|
33
|
+
export interface CropGeometryResult {
|
|
34
|
+
/** Pixels de tela por pixel da imagem original. */
|
|
35
|
+
scale: number;
|
|
36
|
+
/** Deslocamento realmente aplicado: nunca deixa a imagem descolar da moldura. */
|
|
37
|
+
offsetX: number;
|
|
38
|
+
offsetY: number;
|
|
39
|
+
/** Retângulo de origem, em pixels da imagem original, que cai dentro da moldura. */
|
|
40
|
+
source: {
|
|
41
|
+
x: number;
|
|
42
|
+
y: number;
|
|
43
|
+
width: number;
|
|
44
|
+
height: number;
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Geometria pura do recorte: a imagem sempre cobre a moldura (escala mínima = "cover"
|
|
49
|
+
* vezes o zoom) e o arraste é limitado à sobra, para nunca abrir vão entre a imagem e a
|
|
50
|
+
* moldura. Devolve também o retângulo de origem na resolução original da imagem, pronto
|
|
51
|
+
* para desenhar num canvas do tamanho da moldura (ou maior, mantendo a proporção).
|
|
52
|
+
*/
|
|
53
|
+
export declare function computeCropGeometry({ imageWidth, imageHeight, frameWidth, frameHeight, zoom, offsetX, offsetY, }: CropGeometryInput): CropGeometryResult;
|
|
54
|
+
/** Recorte único: entra um File, sai um File novo na resolução original (ou maxOutputWidth). */
|
|
55
|
+
export declare function ImageCropper({ file, aspects, maxOutputWidth, onConfirm, onCancel, className, }: ImageCropperProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface ViewerImage {
|
|
2
|
+
src: string;
|
|
3
|
+
/** Texto alternativo: o que a imagem mostra. */
|
|
4
|
+
alt: string;
|
|
5
|
+
/** Legenda visível. Padrão: o alt. */
|
|
6
|
+
caption?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface ImageViewerProps {
|
|
9
|
+
images: ViewerImage[];
|
|
10
|
+
/** Imagem aberta; null fecha o visualizador. */
|
|
11
|
+
index: number | null;
|
|
12
|
+
onIndexChange: (index: number | null) => void;
|
|
13
|
+
}
|
|
14
|
+
export declare function ImageViewer({ images, index, onIndexChange }: ImageViewerProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
export interface InfoHintProps {
|
|
3
|
+
/** Título do modal (em geral, o título da tela ou da seção). */
|
|
4
|
+
title: string;
|
|
5
|
+
/** O texto orientativo. Pode ter parágrafos e listas. */
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
className?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function InfoHint({ title, children, className }: InfoHintProps): import("react").JSX.Element;
|