astro-consent 1.0.4 → 1.0.5

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.
@@ -28,7 +28,7 @@ export const DEFAULT_CSS = `
28
28
  --cb-text-size: 0.875rem;
29
29
  }
30
30
 
31
- #astro-cookie-banner {
31
+ #astro-consent-banner {
32
32
  position: fixed;
33
33
  bottom: 0;
34
34
  left: 0;
@@ -40,55 +40,55 @@ export const DEFAULT_CSS = `
40
40
  border-top: 1px solid var(--cb-border);
41
41
  }
42
42
 
43
- #astro-cookie-banner > * {
43
+ #astro-consent-banner > * {
44
44
  max-width: var(--cb-max-width);
45
45
  margin: 0 auto;
46
46
  padding: var(--cb-padding);
47
47
  }
48
48
 
49
- #astro-cookie-banner h2 {
49
+ #astro-consent-banner h2 {
50
50
  margin: 0 0 4px;
51
51
  font-size: var(--cb-title-size);
52
52
  }
53
53
 
54
- #astro-cookie-banner p {
54
+ #astro-consent-banner p {
55
55
  margin: 0;
56
56
  font-size: var(--cb-text-size);
57
57
  color: var(--cb-muted);
58
58
  }
59
59
 
60
- #astro-cookie-banner a {
60
+ #astro-consent-banner a {
61
61
  color: var(--cb-accent);
62
62
  text-decoration: underline;
63
63
  }
64
64
 
65
- .astro-cookie-categories {
65
+ .astro-consent-categories {
66
66
  display: grid;
67
67
  gap: var(--cb-gap);
68
68
  margin-top: var(--cb-gap);
69
69
  }
70
70
 
71
- .astro-cookie-category {
71
+ .astro-consent-category {
72
72
  background: var(--cb-surface);
73
73
  padding: 12px;
74
74
  border-radius: var(--cb-radius);
75
75
  border: 1px solid var(--cb-border);
76
76
  }
77
77
 
78
- .astro-cookie-label {
78
+ .astro-consent-label {
79
79
  display: flex;
80
80
  align-items: center;
81
81
  gap: 8px;
82
82
  font-weight: 600;
83
83
  }
84
84
 
85
- .astro-cookie-description {
85
+ .astro-consent-description {
86
86
  margin: 4px 0 0 26px;
87
87
  font-size: 0.8rem;
88
88
  color: var(--cb-muted);
89
89
  }
90
90
 
91
- .astro-cookie-actions {
91
+ .astro-consent-actions {
92
92
  display: flex;
93
93
  gap: 8px;
94
94
  justify-content: flex-end;
@@ -96,7 +96,7 @@ export const DEFAULT_CSS = `
96
96
  flex-wrap: wrap;
97
97
  }
98
98
 
99
- .astro-cookie-actions button {
99
+ .astro-consent-actions button {
100
100
  padding: 8px 14px;
101
101
  border-radius: var(--cb-radius);
102
102
  font-size: 0.875rem;
@@ -104,14 +104,14 @@ export const DEFAULT_CSS = `
104
104
  border: 1px solid var(--cb-btn-border);
105
105
  }
106
106
 
107
- .astro-cookie-actions button:first-child {
107
+ .astro-consent-actions button:first-child {
108
108
  background: var(--cb-btn-secondary-bg);
109
109
  color: var(--cb-btn-secondary-text);
110
110
  }
111
111
 
112
- .astro-cookie-actions button:last-child {
112
+ .astro-consent-actions button:last-child {
113
113
  background: var(--cb-btn-bg);
114
114
  color: var(--cb-btn-text);
115
115
  border-color: var(--cb-btn-bg);
116
116
  }
117
- `;
117
+ `;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "astro-consent",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "description": "A privacy-first, GDPR-compliant cookie consent banner for Astro with a built-in preferences modal, zero dependencies, and full theme control.",
5
5
  "type": "module",
6
6
  "author": {
package/README.md.bak DELETED
@@ -1,128 +0,0 @@
1
- # astro-cookiebanner
2
-
3
- A **privacy‑first, zero‑dependency cookie consent banner** for Astro projects — built for speed, compliance, and full visual control.
4
-
5
- Designed and maintained by **Velohost**.
6
-
7
- ---
8
-
9
- ## ✨ Features
10
-
11
- - ✅ GDPR / UK GDPR friendly
12
- - 🍪 Essential, Analytics & Marketing categories
13
- - 🎛️ Manage preferences modal with toggle switches
14
- - ⚡ No external dependencies
15
- - 🎨 Fully themeable via CSS variables
16
- - 🧠 Frontend‑controlled script loading
17
- - 🧩 Astro Integration + CLI installer
18
- - 🔁 Easy uninstall via CLI
19
- - 🌍 Framework‑agnostic frontend API
20
-
21
- ---
22
-
23
- ## 📦 Installation
24
-
25
- ```bash
26
- npm install astro-cookiebanner
27
- ```
28
-
29
- Then run the installer inside your Astro project:
30
-
31
- ```bash
32
- npx astro-cookiebanner
33
- ```
34
-
35
- To remove everything:
36
-
37
- ```bash
38
- npx astro-cookiebanner remove
39
- ```
40
-
41
- ---
42
-
43
- ## 🔧 Usage
44
-
45
- ```ts
46
- import astroCookieBanner from "astro-cookiebanner";
47
-
48
- export default {
49
- integrations: [
50
- astroCookieBanner({
51
- siteName: "My Website",
52
- policyUrl: "/privacy",
53
- consent: {
54
- days: 30,
55
- storageKey: "astro-cookie-consent"
56
- },
57
- categories: {
58
- analytics: false,
59
- marketing: false
60
- }
61
- })
62
- ]
63
- };
64
- ```
65
-
66
- ---
67
-
68
- ## 🧠 Frontend API
69
-
70
- ```js
71
- window.cookieConsent.get();
72
- window.cookieConsent.set({ essential: true, analytics: true });
73
- window.cookieConsent.reset();
74
- ```
75
-
76
- Example conditional loading:
77
-
78
- ```js
79
- const consent = window.cookieConsent.get();
80
-
81
- if (consent?.categories?.analytics) {
82
- // Load analytics script
83
- }
84
- ```
85
-
86
- ---
87
-
88
- ## 🎨 Theming
89
-
90
- All visuals are controlled via:
91
-
92
- ```
93
- src/cookiebanner.css
94
- ```
95
-
96
- This file is never overwritten.
97
-
98
- ---
99
-
100
- ## 🔐 Privacy
101
-
102
- - No cookies before consent
103
- - No tracking without permission
104
- - No external calls
105
- - Stored locally with TTL
106
-
107
- ---
108
-
109
- ## 🏷️ License & Attribution
110
-
111
- Open‑source with **mandatory attribution**.
112
-
113
- Any public use, fork, or redistribution **must credit Velohost**.
114
-
115
- See `LICENSE.md` for full terms.
116
-
117
- ---
118
-
119
- ## 🏢 Velohost
120
-
121
- Built by **Velohost**
122
- https://velohost.co.uk
123
-
124
- ---
125
-
126
- ## 🤝 Contributions
127
-
128
- PRs welcome — attribution must be preserved.