@jcdecor/vue 0.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 (107) hide show
  1. package/README.md +68 -0
  2. package/dist/brand/Brand.d.ts +83 -0
  3. package/dist/brand/index.d.ts +2 -0
  4. package/dist/brand/paths.d.ts +43 -0
  5. package/dist/brand-CeSffe5P.js +320 -0
  6. package/dist/brand-CeSffe5P.js.map +1 -0
  7. package/dist/brand.d.ts +1 -0
  8. package/dist/brand.js +2 -0
  9. package/dist/charts/ChartCard.d.ts +32 -0
  10. package/dist/charts/charts.d.ts +124 -0
  11. package/dist/charts/echartsTheme.d.ts +19 -0
  12. package/dist/charts/index.d.ts +8 -0
  13. package/dist/charts/palette.d.ts +59 -0
  14. package/dist/charts.d.ts +1 -0
  15. package/dist/charts.js +473 -0
  16. package/dist/charts.js.map +1 -0
  17. package/dist/chat/ChatComposer.d.ts +34 -0
  18. package/dist/chat/ChatLayout.d.ts +53 -0
  19. package/dist/chat/ChatMessage.d.ts +26 -0
  20. package/dist/chat/ChatThread.d.ts +36 -0
  21. package/dist/chat/ConversationList.d.ts +22 -0
  22. package/dist/chat/TypingIndicator.d.ts +8 -0
  23. package/dist/chat/index.d.ts +9 -0
  24. package/dist/chat/node.d.ts +12 -0
  25. package/dist/chat/types.d.ts +38 -0
  26. package/dist/chat/utils.d.ts +25 -0
  27. package/dist/chat.d.ts +1 -0
  28. package/dist/chat.js +661 -0
  29. package/dist/chat.js.map +1 -0
  30. package/dist/colors-DUSEhAuo.js +32 -0
  31. package/dist/colors-DUSEhAuo.js.map +1 -0
  32. package/dist/components/ContentCard/ContentCard.d.ts +8 -0
  33. package/dist/components/ContentCard/ContentCard.types.d.ts +34 -0
  34. package/dist/components/ContentCard/ContentCard.vue.d.ts +35 -0
  35. package/dist/components/ContentCard/index.d.ts +1 -0
  36. package/dist/components/CouponCode/CouponCode.d.ts +20 -0
  37. package/dist/components/CouponCode/index.d.ts +1 -0
  38. package/dist/components/DataTable/DataTable.d.ts +95 -0
  39. package/dist/components/DataTable/index.d.ts +1 -0
  40. package/dist/components/KpiCard/KpiCard.d.ts +12 -0
  41. package/dist/components/KpiCard/KpiCard.types.d.ts +44 -0
  42. package/dist/components/KpiCard/KpiCard.vars.d.ts +3 -0
  43. package/dist/components/KpiCard/KpiCard.vue.d.ts +42 -0
  44. package/dist/components/KpiCard/KpiGroup.d.ts +10 -0
  45. package/dist/components/KpiCard/index.d.ts +1 -0
  46. package/dist/components/PageHeader/PageHeader.d.ts +29 -0
  47. package/dist/components/PageHeader/index.d.ts +1 -0
  48. package/dist/components/PriceTag/PriceTag.d.ts +21 -0
  49. package/dist/components/PriceTag/index.d.ts +1 -0
  50. package/dist/components/ProductCard/ProductCard.d.ts +12 -0
  51. package/dist/components/ProductCard/ProductCard.types.d.ts +53 -0
  52. package/dist/components/ProductCard/ProductCard.vue.d.ts +45 -0
  53. package/dist/components/ProductCard/index.d.ts +1 -0
  54. package/dist/components/PromoBanner/PromoBanner.d.ts +12 -0
  55. package/dist/components/PromoBanner/PromoBanner.types.d.ts +50 -0
  56. package/dist/components/PromoBanner/PromoBanner.vars.d.ts +2 -0
  57. package/dist/components/PromoBanner/PromoBanner.vue.d.ts +41 -0
  58. package/dist/components/PromoBanner/index.d.ts +1 -0
  59. package/dist/components/Tag/Tag.d.ts +18 -0
  60. package/dist/components/Tag/index.d.ts +1 -0
  61. package/dist/components/ThemeToggle/ThemeToggle.d.ts +10 -0
  62. package/dist/components/ThemeToggle/index.d.ts +1 -0
  63. package/dist/components/TokenSwatch/TokenSwatch.d.ts +21 -0
  64. package/dist/components/TokenSwatch/index.d.ts +1 -0
  65. package/dist/components/TopNav/TopNav.d.ts +9 -0
  66. package/dist/components/TopNav/TopNav.types.d.ts +50 -0
  67. package/dist/components/TopNav/TopNav.vue.d.ts +33 -0
  68. package/dist/components/TopNav/index.d.ts +1 -0
  69. package/dist/components/Typography/Typography.d.ts +41 -0
  70. package/dist/components/Typography/index.d.ts +1 -0
  71. package/dist/components/index.d.ts +13 -0
  72. package/dist/format-D40SMATK.js +108 -0
  73. package/dist/format-D40SMATK.js.map +1 -0
  74. package/dist/index.d.ts +15 -0
  75. package/dist/index.js +2239 -0
  76. package/dist/index.js.map +1 -0
  77. package/dist/provider/JcProvider.d.ts +285 -0
  78. package/dist/styles.css +2 -0
  79. package/dist/theme/colors.d.ts +26 -0
  80. package/dist/theme/components/buttons.d.ts +2 -0
  81. package/dist/theme/components/combobox.d.ts +2 -0
  82. package/dist/theme/components/dataDisplay.d.ts +2 -0
  83. package/dist/theme/components/feedback.d.ts +2 -0
  84. package/dist/theme/components/index.d.ts +3 -0
  85. package/dist/theme/components/inputs.d.ts +2 -0
  86. package/dist/theme/components/layout.d.ts +2 -0
  87. package/dist/theme/components/misc.d.ts +2 -0
  88. package/dist/theme/components/navigation.d.ts +2 -0
  89. package/dist/theme/components/overlays.d.ts +2 -0
  90. package/dist/theme/components/types.d.ts +11 -0
  91. package/dist/theme/components/typography.d.ts +2 -0
  92. package/dist/theme/controls.d.ts +44 -0
  93. package/dist/theme/cssVariablesResolver.d.ts +2 -0
  94. package/dist/theme/theme.d.ts +3 -0
  95. package/dist/theme/themeDefaults.d.ts +18 -0
  96. package/dist/theme/tokens.d.ts +457 -0
  97. package/dist/theme/variantColorResolver.d.ts +9 -0
  98. package/dist/themeDefaults-Ckd05FUY.js +29 -0
  99. package/dist/themeDefaults-Ckd05FUY.js.map +1 -0
  100. package/dist/tokens-CDSk_JkY.js +315 -0
  101. package/dist/tokens-CDSk_JkY.js.map +1 -0
  102. package/dist/tokens.d.ts +2 -0
  103. package/dist/tokens.js +3 -0
  104. package/dist/utils/format.d.ts +14 -0
  105. package/dist/utils/styles-api.d.ts +15 -0
  106. package/dist/utils/vue.d.ts +27 -0
  107. package/package.json +109 -0
