@htmlbricks/hb-banner 0.71.35 → 0.71.36

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/README.md +81 -23
  2. package/manifest.json +1 -1
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -1,39 +1,86 @@
1
- ## `hb-banner` — banner
1
+ # `hb-banner` — integrator guide
2
2
 
3
- **Category:** content | **Tags:** content, marketing
3
+ **Category:** content · **Tags:** content, marketing · **Package:** `@htmlbricks/hb-banner`
4
4
 
5
- ### What it does
5
+ ## Summary
6
6
 
7
- Marketing-style hero strip: logo image beside a title and subtitle, using **Bulma** `container is-fluid`, `columns`, and `title` / `subtitle`. Desktop layout uses `is-hidden-touch`; compact layout uses `is-hidden-desktop`.
7
+ `hb-banner` is a marketing-style hero strip: optional logo image beside a heading and supporting line. Content is rendered inside the shadow root using Bulma layout (`container`, `columns`), typography (`.title`, `.subtitle`), and visibility helpers so **wide** and **narrow** viewports get different alignment (side-by-side vs stacked, centered).
8
8
 
9
- ### Custom element
9
+ ## Behavior
10
10
 
11
- `hb-banner`
11
+ - **Two responsive variants** are rendered in the markup; Bulma visibility classes show exactly one at a time:
12
+ - **Wide (not “touch”):** fluid container, vertically centered columns, logo column **right-aligned** (`is-one-third-desktop`), text column **two-thirds** (`is-two-thirds-desktop`).
13
+ - **Narrow (“touch” and below desktop):** stacked, **centered** columns (`is-mobile`, `is-multiline`, `has-text-centered`), logo on its own row then title/subtitle.
14
+ - **`logouri`:** passed to `<img src="…">` in both layouts. If omitted or empty, the image still renders with an empty `src` (invalid image); omit the attribute only when you accept a broken image or handle it in your host page.
15
+ - **`title` / `description`:** rendered as Bulma `.title.is-4` and `.subtitle.is-5` respectively. Either can be omitted; empty headings still produce elements with no visible text.
16
+ - **Internationalization:** none in this component (`extra/docs.ts` lists no `i18n` entries).
17
+ - **Custom events:** none in `types/webcomponent.type.d.ts` (`Events` is `{}`).
12
18
 
13
- ### Attributes / props (snake_case)
19
+ ## Layout and visual design
14
20
 
15
- | Property | Type | Notes |
16
- | --- | --- | --- |
17
- | `id` | string (optional) | Element identifier. |
18
- | `style` | string (optional) | Inline style string. |
19
- | `title` | string (optional) | Main heading text. |
20
- | `description` | string (optional) | Subtitle or body text. |
21
- | `logouri` | string (optional) | Logo image URL. |
21
+ - **Host:** `display: block` (`styles/webcomponent.scss`).
22
+ - **Logo box:** `.hb-banner-figure` width `9.375rem` (max `100%`); `.hb-banner-logo` is `width: 100%`, `height: auto`, `max-height: 9.375rem`, `object-fit: contain`.
23
+ - **Theme:** Bulma 1.x Sass is forwarded on `:host` (container, columns, title, image, typography/spacing helpers, visibility). Additional Bulma CSS variables from the bundled theme apply; documented public variables are listed below.
22
24
 
23
- No CSS vars or slots in style setup metadata.
25
+ ## Logic (implementation reference)
24
26
 
25
- ### Events (`CustomEvent` names)
27
+ 1. Props are read from the custom element API (`logouri`, `title`, `description`; plus `id` / `style` per typings).
28
+ 2. The same inner structure is duplicated: first block uses `is-hidden-touch`, second uses `is-hidden-desktop`, matching Bulma’s breakpoint helpers to the two layouts described above.
26
29
 
27
- None declared in types (`Events` is an empty object).
30
+ ## Custom element tag
28
31
 
