@htmlbricks/hb-cookie-law-banner 0.66.8 → 0.66.9
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 +45 -0
- package/manifest.json +1 -1
- package/package.json +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
## `hb-cookie-law-banner` — cookie-law-banner
|
|
2
|
+
|
|
3
|
+
**Category:** layout | **Tags:** layout, compliance
|
|
4
|
+
|
|
5
|
+
### What it does
|
|
6
|
+
|
|
7
|
+
Bootstrap alert cookie notice until the user accepts or declines; the choice is stored in `localStorage` under `cookielaw`. Supports i18n via `i18nlang`, optional `cookielawuri4more` link, JSON `capabilities` for extended consent, slots to override title/text, and dispatches `acceptCookieLaw` with `{ accepted: "yes" | "no" }`.
|
|
8
|
+
|
|
9
|
+
### Custom element
|
|
10
|
+
|
|
11
|
+
`hb-cookie-law-banner`
|
|
12
|
+
|
|
13
|
+
### Attributes / props (snake_case)
|
|
14
|
+
|
|
15
|
+
| Property | Type | Notes |
|
|
16
|
+
| --- | --- | --- |
|
|
17
|
+
| `id` | string (optional) | Element identifier. |
|
|
18
|
+
| `style` | string (optional) | Inline style string. |
|
|
19
|
+
| `allowdecline` | union (optional) | `"yes"` \| `"no"` — show decline action. |
|
|
20
|
+
| `i18nlang` | string (optional) | Language key (e.g. `en`, `it`). |
|
|
21
|
+
| `capabilities` | object (optional) | JSON `ICapabilities`: cookie groups and items with scopes, mandatory flags, etc. |
|
|
22
|
+
| `cookielawuri4more` | string (optional) | “Learn more” URL. |
|
|
23
|
+
|
|
24
|
+
**Slots:** `title`, `text`. **i18n:** Italian and English in metadata.
|
|
25
|
+
|
|
26
|
+
### Events (`CustomEvent` names)
|
|
27
|
+
|
|
28
|
+
- **`acceptCookieLaw`** — `{ accepted: "yes" | "no" }`
|
|
29
|
+
|
|
30
|
+
### Usage notes
|
|
31
|
+
|
|
32
|
+
- Uses Bootstrap alert styling patterns.
|
|
33
|
+
- Fullscreen layout size hint in metadata for Storybook-style hosts.
|
|
34
|
+
- Shadow DOM; override copy via `title` and `text` slots.
|
|
35
|
+
- Set `i18nlang` to match declared languages.
|
|
36
|
+
|
|
37
|
+
### Minimal HTML example
|
|
38
|
+
|
|
39
|
+
```html
|
|
40
|
+
<hb-cookie-law-banner
|
|
41
|
+
allowdecline="yes"
|
|
42
|
+
i18nlang="en"
|
|
43
|
+
cookielawuri4more="https://example.com/cookies"
|
|
44
|
+
></hb-cookie-law-banner>
|
|
45
|
+
```
|
package/manifest.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@htmlbricks/hb-cookie-law-banner",
|
|
3
|
-
"version": "0.66.
|
|
3
|
+
"version": "0.66.9",
|
|
4
4
|
"contributors": [],
|
|
5
5
|
"description": "Bootstrap alert cookie notice shown until the user chooses accept or decline; the choice is stored in `localStorage` under `cookielaw` so the banner stays hidden on return visits. Supports i18n via `i18nlang`, optional `cookielawuri4more` link, JSON `capabilities` for extended consent, slots to override title/text, and dispatches `acceptCookieLaw` with `{ accepted: boolean }`.",
|
|
6
6
|
"licenses": [
|