@amedia/brick-mcp 0.0.1-LLM-DOCS → 0.0.1-NEW-PATH-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.
Files changed (65) hide show
  1. package/README.md +241 -98
  2. package/dist/data/components/brick-actions.json +6 -0
  3. package/dist/data/components/brick-alt-teaser.json +10 -0
  4. package/dist/data/components/brick-avatar.json +11 -0
  5. package/dist/data/components/brick-button.json +12 -0
  6. package/dist/data/components/brick-card.json +10 -0
  7. package/dist/data/components/brick-carousel.json +11 -0
  8. package/dist/data/components/brick-classnames.json +10 -0
  9. package/dist/data/components/brick-countdown.json +7 -0
  10. package/dist/data/components/brick-dialog.json +11 -0
  11. package/dist/data/components/brick-fonts.json +10 -0
  12. package/dist/data/components/brick-helloworld.json +7 -0
  13. package/dist/data/components/brick-icon.json +10 -0
  14. package/dist/data/components/brick-icons.json +11 -0
  15. package/dist/data/components/brick-illustrations.json +7 -0
  16. package/dist/data/components/brick-image.json +10 -0
  17. package/dist/data/components/brick-input.json +12 -0
  18. package/{data → dist/data}/components/brick-mcp.json +1 -1
  19. package/dist/data/components/brick-nifs.json +7 -0
  20. package/{data → dist/data}/components/brick-pill.json +1 -1
  21. package/{data → dist/data}/components/brick-player.json +1 -1
  22. package/dist/data/components/brick-published.json +7 -0
  23. package/{data → dist/data}/components/brick-share.json +1 -1
  24. package/{data → dist/data}/components/brick-stepper.json +1 -1
  25. package/{data → dist/data}/components/brick-tab.json +1 -1
  26. package/{data → dist/data}/components/brick-tabs.json +1 -1
  27. package/{data → dist/data}/components/brick-tag.json +1 -1
  28. package/{data → dist/data}/components/brick-teaser-player.json +1 -1
  29. package/{data → dist/data}/components/brick-teaser-reels.json +1 -1
  30. package/{data → dist/data}/components/brick-teaser.json +1 -1
  31. package/{data → dist/data}/components/brick-textarea.json +1 -1
  32. package/{data → dist/data}/components/brick-toast.json +1 -1
  33. package/{data → dist/data}/components/brick-toggle.json +1 -1
  34. package/{data → dist/data}/components/brick-tokens.json +1 -1
  35. package/{data → dist/data}/components/brick-tooltip.json +1 -1
  36. package/{data → dist/data}/components-metadata.json +29 -29
  37. package/dist/data/components.json +321 -0
  38. package/dist/http.js +311 -0
  39. package/dist/http.js.map +7 -0
  40. package/dist/index.js +52 -81
  41. package/dist/index.js.map +4 -4
  42. package/package.json +3 -6
  43. package/scripts/generate-data.js +37 -40
  44. package/data/components/brick-actions.md +0 -59
  45. package/data/components/brick-alt-teaser.md +0 -253
  46. package/data/components/brick-avatar.md +0 -265
  47. package/data/components/brick-button.md +0 -364
  48. package/data/components/brick-card.md +0 -329
  49. package/data/components/brick-carousel.md +0 -330
  50. package/data/components/brick-classnames.md +0 -150
  51. package/data/components/brick-countdown.md +0 -179
  52. package/data/components/brick-dialog.md +0 -418
  53. package/data/components/brick-fonts.md +0 -335
  54. package/data/components/brick-helloworld.md +0 -202
  55. package/data/components/brick-icon.md +0 -271
  56. package/data/components/brick-icons.md +0 -430
  57. package/data/components/brick-illustrations.md +0 -552
  58. package/data/components/brick-image.md +0 -335
  59. package/data/components/brick-input.md +0 -521
  60. package/data/components/brick-nifs.md +0 -163
  61. package/data/components/brick-published.json +0 -7
  62. package/data/tokens-documentation.json +0 -7
  63. /package/{data → dist/data}/components/brick-template.json +0 -0
  64. /package/{data → dist/data}/components/brick-themes.json +0 -0
  65. /package/{data → dist/data}/tokens.json +0 -0