@@ -0,0 +1,53 @@
1
+ import { type DefineSetupFnComponent, type SlotsType, type VNodeChild } from 'vue';
2
+ import { type BoxProps, type MantineNode } from '@mantine-vue/core';
3
+ export interface ChatHeaderProps extends BoxProps {
4
+ /** Nome da conversa. O slot `#title` tem prioridade. */
5
+ title?: MantineNode;
6
+ /** Status/descrição abaixo do título. O slot `#subtitle` tem prioridade. */
7
+ subtitle?: MantineNode;
8
+ avatar?: string;
9
+ /** Nome para iniciais do avatar */
10
+ avatarName?: string;
11
+ online?: boolean;
12
+ /** Ações à direita (botões, menu). O slot `#actions` tem prioridade. */
13
+ actions?: MantineNode;
14
+ }
15
+ export type ChatHeaderEmits = {
16
+ /** Clique no botão voltar. O botão (mobile) só aparece quando há um listener `@back`. */
17
+ back: () => void;
18
+ };
19
+ export interface ChatHeaderSlots {
20
+ title?: () => VNodeChild;
21
+ subtitle?: () => VNodeChild;
22
+ actions?: () => VNodeChild;
23
+ }
24
+ /**
25
+ * Cabeçalho da conversa: avatar, nome, status e ações.
26
+ *
27
+ * O botão voltar aparece só com `@back` (equivalente à presença de `onBack` no @jcdecor/ui):
28
+ * `onBack` é declarado como prop — padrão do Vue para detectar se o pai escutou o evento.
29
+ */
30
+ export declare const ChatHeader: DefineSetupFnComponent<ChatHeaderProps, ChatHeaderEmits, SlotsType<ChatHeaderSlots>>;
31
+ export interface ChatLayoutProps extends BoxProps {
32
+ /** Lista de conversas (coluna esquerda) — omita para um chat único. O slot `#sidebar` tem prioridade. */
33
+ sidebar?: MantineNode;
34
+ /** Normalmente um <ChatHeader />. O slot `#header` tem prioridade. */
35
+ header?: MantineNode;
36
+ /** Normalmente um <ChatComposer />. O slot `#composer` tem prioridade. */
37
+ composer?: MantineNode;
38
+ /** Altura total @default 600 */
39
+ height?: number | string;
40
+ /** @default 320 */
41
+ sidebarWidth?: number | string;
42
+ /** Em telas pequenas mostra só a lista ou só a conversa @default 'thread' */
43
+ mobileView?: 'list' | 'thread';
44
+ }
45
+ export interface ChatLayoutSlots {
46
+ /** Normalmente um <ChatThread /> */
47
+ default?: () => VNodeChild;
48
+ sidebar?: () => VNodeChild;
49
+ header?: () => VNodeChild;
50
+ composer?: () => VNodeChild;
51
+ }
52
+ /** Layout de chat: conversas + cabeçalho + mensagens + composer (responsivo). */
53
+ export declare const ChatLayout: DefineSetupFnComponent<ChatLayoutProps, {}, SlotsType<ChatLayoutSlots>>;
@@ -0,0 +1,26 @@
1
+ import { type DefineSetupFnComponent, type SlotsType, type VNodeChild } from 'vue';
2
+ import { type BoxProps } from '@mantine-vue/core';
3
+ import { type GroupPosition } from './utils';
4
+ import type { ChatAttachment, ChatMessageStatus, ChatUser } from './types';
5
+ export interface ChatMessageProps extends BoxProps {
6
+ /** Mensagem do usuário atual (alinhada à direita, bolha azul) */
7
+ own?: boolean;
8
+ author?: ChatUser;
9
+ /** Exibe o nome do autor acima da bolha (útil em grupos) */
10
+ showAuthor?: boolean;
11
+ /** Exibe avatar ao lado da bolha (só na última mensagem do grupo) @default true */
12
+ showAvatar?: boolean;
13
+ createdAt?: Date | string | number;
14
+ status?: ChatMessageStatus;
15
+ attachments?: ChatAttachment[];
16
+ /** Posição dentro de um grupo de mensagens consecutivas @default 'single' */
17
+ position?: GroupPosition;
18
+ /** Mensagem de sistema (centralizada) */
19
+ system?: boolean;
20
+ }
21
+ export interface ChatMessageSlots {
22
+ /** Conteúdo da bolha (texto, links, cards…). Sem conteúdo, a bolha não é renderizada. */
23
+ default?: () => VNodeChild;
24
+ }
25
+ /** Bolha de mensagem de chat. O slot padrão é o conteúdo da bolha; atributos vão para o Box raiz. */
26
+ export declare const ChatMessage: DefineSetupFnComponent<ChatMessageProps, {}, SlotsType<ChatMessageSlots>>;
@@ -0,0 +1,36 @@
1
+ import { type DefineSetupFnComponent, type SlotsType, type VNodeChild } from 'vue';
2
+ import { type MantineNode, type ScrollAreaProps } from '@mantine-vue/core';
3
+ import type { ChatMessageData, ChatUser } from './types';
4
+ export interface ChatThreadProps extends ScrollAreaProps {
5
+ messages: ChatMessageData[];
6
+ /** Id do usuário atual — suas mensagens ficam à direita */
7
+ currentUserId: string;
8
+ users?: ChatUser[] | Record<string, ChatUser>;
9
+ /** Nomes de quem está digitando agora */
10
+ typing?: string[];
11
+ /** Mostra nome do autor no início de cada grupo (conversas em grupo) */
12
+ showAuthors?: boolean;
13
+ /** Rola para a última mensagem quando chegam novas (se o usuário estiver perto do fim) @default true */
14
+ autoScroll?: boolean;
15
+ /** Janela (ms) para agrupar mensagens consecutivas do mesmo autor @default 300000 */
16
+ groupWindow?: number;
17
+ /** Conteúdo exibido quando não há mensagens. O slot `#empty` tem prioridade. */
18
+ empty?: MantineNode;
19
+ /** Renderização customizada do conteúdo da bolha. O slot `#content="{ message }"` tem prioridade. */
20
+ renderContent?: (message: ChatMessageData) => VNodeChild;
21
+ /** Altura da área rolável @default '100%' */
22
+ h?: ScrollAreaProps['h'];
23
+ }
24
+ export interface ChatThreadSlots {
25
+ /** Conteúdo exibido quando não há mensagens */
26
+ empty?: () => VNodeChild;
27
+ /** Conteúdo customizado da bolha de cada mensagem */
28
+ content?: (props: {
29
+ message: ChatMessageData;
30
+ }) => VNodeChild;
31
+ }
32
+ /**
33
+ * Lista rolável de mensagens com separadores de data, agrupamento e auto-scroll.
34
+ * Atributos e props do ScrollArea (`type`, `scrollbarSize`…) vão para o ScrollArea raiz.
35
+ */
36
+ export declare const ChatThread: DefineSetupFnComponent<ChatThreadProps, {}, SlotsType<ChatThreadSlots>>;
@@ -0,0 +1,22 @@
1
+ import { type DefineSetupFnComponent, type SlotsType, type VNodeChild } from 'vue';
2
+ import { type BoxProps, type MantineNode } from '@mantine-vue/core';
3
+ import type { Conversation } from './types';
4
+ export interface ConversationListProps extends BoxProps {
5
+ conversations: Conversation[];
6
+ activeId?: string | null;
7
+ /** Exibe campo de busca @default true */
8
+ searchable?: boolean;
9
+ searchPlaceholder?: string;
10
+ /** Conteúdo quando a lista (ou a busca) fica vazia. O slot `#empty` tem prioridade. */
11
+ empty?: MantineNode;
12
+ }
13
+ export type ConversationListEmits = {
14
+ /** Clique em uma conversa */
15
+ select: (conversation: Conversation) => void;
16
+ };
17
+ export interface ConversationListSlots {
18
+ /** Conteúdo quando a lista (ou a busca) fica vazia */
19
+ empty?: () => VNodeChild;
20
+ }
21
+ /** Lista de conversas com busca, não lidas, presença e última mensagem. */
22
+ export declare const ConversationList: DefineSetupFnComponent<ConversationListProps, ConversationListEmits, SlotsType<ConversationListSlots>>;
@@ -0,0 +1,8 @@
1
+ import { type DefineSetupFnComponent } from 'vue';
2
+ import { type BoxProps } from '@mantine-vue/core';
3
+ export interface TypingIndicatorProps extends BoxProps {
4
+ /** Nomes de quem está digitando. Vazio = só os pontinhos. */
5
+ names?: string[];
6
+ }
7
+ /** Indicador animado de "digitando…". Atributos e style props (`mt`, `ml`…) vão para o Box raiz. */
8
+ export declare const TypingIndicator: DefineSetupFnComponent<TypingIndicatorProps>;
@@ -0,0 +1,9 @@
1
+ export * from './types';
2
+ export * from './ChatMessage';
3
+ export * from './ChatThread';
4
+ export * from './ChatComposer';
5
+ export * from './TypingIndicator';
6
+ export * from './ConversationList';
7
+ export * from './ChatLayout';
8
+ export { buildThread, dayLabel, shortTimeLabel, formatBytes, initialsName } from './utils';
9
+ export type { GroupPosition, ThreadItem } from './utils';
@@ -0,0 +1,12 @@
1
+ import { type PropType, type VNodeChild } from 'vue';
2
+ import type { MantineNode } from '@mantine-vue/core';
3
+ /**
4
+ * Prop que espelha um `React.ReactNode` do @jcdecor/ui: aceita VNode, texto ou função de render.
5
+ * Sem validação de tipo em runtime (VNodeChild inclui string, número, array, objeto, função…).
6
+ */
7
+ export declare const nodeProp: {
8
+ type: PropType<MantineNode>;
9
+ default: undefined;
10
+ };
11
+ /** `true` se o conteúdo renderiza algo visível (ignora null, false, '', comentários e fragments vazios). */
12
+ export declare function hasContent(node: VNodeChild): boolean;
@@ -0,0 +1,38 @@
1
+ export type ChatMessageStatus = 'sending' | 'sent' | 'delivered' | 'read' | 'error';
2
+ export interface ChatUser {
3
+ id: string;
4
+ name: string;
5
+ avatar?: string;
6
+ /** Cor do avatar com iniciais (cor do tema) */
7
+ color?: string;
8
+ }
9
+ export interface ChatAttachment {
10
+ name: string;
11
+ url?: string;
12
+ /** `image` exibe miniatura; `file` exibe chip com nome/tamanho */
13
+ type?: 'image' | 'file';
14
+ /** Tamanho em bytes */
15
+ size?: number;
16
+ }
17
+ export interface ChatMessageData {
18
+ id: string;
19
+ authorId: string;
20
+ text?: string;
21
+ createdAt: Date | string | number;
22
+ status?: ChatMessageStatus;
23
+ attachments?: ChatAttachment[];
24
+ /** Mensagem de sistema (centralizada, sem bolha) */
25
+ system?: boolean;
26
+ }
27
+ export interface Conversation {
28
+ id: string;
29
+ name: string;
30
+ avatar?: string;
31
+ color?: string;
32
+ lastMessage?: string;
33
+ lastMessageAt?: Date | string | number;
34
+ unread?: number;
35
+ online?: boolean;
36
+ /** Selo/etiqueta (ex.: "Pedido #1234") */
37
+ tag?: string;
38
+ }
@@ -0,0 +1,25 @@
1
+ import type { ChatMessageData } from './types';
2
+ export declare function toDate(value: Date | string | number): Date;
3
+ /** "Hoje", "Ontem", "segunda-feira" (últimos 7 dias) ou "12 de set. de 2026". */
4
+ export declare function dayLabel(value: Date | string | number, now?: Date): string;
5
+ /** Horário curto para listas: "14:32" hoje, "Ontem", ou "12/09". */
6
+ export declare function shortTimeLabel(value: Date | string | number, now?: Date): string;
7
+ export type GroupPosition = 'single' | 'first' | 'middle' | 'last';
8
+ export type ThreadItem = {
9
+ type: 'separator';
10
+ key: string;
11
+ label: string;
12
+ } | {
13
+ type: 'message';
14
+ key: string;
15
+ message: ChatMessageData;
16
+ position: GroupPosition;
17
+ };
18
+ /**
19
+ * Agrupa mensagens consecutivas do mesmo autor (janela de `groupWindowMs`)
20
+ * e insere separadores de data.
21
+ */
22
+ export declare function buildThread(messages: ChatMessageData[], groupWindowMs?: number, now?: Date): ThreadItem[];
23
+ /** Remove símbolos/separadores para as iniciais do Avatar: "Bruno · Instalação" → "Bruno Instalação" (BI). */
24
+ export declare function initialsName(name: string): string;
25
+ export declare function formatBytes(bytes: number): string;
package/dist/chat.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from './chat/index';