flicker-alerts 1.0.32 → 1.0.33

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 (3) hide show
  1. package/index.d.ts +4 -3
  2. package/index.js +3 -13
  3. package/package.json +2 -2
package/index.d.ts CHANGED
@@ -1,20 +1,21 @@
1
1
  declare module 'flicker-alerts' {
2
2
  // Definição das opções para os alertas
3
3
  interface AlertOptions {
4
- type: 'success' | 'info' | 'warning' | 'danger';
4
+ type: 'success' | 'info' | 'warning' | 'danger'; // Tipos de alerta disponíveis
5
5
  title: string;
6
6
  message: string;
7
- duration?: number; // Duração opcional do alerta
7
+ timer?: number; // Duração opcional do alerta (em milissegundos)
8
8
  position?: 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left' | 'center' | 'top-center' | 'bottom-center'; // Posições possíveis do alerta
9
9
  }
10
10
 
11
11
  // Definição das opções para os modais
12
12
  interface ModalOptions {
13
- type: 'warning' | 'danger' | 'info' | 'success'; // Tipos de modais disponíveis
13
+ type: 'warning' | 'delete' ; // Tipos de modal disponíveis
14
14
  title: string;
15
15
  message: string;
16
16
  onConfirm?: () => void; // Função executada no botão de confirmação
17
17
  onCancel?: () => void; // Função executada no botão de cancelamento
18
+ timer?: number; // Duração opcional do modal (em milissegundos)
18
19
  }
19
20
 
20
21
  // Classe principal para a biblioteca FlickerAlerts
package/index.js CHANGED
@@ -1,6 +1,3 @@
1
-
2
-
3
-
4
1
  const FlickerAlerts = {
5
2
  showAlert: function ({ type, title, message, timer = 3000, position = 'top-right' }) {
6
3
  if (typeof window !== 'undefined' && typeof document !== 'undefined') {
@@ -38,7 +35,7 @@ const FlickerAlerts = {
38
35
  divider.className = 'divider';
39
36
  console.log(`Created divider for ${type}`); // Para depuração
40
37
  alertBox.appendChild(divider);
41
-
38
+
42
39
  // Conteúdo
43
40
  const content = document.createElement('div');
44
41
  content.innerHTML = `<div class="title">${title}</div><div class="message">${message}</div>`;
@@ -75,9 +72,6 @@ const FlickerAlerts = {
75
72
  },
76
73
  };
77
74
 
78
-
79
-
80
-
81
75
  // Botões de teste - Eles podem ser removidos se não forem necessários
82
76
  if (typeof document !== 'undefined') {
83
77
  document.getElementById('success-btn')?.addEventListener('click', () => {
@@ -97,12 +91,8 @@ if (typeof document !== 'undefined') {
97
91
  });
98
92
  }
99
93
 
100
- // Exportação
101
- export default FlickerAlerts;
102
-
103
-
104
94
  const FlickerModals = {
105
- showModal: function ({ type, title, message, onConfirm, onCancel }) {
95
+ showModal: function ({ type, title, message, timer = 3000, onConfirm, onCancel }) {
106
96
  if (typeof window !== 'undefined' && typeof document !== 'undefined') {
107
97
  let container = document.getElementById('modals-container');
108
98
  if (!container) {
@@ -230,4 +220,4 @@ if (typeof document !== 'undefined') {
230
220
  });
231
221
  }
232
222
 
233
-
223
+ export default FlickerAlerts;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flicker-alerts",
3
- "version": "1.0.32",
3
+ "version": "1.0.33",
4
4
  "description": "Biblioteca para alertas animados",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -16,6 +16,6 @@
16
16
  "author": "https://www.linkedin.com/in/bruno-carneiro-9a51aa190/",
17
17
  "license": "MIT",
18
18
  "dependencies": {
19
- "flicker-alerts": "^1.0.32"
19
+ "flicker-alerts": "^1.0.33"
20
20
  }
21
21
  }