29
- ### Usage notes
32
+ ```html
33
+ <hb-banner …></hb-banner>
34
+ ```
35
+
36
+ ## Attributes (HTML / reflected props)
37
+
38
+ Web component attributes are **strings** (snake_case names). Logical optional fields from authoring types:
39
+
40
+ | Attribute | Role |
41
+ |-----------|------|
42
+ | `id` | Optional element id (per `Component` typings; standard host attribute). |
43
+ | `style` | Optional inline style on the host (per `Component` typings). |
44
+ | `title` | Main heading text. |
45
+ | `description` | Subtitle / supporting line under the heading. |
46
+ | `logouri` | URL of the logo image for `<img src>`. |
47
+
48
+ ## Events
49
+
50
+ No custom events are declared for this component (`Events` is an empty object in `types/webcomponent.type.d.ts`). Use standard DOM events on the host if needed.
51
+
52
+ ## CSS custom properties, parts, and slots
53
+
54
+ **Documented theme variables** (from `extra/docs.ts` / `styleSetup`):
55
+
56
+ | Variable | Default | Notes |
57
+ |----------|---------|--------|
58
+ | `--bulma-primary` | `#00d1b2` | Accent / link tones from Bulma theme setup. |
59
+ | `--bulma-text` | `#363636` | Body / general text tone. |
60
+ | `--bulma-title-color` | `#363636` | Bulma `.title` color. |
61
+
62
+ Other `--bulma-*` tokens from the bundled Bulma theme may apply on `:host`; see [Bulma CSS variables](https://bulma.io/documentation/features/css-variables/).
63
+
64
+ - **`::part`:** none (`cssParts` is empty).
65
+ - **Slots:** none (`htmlSlots` is empty); all markup is internal to the shadow root.
30
66
 
31
- - Relies on Bulma grid, visibility helpers (`is-hidden-touch`, `is-hidden-desktop`), and typography helpers (`has-text-right`, `has-text-centered`).
32
- - Icons are not bundled; extend the markup if you need icon fonts.
33
- - Shadow DOM keeps typography/spacing internal unless slotted content is added in implementation.
34
- - No i18n in `docs.ts`.
67
+ ## TypeScript typings (authoring)
35
68
 
36
- ### Minimal HTML example
69
+ From `types/webcomponent.type.d.ts`:
70
+
71
+ ```ts
72
+ export type Component = {
73
+ id?: string;
74
+ style?: string;
75
+ title?: string;
76
+ description?: string;
77
+ logouri?: string;
78
+ };
79
+
80
+ export type Events = {};
81
+ ```
82
+
83
+ ## Minimal HTML
37
84
 
38
85
  ```html
39
86
  <hb-banner
@@ -42,3 +89,14 @@ None declared in types (`Events` is an empty object).
42
89
  logouri="https://example.com/logo.svg"
43
90
  ></hb-banner>
44
91
  ```
92
+
93
+ Text-only (no logo URL):
94
+
95
+ ```html
96
+ <hb-banner
97
+ title="Welcome"
98
+ description="Short supporting line under the heading."
99
+ ></hb-banner>
100
+ ```
101
+
102
+ Only set `logouri` when you have a valid image URL; the template always includes an `<img>` bound to `logouri`.
package/manifest.json CHANGED
@@ -137,5 +137,5 @@
137
137
  "size": {},
138
138
  "iifePath": "main.iife.js",
139
139
  "repoName": "@htmlbricks/hb-banner",
140
- "version": "0.71.35"
140
+ "version": "0.71.36"
141
141
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@htmlbricks/hb-banner",
3
- "version": "0.71.35",
3
+ "version": "0.71.36",
4
4
  "contributors": [],
5
5
  "description": "Marketing-style hero strip: logo image beside a title and subtitle, using Bootstrap grid. Layout switches from side-by-side on large screens to stacked, centered content on smaller breakpoints (`d-none d-lg-block` / `d-lg-none`).",
6
6
  "licenses": [