@samline/notify 0.2.2 → 0.2.3
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/README.md +3 -3
- package/dist/styles.css +33 -19
- package/docs/browser.md +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -50,8 +50,8 @@ Use the browser build when your project loads scripts directly and cannot compil
|
|
|
50
50
|
|
|
51
51
|
|
|
52
52
|
```html
|
|
53
|
-
<script src="https://unpkg.com/@samline/notify@0.2.
|
|
54
|
-
<link rel="stylesheet" href="https://unpkg.com/@samline/notify@0.2.
|
|
53
|
+
<script src="https://unpkg.com/@samline/notify@0.2.3/dist/notify.umd.js"></script>
|
|
54
|
+
<link rel="stylesheet" href="https://unpkg.com/@samline/notify@0.2.3/dist/styles.css" />
|
|
55
55
|
|
|
56
56
|
<script>
|
|
57
57
|
// Always use an array of strings as the second argument
|
|
@@ -81,7 +81,7 @@ Choose the entrypoint matching your stack so you only import what you need.
|
|
|
81
81
|
| Use case | Import | Guide |
|
|
82
82
|
| ------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------- |
|
|
83
83
|
| Vanilla JS | `import { notify, initToasters } from '@samline/notify/vanilla'` | [docs/vanilla.md](docs/vanilla.md) |
|
|
84
|
-
| Browser / CDN | `<script src="https://unpkg.com/@samline/notify@0.2.
|
|
84
|
+
| Browser / CDN | `<script src="https://unpkg.com/@samline/notify@0.2.3/dist/notify.umd.js"></script>`<br/>`const api = window.notify; api.initToasters(...);` | [docs/browser.md](docs/browser.md) |
|
|
85
85
|
| React | `import { Toaster, notify } from '@samline/notify/react'` | [docs/react.md](docs/react.md) |
|
|
86
86
|
| Vue | `import { Toaster, notify } from '@samline/notify/vue'` | [docs/vue.md](docs/vue.md) |
|
|
87
87
|
| Svelte | `import Toaster, { notify } from '@samline/notify/svelte'` | [docs/svelte.md](docs/svelte.md) |
|
package/dist/styles.css
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
--sileo-error: #ef4444;
|
|
6
6
|
--sileo-info: #2563eb;
|
|
7
7
|
--sileo-warning: #f59e0b;
|
|
8
|
-
--sileo-gap:
|
|
8
|
+
--sileo-gap: 0.75rem;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
.sileo-toaster{
|
|
@@ -17,33 +17,47 @@
|
|
|
17
17
|
pointer-events: none;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
.sileo-toaster[data-position="top-right"]{ top:
|
|
21
|
-
.sileo-toaster[data-position="top-left"]{ top:
|
|
22
|
-
.sileo-toaster[data-position="bottom-right"]{ bottom:
|
|
23
|
-
.sileo-toaster[data-position="bottom-left"]{ bottom:
|
|
20
|
+
.sileo-toaster[data-position="top-right"]{ top: 1rem; right: 1rem; align-items:flex-end; }
|
|
21
|
+
.sileo-toaster[data-position="top-left"]{ top: 1rem; left: 1rem; align-items:flex-start; }
|
|
22
|
+
.sileo-toaster[data-position="bottom-right"]{ bottom: 1rem; right: 1rem; align-items:flex-end; }
|
|
23
|
+
.sileo-toaster[data-position="bottom-left"]{ bottom: 1rem; left: 1rem; align-items:flex-start; }
|
|
24
|
+
|
|
25
|
+
/* Soporte para posiciones centradas */
|
|
26
|
+
.sileo-toaster[data-position="top-center"] {
|
|
27
|
+
top: 1rem;
|
|
28
|
+
left: 50%;
|
|
29
|
+
transform: translateX(-50%);
|
|
30
|
+
align-items: center;
|
|
31
|
+
}
|
|
32
|
+
.sileo-toaster[data-position="bottom-center"] {
|
|
33
|
+
bottom: 1rem;
|
|
34
|
+
left: 50%;
|
|
35
|
+
transform: translateX(-50%);
|
|
36
|
+
align-items: center;
|
|
37
|
+
}
|
|
24
38
|
|
|
25
39
|
.sileo-toast{
|
|
26
40
|
pointer-events: auto;
|
|
27
|
-
min-width:
|
|
28
|
-
max-width:
|
|
41
|
+
min-width: 13.75rem;
|
|
42
|
+
max-width: 22.5rem;
|
|
29
43
|
background: var(--sileo-bg);
|
|
30
44
|
color: var(--sileo-foreground);
|
|
31
|
-
padding:
|
|
32
|
-
border-radius:
|
|
33
|
-
box-shadow: 0
|
|
45
|
+
padding: 0.75rem 0.875rem;
|
|
46
|
+
border-radius: 0.625rem;
|
|
47
|
+
box-shadow: 0 0.375rem 1.125rem rgba(2,6,23,0.6);
|
|
34
48
|
display: flex;
|
|
35
|
-
gap:
|
|
49
|
+
gap: 0.5rem;
|
|
36
50
|
align-items: center;
|
|
37
51
|
position: relative;
|
|
38
52
|
overflow: hidden;
|
|
39
53
|
}
|
|
40
54
|
|
|
41
|
-
.sileo-toast[data-type="success"]{ border-left:
|
|
42
|
-
.sileo-toast[data-type="error"]{ border-left:
|
|
43
|
-
.sileo-toast[data-type="info"]{ border-left:
|
|
44
|
-
.sileo-toast[data-type="warning"]{ border-left:
|
|
55
|
+
.sileo-toast[data-type="success"]{ border-left: 0.25rem solid var(--sileo-success); }
|
|
56
|
+
.sileo-toast[data-type="error"]{ border-left: 0.25rem solid var(--sileo-error); }
|
|
57
|
+
.sileo-toast[data-type="info"]{ border-left: 0.25rem solid var(--sileo-info); }
|
|
58
|
+
.sileo-toast[data-type="warning"]{ border-left: 0.25rem solid var(--sileo-warning); }
|
|
45
59
|
|
|
46
|
-
.sileo-toast-header{ font-weight: 600; font-size:
|
|
47
|
-
.sileo-toast-desc{ font-size:
|
|
48
|
-
.sileo-toast-btn{ margin-left:
|
|
49
|
-
.sileo-toast-close{ position: absolute; right:
|
|
60
|
+
.sileo-toast-header{ font-weight: 600; font-size: 0.875rem; }
|
|
61
|
+
.sileo-toast-desc{ font-size: 0.8125rem; opacity: 0.85; margin-top: 0.25rem; }
|
|
62
|
+
.sileo-toast-btn{ margin-left: 0.5rem; background: transparent; color: inherit; border: 1px solid rgba(255,255,255,0.08); padding: 0.375rem 0.5rem; border-radius: 0.375rem; cursor: pointer; }
|
|
63
|
+
.sileo-toast-close{ position: absolute; right: 0.5rem; top: 0.375rem; background: transparent; border: none; color: inherit; font-size: 1rem; cursor: pointer; }
|
package/docs/browser.md
CHANGED
|
@@ -8,8 +8,8 @@ Use this package directly in the browser when you cannot use npm modules or a bu
|
|
|
8
8
|
Add the stylesheet and UMD bundle to your HTML:
|
|
9
9
|
|
|
10
10
|
```html
|
|
11
|
-
<link rel="stylesheet" href="https://unpkg.com/@samline/notify@0.2.
|
|
12
|
-
<script src="https://unpkg.com/@samline/notify@0.2.
|
|
11
|
+
<link rel="stylesheet" href="https://unpkg.com/@samline/notify@0.2.3/dist/styles.css">
|
|
12
|
+
<script src="https://unpkg.com/@samline/notify@0.2.3/dist/notify.umd.js"></script>
|
|
13
13
|
<script>
|
|
14
14
|
document.addEventListener('DOMContentLoaded', () => {
|
|
15
15
|
const api = window.notify; // or window.notifications for legacy
|
package/package.json
CHANGED