teraprox-ui-kit 0.1.0 → 0.1.2

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/dist/index.d.mts CHANGED
@@ -13,6 +13,43 @@ interface DeleteButtonProps {
13
13
  }
14
14
  declare const DeleteButton: React.FC<DeleteButtonProps>;
15
15
 
16
+ interface ActionButtonsProps {
17
+ /** Botão Salvar */
18
+ onSave?: () => void;
19
+ saveLabel?: string;
20
+ saveVariant?: string;
21
+ disabled?: boolean;
22
+ /** Botão Excluir */
23
+ onDelete?: (details?: string) => void;
24
+ deleteLabel?: string;
25
+ deleteConfirmMsg?: string;
26
+ needExclusionDetails?: boolean;
27
+ /** Botão Voltar */
28
+ onBack?: () => void;
29
+ backLabel?: string;
30
+ /** Botão Cancelar Edição */
31
+ onCancelEdit?: () => void;
32
+ cancelEditLabel?: string;
33
+ /** Botão Copiar Form */
34
+ onCopy?: () => void;
35
+ copyLabel?: string;
36
+ /** Meta-estado */
37
+ isEditing?: boolean;
38
+ /** Configuração Especial: Deleção com Delay (Hold for 3s) */
39
+ useDelayedDelete?: boolean;
40
+ delayedDeleteTimeout?: number;
41
+ /** Wrapper opcional para controle de permissões (ex: PermissionContainer) */
42
+ PermissionWrapper?: React.ComponentType<{
43
+ children: React.ReactNode;
44
+ id?: string;
45
+ }>;
46
+ }
47
+ /**
48
+ * Agrupamento de botões de ação (Salvar, Excluir, Voltar, etc) padronizado.
49
+ * Agrega funcionalidade de confirmação de deleção e animação de 'hold-to-delete'.
50
+ */
51
+ declare const ActionButtons: React.FC<ActionButtonsProps>;
52
+
16
53
  interface ResponsiveContainerProps {
17
54
  title?: string;
18
55
  show: boolean;
@@ -68,6 +105,117 @@ interface GenericDisplayProps {
68
105
  }
69
106
  declare const GenericDisplay: React.FC<GenericDisplayProps>;
70
107
 
108
+ interface MailSenderProps {
109
+ /** Conteúdo HTML a ser enviado no corpo do e-mail */
110
+ htmlContent: string;
111
+ /** Nome da empresa para o assunto/corpo padrão */
112
+ companyName: string;
113
+ /** Callback para buscar a lista de e-mails da companhia */
114
+ onFetchEmails: () => Promise<Array<{
115
+ email: string;
116
+ }>>;
117
+ /** Callback para enviar o e-mail consolidado */
118
+ onSendEmail: (emailData: {
119
+ to: string;
120
+ subject: string;
121
+ text: string;
122
+ html: string;
123
+ }) => Promise<void>;
124
+ /** Flag para ocultar o componente */
125
+ hide?: boolean;
126
+ /** Render prop opcional para o botão de ativação customizado */
127
+ renderTrigger?: (props: {
128
+ onClick: () => void;
129
+ loading: boolean;
130
+ }) => React.ReactNode;
131
+ }
132
+ /**
133
+ * Componente para seleção de destinatários e envio de e-mails.
134
+ * Refatorado para ser agnóstico a implementações de hooks/endpoints específicos das apps.
135
+ */
136
+ declare const MailSender: React.FC<MailSenderProps>;
137
+
138
+ interface DeleteConfirmProps {
139
+ /** Controla visibilidade do modal */
140
+ show: boolean;
141
+ /** Fecha o modal */
142
+ onHide: (show: boolean) => void;
143
+ /** Callback chamado ao confirmar a exclusão */
144
+ onConfirm: (details: string) => void;
145
+ /** Título do modal */
146
+ title?: string;
147
+ /** Texto do corpo do modal (pode ser string ou função que recebe payload) */
148
+ dialogText?: string | ((payload: any) => string);
149
+ /** Dados extras para o dialogText */
150
+ payload?: any;
151
+ /** Se true, exige um campo de 'Motivo' com pelo menos 8 caracteres */
152
+ needExclusionDetails?: boolean;
153
+ }
154
+ /**
155
+ * Modal de confirmação de exclusão padronizado.
156
+ */
157
+ declare const DeleteConfirm: React.FC<DeleteConfirmProps>;
158
+
159
+ interface AutoCompleteProps {
160
+ className?: string;
161
+ /** Opções estáticas iniciais */
162
+ ops?: any[];
163
+ /** Chave para ordenação */
164
+ sortKey?: string;
165
+ /** Chave para exibição no input */
166
+ displayKey?: string;
167
+ /** Chaves para exibição concatenada */
168
+ displayKeys?: string[];
169
+ /** Callback de alteração no input */
170
+ onValueChanged?: (val: string) => void;
171
+ /** Callback ao clicar em uma sugestão */
172
+ onSelectedClick: (li: any, index: number, lItem: any[]) => void;
173
+ /** Valor controlado */
174
+ value?: string;
175
+ /** Botão de ação opcional (ex: clear) */
176
+ actionButton?: (clear: () => void) => React.ReactNode;
177
+ /** Segundo botão de ação opcional */
178
+ actionButton2?: (input: string) => React.ReactNode;
179
+ placeH?: string;
180
+ title?: string;
181
+ /** Valor para filtrar a lista inicial */
182
+ filter?: any;
183
+ filterField?: string;
184
+ /** Função de carregamento assíncrono */
185
+ loadFunc?: () => Promise<any[]>;
186
+ /** Condição para disparar o carregamento */
187
+ loadCondition?: boolean;
188
+ onBlurEvent?: (e: React.FocusEvent<HTMLInputElement>, input: string) => void;
189
+ /** Função customizada para formatar a label da lista */
190
+ formatationFunc?: (item: any) => string;
191
+ onEscKeyDown?: () => void;
192
+ onEnterKeyDown?: (input: string) => void;
193
+ /** Margem superior */
194
+ margT?: number;
195
+ /** Margem inferior */
196
+ margB?: number;
197
+ hideComponent?: boolean;
198
+ disableComponent?: boolean;
199
+ disableSelect?: boolean;
200
+ autoFocusConfig?: boolean;
201
+ onLoad?: (data: any[]) => void;
202
+ /** Chave para cache em memória */
203
+ cacheKey?: string;
204
+ /** Mínimo de caracteres para mostrar a lista */
205
+ minChars?: number;
206
+ /** Limite de itens na lista */
207
+ maxItems?: number;
208
+ /** Se deve mostrar a lista ao focar */
209
+ showListOnFocus?: boolean;
210
+ /** Se deve carregar sob demanda ao digitar */
211
+ lazyLoad?: boolean;
212
+ }
213
+ /**
214
+ * Componente de Input com Auto-complete dinâmico.
215
+ * Suporta cache em memória compartilhada entre instâncias via window.
216
+ */
217
+ declare const AutoComplete: React.FC<AutoCompleteProps>;
218
+
71
219
  interface SelectOption {
72
220
  label: string;
73
221
  value: string | number;
@@ -131,4 +279,4 @@ declare class GenericSelectOps {
131
279
  }
132
280
  declare const GenericSelect: React.FC<GenericSelectProps>;
133
281
 
134
- export { AddButton, ConfigObject, DeleteButton, GenericDisplay, GenericForm, GenericSelect, GenericSelectOps, ResponsiveContainer, UuidPill };
282
+ export { ActionButtons, type ActionButtonsProps, AddButton, AutoComplete, type AutoCompleteProps, ConfigObject, DeleteButton, DeleteConfirm, type DeleteConfirmProps, GenericDisplay, GenericForm, GenericSelect, GenericSelectOps, MailSender, type MailSenderProps, ResponsiveContainer, UuidPill };
package/dist/index.d.ts CHANGED
@@ -13,6 +13,43 @@ interface DeleteButtonProps {
13
13
  }
14
14
  declare const DeleteButton: React.FC<DeleteButtonProps>;
15
15
 
16
+ interface ActionButtonsProps {
17
+ /** Botão Salvar */
18
+ onSave?: () => void;
19
+ saveLabel?: string;
20
+ saveVariant?: string;
21
+ disabled?: boolean;
22
+ /** Botão Excluir */
23
+ onDelete?: (details?: string) => void;
24
+ deleteLabel?: string;
25
+ deleteConfirmMsg?: string;
26
+ needExclusionDetails?: boolean;
27
+ /** Botão Voltar */
28
+ onBack?: () => void;
29
+ backLabel?: string;
30
+ /** Botão Cancelar Edição */
31
+ onCancelEdit?: () => void;
32
+ cancelEditLabel?: string;
33
+ /** Botão Copiar Form */
34
+ onCopy?: () => void;
35
+ copyLabel?: string;
36
+ /** Meta-estado */
37
+ isEditing?: boolean;
38
+ /** Configuração Especial: Deleção com Delay (Hold for 3s) */
39
+ useDelayedDelete?: boolean;
40
+ delayedDeleteTimeout?: number;
41
+ /** Wrapper opcional para controle de permissões (ex: PermissionContainer) */
42
+ PermissionWrapper?: React.ComponentType<{
43
+ children: React.ReactNode;
44
+ id?: string;
45
+ }>;
46
+ }
47
+ /**
48
+ * Agrupamento de botões de ação (Salvar, Excluir, Voltar, etc) padronizado.
49
+ * Agrega funcionalidade de confirmação de deleção e animação de 'hold-to-delete'.
50
+ */
51
+ declare const ActionButtons: React.FC<ActionButtonsProps>;
52
+
16
53
  interface ResponsiveContainerProps {
17
54
  title?: string;
18
55
  show: boolean;
@@ -68,6 +105,117 @@ interface GenericDisplayProps {
68
105
  }
69
106
  declare const GenericDisplay: React.FC<GenericDisplayProps>;
70
107
 
108
+ interface MailSenderProps {
109
+ /** Conteúdo HTML a ser enviado no corpo do e-mail */
110
+ htmlContent: string;
111
+ /** Nome da empresa para o assunto/corpo padrão */
112
+ companyName: string;
113
+ /** Callback para buscar a lista de e-mails da companhia */
114
+ onFetchEmails: () => Promise<Array<{
115
+ email: string;
116
+ }>>;
117
+ /** Callback para enviar o e-mail consolidado */
118
+ onSendEmail: (emailData: {
119
+ to: string;
120
+ subject: string;
121
+ text: string;
122
+ html: string;
123
+ }) => Promise<void>;
124
+ /** Flag para ocultar o componente */
125
+ hide?: boolean;
126
+ /** Render prop opcional para o botão de ativação customizado */
127
+ renderTrigger?: (props: {
128
+ onClick: () => void;
129
+ loading: boolean;
130
+ }) => React.ReactNode;
131
+ }
132
+ /**
133
+ * Componente para seleção de destinatários e envio de e-mails.
134
+ * Refatorado para ser agnóstico a implementações de hooks/endpoints específicos das apps.
135
+ */
136
+ declare const MailSender: React.FC<MailSenderProps>;
137
+
138
+ interface DeleteConfirmProps {
139
+ /** Controla visibilidade do modal */
140
+ show: boolean;
141
+ /** Fecha o modal */
142
+ onHide: (show: boolean) => void;
143
+ /** Callback chamado ao confirmar a exclusão */
144
+ onConfirm: (details: string) => void;
145
+ /** Título do modal */
146
+ title?: string;
147
+ /** Texto do corpo do modal (pode ser string ou função que recebe payload) */
148
+ dialogText?: string | ((payload: any) => string);
149
+ /** Dados extras para o dialogText */
150
+ payload?: any;
151
+ /** Se true, exige um campo de 'Motivo' com pelo menos 8 caracteres */
152
+ needExclusionDetails?: boolean;
153
+ }
154
+ /**
155
+ * Modal de confirmação de exclusão padronizado.
156
+ */
157
+ declare const DeleteConfirm: React.FC<DeleteConfirmProps>;
158
+
159
+ interface AutoCompleteProps {
160
+ className?: string;
161
+ /** Opções estáticas iniciais */
162
+ ops?: any[];
163
+ /** Chave para ordenação */
164
+ sortKey?: string;
165
+ /** Chave para exibição no input */
166
+ displayKey?: string;
167
+ /** Chaves para exibição concatenada */
168
+ displayKeys?: string[];
169
+ /** Callback de alteração no input */
170
+ onValueChanged?: (val: string) => void;
171
+ /** Callback ao clicar em uma sugestão */
172
+ onSelectedClick: (li: any, index: number, lItem: any[]) => void;
173
+ /** Valor controlado */
174
+ value?: string;
175
+ /** Botão de ação opcional (ex: clear) */
176
+ actionButton?: (clear: () => void) => React.ReactNode;
177
+ /** Segundo botão de ação opcional */
178
+ actionButton2?: (input: string) => React.ReactNode;
179
+ placeH?: string;
180
+ title?: string;
181
+ /** Valor para filtrar a lista inicial */
182
+ filter?: any;
183
+ filterField?: string;
184
+ /** Função de carregamento assíncrono */
185
+ loadFunc?: () => Promise<any[]>;
186
+ /** Condição para disparar o carregamento */
187
+ loadCondition?: boolean;
188
+ onBlurEvent?: (e: React.FocusEvent<HTMLInputElement>, input: string) => void;
189
+ /** Função customizada para formatar a label da lista */
190
+ formatationFunc?: (item: any) => string;
191
+ onEscKeyDown?: () => void;
192
+ onEnterKeyDown?: (input: string) => void;
193
+ /** Margem superior */
194
+ margT?: number;
195
+ /** Margem inferior */
196
+ margB?: number;
197
+ hideComponent?: boolean;
198
+ disableComponent?: boolean;
199
+ disableSelect?: boolean;
200
+ autoFocusConfig?: boolean;
201
+ onLoad?: (data: any[]) => void;
202
+ /** Chave para cache em memória */
203
+ cacheKey?: string;
204
+ /** Mínimo de caracteres para mostrar a lista */
205
+ minChars?: number;
206
+ /** Limite de itens na lista */
207
+ maxItems?: number;
208
+ /** Se deve mostrar a lista ao focar */
209
+ showListOnFocus?: boolean;
210
+ /** Se deve carregar sob demanda ao digitar */
211
+ lazyLoad?: boolean;
212
+ }
213
+ /**
214
+ * Componente de Input com Auto-complete dinâmico.
215
+ * Suporta cache em memória compartilhada entre instâncias via window.
216
+ */
217
+ declare const AutoComplete: React.FC<AutoCompleteProps>;
218
+
71
219
  interface SelectOption {
72
220
  label: string;
73
221
  value: string | number;
@@ -131,4 +279,4 @@ declare class GenericSelectOps {
131
279
  }
132
280
  declare const GenericSelect: React.FC<GenericSelectProps>;
133
281
 
134
- export { AddButton, ConfigObject, DeleteButton, GenericDisplay, GenericForm, GenericSelect, GenericSelectOps, ResponsiveContainer, UuidPill };
282
+ export { ActionButtons, type ActionButtonsProps, AddButton, AutoComplete, type AutoCompleteProps, ConfigObject, DeleteButton, DeleteConfirm, type DeleteConfirmProps, GenericDisplay, GenericForm, GenericSelect, GenericSelectOps, MailSender, type MailSenderProps, ResponsiveContainer, UuidPill };