@jcdecor/ui 0.1.0 → 0.1.6

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 CHANGED
@@ -2,12 +2,12 @@
2
2
 
3
3
  Design System da **JC Decor** para React: tema, tokens e componentes construídos sobre o [Mantine 9](https://mantine.dev).
4
4
 
5
- - 🎨 Paleta da marca (Horizon, Obsidian, Electric, Evergreen) em rampas OKLCH com contraste WCAG AA validado, tipografia Poppins, spacing, raios e sombras
6
- - 🌗 Tema claro (padrão) e escuro, com variáveis CSS `--ds-*` semânticas
7
- - 🧩 Todo o Mantine reexportado já temado, mais componentes da marca: `KpiCard`, `Tag`, `PromoBanner`, `TopNav`, `DataTable`, `ProductCard`, `PriceTag`…
8
- - 💬 `@jcdecor/ui/chat`: bolhas, conversa, composer, lista de conversas e layout de atendimento
9
- - 🛡️ Logos e ilustrações da marca como componentes SVG recoloríveis, com variações para fundo claro e escuro
10
- - 📊 `@jcdecor/ui/charts`: gráficos do `@mantine/charts` na paleta da marca, em pt-BR
5
+ - Paleta da marca (Horizon, Obsidian, Electric, Evergreen) em rampas OKLCH com contraste WCAG AA validado, tipografia Poppins, spacing, raios e sombras
6
+ - Tema claro (padrão) e escuro, com variáveis CSS `--ds-*` semânticas
7
+ - Todo o Mantine reexportado já temado, mais componentes da marca: `KpiCard`, `Tag`, `PromoBanner`, `TopNav`, `DataTable`, `ProductCard`, `PriceTag`…
8
+ - `@jcdecor/ui/chat`: bolhas, conversa, composer, lista de conversas e layout de atendimento
9
+ - Logos e ilustrações da marca como componentes SVG recoloríveis, com variações para fundo claro e escuro
10
+ - `@jcdecor/ui/charts`: gráficos do `@mantine/charts` na paleta da marca, em pt-BR
11
11
 
12
12
  ### Logo
13
13
 
@@ -18,10 +18,22 @@ export interface ChatComposerProps extends Omit<BoxProps, 'onSubmit'> {
18
18
  maxRows?: number;
19
19
  /** Elementos extras à esquerda (ex.: emoji picker, respostas rápidas) */
20
20
  leftSection?: React.ReactNode;
21
+ /** Elementos extras à direita do campo, antes do botão de enviar (ex.: biblioteca de prompts) */
22
+ rightSection?: React.ReactNode;
21
23
  sendLabel?: string;
24
+ /**
25
+ * Uma resposta está em andamento: o envio fica bloqueado (o texto digitado é mantido e o campo
26
+ * continua editável). Com `onStop`, o botão de enviar vira o botão de interromper.
27
+ */
28
+ loading?: boolean;
29
+ /** Chamado pelo botão de interromper (visível enquanto `loading`) */
30
+ onStop?: () => void;
31
+ stopLabel?: string;
32
+ /** Bloqueia o envio sem desabilitar o campo (ex.: integração ainda não conectada) */
33
+ sendDisabled?: boolean;
22
34
  }
23
35
  /** Campo de mensagem: Enter envia, Shift+Enter quebra linha, anexos opcionais. */
24
- export declare function ChatComposer({ value, defaultValue, onChange, onSend, placeholder, disabled, allowAttachments, accept, maxRows, leftSection, sendLabel, ...others }: ChatComposerProps): import("react").JSX.Element;
36
+ export declare function ChatComposer({ value, defaultValue, onChange, onSend, placeholder, disabled, allowAttachments, accept, maxRows, leftSection, rightSection, sendLabel, loading, onStop, stopLabel, sendDisabled, ...others }: ChatComposerProps): import("react").JSX.Element;
25
37
  export declare namespace ChatComposer {
26
38
  var displayName: string;
27
39
  }
@@ -16,10 +16,14 @@ export interface ChatMessageProps extends BoxProps, Omit<React.ComponentProps<'d
16
16
  position?: GroupPosition;
17
17
  /** Mensagem de sistema (centralizada) */
18
18
  system?: boolean;
19
+ /** `plain` = sem bolha e em largura total (respostas de assistente com markdown/tabelas) @default 'bubble' */
20
+ variant?: 'bubble' | 'plain';
21
+ /** Avatar customizado (ex.: ícone do assistente); substitui o avatar do `author` */
22
+ avatar?: React.ReactNode;
19
23
  children?: React.ReactNode;
20
24
  }
