@htmlbricks/hb-paragraps-around-image-cell 0.71.35 → 0.71.37
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 +97 -19
- package/manifest.json +30 -17
- package/package.json +1 -1
- package/types/webcomponent.type.d.json +8 -4
- package/types/webcomponent.type.d.ts +1 -1
package/README.md
CHANGED
|
@@ -1,37 +1,115 @@
|
|
|
1
|
-
|
|
1
|
+
# `hb-paragraps-around-image-cell` — integrator guide
|
|
2
2
|
|
|
3
|
-
**Category:** content
|
|
4
|
-
**Tags:** content
|
|
3
|
+
**Category:** content · **Tags:** content · **Package:** `@htmlbricks/hb-paragraps-around-image-cell`
|
|
5
4
|
|
|
6
|
-
|
|
5
|
+
## Summary
|
|
7
6
|
|
|
8
|
-
|
|
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
|
-
|
|
9
|
+
## Custom element
|
|
11
10
|
|
|
12
|
-
|
|
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` | No | JSON string (or object from JS) describing the tile. Parsed in the component; missing or invalid values 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
|
-
###
|
|
68
|
+
### Icons
|
|
15
69
|
|
|
16
|
-
|
|
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
|
-
###
|
|
72
|
+
### Layout notes
|
|
21
73
|
|
|
22
|
-
|
|
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
|
-
|
|
76
|
+
## Examples
|
|
25
77
|
|
|
26
|
-
|
|
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
|
-
|
|
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":"
|
|
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
|
@@ -41,15 +41,19 @@
|
|
|
41
41
|
"type": "number"
|
|
42
42
|
},
|
|
43
43
|
"paragraph": {
|
|
44
|
-
"
|
|
44
|
+
"anyOf": [
|
|
45
|
+
{
|
|
46
|
+
"$ref": "#/definitions/Paragraphs"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"type": "string"
|
|
50
|
+
}
|
|
51
|
+
]
|
|
45
52
|
},
|
|
46
53
|
"style": {
|
|
47
54
|
"type": "string"
|
|
48
55
|
}
|
|
49
56
|
},
|
|
50
|
-
"required": [
|
|
51
|
-
"paragraph"
|
|
52
|
-
],
|
|
53
57
|
"type": "object"
|
|
54
58
|
},
|
|
55
59
|
"Paragraphs": {
|
|
@@ -98,22 +102,31 @@
|
|
|
98
102
|
"styleSetup": {
|
|
99
103
|
"vars": [
|
|
100
104
|
{
|
|
101
|
-
"name": "--
|
|
102
|
-
"valueType": "
|
|
103
|
-
"defaultValue": ""
|
|
105
|
+
"name": "--bulma-text",
|
|
106
|
+
"valueType": "color",
|
|
107
|
+
"defaultValue": "#363636",
|
|
108
|
+
"description": "Body copy and non-link titles."
|
|
104
109
|
},
|
|
105
110
|
{
|
|
106
|
-
"name": "--
|
|
107
|
-
"valueType": "
|
|
108
|
-
"defaultValue": ""
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
"parts": [
|
|
111
|
+
"name": "--bulma-link",
|
|
112
|
+
"valueType": "color",
|
|
113
|
+
"defaultValue": "#485fc7",
|
|
114
|
+
"description": "External title links (`paragraph.link`)."
|
|
115
|
+
},
|
|
112
116
|
{
|
|
113
|
-
"name": "
|
|
114
|
-
"
|
|
117
|
+
"name": "--bulma-text-strong",
|
|
118
|
+
"valueType": "color",
|
|
119
|
+
"defaultValue": "#363636",
|
|
120
|
+
"description": "Bold title row when distinguished from body text."
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
"name": "--bulma-block-spacing",
|
|
124
|
+
"valueType": "number",
|
|
125
|
+
"defaultValue": "1.5rem",
|
|
126
|
+
"description": "Vertical rhythm with parent `hb-paragraps-around-image` columns."
|
|
115
127
|
}
|
|
116
|
-
]
|
|
128
|
+
],
|
|
129
|
+
"parts": []
|
|
117
130
|
},
|
|
118
131
|
"contributors": [],
|
|
119
132
|
"htmlSlots": [],
|
|
@@ -199,5 +212,5 @@
|
|
|
199
212
|
"size": {},
|
|
200
213
|
"iifePath": "main.iife.js",
|
|
201
214
|
"repoName": "@htmlbricks/hb-paragraps-around-image-cell",
|
|
202
|
-
"version": "0.71.
|
|
215
|
+
"version": "0.71.37"
|
|
203
216
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@htmlbricks/hb-paragraps-around-image-cell",
|
|
3
|
-
"version": "0.71.
|
|
3
|
+
"version": "0.71.37",
|
|
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": [
|
|
@@ -12,15 +12,19 @@
|
|
|
12
12
|
"type": "number"
|
|
13
13
|
},
|
|
14
14
|
"paragraph": {
|
|
15
|
-
"
|
|
15
|
+
"anyOf": [
|
|
16
|
+
{
|
|
17
|
+
"$ref": "#/definitions/Paragraphs"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"type": "string"
|
|
21
|
+
}
|
|
22
|
+
]
|
|
16
23
|
},
|
|
17
24
|
"style": {
|
|
18
25
|
"type": "string"
|
|
19
26
|
}
|
|
20
27
|
},
|
|
21
|
-
"required": [
|
|
22
|
-
"paragraph"
|
|
23
|
-
],
|
|
24
28
|
"type": "object"
|
|
25
29
|
},
|
|
26
30
|
"Paragraphs": {
|