@gyramais/gyra-design 0.2.56 → 0.2.58

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 (24) hide show
  1. package/dist/components/ChatWidget/ChatBlocks.d.ts +29 -0
  2. package/dist/components/ChatWidget/ChatMarkdown.d.ts +10 -0
  3. package/dist/components/ChatWidget/ChatMessageBubble.d.ts +10 -1
  4. package/dist/components/ChatWidget/ChatWidget.d.ts +26 -3
  5. package/dist/components/ChatWidget/index.d.ts +2 -0
  6. package/dist/components/ChatWidget/index.js +25 -7
  7. package/dist/components/ChatWidget/index.js.map +1 -1
  8. package/dist/components/ChatWidget/types.d.ts +52 -0
  9. package/dist/components/Rail/index.js +1 -1
  10. package/dist/components/Rail/index.js.map +1 -1
  11. package/dist/emails/balance-sheet-finalized/components/ChatWidget/ChatBlocks.d.ts +29 -0
  12. package/dist/emails/balance-sheet-finalized/components/ChatWidget/ChatMarkdown.d.ts +10 -0
  13. package/dist/emails/balance-sheet-finalized/components/ChatWidget/ChatMessageBubble.d.ts +10 -1
  14. package/dist/emails/balance-sheet-finalized/components/ChatWidget/ChatWidget.d.ts +26 -3
  15. package/dist/emails/balance-sheet-finalized/components/ChatWidget/index.d.ts +2 -0
  16. package/dist/emails/balance-sheet-finalized/components/ChatWidget/types.d.ts +52 -0
  17. package/dist/emails/email/components/ChatWidget/ChatBlocks.d.ts +29 -0
  18. package/dist/emails/email/components/ChatWidget/ChatMarkdown.d.ts +10 -0
  19. package/dist/emails/email/components/ChatWidget/ChatMessageBubble.d.ts +10 -1
  20. package/dist/emails/email/components/ChatWidget/ChatWidget.d.ts +26 -3
  21. package/dist/emails/email/components/ChatWidget/index.d.ts +2 -0
  22. package/dist/emails/email/components/ChatWidget/types.d.ts +52 -0
  23. package/dist/index.css +286 -2
  24. package/package.json +1 -1
@@ -0,0 +1,29 @@
1
+ import React from "react";
2
+ import { ChatActionBlock, ChatBlock, ChatLinkBlock, ChatVideoBlock } from "./types";
3
+ export interface ChatLinkCardProps {
4
+ block: ChatLinkBlock;
5
+ /** Recebe o `href` relativo. Sem ele, o link interno vira navegacao comum. */
6
+ onNavigate?: (href: string) => void;
7
+ }
8
+ declare const ChatLinkCard: ({ block, onNavigate }: ChatLinkCardProps) => React.JSX.Element | null;
9
+ export interface ChatVideoCardProps {
10
+ block: ChatVideoBlock;
11
+ }
12
+ declare const ChatVideoCard: ({ block }: ChatVideoCardProps) => React.JSX.Element | null;
13
+ export interface ChatActionCardProps {
14
+ block: ChatActionBlock;
15
+ /** Manda a resposta como a proxima mensagem do usuario. */
16
+ onRespond?: (text: string) => void | Promise<void>;
17
+ /** Trava os botoes (ja respondido, ou a conversa seguiu adiante). */
18
+ locked?: boolean;
19
+ onNavigate?: (href: string) => void;
20
+ }
21
+ declare const ChatActionCard: ({ block, onRespond, locked, onNavigate }: ChatActionCardProps) => React.JSX.Element;
22
+ export interface ChatBlocksProps {
23
+ blocks: ChatBlock[];
24
+ onNavigate?: (href: string) => void;
25
+ onRespond?: (text: string) => void | Promise<void>;
26
+ actionsLocked?: boolean;
27
+ }
28
+ declare const ChatBlocks: ({ blocks, onNavigate, onRespond, actionsLocked }: ChatBlocksProps) => React.JSX.Element;
29
+ export { ChatBlocks, ChatLinkCard, ChatVideoCard, ChatActionCard };
@@ -0,0 +1,10 @@
1
+ import React from "react";
2
+ export declare const isSafeHttpUrl: (href: string | undefined | null) => boolean;
3
+ /** Caminho interno do app ("/relatorios/123"). "//host" e protocolo relativo, nao conta. */
4
+ export declare const isInternalHref: (href: string | undefined | null) => boolean;
5
+ interface ChatMarkdownProps {
6
+ children: string;
7
+ onNavigate?: (href: string) => void;
8
+ }
9
+ declare const ChatMarkdown: ({ children, onNavigate }: ChatMarkdownProps) => React.JSX.Element;
10
+ export { ChatMarkdown };
@@ -2,6 +2,15 @@ import React from "react";
2
2
  import { ChatMessage } from "./types";
