flicker-alerts 1.0.15 → 1.0.17

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/index.d.ts CHANGED
@@ -5,7 +5,7 @@ declare module 'flicker-alerts' {
5
5
  title: string;
6
6
  message: string;
7
7
  duration?: number; // Duração do alerta (opcional)
8
- position?: 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left' | 'center' | 'top-center' | 'bottom-center'; // Nova propriedade 'position' com 'bottom-center'
8
+ position?: 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left' | 'center' | 'top-center' | 'bottom-center';
9
9
  }
10
10
 
11
11
  export default class FlickerAlerts {
package/index.js CHANGED
@@ -8,10 +8,15 @@ const FlickerAlerts = {
8
8
  // Cria o container se ele não existir
9
9
  container = document.createElement('div');
10
10
  container.id = 'alerts-container';
11
- container.className = position; // Aplica a classe para posicionar com base na posição fornecida
12
11
  document.body.appendChild(container); // Adiciona o container ao body
12
+ } else {
13
+ // Limpar as classes anteriores de posição
14
+ container.className = '';
13
15
  }
14
16
 
17
+ // Aplica a nova classe de posição
18
+ container.classList.add(position);
19
+
15
20
  // Criação do alerta
16
21
  const alertBox = document.createElement('div');
17
22
  alertBox.className = `alert-custom alert-${type}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flicker-alerts",
3
- "version": "1.0.15",
3
+ "version": "1.0.17",
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": "",
17
17
  "license": "MIT",
18
18
  "dependencies": {
19
- "flicker-alerts": "^1.0.15"
19
+ "flicker-alerts": "^1.0.17"
20
20
  }
21
21
  }
package/style.css CHANGED
@@ -35,12 +35,6 @@
35
35
  font-size: inherit; /* Ajusta o ícone ao tamanho da div */
36
36
  }
37
37
 
38
- .bottom-center {
39
- bottom: 1rem;
40
- left: 50%;
41
- transform: translateX(-50%);
42
- }
43
-
44
38
  /* Estilo do conteúdo do alerta (título e mensagem) */
45
39
  .alert-custom .content {
46
40
  display: flex;
@@ -113,7 +107,7 @@
113
107
  }
114
108
 
115
109
  /* Classes para o container de alertas */
116
- .top-right, .top-left, .bottom-right, .bottom-left, .center, .top-center {
110
+ .top-right, .top-left, .bottom-right, .bottom-left, .center, .top-center, .bottom-center {
117
111
  position: fixed;
118
112
  display: flex;
119
113
  flex-direction: column;
@@ -148,13 +142,18 @@
148
142
  transform: translate(-50%, -50%);
149
143
  }
150
144
 
151
- /* Novo estilo para o top-center */
152
145
  .top-center {
153
146
  top: 1rem;
154
147
  left: 50%;
155
148
  transform: translateX(-50%);
156
149
  }
157
150
 
151
+ .bottom-center {
152
+ bottom: 1rem;
153
+ left: 50%;
154
+ transform: translateX(-50%);
155
+ }
156
+
158
157
  /* Barra de progresso */
159
158
  .progress-bar {
160
159
  position: absolute;