@htmlbricks/hb-paragraps-around-image-cell 0.71.34 → 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 +97 -19
  2. package/manifest.json +23 -19
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -1,37 +1,115 @@
1
- ## `hb-paragraps-around-image-cell` — paragraph cell around image
1
+ # hb-paragraps-around-image-cell
2
2
 
3
- **Category:** content
4
- **Tags:** content
3
+ **Category:** content · **Tags:** content
5
4
 
6
- ### What it does
5
+ ## Overview
7
6
 
8
- One paragraph tile with Bootstrap icon, optional title as external link or key-triggered control (dispatches `paragraphPressed` with `key`), and body text clamped to `max_lines` for consistent height inside `hb-paragraps-around-image` layouts.
7
+ `hb-paragraps-around-image-cell` renders a single content tile: a Bootstrap icon, an optional title row (plain text, external link, or interactive control), and a body paragraph whose height is limited by a line clamp so tiles stay visually consistent in multi-column layouts. It is designed to sit inside `hb-paragraps-around-image` (the parent “paragraphs around image” layout) but can be used on its own wherever you need a compact icon + text block.
9
8
 
10
- ### Custom element
9
+ ## Custom element
11
10
 
12
- `hb-paragraps-around-image-cell`
11
+ ```html
12
+ <hb-paragraps-around-image-cell></hb-paragraps-around-image-cell>
13
+ ```
14
+
15
+ ## Attributes (snake_case, string values from HTML)
16
+
17
+ Web component attributes are always strings. Pass structured data as JSON on `paragraph`, and numeric limits as their string form (for example `"8"`).
18
+
19
+ | Attribute | Required | Description |
20
+ |-----------|----------|-------------|
21
+ | `paragraph` | Yes | JSON string describing the tile. Parsed in the component; invalid JSON is logged and the tile may not render. |
22
+ | `max_lines` | No | Maximum number of lines for the body text clamp. Coerced to a number internally; default **8** if omitted. |
23
+ | `id` | No | Optional host `id` (standard HTML). |
24
+
25
+ The authoring TypeScript `Component` type also lists an optional `style` field; the current implementation does not wire a `style` prop into the markup, so prefer styling the host from the light DOM (selectors on the custom element) or Bulma variables below.
26
+
27
+ ### `paragraph` object shape
28
+
29
+ The `paragraph` value matches the shared `Paragraphs` type (same family as the parent `hb-paragraps-around-image` items):
30
+
31
+ | Field | Type | Description |
32
+ |-------|------|-------------|
33
+ | `text` | string | Body copy (required). |
34
+ | `title` | string (optional) | Heading row above the body. If omitted, only the icon and body are shown. |
35
+ | `icon` | string (optional) | Bootstrap Icons **name without** the `bi-` prefix (the template uses `class="bi bi-{icon}"`). |
36
+ | `link` | string (optional) | If set together with `title`, the title is rendered as an external link (`target="_blank"`) using link styling. |
37
+ | `key` | string (optional) | If `title` is set and `link` is **not**, and `key` **is** set, the title row becomes an underlined, clickable control. A click dispatches `paragraphPressed` with this `key` in the event detail. |
38
+
39
+ **Title row rules (in order):**
40
+
41
+ 1. `link` present → title is a normal anchor to `link`.
42
+ 2. Else `key` present → title is clickable and emits `paragraphPressed`.
43
+ 3. Else → title is plain bold text.
44
+
45
+ If `paragraph` is missing or not an object after parsing, the component logs a warning and renders nothing.
46
+
47
+ ## Events
48
+
49
+ Listen for the following custom event on the element (or on a parent in the bubbling phase):
50
+
51
+ | Event | `detail` | When |
52
+ |-------|-----------|------|
53
+ | `paragraphPressed` | `{ key: string }` | User activates the title control when `paragraph.key` is set (and `paragraph.link` is not). |
54
+
55
+ ## Styling
56
+
57
+ ### Bulma CSS variables
58
+
59
+ The host uses the shared Bulma web-component theme. From the light DOM you can override Bulma variables on `:host` or ancestors; see [Bulma CSS variables](https://bulma.io/documentation/features/css-variables/).
60
+
61
+ | Variable | Role |
62
+ |----------|------|
63
+ | `--bulma-text` | Body and non-link titles. |
64
+ | `--bulma-link` | Linked title (`paragraph.link`). |
65
+ | `--bulma-text-strong` | Bold title row. |
66
+ | `--bulma-block-spacing` | Vertical rhythm when nested in parent column layouts. |
13
67
 
14
- ### Attributes (snake_case; use string values in HTML)
68
+ ### Icons
15
69
 
16
- - `id`, `style` (optional): strings.
17
- - `paragraph` (required): JSON string — `{ text; title?; icon?; link?; key? }`.
18
- - `max_lines` (optional): number as string — line clamp for body text.
70
+ Bootstrap Icons are loaded for this component (font CSS). Ensure `paragraph.icon` matches an icon name from the Bootstrap Icons set.
19
71
 
20
- ### Events
72
+ ### Layout notes
21
73
 
22
- - `paragraphPressed`: `{ key: string }`.
74
+ The inner layout uses fixed inline flex/spacing for the icon column and text column. `:host` is `display: block`. There are **no** exposed `::part()` hooks and **no** slots.
23
75
 
24
- ### Usage notes
76
+ ## Examples
25
77
 
26
- - **Slots:** `skelcontent`.
27
- - **CSS parts:** `testpart`.
28
- - Typically embedded by `hb-paragraps-around-image`; usable alone for Storybook-style tiles (no separate image prop on this cell).
78
+ ### Clickable title (dispatches `paragraphPressed`)
29
79
 
30
- ### Minimal HTML example
80
+ ```html
81
+ <hb-paragraps-around-image-cell
82
+ paragraph='{"text":"Supporting copy for this section.","title":"Open details","icon":"globe","key":"section-1"}'
83
+ max_lines="6"
84
+ ></hb-paragraps-around-image-cell>
85
+ ```
86
+
87
+ ### Title as external link
31
88
 
32
89
  ```html
33
90
  <hb-paragraps-around-image-cell
34
- paragraph='{"text":"Body copy","title":"Read more","icon":"globe","key":"section-1"}'
91
+ paragraph='{"text":"Short intro text.","title":"Read documentation","icon":"box-arrow-up-right","link":"https://bulma.io/documentation/"}'
35
92
  max_lines="4"
36
93
  ></hb-paragraps-around-image-cell>
37
94
  ```
95
+
96
+ ### Body only (no title)
97
+
98
+ ```html
99
+ <hb-paragraps-around-image-cell
100
+ paragraph='{"text":"Sidebar note or caption without a heading row.","icon":"info-circle"}'
101
+ ></hb-paragraps-around-image-cell>
102
+ ```
103
+
104
+ ### Default clamp (omit `max_lines` → eight lines)
105
+
106
+ ```html
107
+ <hb-paragraps-around-image-cell
108
+ paragraph='{"text":"Long body …","title":"Title","icon":"text-paragraph","key":"block-a"}'
109
+ ></hb-paragraps-around-image-cell>
110
+ ```
111
+
112
+ ## Related
113
+
114
+ - Parent layout: `hb-paragraps-around-image` (grid of cells + central image).
115
+ - Package name in metadata: `@htmlbricks/hb-paragraps-around-image-cell`.
package/manifest.json CHANGED
@@ -98,30 +98,34 @@
98
98
  "styleSetup": {
99
99
  "vars": [
100
100
  {
101
- "name": "--lh",
102
- "valueType": "string",
103
- "defaultValue": ""
101
+ "name": "--bulma-text",
102
+ "valueType": "color",
103
+ "defaultValue": "#363636",
104
+ "description": "Body copy and non-link titles."
104
105
  },
105
106
  {
106
- "name": "--max-lines",
107
- "valueType": "string",
108
- "defaultValue": ""
109
- }
110
- ],
111
- "parts": [
107
+ "name": "--bulma-link",
108
+ "valueType": "color",
109
+ "defaultValue": "#485fc7",
110
+ "description": "External title links (`paragraph.link`)."
111
+ },
112
+ {
113
+ "name": "--bulma-text-strong",
114
+ "valueType": "color",
115
+ "defaultValue": "#363636",
116
+ "description": "Bold title row when distinguished from body text."
117
+ },
112
118
  {
113
- "name": "testpart",
114
- "description": "test css part on 2 div tag"
119
+ "name": "--bulma-block-spacing",
120
+ "valueType": "number",
121
+ "defaultValue": "1.5rem",
122
+ "description": "Vertical rhythm with parent `hb-paragraps-around-image` columns."
115
123
  }
116
- ]
124
+ ],
125
+ "parts": []
117
126
  },
118
127
  "contributors": [],
119
- "htmlSlots": [
120
- {
121
- "name": "skelcontent",
122
- "description": "test slot"
123
- }
124
- ],
128
+ "htmlSlots": [],
125
129
  "i18n": [],
126
130
  "examples": [
127
131
  {
@@ -204,5 +208,5 @@
204
208
  "size": {},
205
209
  "iifePath": "main.iife.js",
206
210
  "repoName": "@htmlbricks/hb-paragraps-around-image-cell",
207
- "version": "0.71.34"
211
+ "version": "0.71.36"
208
212
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@htmlbricks/hb-paragraps-around-image-cell",
3
- "version": "0.71.34",
3
+ "version": "0.71.36",
4
4
  "contributors": [],
5
5
  "description": "One paragraph tile with Bootstrap icon, optional title as external link or key-triggered control (dispatches paragraphPressed with key), and body text clamped to max_lines for consistent height inside paragraps-around-image layouts.",
6
6
  "licenses": [