@@ -1,335 +0,0 @@
1
- ---
2
- name: brick-image
3
- version: 6.0.5
4
- selector: brick-image-v6
5
- category: Media
6
- tags: [image, responsive, lazy-loading, srcset, performance, media, picture, img]
7
- use_cases: [hero-section, article-images, product-listing, image-gallery, thumbnail, teaser, card, banner, media-content, responsive-images]
8
- related: [brick-button, brick-link, brick-card]
9
- ---
10
-
11
- # Brick Image
12
-
13
- A responsive image component that wraps the native `<img>` element with support for modern image loading features including lazy loading, responsive images via srcset/sizes, and performance optimizations.
14
-
15
- ## Key Capabilities
16
-
17
- - Native browser lazy loading with configurable `loading` attribute
18
- - Responsive image support through `srcset` and `sizes` attributes
19
- - Performance optimizations via `fetchpriority` and `decoding` attributes
20
- - Aspect ratio preservation using CSS custom properties
21
- - Server-side rendering support with `renderBrickImage()` function
22
- - Customizable styling through CSS variables (object-fit, dimensions, positioning)
23
-
24
- ## Props/Attributes
25
-
26
- | Attribute | Type | Default | Required | Description |
27
- |-----------|------|---------|----------|-------------|
28
- | `data-src` | string | - | yes | The image source URL |
29
- | `data-srcset` | string | - | no | Responsive image source set (e.g., "image-400.jpg 400w, image-800.jpg 800w") |
30
- | `data-srcsize` | string | - | no | Specific size for the src attribute (alternative to default sizing) |
31
- | `data-sizes` | string | - | no | Media query conditions for responsive image selection (e.g., "(min-width: 800px) 800px, 100vw") |
32
- | `data-width` | string | - | no | Intrinsic width of the image (sets width attribute on img) |
33
- | `data-height` | string | - | no | Intrinsic height of the image (sets height attribute on img) |
34
- | `data-alt-text` | string | `""` | no | Alternative text for accessibility |
35
- | `data-loading` | `"eager" \| "lazy"` | `"lazy"` | no | Browser loading strategy |
36
- | `data-fetch-priority` | `"high" \| "low" \| "auto"` | `"auto"` | no | Resource fetch priority hint |
37
- | `data-decoding` | `"async" \| "sync" \| "auto"` | `"auto"` | no | Image decoding hint |
38
-
39
- ## Examples
40
-
41
- ### Basic Image
42
-
43
- ```html
44
- <brick-image-v6
45
- data-src="https://example.com/image.jpg"
46
- data-alt-text="A beautiful landscape">
47
- </brick-image-v6>
48
- ```
49
-
50
- ### Responsive Image with Srcset
51
-
52
- ```html
53
- <brick-image-v6
54
- data-src="https://example.com/image-800.jpg"
55
- data-srcset="https://example.com/image-400.jpg 400w,
56
- https://example.com/image-800.jpg 800w,
57
- https://example.com/image-1200.jpg 1200w"
58
- data-sizes="(min-width: 1200px) 1200px, (min-width: 800px) 800px, 100vw"
59
- data-alt-text="Product photo">
60
- </brick-image-v6>
61
- ```
62
-
63
- ### Image with Aspect Ratio
64
-
65
- ```html
66
- <brick-image-v6
67
- data-src="https://example.com/image.jpg"
68
- data-width="1600"
69
- data-height="900"
70
- data-alt-text="16:9 aspect ratio image">
71
- </brick-image-v6>
72
- ```
73
-
74
- ### Eager Loading for Above-the-Fold Images
75
-
76
- ```html
77
- <brick-image-v6
78
- data-src="https://example.com/hero.jpg"
79
- data-srcset="https://example.com/hero-800.jpg 800w,
80
- https://example.com/hero-1600.jpg 1600w"
81
- data-sizes="100vw"
82
- data-loading="eager"
83
- data-fetch-priority="high"
84
- data-alt-text="Hero image">
85
- </brick-image-v6>
86
- ```
87
-
88
- ### Lazy Loading for Below-the-Fold Images
89
-
90
- ```html
91
- <brick-image-v6
92
- data-src="https://example.com/thumbnail.jpg"
93
- data-loading="lazy"
94
- data-decoding="async"
95
- data-alt-text="Thumbnail image">
96
- </brick-image-v6>
97
- ```
98
-
99
- ## Framework Integration
100
-
101
- ### Svelte
102
-
103
- ```svelte
104
- <script>
105
- let imageSrc = 'https://example.com/image.jpg';
106
- let altText = 'Dynamic image';
107
- </script>
108
-
109
- <brick-image-v6
110
- data-src={imageSrc}
111
- data-alt-text={altText}
112
- data-loading="lazy"
113
- />
114
- ```
115
-
116
- ### React
117
-
118
- ```jsx
119
- function MyComponent() {
120
- return (
121
- <brick-image-v6
122
- data-src="https://example.com/image.jpg"
123
- data-srcset="https://example.com/image-400.jpg 400w, https://example.com/image-800.jpg 800w"
124
- data-sizes="(min-width: 800px) 800px, 100vw"
125
- data-alt-text="Product image"
126
- data-loading="lazy"
127
- />
128
- );
129
- }
130
- ```
131
-
132
- ## Programmatic Usage
133
-
134
- ```javascript
135
- import { BrickImage } from '@amedia/brick-image';
136
-
137
- const imageElement = document.createElement('brick-image-v6');
138
- imageElement.dataSrc = 'https://example.com/image.jpg';
139
- imageElement.dataAltText = 'Programmatically created image';
140
- imageElement.dataLoading = 'lazy';
141
- document.body.appendChild(imageElement);
142
- ```
143
-
144
- ### Server-Side Rendering
145
-
146
- ```javascript
147
- import { renderBrickImage } from '@amedia/brick-image/template';
148
-
149
- const html = renderBrickImage({
150
- dataSrc: 'https://example.com/image.jpg',
151
- dataSrcset: 'https://example.com/image-400.jpg 400w, https://example.com/image-800.jpg 800w',
152
- dataSizes: '(min-width: 800px) 800px, 100vw',
153
- dataWidth: '1600',
154
- dataHeight: '900',
155
- dataAltText: 'Server-rendered image',
156
- dataLoading: 'lazy'
157
- });
158
-
159
- // Returns:
160
- // <brick-image-v6 is-rendered brick-component="brick-image" class="..." data-src="..." ...>
161
- // <img src="..." srcset="..." sizes="..." width="1600" height="900" alt="..." loading="lazy" class="..." style="--brick-image-ratio: 1600 / 900;">
162
- // </brick-image-v6>
163
- ```
164
-
165
- ## Styling with CSS Variables
166
-
167
- The component exposes several CSS variables for customization:
168
-
169
- ```css
170
- brick-image-v6 {
171
- /* Dimensions */
172
- --brick-image-width: 100%;
173
- --brick-image-height: auto;
174
- --brick-image-maxwidth: 100%;
175
- --brick-image-maxheight: auto;
176
-
177
- /* Object positioning and fit */
178
- --brick-image-objectfit: cover;
179
- --brick-image-objectposition: center;
180
-
181
- /* Background (visible while loading) */
182
- --brick-image-color-bg: transparent;
183
-
184
- /* Sizes attribute (alternative to data-sizes) */
185
- --brick-image-sizes: (min-width: 800px) 800px, 100vw;
186
- }
187
- ```
188
-
189
- ### Example: Custom Styling
190
-
191
- ```html
192
- <style>
193
- .hero-image {
194
- --brick-image-width: 100%;
195
- --brick-image-height: 60vh;
196
- --brick-image-objectfit: cover;
197
- --brick-image-objectposition: center top;
198
- }
199
-
200
- .thumbnail {
201
- --brick-image-width: 200px;
202
- --brick-image-height: 200px;
203
- --brick-image-objectfit: contain;
204
- --brick-image-color-bg: #f0f0f0;
205
- }
206
- </style>
207
-
208
- <brick-image-v6
209
- class="hero-image"
210
- data-src="https://example.com/hero.jpg"
211
- data-alt-text="Hero image">
212
- </brick-image-v6>
213
-
214
- <brick-image-v6
215
- class="thumbnail"
216
- data-src="https://example.com/thumb.jpg"
217
- data-alt-text="Thumbnail">
218
- </brick-image-v6>
219
- ```
220
-
221
- ## Accessibility
222
-
223
- - Always provide meaningful `data-alt-text` for screen readers
224
- - For decorative images, use empty alt text: `data-alt-text=""`
225
- - Aspect ratio preservation prevents layout shift (CLS) when `data-width` and `data-height` are provided
226
- - Native lazy loading reduces initial page load for better user experience
227
-
228
- ## Common Patterns
229
-
230
- ### Hero Section Image
231
-
232
- Large, above-the-fold images should use eager loading with high priority:
233
-
234
- ```html
235
- <brick-image-v6
236
- data-src="https://example.com/hero-1600.jpg"
237
- data-srcset="https://example.com/hero-800.jpg 800w,
238
- https://example.com/hero-1600.jpg 1600w,
239
- https://example.com/hero-2400.jpg 2400w"
240
- data-sizes="100vw"
241
- data-width="1600"
242
- data-height="600"
243
- data-loading="eager"
244
- data-fetch-priority="high"
245
- data-alt-text="Welcome to our store"
246
- style="--brick-image-objectfit: cover; --brick-image-height: 60vh;">
247
- </brick-image-v6>
248
- ```
249
-
250
- ### Product Listing Thumbnails
251
-
252
- Grid of images with consistent aspect ratios:
253
-
254
- ```html
255
- <brick-image-v6
256
- data-src="https://example.com/product.jpg"
257
- data-srcset="https://example.com/product-400.jpg 400w,
258
- https://example.com/product-800.jpg 800w"
259
- data-sizes="(min-width: 768px) 33vw, 50vw"
260
- data-width="800"
261
- data-height="800"
262
- data-loading="lazy"
263
- data-decoding="async"
264
- data-alt-text="Product name"
265
- style="--brick-image-objectfit: cover;">
266
- </brick-image-v6>
267
- ```
268
-
269
- ### Article Images
270
-
271
- Content images with natural aspect ratios:
272
-
273
- ```html
274
- <brick-image-v6
275
- data-src="https://example.com/article-image.jpg"
276
- data-srcset="https://example.com/article-image-600.jpg 600w,
277
- https://example.com/article-image-1200.jpg 1200w"
278
- data-sizes="(min-width: 1200px) 800px, (min-width: 768px) 600px, 100vw"
279
- data-width="1200"
280
- data-height="800"
281
- data-loading="lazy"
282
- data-alt-text="Description of the image content">
283
- </brick-image-v6>
284
- ```
285
-
286
- ### Using CSS Variable for Sizes
287
-
288
- Instead of `data-sizes`, you can use the CSS variable approach:
289
-
290
- ```html
291
- <style>
292
- .responsive-image {
293
- --brick-image-sizes: (min-width: 1024px) 800px, (min-width: 768px) 600px, 100vw;
294
- }
295
- </style>
296
-
297
- <brick-image-v6
298
- class="responsive-image"
299
- data-src="https://example.com/image.jpg"
300
- data-srcset="https://example.com/image-600.jpg 600w,
301
- https://example.com/image-800.jpg 800w,
302
- https://example.com/image-1200.jpg 1200w"
303
- data-alt-text="Responsive image">
304
- </brick-image-v6>
305
- ```
306
-
307
- ## Technical Details
308
-
309
- - **Custom Element**: `brick-image-v6`
310
- - **Base Class**: BrickElement (from @amedia/brick-template)
311
- - **Dependencies**: @amedia/brick-tokens, @amedia/brick-template
312
- - **Renders as**: Custom element wrapping an `<img>` tag
313
- - **Browser Support**: Modern browsers with Web Components support
314
- - **Package**: @amedia/brick-image
315
-
316
- ## Important Notes
317
-
318
- - The component does NOT generate srcset automatically. You must provide the correct `data-srcset` value for responsive images.
319
- - Image URLs are used as-is; no automatic resizing or transformation is applied by the component.
320
- - When both `data-width` and `data-height` are provided, the component sets the `aspect-ratio` CSS property for browsers that support it.
321
- - The `data-srcsize` attribute is for cases where you need to specify a different size variant for the `src` attribute.
322
- - For server-side rendering, use the `renderBrickImage()` function from the `/template` export, which returns the full HTML string including the custom element wrapper.
323
- - The component uses native browser lazy loading (`loading="lazy"`), which is well-supported in modern browsers.
324
- - CSS variables prefixed with `--brick-image-` can be used to customize the component's appearance without modifying the component itself.
325
-
326
- ## Version
327
-
328
- Current version: 6.0.5
329
-
330
- ### Recent Changes
331
-
332
- - **6.0.4**: Improved types for `dataLoading`, `dataFetchPriority`, `dataDecoding`
333
- - **6.0.0**: Removed legacy `<amedia-img>` custom element export
334
- - **5.0.0**: Removed CommonJS support (ESM only)
335
- - **4.0.11**: Added `data-decoding` attribute support