@amedia/brick-mcp 0.0.2 → 0.1.1
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/data/components-metadata.json +35 -29
- package/data/tokens-documentation.json +1 -1
- package/data/tokens.json +4848 -128
- package/dist/data/components/brick-actions.md +59 -0
- package/dist/data/components/brick-alt-teaser.md +264 -0
- package/dist/data/components/brick-avatar.md +299 -0
- package/dist/data/components/brick-button.md +373 -0
- package/dist/data/components/brick-card.md +359 -0
- package/dist/data/components/brick-carousel.md +355 -0
- package/dist/data/components/brick-classnames.md +147 -0
- package/dist/data/components/brick-countdown.md +180 -0
- package/dist/data/components/brick-dialog.md +458 -0
- package/dist/data/components/brick-fonts.md +389 -0
- package/dist/data/components/brick-helloworld.md +228 -0
- package/dist/data/components/brick-icon.md +274 -0
- package/dist/data/components/brick-icons.md +570 -0
- package/dist/data/components/brick-illustrations.md +604 -0
- package/dist/data/components/brick-image.md +361 -0
- package/dist/data/components/brick-input.md +557 -0
- package/dist/data/components/brick-mcp.json +6 -0
- package/dist/data/components/brick-nifs.md +164 -0
- package/dist/data/components/brick-pill.json +6 -0
- package/dist/data/components/brick-player.json +7 -0
- package/dist/data/components/brick-published.json +7 -0
- package/dist/data/components/brick-share.json +7 -0
- package/dist/data/components/brick-stepper.json +7 -0
- package/dist/data/components/brick-tab.json +7 -0
- package/dist/data/components/brick-tabs.json +9 -0
- package/dist/data/components/brick-tag.json +7 -0
- package/dist/data/components/brick-teaser-player.json +9 -0
- package/dist/data/components/brick-teaser-reels.json +9 -0
- package/dist/data/components/brick-teaser.json +9 -0
- package/dist/data/components/brick-template.json +9 -0
- package/dist/data/components/brick-textarea.json +7 -0
- package/dist/data/components/brick-themes.json +6 -0
- package/dist/data/components/brick-toast.json +9 -0
- package/dist/data/components/brick-toggle.json +7 -0
- package/dist/data/components/brick-tokens.json +8 -0
- package/dist/data/components/brick-tooltip.json +7 -0
- package/dist/data/components-metadata.json +234 -0
- package/dist/data/tokens-documentation.json +7 -0
- package/dist/data/tokens.json +4976 -0
- package/dist/http.js +314 -0
- package/dist/http.js.map +7 -0
- package/dist/index.js +26 -37
- package/dist/index.js.map +2 -2
- package/package.json +2 -2
- package/scripts/generate-data.js +15 -47
|
@@ -0,0 +1,359 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: brick-card
|
|
3
|
+
version: 7.3.8
|
|
4
|
+
selector: brick-card-v7
|
|
5
|
+
category: Layout
|
|
6
|
+
tags:
|
|
7
|
+
[
|
|
8
|
+
card,
|
|
9
|
+
container,
|
|
10
|
+
content-grouping,
|
|
11
|
+
layout,
|
|
12
|
+
flexible-container,
|
|
13
|
+
image-text,
|
|
14
|
+
article,
|
|
15
|
+
]
|
|
16
|
+
use_cases:
|
|
17
|
+
[
|
|
18
|
+
content-cards,
|
|
19
|
+
article-teasers,
|
|
20
|
+
product-listings,
|
|
21
|
+
call-to-action,
|
|
22
|
+
promotional-banners,
|
|
23
|
+
feature-highlights,
|
|
24
|
+
subscription-prompts,
|
|
25
|
+
tips-boxes,
|
|
26
|
+
step-by-step-guides,
|
|
27
|
+
]
|
|
28
|
+
related: [brick-button, brick-image, brick-stepper]
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
# Brick Card
|
|
32
|
+
|
|
33
|
+
A flexible container component for grouping related content with support for images, text, buttons, and optional stepper functionality.
|
|
34
|
+
|
|
35
|
+
## Key Capabilities
|
|
36
|
+
|
|
37
|
+
- Highly flexible layout with horizontal and vertical orientations (including reverse directions)
|
|
38
|
+
- Supports multiple visual themes (light, dark, alt, sport, highlight, custom)
|
|
39
|
+
- Integrates brick-image and brick-button components seamlessly
|
|
40
|
+
- Optional dense/compact layout modes for space efficiency
|
|
41
|
+
- Primary and secondary button support with icons and ADP analytics tracking
|
|
42
|
+
- Semantic HTML with configurable container tags (article or div)
|
|
43
|
+
- Built-in support for brick-stepper to show progress
|
|
44
|
+
- Meta itemprops for structured data and analytics
|
|
45
|
+
|
|
46
|
+
## Props/Attributes
|
|
47
|
+
|
|
48
|
+
| Attribute | Type | Default | Required | Description |
|
|
49
|
+
| --------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------- | -------- | -------------------------------------------------------------------------------------------------------- |
|
|
50
|
+
| `data-skin` | `'none' \| 'black' \| 'custom-one' \| 'custom-two' \| 'sport' \| 'highlight' \| 'alt' \| 'dark' \| 'light'` | `'light'` | No | Visual theme/background color of the card |
|
|
51
|
+
| `data-as` | `'article' \| 'div'` | `'article'` | No | HTML tag to use for card container |
|
|
52
|
+
| `data-title-text` | `string` | - | No | Main heading text |
|
|
53
|
+
| `data-title-as` | `'h1' \| 'h2' \| 'h3' \| 'h4' \| 'h5' \| 'h6'` | `'h2'` | No | HTML heading level for title |
|
|
54
|
+
| `data-text` | `string` | - | No | Body text content |
|
|
55
|
+
| `data-primary-link-to` | `string` | - | No | URL for primary button |
|
|
56
|
+
| `data-primary-button-text` | `string` | - | No | Text for primary button |
|
|
57
|
+
| `data-primary-button-icon` | `string` | - | No | Icon name for primary button |
|
|
58
|
+
| `data-primary-button-adp-label` | `string` | - | No | ADP tracking label for primary button clicks |
|
|
59
|
+
| `data-primary-button-adp-value` | `string` | - | No | ADP tracking value for primary button clicks |
|
|
60
|
+
| `data-secondary-link-to` | `string` | - | No | URL for secondary button |
|
|
61
|
+
| `data-secondary-button-text` | `string` | - | No | Text for secondary button |
|
|
62
|
+
| `data-secondary-button-icon` | `string` | - | No | Icon name for secondary button |
|
|
63
|
+
| `data-secondary-button-adp-label` | `string` | - | No | ADP tracking label for secondary button clicks |
|
|
64
|
+
| `data-secondary-button-adp-value` | `string` | - | No | ADP tracking value for secondary button clicks |
|
|
65
|
+
| `data-button-size` | `'small' \| 'medium'` | `'medium'` | No | Size of buttons |
|
|
66
|
+
| `data-image-src` | `string` | - | No | Image source URL (use properly sized/encoded Reflex URLs) |
|
|
67
|
+
| `data-image-alt-text` | `string` | - | No | Alt text for image (required if image-src is provided) |
|
|
68
|
+
| `data-image-size` | `'small' \| 'medium' \| 'large'` | `'medium'` | No | Size of the image within the card |
|
|
69
|
+
| `data-layout` | `'default' \| 'compact'` | `'default'` | No | Layout density (compact has tighter spacing and smaller fonts) |
|
|
70
|
+
| `data-layout-direction` | `'row' \| 'column' \| 'row-reverse' \| 'column-reverse'` | `'row'` | No | Direction of content flow |
|
|
71
|
+
| `data-dense` | `boolean` | `false` | No | Enable dense spacing mode |
|
|
72
|
+
| `data-meta-itemprops` | `string` | - | No | Meta element attributes as comma-separated key:value pairs (e.g., "adpType:teaser,contentModel:paywall") |
|
|
73
|
+
| `data-steps` | `string` | - | No | Number of steps for brick-stepper |
|
|
74
|
+
| `data-steps-current` | `string` | - | No | Current step for brick-stepper |
|
|
75
|
+
| `data-steps-completed` | `string` | - | No | Number of completed steps for brick-stepper |
|
|
76
|
+
| `data-steps-order` | `'asc' \| 'desc'` | `'asc'` | No | Order direction for steps |
|
|
77
|
+
| `data-steps-aria-label` | `string` | - | No | Aria label for stepper |
|
|
78
|
+
| `data-steps-label` | `string` | - | No | Label text for steps |
|
|
79
|
+
| `data-steps-icon-check` | `string` | - | No | Show check icon for completed steps |
|
|
80
|
+
| `data-steps-icon-lock` | `string` | - | No | Show lock icon for locked steps |
|
|
81
|
+
|
|
82
|
+
## Examples
|
|
83
|
+
|
|
84
|
+
### Basic Card with Image and Title
|
|
85
|
+
|
|
86
|
+
A simple horizontal card with an image and title.
|
|
87
|
+
|
|
88
|
+
```html
|
|
89
|
+
<brick-card-v7
|
|
90
|
+
data-image-src="https://g.acdn.no/api/reflex/v1/image/resize/680/https%3A%2F%2Fg.acdn.no%2Fobscura%2FAPI%2Fdynamic%2Fr1%2Fece5%2Ftr_2000_2000_s_f%2F0000%2Favio%2F2023%2F5%2F16%2F8%2F%252BHandwerk%252BBotaniske%252B-4151.jpg%3Fchk%3DDDB861"
|
|
91
|
+
data-image-alt-text="A happy waitress holding a breakfast tray"
|
|
92
|
+
data-title-text="Oppgrader og få frukost på din bursdag!"
|
|
93
|
+
data-skin="light"
|
|
94
|
+
data-image-size="large"
|
|
95
|
+
>
|
|
96
|
+
</brick-card-v7>
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### Complete Card with All Features
|
|
100
|
+
|
|
101
|
+
Full-featured card with image, title, text, and two buttons.
|
|
102
|
+
|
|
103
|
+
```html
|
|
104
|
+
<brick-card-v7
|
|
105
|
+
data-image-src="https://g.acdn.no/api/reflex/v1/image/resize/680/https%3A%2F%2Fg.acdn.no%2Fobscura%2FAPI%2Fdynamic%2Fr1%2Fece5%2Ftr_2000_2000_s_f%2F0000%2Favio%2F2023%2F5%2F16%2F8%2F%252BHandwerk%252BBotaniske%252B-4151.jpg%3Fchk%3DDDB861"
|
|
106
|
+
data-image-alt-text="A happy waitress holding a breakfast tray"
|
|
107
|
+
data-image-size="large"
|
|
108
|
+
data-title-text="Oppgrader og få frukost på din bursdag!"
|
|
109
|
+
data-text="Å spise frokost på kafé er en bra start på dagen enten du er en morgenfugl eller liker å sove lenge. Med +Alt får du alltid frukost på din bursdag!"
|
|
110
|
+
data-skin="light"
|
|
111
|
+
data-as="article"
|
|
112
|
+
data-primary-link-to="https://www.ao.no/stor-guide-lyst-pa-frokost-pa-kaf-her-er-13-steder-med-god-stemning/f/5-128-522696"
|
|
113
|
+
data-primary-button-text="Oppgrader til +Alt"
|
|
114
|
+
data-primary-button-icon="plusall"
|
|
115
|
+
data-button-size="small"
|
|
116
|
+
data-secondary-link-to="https://nn.wikipedia.org/wiki/Frukost"
|
|
117
|
+
data-secondary-button-text="Les mer om frukost"
|
|
118
|
+
>
|
|
119
|
+
</brick-card-v7>
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
### Vertical Layout Card
|
|
123
|
+
|
|
124
|
+
Card with vertical content stacking (column layout).
|
|
125
|
+
|
|
126
|
+
```html
|
|
127
|
+
<brick-card-v7
|
|
128
|
+
data-layout-direction="column"
|
|
129
|
+
data-image-src="https://g.acdn.no/api/reflex/v1/image/resize/680/https%3A%2F%2Fg.acdn.no%2Fobscura%2FAPI%2Fdynamic%2Fr1%2Fece5%2Ftr_2000_2000_s_f%2F0000%2Favio%2F2023%2F5%2F16%2F8%2F%252BHandwerk%252BBotaniske%252B-4151.jpg%3Fchk%3DDDB861"
|
|
130
|
+
data-image-alt-text="A happy waitress holding a breakfast tray"
|
|
131
|
+
data-title-text="Vertical Card Example"
|
|
132
|
+
data-text="Content flows vertically in this layout."
|
|
133
|
+
data-skin="dark"
|
|
134
|
+
data-primary-link-to="/example"
|
|
135
|
+
data-primary-button-text="Learn More"
|
|
136
|
+
>
|
|
137
|
+
</brick-card-v7>
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
### Dense/Compact Card Without Image
|
|
141
|
+
|
|
142
|
+
Minimal card for call-to-action boxes without images.
|
|
143
|
+
|
|
144
|
+
```html
|
|
145
|
+
<brick-card-v7
|
|
146
|
+
data-text="Vet du noe mer om denne saken?"
|
|
147
|
+
data-primary-link-to="/vis/info/tips-oss"
|
|
148
|
+
data-primary-button-text="Tips oss"
|
|
149
|
+
data-button-size="medium"
|
|
150
|
+
data-layout-direction="row"
|
|
151
|
+
data-dense="true"
|
|
152
|
+
data-skin="alt"
|
|
153
|
+
>
|
|
154
|
+
</brick-card-v7>
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
### Card with Stepper
|
|
158
|
+
|
|
159
|
+
Card displaying progress through steps (e.g., for courses or multi-step processes).
|
|
160
|
+
|
|
161
|
+
```html
|
|
162
|
+
<brick-card-v7
|
|
163
|
+
data-layout-direction="column"
|
|
164
|
+
data-title-text="Complete Your Profile"
|
|
165
|
+
data-text="Follow these steps to complete your setup"
|
|
166
|
+
data-skin="light"
|
|
167
|
+
data-steps="7"
|
|
168
|
+
data-steps-current="3"
|
|
169
|
+
data-steps-label="Dag"
|
|
170
|
+
data-steps-order="desc"
|
|
171
|
+
data-steps-icon-check="true"
|
|
172
|
+
data-steps-icon-lock="true"
|
|
173
|
+
data-primary-link-to="/continue"
|
|
174
|
+
data-primary-button-text="Continue"
|
|
175
|
+
>
|
|
176
|
+
</brick-card-v7>
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
## Programmatic Usage
|
|
180
|
+
|
|
181
|
+
### Client-Side Rendering
|
|
182
|
+
|
|
183
|
+
```javascript
|
|
184
|
+
import '@amedia/brick-card';
|
|
185
|
+
|
|
186
|
+
const card = document.createElement('brick-card-v7');
|
|
187
|
+
card.dataset.titleText = 'My Card Title';
|
|
188
|
+
card.dataset.text = 'Card description text';
|
|
189
|
+
card.dataset.imageSrc = 'https://example.com/image.jpg';
|
|
190
|
+
card.dataset.imageAltText = 'Image description';
|
|
191
|
+
card.dataset.primaryLinkTo = '/learn-more';
|
|
192
|
+
card.dataset.primaryButtonText = 'Learn More';
|
|
193
|
+
card.dataset.skin = 'light';
|
|
194
|
+
|
|
195
|
+
document.body.appendChild(card);
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
### Server-Side Rendering
|
|
199
|
+
|
|
200
|
+
```javascript
|
|
201
|
+
import { renderBrickCard } from '@amedia/brick-card/template';
|
|
202
|
+
|
|
203
|
+
const cardMarkup = renderBrickCard({
|
|
204
|
+
dataTitleText: 'Server-Rendered Card',
|
|
205
|
+
dataText: 'This card is rendered on the server',
|
|
206
|
+
dataImageSrc: 'https://example.com/image.jpg',
|
|
207
|
+
dataImageAltText: 'Image description',
|
|
208
|
+
dataPrimaryLinkTo: '/action',
|
|
209
|
+
dataPrimaryButtonText: 'Take Action',
|
|
210
|
+
dataSkin: 'dark',
|
|
211
|
+
});
|
|
212
|
+
|
|
213
|
+
// cardMarkup is a string of HTML ready to be sent to the client
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
## Accessibility
|
|
217
|
+
|
|
218
|
+
- Semantic HTML: Use `data-as="article"` for self-contained content
|
|
219
|
+
- Proper heading hierarchy: Configure `data-title-as` to match document structure
|
|
220
|
+
- Image alt text: Always provide `data-image-alt-text` when using images
|
|
221
|
+
- Keyboard navigation: All buttons are fully keyboard accessible
|
|
222
|
+
- Screen reader support: Stepper component includes `data-steps-aria-label`
|
|
223
|
+
- WCAG 2.1 AA compliant color contrast across all skin variants
|
|
224
|
+
|
|
225
|
+
## Analytics Integration
|
|
226
|
+
|
|
227
|
+
Brick-card supports ADP (Amedia Data Platform) analytics tracking for button clicks:
|
|
228
|
+
|
|
229
|
+
```html
|
|
230
|
+
<brick-card-v7
|
|
231
|
+
data-primary-button-text="Subscribe"
|
|
232
|
+
data-primary-link-to="/subscribe"
|
|
233
|
+
data-primary-button-adp-label="upgrade"
|
|
234
|
+
data-primary-button-adp-value="subscription-tier-premium"
|
|
235
|
+
data-secondary-button-text="Learn More"
|
|
236
|
+
data-secondary-link-to="/info"
|
|
237
|
+
data-secondary-button-adp-label="read-more"
|
|
238
|
+
data-secondary-button-adp-value="subscription-info"
|
|
239
|
+
>
|
|
240
|
+
</brick-card-v7>
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
**Important:** ADP logging requires wrapping the card with proper `itemscope` attributes. The card itself only renders the button labels; you must provide the ADP scope wrapper.
|
|
244
|
+
|
|
245
|
+
## Common Patterns
|
|
246
|
+
|
|
247
|
+
### Subscription/Upgrade Prompt
|
|
248
|
+
|
|
249
|
+
For conversion-focused cards encouraging upgrades or subscriptions.
|
|
250
|
+
|
|
251
|
+
```html
|
|
252
|
+
<brick-card-v7
|
|
253
|
+
data-title-text="Upgrade to Premium"
|
|
254
|
+
data-text="Get unlimited access to all articles and exclusive content"
|
|
255
|
+
data-skin="highlight"
|
|
256
|
+
data-layout-direction="column"
|
|
257
|
+
data-primary-button-text="Upgrade Now"
|
|
258
|
+
data-primary-link-to="/subscribe"
|
|
259
|
+
data-primary-button-icon="plusall"
|
|
260
|
+
data-button-size="medium"
|
|
261
|
+
>
|
|
262
|
+
</brick-card-v7>
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
### Article Teaser
|
|
266
|
+
|
|
267
|
+
For displaying article previews in lists or grids.
|
|
268
|
+
|
|
269
|
+
```html
|
|
270
|
+
<brick-card-v7
|
|
271
|
+
data-as="article"
|
|
272
|
+
data-image-src="https://example.com/article-image.jpg"
|
|
273
|
+
data-image-alt-text="Article preview image"
|
|
274
|
+
data-image-size="large"
|
|
275
|
+
data-title-text="Breaking News: Local Event Draws Crowds"
|
|
276
|
+
data-title-as="h3"
|
|
277
|
+
data-text="Thousands gathered downtown for the annual festival..."
|
|
278
|
+
data-skin="light"
|
|
279
|
+
data-primary-link-to="/article/12345"
|
|
280
|
+
data-primary-button-text="Read More"
|
|
281
|
+
data-meta-itemprops="adpType:teaser,contentModel:free"
|
|
282
|
+
>
|
|
283
|
+
</brick-card-v7>
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
### Tips/Help Box
|
|
287
|
+
|
|
288
|
+
For contextual help or user engagement prompts.
|
|
289
|
+
|
|
290
|
+
```html
|
|
291
|
+
<brick-card-v7
|
|
292
|
+
data-text="Vet du noe mer om denne saken?"
|
|
293
|
+
data-skin="alt"
|
|
294
|
+
data-dense="true"
|
|
295
|
+
data-primary-link-to="/tips"
|
|
296
|
+
data-primary-button-text="Tips oss"
|
|
297
|
+
data-primary-button-adp-label="user-tips"
|
|
298
|
+
>
|
|
299
|
+
</brick-card-v7>
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
## Technical Details
|
|
303
|
+
|
|
304
|
+
- **Custom Element**: `brick-card-v7`
|
|
305
|
+
- **Base Class**: BrickElement (from @amedia/brick-template)
|
|
306
|
+
- **Dependencies**:
|
|
307
|
+
- @amedia/brick-template
|
|
308
|
+
- @amedia/brick-button
|
|
309
|
+
- @amedia/brick-image
|
|
310
|
+
- @amedia/brick-stepper
|
|
311
|
+
- @amedia/brick-tokens
|
|
312
|
+
- **Renders as**: Configurable (`article` or `div`)
|
|
313
|
+
- **Browser Support**: Modern browsers (ES2020+)
|
|
314
|
+
- **Build Target**: ESM and CommonJS modules available
|
|
315
|
+
|
|
316
|
+
## Important Notes
|
|
317
|
+
|
|
318
|
+
### Image URLs
|
|
319
|
+
|
|
320
|
+
Since brick-card v7.0.0 (brick-image v4), image URLs must be properly sized and encoded. Use Amedia's Reflex API:
|
|
321
|
+
|
|
322
|
+
```
|
|
323
|
+
https://g.acdn.no/api/reflex/v1/image/resize/680/[ENCODED_URL]
|
|
324
|
+
```
|
|
325
|
+
|
|
326
|
+
The size is not automatically applied; you must provide the correct size in the URL.
|
|
327
|
+
|
|
328
|
+
### Breaking Changes from v6
|
|
329
|
+
|
|
330
|
+
- `dataLinkTo` → `dataPrimaryLinkTo`
|
|
331
|
+
- `dataButtonText` → `dataPrimaryButtonText`
|
|
332
|
+
|
|
333
|
+
### Layout Flexibility
|
|
334
|
+
|
|
335
|
+
The card does not require an image. You can create text-only cards by omitting `data-image-src`. Similarly, buttons are optional - omit button properties to create cards without actions.
|
|
336
|
+
|
|
337
|
+
### Theme Inheritance
|
|
338
|
+
|
|
339
|
+
Brick-card inherits theme context from parent elements. The `data-skin` attribute controls the card's background color within the inherited theme.
|
|
340
|
+
|
|
341
|
+
### Meta Itemprops Format
|
|
342
|
+
|
|
343
|
+
The `data-meta-itemprops` attribute accepts a comma-separated string of key:value pairs:
|
|
344
|
+
|
|
345
|
+
```html
|
|
346
|
+
data-meta-itemprops="adpType:teaser,contentModel:paywall,category:news"
|
|
347
|
+
```
|
|
348
|
+
|
|
349
|
+
This generates:
|
|
350
|
+
|
|
351
|
+
```html
|
|
352
|
+
<meta itemprop="adpType" content="teaser" />
|
|
353
|
+
<meta itemprop="contentModel" content="paywall" />
|
|
354
|
+
<meta itemprop="category" content="news" />
|
|
355
|
+
```
|
|
356
|
+
|
|
357
|
+
## Version
|
|
358
|
+
|
|
359
|
+
Current version: 7.3.8
|