3
3
  interface ChatMessageBubbleProps {
4
4
  message: ChatMessage;
5
+ /** Esta e a resposta sendo gerada agora (mostra o passo atual). */
6
+ streaming?: boolean;
7
+ /** Rotulo do "pensando" quando a mensagem nao traz `steps` proprios. */
8
+ statusLabel?: string;
9
+ onNavigate?: (href: string) => void;
10
+ /** Resposta dos cards de confirmacao, pelo mesmo caminho do composer. */
11
+ onRespond?: (text: string) => void | Promise<void>;
12
+ /** Trava os cards de confirmacao desta mensagem. */
13
+ actionsLocked?: boolean;
5
14
  }
6
- declare const ChatMessageBubble: ({ message }: ChatMessageBubbleProps) => React.JSX.Element;
15
+ declare const ChatMessageBubble: ({ message, streaming, statusLabel, onNavigate, onRespond, actionsLocked, }: ChatMessageBubbleProps) => React.JSX.Element;
7
16
  export { ChatMessageBubble };
@@ -1,13 +1,36 @@
1
1
  import React from "react";
2
2
  import "./index.css";
3
- import { ChatMessage, ChatStatus, ChatTheme } from "./types";
3
+ import { ChatAttachment, ChatMessage, ChatSendOptions, ChatStatus, ChatTheme } from "./types";
4
4
  export interface ChatWidgetProps {
5
5
  open: boolean;
6
6
  onOpenChange: (open: boolean) => void;
7
7
  messages: ChatMessage[];
8
8
  status: ChatStatus;
9
- onSend: (text: string) => void | Promise<void>;
9
+ /**
10
+ * `options.attachmentIds` so vem quando ha anexos prontos no composer. Os
11
+ * cards de confirmacao tambem respondem por aqui (sem o segundo argumento).
12
+ */
13
+ onSend: (text: string, options?: ChatSendOptions) => void | Promise<void>;
10
14
  onReset?: () => void;
15
+ /**
16
+ * Links internos (href comecando com "/") dos cards e do markdown. Sem ele,
17
+ * viram navegacao comum do navegador.
18
+ */
19
+ onNavigate?: (href: string) => void;
20
+ /**
21
+ * Com ele, o composer ganha o clipe de anexo. Recebe o arquivo escolhido e
22
+ * devolve `{ id, name }` do upload; um erro lancado vira aviso no composer
23
+ * (use a `message` do erro para o texto em portugues).
24
+ */
25
+ onAttach?: (file: File) => Promise<ChatAttachment>;
26
+ /** `accept` do seletor de arquivos. */
27
+ attachAccept?: string;
28
+ /** Dica de formatos e tamanho, no tooltip do clipe e abaixo dos anexos. */
29
+ attachHint?: string;
30
+ /** Maximo de anexos por mensagem. */
31
+ maxAttachments?: number;
32
+ /** Texto ao lado dos pontinhos enquanto a resposta nao comeca a chegar. */
33
+ statusLabel?: string;
11
34
  theme?: ChatTheme;
12
35
  title?: string;
13
36
  triggerLabel?: string;
@@ -26,5 +49,5 @@ export interface ChatWidgetProps {
26
49
  headerExtra?: React.ReactNode;
27
50
  belowHeader?: React.ReactNode;
28
51
  }
29
- declare const ChatWidget: ({ open, onOpenChange, messages, status, onSend, onReset, theme, title, triggerLabel, placeholder, emptyTitle, emptySubtitle, suggestions, collapsedHeight, expandedHeight, collapsedWidth, expandedWidth, defaultExpanded, expandable, className, zIndex, headerExtra, belowHeader, }: ChatWidgetProps) => React.JSX.Element;
52
+ declare const ChatWidget: ({ open, onOpenChange, messages, status, onSend, onReset, onNavigate, onAttach, attachAccept, attachHint, maxAttachments, statusLabel, theme, title, triggerLabel, placeholder, emptyTitle, emptySubtitle, suggestions, collapsedHeight, expandedHeight, collapsedWidth, expandedWidth, defaultExpanded, expandable, className, zIndex, headerExtra, belowHeader, }: ChatWidgetProps) => React.JSX.Element;
30
53
  export { ChatWidget };
@@ -1,3 +1,5 @@
1
1
  export * from "./ChatWidget";
2
2
  export * from "./ChatMessageBubble";
3
+ export * from "./ChatBlocks";
4
+ export { ChatMarkdown } from "./ChatMarkdown";
3
5
  export * from "./types";