@amedia/brick-mcp 0.0.2 → 0.1.0

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 (48) hide show
  1. package/data/components-metadata.json +28 -28
  2. package/data/tokens-documentation.json +1 -1
  3. package/data/tokens.json +4848 -128
  4. package/dist/data/components/brick-actions.md +59 -0
  5. package/dist/data/components/brick-alt-teaser.md +264 -0
  6. package/dist/data/components/brick-avatar.md +299 -0
  7. package/dist/data/components/brick-button.md +373 -0
  8. package/dist/data/components/brick-card.md +359 -0
  9. package/dist/data/components/brick-carousel.md +355 -0
  10. package/dist/data/components/brick-classnames.md +147 -0
  11. package/dist/data/components/brick-countdown.md +180 -0
  12. package/dist/data/components/brick-dialog.md +458 -0
  13. package/dist/data/components/brick-fonts.md +389 -0
  14. package/dist/data/components/brick-helloworld.md +228 -0
  15. package/dist/data/components/brick-icon.md +274 -0
  16. package/dist/data/components/brick-icons.md +570 -0
  17. package/dist/data/components/brick-illustrations.md +604 -0
  18. package/dist/data/components/brick-image.md +361 -0
  19. package/dist/data/components/brick-input.md +557 -0
  20. package/dist/data/components/brick-mcp.json +6 -0
  21. package/dist/data/components/brick-nifs.md +164 -0
  22. package/dist/data/components/brick-pill.json +6 -0
  23. package/dist/data/components/brick-player.json +7 -0
  24. package/dist/data/components/brick-published.json +7 -0
  25. package/dist/data/components/brick-share.json +7 -0
  26. package/dist/data/components/brick-stepper.json +7 -0
  27. package/dist/data/components/brick-tab.json +7 -0
  28. package/dist/data/components/brick-tabs.json +9 -0
  29. package/dist/data/components/brick-tag.json +7 -0
  30. package/dist/data/components/brick-teaser-player.json +9 -0
  31. package/dist/data/components/brick-teaser-reels.json +9 -0
  32. package/dist/data/components/brick-teaser.json +9 -0
  33. package/dist/data/components/brick-template.json +9 -0
  34. package/dist/data/components/brick-textarea.json +7 -0
  35. package/dist/data/components/brick-themes.json +6 -0
  36. package/dist/data/components/brick-toast.json +9 -0
  37. package/dist/data/components/brick-toggle.json +7 -0
  38. package/dist/data/components/brick-tokens.json +8 -0
  39. package/dist/data/components/brick-tooltip.json +7 -0
  40. package/dist/data/components-metadata.json +228 -0
  41. package/dist/data/tokens-documentation.json +7 -0
  42. package/dist/data/tokens.json +4976 -0
  43. package/dist/http.js +314 -0
  44. package/dist/http.js.map +7 -0
  45. package/dist/index.js +26 -37
  46. package/dist/index.js.map +2 -2
  47. package/package.json +1 -1
  48. package/scripts/generate-data.js +15 -47