21
25
  /** Bolha de mensagem de chat. */
22
- export declare function ChatMessage({ own, author, showAuthor, showAvatar, createdAt, status, attachments, position, system, children, ...others }: ChatMessageProps): import("react").JSX.Element;
26
+ export declare function ChatMessage({ own, author, showAuthor, showAvatar, createdAt, status, attachments, position, system, variant, avatar, children, ...others }: ChatMessageProps): import("react").JSX.Element;
23
27
  export declare namespace ChatMessage {
24
28
  var displayName: string;
25
29
  }
@@ -17,9 +17,13 @@ export interface ChatThreadProps extends Omit<ScrollAreaProps, 'children'> {
17
17
  empty?: React.ReactNode;
18
18
  /** Renderização customizada do conteúdo da bolha */
19
19
  renderContent?: (message: ChatMessageData) => React.ReactNode;
20
+ /** Avatar customizado por mensagem (ex.: ícone do assistente) */
21
+ renderAvatar?: (message: ChatMessageData) => React.ReactNode;
22
+ /** Conteúdo ao fim da conversa, antes do "digitando" (ex.: status de uma resposta em andamento) */
23
+ footer?: React.ReactNode;
20
24
  }
21
25
  /** Lista rolável de mensagens com separadores de data, agrupamento e auto-scroll. */
22
- export declare function ChatThread({ messages, currentUserId, users, typing, showAuthors, autoScroll, groupWindow, empty, renderContent, h, ...others }: ChatThreadProps): import("react").JSX.Element;
26
+ export declare function ChatThread({ messages, currentUserId, users, typing, showAuthors, autoScroll, groupWindow, empty, renderContent, renderAvatar, footer, h, ...others }: ChatThreadProps): import("react").JSX.Element;
23
27
  export declare namespace ChatThread {
24
28
  var displayName: string;
25
29
  }
@@ -8,9 +8,13 @@ export interface ConversationListProps extends Omit<BoxProps, 'onSelect'> {
8
8
  searchable?: boolean;
9
9
  searchPlaceholder?: string;
10
10
  empty?: React.ReactNode;
11
+ /** Ícone no lugar do avatar com iniciais (ex.: conversas com um assistente) */
12
+ renderIcon?: (conversation: Conversation) => React.ReactNode;
13
+ /** Ações por conversa (ex.: menu renomear/excluir), à direita do item */
14
+ renderActions?: (conversation: Conversation) => React.ReactNode;
11
15
  }
12
16
  /** Lista de conversas com busca, não lidas, presença e última mensagem. */
13
- export declare function ConversationList({ conversations, activeId, onSelect, searchable, searchPlaceholder, empty, ...others }: ConversationListProps): import("react").JSX.Element;
17
+ export declare function ConversationList({ conversations, activeId, onSelect, searchable, searchPlaceholder, empty, renderIcon, renderActions, ...others }: ConversationListProps): import("react").JSX.Element;
14
18
  export declare namespace ConversationList {
15
19
  var displayName: string;
16
20
  }
@@ -23,6 +23,8 @@ export interface ChatMessageData {
23
23
  attachments?: ChatAttachment[];
24
24
  /** Mensagem de sistema (centralizada, sem bolha) */
25
25
  system?: boolean;
26
+ /** `plain` = sem bolha e em largura total (ex.: respostas longas de assistente com markdown/tabelas) @default 'bubble' */
27
+ variant?: 'bubble' | 'plain';
26
28
  }
27
29
  export interface Conversation {
28
30
  id: string;