@@ -0,0 +1,570 @@
1
+ ---
2
+ name: brick-icons
3
+ version: 2.1.0
4
+ category: Media
5
+ tags: [icons, svg, sprite, graphics, design-system, figma]
6
+ use_cases:
7
+ [
8
+ icons,
9
+ ui-enhancement,
10
+ navigation-icons,
11
+ action-icons,
12
+ status-indicators,
13
+ brand-icons,
14
+ decorative-graphics,
15
+ ]
16
+ related: [brick-button, brick-card, brick-actions]
17
+ ---
18
+
19
+ # Brick Icons
20
+
21
+ SVG icon sprite library providing theme-specific icon sets distributed via CDN for consistent, scalable graphics across Amedia's design system.
22
+
23
+ ## Key Capabilities
24
+
25
+ - **Theme-Specific Sprites**: Separate SVG sprite files for each theme (alfa, bravo, charlie, nettavisen, alt)
26
+ - **CDN Distribution**: Icons served via Eik CDN for optimal performance and caching
27
+ - **Figma Automation**: Icons automatically synced from Figma using Figmagic
28
+ - **Scalable Graphics**: SVG format ensures crisp rendering at any size without quality loss
29
+ - **Color Inheritance**: Icons use `currentColor` for easy color customization via CSS
30
+ - **Comprehensive Icon Set**: Includes navigation, action, status, social, and brand icons
31
+
32
+ ## Available Themes
33
+
34
+ | Theme | CDN Path |
35
+ | ---------- | ------------------------------------------------------------------------------ |
36
+ | alfa | `https://assets.acdn.no/pkg/@amedia/brick-icons/v2/icons/alfa/icons.svg` |
37
+ | bravo | `https://assets.acdn.no/pkg/@amedia/brick-icons/v2/icons/bravo/icons.svg` |
38
+ | charlie | `https://assets.acdn.no/pkg/@amedia/brick-icons/v2/icons/charlie/icons.svg` |
39
+ | nettavisen | `https://assets.acdn.no/pkg/@amedia/brick-icons/v2/icons/nettavisen/icons.svg` |
40
+ | alt | `https://assets.acdn.no/pkg/@amedia/brick-icons/v2/icons/alt/icons.svg` |
41
+
42
+ ## Icon Categories
43
+
44
+ **Navigation**: arrow-down, arrow-up, arrow-left, arrow-right, arrow-dropdown, arrow-dropup, chevron-down, chevron-up, close, menu
45
+
46
+ **Actions**: add, delete, copy, share, share-url, edit, settings-fill, settings-outline, camera, gift
47
+
48
+ **Status**: checkmark, checkmark-toggle, check-circle, error-circle, warning-circle, info-circle, lock, notification-off
49
+
50
+ **Media**: play, pause, replay, volume-on, volume-off, desktop, mobile
51
+
52
+ **Social/Brand**: facebook, instagram, linkedin, twitter, youtube, appstore, googleplay
53
+
54
+ **Tags/Labels**: pill-tag, pill-video, pill-breaking, pill-untold, plusall, tag-fill, tag-outline
55
+
56
+ **Other**: clock, datepicker, dice-1 through dice-6, logo-alt
57
+
58
+ ## Examples
59
+
60
+ ### Basic Icon Usage
61
+
62
+ ```html
63
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24">
64
+ <use
65
+ href="https://assets.acdn.no/pkg/@amedia/brick-icons/v2/icons/alfa/icons.svg#checkmark"
66
+ ></use>
67
+ </svg>
68
+ ```
69
+
70
+ ### Accessible Icon with Title
71
+
72
+ ```html
73
+ <svg
74
+ xmlns="http://www.w3.org/2000/svg"
75
+ width="24"
76
+ height="24"
77
+ aria-labelledby="search-title"
78
+ >
79
+ <title id="search-title">Search</title>
80
+ <use
81
+ href="https://assets.acdn.no/pkg/@amedia/brick-icons/v2/icons/alfa/icons.svg#search"
82
+ ></use>
83
+ </svg>
84
+ ```
85
+
86
+ ### Decorative Icon (Hidden from Screen Readers)
87
+
88
+ ```html
89
+ <svg
90
+ xmlns="http://www.w3.org/2000/svg"
91
+ width="24"
92
+ height="24"
93
+ aria-hidden="true"
94
+ >
95
+ <use
96
+ href="https://assets.acdn.no/pkg/@amedia/brick-icons/v2/icons/nettavisen/icons.svg#arrow-right"
97
+ ></use>
98
+ </svg>
99
+ ```
100
+
101
+ ### Icon with Custom Color and Size
102
+
103
+ ```html
104
+ <svg
105
+ xmlns="http://www.w3.org/2000/svg"
106
+ width="32"
107
+ height="32"
108
+ style="color: #ff0000;"
109
+ >
110
+ <use
111
+ href="https://assets.acdn.no/pkg/@amedia/brick-icons/v2/icons/charlie/icons.svg#heart"
112
+ ></use>
113
+ </svg>
114
+ ```
115
+
116
+ ### Icon in Button Component
117
+
118
+ ```html
119
+ <brick-button-v9 data-variant="primary">
120
+ <svg
121
+ xmlns="http://www.w3.org/2000/svg"
122
+ width="20"
123
+ height="20"
124
+ aria-hidden="true"
125
+ >
126
+ <use
127
+ href="https://assets.acdn.no/pkg/@amedia/brick-icons/v2/icons/alfa/icons.svg#add"
128
+ ></use>
129
+ </svg>
130
+ Add Item
131
+ </brick-button-v9>
132
+ ```
133
+
134
+ ### Social Media Icon Link
135
+
136
+ ```html
137
+ <a href="https://facebook.com/example" aria-label="Follow us on Facebook">
138
+ <svg
139
+ xmlns="http://www.w3.org/2000/svg"
140
+ width="24"
141
+ height="24"
142
+ aria-hidden="true"
143
+ >
144
+ <use
145
+ href="https://assets.acdn.no/pkg/@amedia/brick-icons/v2/icons/alt/icons.svg#facebook"
146
+ ></use>
147
+ </svg>
148
+ </a>
149
+ ```
150
+
151
+ ## Framework Integration
152
+
153
+ ### Svelte
154
+
155
+ ```svelte
156
+ <script>
157
+ const theme = 'alfa';
158
+ const iconName = 'checkmark';
159
+ const iconUrl = `https://assets.acdn.no/pkg/@amedia/brick-icons/v2/icons/${theme}/icons.svg#${iconName}`;
160
+ </script>
161
+
162
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24">
163
+ <use href={iconUrl}></use>
164
+ </svg>
165
+ ```
166
+
167
+ ### React
168
+
169
+ ```jsx
170
+ function Icon({ theme, name, size = 24, title }) {
171
+ const iconUrl = `https://assets.acdn.no/pkg/@amedia/brick-icons/v2/icons/${theme}/icons.svg#${name}`;
172
+
173
+ return (
174
+ <svg
175
+ xmlns="http://www.w3.org/2000/svg"
176
+ width={size}
177
+ height={size}
178
+ aria-labelledby={title ? `icon-${name}` : undefined}
179
+ >
180
+ {title && <title id={`icon-${name}`}>{title}</title>}
181
+ <use href={iconUrl}></use>
182
+ </svg>
183
+ );
184
+ }
185
+
186
+ // Usage
187
+ <Icon theme="alfa" name="checkmark" title="Success" />;
188
+ ```
189
+
190
+ ### Vue
191
+
192
+ ```vue
193
+ <template>
194
+ <svg xmlns="http://www.w3.org/2000/svg" :width="size" :height="size">
195
+ <title v-if="title">{{ title }}</title>
196
+ <use :href="iconUrl"></use>
197
+ </svg>
198
+ </template>
199
+
200
+ <script>
201
+ export default {
202
+ props: {
203
+ theme: { type: String, required: true },
204
+ name: { type: String, required: true },
205
+ size: { type: Number, default: 24 },
206
+ title: String,
207
+ },
208
+ computed: {
209
+ iconUrl() {
210
+ return `https://assets.acdn.no/pkg/@amedia/brick-icons/v2/icons/${this.theme}/icons.svg#${this.name}`;
211
+ },
212
+ },
213
+ };
214
+ </script>
215
+ ```
216
+
217
+ ## Programmatic Usage
218
+
219
+ ### Import Sprite Paths
220
+
221
+ ```javascript
222
+ import { alfa, bravo, charlie, nettavisen, alt } from '@amedia/brick-icons';
223
+
224
+ console.log(alfa); // './sprites/alfa/icons.svg'
225
+ ```
226
+
227
+ ### Dynamic Icon Loading
228
+
229
+ ```javascript
230
+ // Helper function to create icon element
231
+ function createIcon(theme, iconName, options = {}) {
232
+ const { width = 24, height = 24, title, color } = options;
233
+
234
+ const svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
235
+ svg.setAttribute('xmlns', 'http://www.w3.org/2000/svg');
236
+ svg.setAttribute('width', width);
237
+ svg.setAttribute('height', height);
238
+
239
+ if (color) {
240
+ svg.style.color = color;
241
+ }
242
+
243
+ if (title) {
244
+ const titleElement = document.createElementNS(
245
+ 'http://www.w3.org/2000/svg',
246
+ 'title'
247
+ );
248
+ titleElement.textContent = title;
249
+ svg.appendChild(titleElement);
250
+ } else {
251
+ svg.setAttribute('aria-hidden', 'true');
252
+ }
253
+
254
+ const use = document.createElementNS('http://www.w3.org/2000/svg', 'use');
255
+ use.setAttributeNS(
256
+ 'http://www.w3.org/1999/xlink',
257
+ 'href',
258
+ `https://assets.acdn.no/pkg/@amedia/brick-icons/v2/icons/${theme}/icons.svg#${iconName}`
259
+ );
260
+
261
+ svg.appendChild(use);
262
+ return svg;
263
+ }
264
+
265
+ // Usage
266
+ const icon = createIcon('alfa', 'checkmark', {
267
+ width: 32,
268
+ height: 32,
269
+ title: 'Completed',
270
+ color: '#00aa00',
271
+ });
272
+ document.body.appendChild(icon);
273
+ ```
274
+
275
+ ## Accessibility
276
+
277
+ ### Informative vs Decorative Icons
278
+
279
+ **Informative Icons** (convey meaning):
280
+
281
+ - MUST include a `<title>` element with descriptive text
282
+ - MUST have `aria-labelledby` pointing to the title element ID
283
+ - Example: Standalone icon buttons, status indicators
284
+
285
+ **Decorative Icons** (purely visual):
286
+
287
+ - MUST include `aria-hidden="true"`
288
+ - Should be paired with visible text labels
289
+ - Example: Icons next to text labels in buttons
290
+
291
+ ### Best Practices
292
+
293
+ ```html
294
+ <!-- ✅ GOOD: Informative icon with proper accessibility -->
295
+ <button>
296
+ <svg
297
+ xmlns="http://www.w3.org/2000/svg"
298
+ width="20"
299
+ height="20"
300
+ aria-labelledby="close-title"
301
+ >
302
+ <title id="close-title">Close dialog</title>
303
+ <use href="icons/alfa/icons.svg#close"></use>
304
+ </svg>
305
+ </button>
306
+
307
+ <!-- ✅ GOOD: Decorative icon paired with text -->
308
+ <button>
309
+ <svg
310
+ xmlns="http://www.w3.org/2000/svg"
311
+ width="20"
312
+ height="20"
313
+ aria-hidden="true"
314
+ >
315
+ <use href="icons/alfa/icons.svg#add"></use>
316
+ </svg>
317
+ Add Item
318
+ </button>
319
+
320
+ <!-- ❌ BAD: Informative icon without accessibility support -->
321
+ <button>
322
+ <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20">
323
+ <use href="icons/alfa/icons.svg#delete"></use>
324
+ </svg>
325
+ </button>
326
+
327
+ <!-- ❌ BAD: Standalone decorative icon -->
328
+ <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20">
329
+ <use href="icons/alfa/icons.svg#arrow-right"></use>
330
+ </svg>
331
+ ```
332
+
333
+ ### Keyboard Navigation
334
+
335
+ Icons themselves are not interactive. Always wrap icons in interactive elements like:
336
+
337
+ - `<button>` for actions
338
+ - `<a>` for navigation
339
+ - Ensure interactive elements are keyboard accessible with proper focus styles
340
+
341
+ ## Common Patterns
342
+
343
+ ### Icon Button
344
+
345
+ ```html
346
+ <brick-button-v9 data-variant="ghost" data-shape="circle">
347
+ <svg
348
+ xmlns="http://www.w3.org/2000/svg"
349
+ width="24"
350
+ height="24"
351
+ aria-labelledby="settings-title"
352
+ >
353
+ <title id="settings-title">Open settings</title>
354
+ <use
355
+ href="https://assets.acdn.no/pkg/@amedia/brick-icons/v2/icons/alfa/icons.svg#settings-fill"
356
+ ></use>
357
+ </svg>
358
+ </brick-button-v9>
359
+ ```
360
+
361
+ ### Status Indicator with Icon
362
+
363
+ ```html
364
+ <div
365
+ class="status-success"
366
+ style="display: flex; align-items: center; gap: 8px; color: #00aa00;"
367
+ >
368
+ <svg
369
+ xmlns="http://www.w3.org/2000/svg"
370
+ width="20"
371
+ height="20"
372
+ aria-hidden="true"
373
+ >
374
+ <use
375
+ href="https://assets.acdn.no/pkg/@amedia/brick-icons/v2/icons/alfa/icons.svg#check-circle"
376
+ ></use>
377
+ </svg>
378
+ <span>Operation completed successfully</span>
379
+ </div>
380
+ ```
381
+
382
+ ### Navigation Menu Item
383
+
384
+ ```html
385
+ <a href="/profile" style="display: flex; align-items: center; gap: 12px;">
386
+ <svg
387
+ xmlns="http://www.w3.org/2000/svg"
388
+ width="24"
389
+ height="24"
390
+ aria-hidden="true"
391
+ >
392
+ <use
393
+ href="https://assets.acdn.no/pkg/@amedia/brick-icons/v2/icons/nettavisen/icons.svg#user"
394
+ ></use>
395
+ </svg>
396
+ <span>My Profile</span>
397
+ </a>
398
+ ```
399
+
400
+ ### Media Controls
401
+
402
+ ```html
403
+ <div class="media-controls" style="display: flex; gap: 16px;">
404
+ <button aria-label="Play video">
405
+ <svg
406
+ xmlns="http://www.w3.org/2000/svg"
407
+ width="32"
408
+ height="32"
409
+ aria-hidden="true"
410
+ >
411
+ <use
412
+ href="https://assets.acdn.no/pkg/@amedia/brick-icons/v2/icons/alt/icons.svg#play"
413
+ ></use>
414
+ </svg>
415
+ </button>
416
+ <button aria-label="Mute audio">
417
+ <svg
418
+ xmlns="http://www.w3.org/2000/svg"
419
+ width="32"
420
+ height="32"
421
+ aria-hidden="true"
422
+ >
423
+ <use
424
+ href="https://assets.acdn.no/pkg/@amedia/brick-icons/v2/icons/alt/icons.svg#volume-on"
425
+ ></use>
426
+ </svg>
427
+ </button>
428
+ </div>
429
+ ```
430
+
431
+ ### Social Media Links
432
+
433
+ ```html
434
+ <nav aria-label="Social media" style="display: flex; gap: 16px;">
435
+ <a href="https://facebook.com/example" aria-label="Facebook">
436
+ <svg
437
+ xmlns="http://www.w3.org/2000/svg"
438
+ width="24"
439
+ height="24"
440
+ aria-hidden="true"
441
+ >
442
+ <use
443
+ href="https://assets.acdn.no/pkg/@amedia/brick-icons/v2/icons/charlie/icons.svg#facebook"
444
+ ></use>
445
+ </svg>
446
+ </a>
447
+ <a href="https://twitter.com/example" aria-label="Twitter">
448
+ <svg
449
+ xmlns="http://www.w3.org/2000/svg"
450
+ width="24"
451
+ height="24"
452
+ aria-hidden="true"
453
+ >
454
+ <use
455
+ href="https://assets.acdn.no/pkg/@amedia/brick-icons/v2/icons/charlie/icons.svg#twitter"
456
+ ></use>
457
+ </svg>
458
+ </a>
459
+ <a href="https://instagram.com/example" aria-label="Instagram">
460
+ <svg
461
+ xmlns="http://www.w3.org/2000/svg"
462
+ width="24"
463
+ height="24"
464
+ aria-hidden="true"
465
+ >
466
+ <use
467
+ href="https://assets.acdn.no/pkg/@amedia/brick-icons/v2/icons/charlie/icons.svg#instagram"
468
+ ></use>
469
+ </svg>
470
+ </a>
471
+ </nav>
472
+ ```
473
+
474
+ ## Technical Details
475
+
476
+ - **Package Name**: @amedia/brick-icons
477
+ - **Distribution**: CDN via Eik (https://assets.acdn.no)
478
+ - **Source**: Figma (synced via Figmagic)
479
+ - **Format**: SVG sprite sheets
480
+ - **Themes**: alfa, bravo, charlie, nettavisen, alt
481
+ - **Build Tools**: Figmagic, svg-sprite, svgson
482
+ - **Dependencies**: None (icons are static assets)
483
+
484
+ ### CDN URL Structure
485
+
486
+ ```
487
+ https://assets.acdn.no/pkg/@amedia/brick-icons/v{major}/icons/{theme}/icons.svg#{icon-name}
488
+ ```
489
+
490
+ Example:
491
+
492
+ ```
493
+ https://assets.acdn.no/pkg/@amedia/brick-icons/v2/icons/alfa/icons.svg#checkmark
494
+ ```
495
+
496
+ ### Version Aliasing
497
+
498
+ The package uses Eik version aliasing:
499
+
500
+ - `v1` → Latest 1.x.x version
501
+ - `v2` → Latest 2.x.x version (current)
502
+
503
+ This allows automatic updates within major versions without changing URLs.
504
+
505
+ ## Important Notes
506
+
507
+ ### Icon Updates
508
+
509
+ Icons are automatically synced from Figma. To update icons:
510
+
511
+ 1. Ensure you have Figma API access token
512
+ 2. Run: `npm run build:svg && npm run build:altered-svg && npm run build:sprite`
513
+ 3. Create changeset: `npx changeset`
514
+ 4. Commit and push changes
515
+ 5. After merge, flush Varnish cache if needed
516
+
517
+ ### Color Customization
518
+
519
+ Most icons use `currentColor` for fill/stroke, allowing easy color changes via CSS:
520
+
521
+ ```html
522
+ <svg
523
+ style="color: #ff0000;"
524
+ xmlns="http://www.w3.org/2000/svg"
525
+ width="24"
526
+ height="24"
527
+ >
528
+ <use href="icons/alfa/icons.svg#heart"></use>
529
+ </svg>
530
+ ```
531
+
532
+ Some multi-colored brand icons (like social media logos) may have fixed colors.
533
+
534
+ ### Performance
535
+
536
+ - Icons are served from CDN with aggressive caching
537
+ - Sprite sheets bundle all icons per theme in single HTTP request
538
+ - Use version aliases (v2) for automatic updates within major versions
539
+ - Consider preloading sprite sheets for critical icons:
540
+
541
+ ```html
542
+ <link
543
+ rel="preload"
544
+ as="image"
545
+ type="image/svg+xml"
546
+ href="https://assets.acdn.no/pkg/@amedia/brick-icons/v2/icons/alfa/icons.svg"
547
+ />
548
+ ```
549
+
550
+ ### Browser Compatibility
551
+
552
+ SVG sprites with `<use>` elements are supported in all modern browsers. For legacy browser support, consider using polyfills like svg4everybody.
553
+
554
+ ### Icon Availability
555
+
556
+ Not all icons are available in all themes. Check the Figma source files or sprite sheets to confirm icon availability for your theme. The build process syncs exactly what's in Figma for each theme.
557
+
558
+ ### Non-Interactive Elements
559
+
560
+ Icons are purely presentational elements and should NOT be interactive on their own. Always wrap icons in interactive elements like `<button>` or `<a>` tags when user interaction is needed.
561
+
562
+ ## Version
563
+
564
+ Current version: 2.1.0
565
+
566
+ Recent updates:
567
+
568
+ - **2.1.0**: New icons: gift, camera, settings-outline
569
+ - **2.0.4**: Synced icons
570
+ - **2.0.0**: Removed CommonJS support (ESM only)