@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.
- package/README.md +241 -98
- package/dist/data/components/brick-actions.json +6 -0
- package/dist/data/components/brick-alt-teaser.json +10 -0
- package/dist/data/components/brick-avatar.json +11 -0
- package/dist/data/components/brick-button.json +12 -0
- package/dist/data/components/brick-card.json +10 -0
- package/dist/data/components/brick-carousel.json +11 -0
- package/dist/data/components/brick-classnames.json +10 -0
- package/dist/data/components/brick-countdown.json +7 -0
- package/dist/data/components/brick-dialog.json +11 -0
- package/dist/data/components/brick-fonts.json +10 -0
- package/dist/data/components/brick-helloworld.json +7 -0
- package/dist/data/components/brick-icon.json +10 -0
- package/dist/data/components/brick-icons.json +11 -0
- package/dist/data/components/brick-illustrations.json +7 -0
- package/dist/data/components/brick-image.json +10 -0
- package/dist/data/components/brick-input.json +12 -0
- package/{data → dist/data}/components/brick-mcp.json +1 -1
- package/dist/data/components/brick-nifs.json +7 -0
- package/{data → dist/data}/components/brick-pill.json +1 -1
- package/{data → dist/data}/components/brick-player.json +1 -1
- package/dist/data/components/brick-published.json +7 -0
- package/{data → dist/data}/components/brick-share.json +1 -1
- package/{data → dist/data}/components/brick-stepper.json +1 -1
- package/{data → dist/data}/components/brick-tab.json +1 -1
- package/{data → dist/data}/components/brick-tabs.json +1 -1
- package/{data → dist/data}/components/brick-tag.json +1 -1
- package/{data → dist/data}/components/brick-teaser-player.json +1 -1
- package/{data → dist/data}/components/brick-teaser-reels.json +1 -1
- package/{data → dist/data}/components/brick-teaser.json +1 -1
- package/{data → dist/data}/components/brick-textarea.json +1 -1
- package/{data → dist/data}/components/brick-toast.json +1 -1
- package/{data → dist/data}/components/brick-toggle.json +1 -1
- package/{data → dist/data}/components/brick-tokens.json +1 -1
- package/{data → dist/data}/components/brick-tooltip.json +1 -1
- package/{data → dist/data}/components-metadata.json +29 -29
- package/dist/data/components.json +321 -0
- package/dist/http.js +311 -0
- package/dist/http.js.map +7 -0
- package/dist/index.js +52 -81
- package/dist/index.js.map +4 -4
- package/package.json +3 -6
- package/scripts/generate-data.js +37 -40
- package/data/components/brick-actions.md +0 -59
- package/data/components/brick-alt-teaser.md +0 -253
- package/data/components/brick-avatar.md +0 -265
- package/data/components/brick-button.md +0 -364
- package/data/components/brick-card.md +0 -329
- package/data/components/brick-carousel.md +0 -330
- package/data/components/brick-classnames.md +0 -150
- package/data/components/brick-countdown.md +0 -179
- package/data/components/brick-dialog.md +0 -418
- package/data/components/brick-fonts.md +0 -335
- package/data/components/brick-helloworld.md +0 -202
- package/data/components/brick-icon.md +0 -271
- package/data/components/brick-icons.md +0 -430
- package/data/components/brick-illustrations.md +0 -552
- package/data/components/brick-image.md +0 -335
- package/data/components/brick-input.md +0 -521
- package/data/components/brick-nifs.md +0 -163
- package/data/components/brick-published.json +0 -7
- package/data/tokens-documentation.json +0 -7
- /package/{data → dist/data}/components/brick-template.json +0 -0
- /package/{data → dist/data}/components/brick-themes.json +0 -0
- /package/{data → dist/data}/tokens.json +0 -0
|
@@ -1,271 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: brick-icon
|
|
3
|
-
version: 2.3.1
|
|
4
|
-
selector: brick-icon-v2
|
|
5
|
-
category: Media
|
|
6
|
-
tags: [icon, svg, graphics, accessibility, sprite, visual]
|
|
7
|
-
use_cases: [all-ui, navigation, buttons, visual-indicators, status-display, content-decoration]
|
|
8
|
-
related: [brick-button, brick-pill, brick-avatar]
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
# Brick Icon
|
|
12
|
-
|
|
13
|
-
A lightweight Web Component for rendering SVG icons from an embedded SVG sprite with built-in accessibility features.
|
|
14
|
-
|
|
15
|
-
## Key Capabilities
|
|
16
|
-
|
|
17
|
-
- Renders icons from an inline SVG sprite using icon IDs
|
|
18
|
-
- Automatic accessibility handling with configurable screen reader text
|
|
19
|
-
- Dynamic icon switching via attribute changes
|
|
20
|
-
- Size control through data attributes or CSS variables
|
|
21
|
-
- Color customization via CSS custom properties
|
|
22
|
-
- Special animation support for breaking news icon
|
|
23
|
-
- Framework-agnostic Web Component
|
|
24
|
-
|
|
25
|
-
## Props/Attributes
|
|
26
|
-
|
|
27
|
-
| Attribute | Type | Default | Required | Description |
|
|
28
|
-
|-----------|------|---------|----------|-------------|
|
|
29
|
-
| `data-icon-id` | string | - | yes | The ID of the SVG symbol inside the embedded SVG sprite |
|
|
30
|
-
| `data-icon-text` | string | - | no | Screen reader announcement text. When provided, icon gets `role="graphics-symbol"` and a `<title>` tag. When omitted, icon is hidden from screen readers with `aria-hidden="true"` |
|
|
31
|
-
| `data-icon-size` | 'small' \| 'medium' \| string | 'medium' | no | Predefined size for the icon container. 'small' or 'medium' values use token-based sizing |
|
|
32
|
-
|
|
33
|
-
## Examples
|
|
34
|
-
|
|
35
|
-
### Basic Icon (Decorative)
|
|
36
|
-
|
|
37
|
-
Icon without screen reader text, suitable for decorative purposes or when paired with visible text:
|
|
38
|
-
|
|
39
|
-
```html
|
|
40
|
-
<brick-icon-v2 data-icon-id="chevron-right"></brick-icon-v2>
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
### Accessible Icon
|
|
44
|
-
|
|
45
|
-
Icon with screen reader text for meaningful standalone icons:
|
|
46
|
-
|
|
47
|
-
```html
|
|
48
|
-
<brick-icon-v2
|
|
49
|
-
data-icon-id="play"
|
|
50
|
-
data-icon-text="Play video">
|
|
51
|
-
</brick-icon-v2>
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
### Sized Icon
|
|
55
|
-
|
|
56
|
-
Icon with predefined size:
|
|
57
|
-
|
|
58
|
-
```html
|
|
59
|
-
<brick-icon-v2
|
|
60
|
-
data-icon-id="search"
|
|
61
|
-
data-icon-text="Search"
|
|
62
|
-
data-icon-size="small">
|
|
63
|
-
</brick-icon-v2>
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
### Icon in Button Context
|
|
67
|
-
|
|
68
|
-
Decorative icon alongside text (hidden from screen readers):
|
|
69
|
-
|
|
70
|
-
```html
|
|
71
|
-
<button>
|
|
72
|
-
<brick-icon-v2 data-icon-id="play"></brick-icon-v2>
|
|
73
|
-
Play
|
|
74
|
-
</button>
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
### Breaking News Icon
|
|
78
|
-
|
|
79
|
-
Special icon with pulse animation:
|
|
80
|
-
|
|
81
|
-
```html
|
|
82
|
-
<brick-icon-v2
|
|
83
|
-
data-icon-id="pill-breaking"
|
|
84
|
-
data-icon-text="Breaking news">
|
|
85
|
-
</brick-icon-v2>
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
## Programmatic Usage
|
|
89
|
-
|
|
90
|
-
### Client-Side Rendering
|
|
91
|
-
|
|
92
|
-
```javascript
|
|
93
|
-
import '@amedia/brick-icon';
|
|
94
|
-
|
|
95
|
-
// The custom element defines itself automatically
|
|
96
|
-
const icon = document.createElement('brick-icon-v2');
|
|
97
|
-
icon.setAttribute('data-icon-id', 'chevron-right');
|
|
98
|
-
icon.setAttribute('data-icon-text', 'Navigate right');
|
|
99
|
-
document.body.appendChild(icon);
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
### Server-Side Rendering
|
|
103
|
-
|
|
104
|
-
```javascript
|
|
105
|
-
import { renderBrickIcon } from '@amedia/brick-icon/template';
|
|
106
|
-
|
|
107
|
-
const html = renderBrickIcon({
|
|
108
|
-
dataIconId: 'play',
|
|
109
|
-
dataIconText: 'Play video',
|
|
110
|
-
dataIconSize: 'medium'
|
|
111
|
-
});
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
### Dynamic Icon Changes
|
|
115
|
-
|
|
116
|
-
Icons can be updated dynamically via attribute changes:
|
|
117
|
-
|
|
118
|
-
```javascript
|
|
119
|
-
const icon = document.querySelector('brick-icon-v2');
|
|
120
|
-
|
|
121
|
-
// Update icon ID
|
|
122
|
-
icon.setAttribute('data-icon-id', 'chevron-up');
|
|
123
|
-
|
|
124
|
-
// Update screen reader text
|
|
125
|
-
icon.setAttribute('data-icon-text', 'Collapse section');
|
|
126
|
-
```
|
|
127
|
-
|
|
128
|
-
## Prerequisites
|
|
129
|
-
|
|
130
|
-
### SVG Sprite Requirement
|
|
131
|
-
|
|
132
|
-
brick-icon requires an SVG sprite to be embedded in the HTML page. The sprite must contain `<symbol>` elements with IDs matching the `data-icon-id` values.
|
|
133
|
-
|
|
134
|
-
```html
|
|
135
|
-
<svg style="display: none;">
|
|
136
|
-
<symbol id="play" viewBox="0 0 24 24">
|
|
137
|
-
<path d="..."/>
|
|
138
|
-
</symbol>
|
|
139
|
-
<symbol id="chevron-right" viewBox="0 0 24 24">
|
|
140
|
-
<path d="..."/>
|
|
141
|
-
</symbol>
|
|
142
|
-
</svg>
|
|
143
|
-
```
|
|
144
|
-
|
|
145
|
-
Check out `@amedia/brick-icons` package which provides theme-specific SVG sprites maintained in Figma.
|
|
146
|
-
|
|
147
|
-
### Why Inline SVG Sprite
|
|
148
|
-
|
|
149
|
-
- Eliminates additional network requests
|
|
150
|
-
- Simpler implementation without asynchronous loading
|
|
151
|
-
- Icons available immediately when HTML is parsed
|
|
152
|
-
- Better perceived performance
|
|
153
|
-
- Optimal for small to medium icon sets
|
|
154
|
-
|
|
155
|
-
## Accessibility
|
|
156
|
-
|
|
157
|
-
### Automatic ARIA Handling
|
|
158
|
-
|
|
159
|
-
- **With `data-icon-text`**: Icon receives `role="graphics-symbol"` and a `<title>` element with the provided text, making it accessible to screen readers
|
|
160
|
-
- **Without `data-icon-text`**: Icon receives `aria-hidden="true"`, hiding it from screen readers (appropriate for decorative icons)
|
|
161
|
-
|
|
162
|
-
### VoiceOver Compatibility
|
|
163
|
-
|
|
164
|
-
Icons include `aria-labelledby` attributes for proper announcement in Safari with VoiceOver.
|
|
165
|
-
|
|
166
|
-
### Best Practices
|
|
167
|
-
|
|
168
|
-
- Omit `data-icon-text` for decorative icons or when adjacent text provides context
|
|
169
|
-
- Always provide `data-icon-text` for standalone interactive icons
|
|
170
|
-
- Ensure color contrast meets WCAG 2.1 AA requirements when customizing colors
|
|
171
|
-
|
|
172
|
-
## Styling
|
|
173
|
-
|
|
174
|
-
### CSS Custom Properties
|
|
175
|
-
|
|
176
|
-
| Property | Description | Default |
|
|
177
|
-
|----------|-------------|---------|
|
|
178
|
-
| `--b-icon-color` | Icon fill color | `currentColor` |
|
|
179
|
-
| `--b-icon-size` | Container size (height) | `var(--brick-sizes-iconM)` (24px) |
|
|
180
|
-
| `--b-icon-svg-width` | SVG element width | `var(--brick-sizes-iconM)` (24px) |
|
|
181
|
-
| `--b-icon-svg-height` | SVG element height | `var(--brick-sizes-iconM)` (24px) |
|
|
182
|
-
| `--b-icon-color-breaking-pulseStart` | Breaking icon pulse animation start color | `var(--brick-colors-pillNonePulseStartBg)` |
|
|
183
|
-
| `--b-icon-color-breaking-pulseEnd` | Breaking icon pulse animation end color | `var(--brick-colors-pillNonePulseEndBg)` |
|
|
184
|
-
|
|
185
|
-
### Custom Sizing Example
|
|
186
|
-
|
|
187
|
-
```css
|
|
188
|
-
brick-icon-v2[data-icon-id="custom-large"] {
|
|
189
|
-
--b-icon-svg-width: 48px;
|
|
190
|
-
--b-icon-svg-height: 48px;
|
|
191
|
-
}
|
|
192
|
-
```
|
|
193
|
-
|
|
194
|
-
### Color Customization
|
|
195
|
-
|
|
196
|
-
```css
|
|
197
|
-
brick-icon-v2 {
|
|
198
|
-
--b-icon-color: #007bff;
|
|
199
|
-
}
|
|
200
|
-
```
|
|
201
|
-
|
|
202
|
-
## Common Patterns
|
|
203
|
-
|
|
204
|
-
### Icon with Adjacent Text
|
|
205
|
-
|
|
206
|
-
```html
|
|
207
|
-
<a href="/search">
|
|
208
|
-
<brick-icon-v2 data-icon-id="search"></brick-icon-v2>
|
|
209
|
-
Search
|
|
210
|
-
</a>
|
|
211
|
-
```
|
|
212
|
-
|
|
213
|
-
### Icon-Only Button
|
|
214
|
-
|
|
215
|
-
```html
|
|
216
|
-
<button aria-label="Close dialog">
|
|
217
|
-
<brick-icon-v2
|
|
218
|
-
data-icon-id="close"
|
|
219
|
-
data-icon-text="Close">
|
|
220
|
-
</brick-icon-v2>
|
|
221
|
-
</button>
|
|
222
|
-
```
|
|
223
|
-
|
|
224
|
-
### Responsive Icon Sizing
|
|
225
|
-
|
|
226
|
-
```css
|
|
227
|
-
brick-icon-v2 {
|
|
228
|
-
--b-icon-size: 16px;
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
@media (min-width: 768px) {
|
|
232
|
-
brick-icon-v2 {
|
|
233
|
-
--b-icon-size: 24px;
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
```
|
|
237
|
-
|
|
238
|
-
## Technical Details
|
|
239
|
-
|
|
240
|
-
- **Custom Element**: `brick-icon-v2`
|
|
241
|
-
- **Base Class**: BrickElement
|
|
242
|
-
- **Dependencies**: @amedia/brick-tokens, @amedia/brick-template
|
|
243
|
-
- **Renders as**: `<brick-icon-v2>` container with internal `<svg>` element
|
|
244
|
-
- **Observed Attributes**: `data-icon-id`, `data-icon-text`
|
|
245
|
-
- **Mirrored Props**: `data-icon-id`, `data-icon-text`, `data-icon-size`
|
|
246
|
-
|
|
247
|
-
## Important Notes
|
|
248
|
-
|
|
249
|
-
### Version 2 Breaking Changes
|
|
250
|
-
|
|
251
|
-
Version 2.0.0 introduced breaking changes:
|
|
252
|
-
- New tag name: `brick-icon-v2` (previously `brick-icon`)
|
|
253
|
-
- Requires embedded SVG sprite in HTML (no external sprite loading)
|
|
254
|
-
- Removed `theme` property (no longer needed)
|
|
255
|
-
- Removed CommonJS build
|
|
256
|
-
|
|
257
|
-
### Size Control
|
|
258
|
-
|
|
259
|
-
The `data-icon-size` attribute sets predefined sizes:
|
|
260
|
-
- `small`: Uses `--brick-sizes-iconS` token (typically 16px)
|
|
261
|
-
- `medium`: Uses `--brick-sizes-iconM` token (typically 24px)
|
|
262
|
-
|
|
263
|
-
For custom sizes, use CSS custom properties instead.
|
|
264
|
-
|
|
265
|
-
### Breaking News Animation
|
|
266
|
-
|
|
267
|
-
The icon with `data-icon-id="pill-breaking"` includes a special pulsing animation controlled by the `--b-icon-color-breaking-pulseStart` and `--b-icon-color-breaking-pulseEnd` CSS variables.
|
|
268
|
-
|
|
269
|
-
## Version
|
|
270
|
-
|
|
271
|
-
Current version: 2.3.1
|
|
@@ -1,430 +0,0 @@
|
|
|
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: [icons, ui-enhancement, navigation-icons, action-icons, status-indicators, brand-icons, decorative-graphics]
|
|
7
|
-
related: [brick-button, brick-card, brick-actions]
|
|
8
|
-
---
|
|
9
|
-
|
|
10
|
-
# Brick Icons
|
|
11
|
-
|
|
12
|
-
SVG icon sprite library providing theme-specific icon sets distributed via CDN for consistent, scalable graphics across Amedia's design system.
|
|
13
|
-
|
|
14
|
-
## Key Capabilities
|
|
15
|
-
|
|
16
|
-
- **Theme-Specific Sprites**: Separate SVG sprite files for each theme (alfa, bravo, charlie, nettavisen, alt)
|
|
17
|
-
- **CDN Distribution**: Icons served via Eik CDN for optimal performance and caching
|
|
18
|
-
- **Figma Automation**: Icons automatically synced from Figma using Figmagic
|
|
19
|
-
- **Scalable Graphics**: SVG format ensures crisp rendering at any size without quality loss
|
|
20
|
-
- **Color Inheritance**: Icons use `currentColor` for easy color customization via CSS
|
|
21
|
-
- **Comprehensive Icon Set**: Includes navigation, action, status, social, and brand icons
|
|
22
|
-
|
|
23
|
-
## Available Themes
|
|
24
|
-
|
|
25
|
-
| Theme | CDN Path |
|
|
26
|
-
|-------|----------|
|
|
27
|
-
| alfa | `https://assets.acdn.no/pkg/@amedia/brick-icons/v2/icons/alfa/icons.svg` |
|
|
28
|
-
| bravo | `https://assets.acdn.no/pkg/@amedia/brick-icons/v2/icons/bravo/icons.svg` |
|
|
29
|
-
| charlie | `https://assets.acdn.no/pkg/@amedia/brick-icons/v2/icons/charlie/icons.svg` |
|
|
30
|
-
| nettavisen | `https://assets.acdn.no/pkg/@amedia/brick-icons/v2/icons/nettavisen/icons.svg` |
|
|
31
|
-
| alt | `https://assets.acdn.no/pkg/@amedia/brick-icons/v2/icons/alt/icons.svg` |
|
|
32
|
-
|
|
33
|
-
## Icon Categories
|
|
34
|
-
|
|
35
|
-
**Navigation**: arrow-down, arrow-up, arrow-left, arrow-right, arrow-dropdown, arrow-dropup, chevron-down, chevron-up, close, menu
|
|
36
|
-
|
|
37
|
-
**Actions**: add, delete, copy, share, share-url, edit, settings-fill, settings-outline, camera, gift
|
|
38
|
-
|
|
39
|
-
**Status**: checkmark, checkmark-toggle, check-circle, error-circle, warning-circle, info-circle, lock, notification-off
|
|
40
|
-
|
|
41
|
-
**Media**: play, pause, replay, volume-on, volume-off, desktop, mobile
|
|
42
|
-
|
|
43
|
-
**Social/Brand**: facebook, instagram, linkedin, twitter, youtube, appstore, googleplay
|
|
44
|
-
|
|
45
|
-
**Tags/Labels**: pill-tag, pill-video, pill-breaking, pill-untold, plusall, tag-fill, tag-outline
|
|
46
|
-
|
|
47
|
-
**Other**: clock, datepicker, dice-1 through dice-6, logo-alt
|
|
48
|
-
|
|
49
|
-
## Examples
|
|
50
|
-
|
|
51
|
-
### Basic Icon Usage
|
|
52
|
-
|
|
53
|
-
```html
|
|
54
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24">
|
|
55
|
-
<use href="https://assets.acdn.no/pkg/@amedia/brick-icons/v2/icons/alfa/icons.svg#checkmark"></use>
|
|
56
|
-
</svg>
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
### Accessible Icon with Title
|
|
60
|
-
|
|
61
|
-
```html
|
|
62
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" aria-labelledby="search-title">
|
|
63
|
-
<title id="search-title">Search</title>
|
|
64
|
-
<use href="https://assets.acdn.no/pkg/@amedia/brick-icons/v2/icons/alfa/icons.svg#search"></use>
|
|
65
|
-
</svg>
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
### Decorative Icon (Hidden from Screen Readers)
|
|
69
|
-
|
|
70
|
-
```html
|
|
71
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" aria-hidden="true">
|
|
72
|
-
<use href="https://assets.acdn.no/pkg/@amedia/brick-icons/v2/icons/nettavisen/icons.svg#arrow-right"></use>
|
|
73
|
-
</svg>
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
### Icon with Custom Color and Size
|
|
77
|
-
|
|
78
|
-
```html
|
|
79
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" style="color: #ff0000;">
|
|
80
|
-
<use href="https://assets.acdn.no/pkg/@amedia/brick-icons/v2/icons/charlie/icons.svg#heart"></use>
|
|
81
|
-
</svg>
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
### Icon in Button Component
|
|
85
|
-
|
|
86
|
-
```html
|
|
87
|
-
<brick-button-v9 data-variant="primary">
|
|
88
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" aria-hidden="true">
|
|
89
|
-
<use href="https://assets.acdn.no/pkg/@amedia/brick-icons/v2/icons/alfa/icons.svg#add"></use>
|
|
90
|
-
</svg>
|
|
91
|
-
Add Item
|
|
92
|
-
</brick-button-v9>
|
|
93
|
-
```
|
|
94
|
-
|
|
95
|
-
### Social Media Icon Link
|
|
96
|
-
|
|
97
|
-
```html
|
|
98
|
-
<a href="https://facebook.com/example" aria-label="Follow us on Facebook">
|
|
99
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" aria-hidden="true">
|
|
100
|
-
<use href="https://assets.acdn.no/pkg/@amedia/brick-icons/v2/icons/alt/icons.svg#facebook"></use>
|
|
101
|
-
</svg>
|
|
102
|
-
</a>
|
|
103
|
-
```
|
|
104
|
-
|
|
105
|
-
## Framework Integration
|
|
106
|
-
|
|
107
|
-
### Svelte
|
|
108
|
-
|
|
109
|
-
```svelte
|
|
110
|
-
<script>
|
|
111
|
-
const theme = 'alfa';
|
|
112
|
-
const iconName = 'checkmark';
|
|
113
|
-
const iconUrl = `https://assets.acdn.no/pkg/@amedia/brick-icons/v2/icons/${theme}/icons.svg#${iconName}`;
|
|
114
|
-
</script>
|
|
115
|
-
|
|
116
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24">
|
|
117
|
-
<use href={iconUrl}></use>
|
|
118
|
-
</svg>
|
|
119
|
-
```
|
|
120
|
-
|
|
121
|
-
### React
|
|
122
|
-
|
|
123
|
-
```jsx
|
|
124
|
-
function Icon({ theme, name, size = 24, title }) {
|
|
125
|
-
const iconUrl = `https://assets.acdn.no/pkg/@amedia/brick-icons/v2/icons/${theme}/icons.svg#${name}`;
|
|
126
|
-
|
|
127
|
-
return (
|
|
128
|
-
<svg xmlns="http://www.w3.org/2000/svg" width={size} height={size} aria-labelledby={title ? `icon-${name}` : undefined}>
|
|
129
|
-
{title && <title id={`icon-${name}`}>{title}</title>}
|
|
130
|
-
<use href={iconUrl}></use>
|
|
131
|
-
</svg>
|
|
132
|
-
);
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
// Usage
|
|
136
|
-
<Icon theme="alfa" name="checkmark" title="Success" />
|
|
137
|
-
```
|
|
138
|
-
|
|
139
|
-
### Vue
|
|
140
|
-
|
|
141
|
-
```vue
|
|
142
|
-
<template>
|
|
143
|
-
<svg xmlns="http://www.w3.org/2000/svg" :width="size" :height="size">
|
|
144
|
-
<title v-if="title">{{ title }}</title>
|
|
145
|
-
<use :href="iconUrl"></use>
|
|
146
|
-
</svg>
|
|
147
|
-
</template>
|
|
148
|
-
|
|
149
|
-
<script>
|
|
150
|
-
export default {
|
|
151
|
-
props: {
|
|
152
|
-
theme: { type: String, required: true },
|
|
153
|
-
name: { type: String, required: true },
|
|
154
|
-
size: { type: Number, default: 24 },
|
|
155
|
-
title: String
|
|
156
|
-
},
|
|
157
|
-
computed: {
|
|
158
|
-
iconUrl() {
|
|
159
|
-
return `https://assets.acdn.no/pkg/@amedia/brick-icons/v2/icons/${this.theme}/icons.svg#${this.name}`;
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
</script>
|
|
164
|
-
```
|
|
165
|
-
|
|
166
|
-
## Programmatic Usage
|
|
167
|
-
|
|
168
|
-
### Import Sprite Paths
|
|
169
|
-
|
|
170
|
-
```javascript
|
|
171
|
-
import { alfa, bravo, charlie, nettavisen, alt } from '@amedia/brick-icons';
|
|
172
|
-
|
|
173
|
-
console.log(alfa); // './sprites/alfa/icons.svg'
|
|
174
|
-
```
|
|
175
|
-
|
|
176
|
-
### Dynamic Icon Loading
|
|
177
|
-
|
|
178
|
-
```javascript
|
|
179
|
-
// Helper function to create icon element
|
|
180
|
-
function createIcon(theme, iconName, options = {}) {
|
|
181
|
-
const { width = 24, height = 24, title, color } = options;
|
|
182
|
-
|
|
183
|
-
const svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
|
|
184
|
-
svg.setAttribute('xmlns', 'http://www.w3.org/2000/svg');
|
|
185
|
-
svg.setAttribute('width', width);
|
|
186
|
-
svg.setAttribute('height', height);
|
|
187
|
-
|
|
188
|
-
if (color) {
|
|
189
|
-
svg.style.color = color;
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
if (title) {
|
|
193
|
-
const titleElement = document.createElementNS('http://www.w3.org/2000/svg', 'title');
|
|
194
|
-
titleElement.textContent = title;
|
|
195
|
-
svg.appendChild(titleElement);
|
|
196
|
-
} else {
|
|
197
|
-
svg.setAttribute('aria-hidden', 'true');
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
const use = document.createElementNS('http://www.w3.org/2000/svg', 'use');
|
|
201
|
-
use.setAttributeNS('http://www.w3.org/1999/xlink', 'href',
|
|
202
|
-
`https://assets.acdn.no/pkg/@amedia/brick-icons/v2/icons/${theme}/icons.svg#${iconName}`
|
|
203
|
-
);
|
|
204
|
-
|
|
205
|
-
svg.appendChild(use);
|
|
206
|
-
return svg;
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
// Usage
|
|
210
|
-
const icon = createIcon('alfa', 'checkmark', {
|
|
211
|
-
width: 32,
|
|
212
|
-
height: 32,
|
|
213
|
-
title: 'Completed',
|
|
214
|
-
color: '#00aa00'
|
|
215
|
-
});
|
|
216
|
-
document.body.appendChild(icon);
|
|
217
|
-
```
|
|
218
|
-
|
|
219
|
-
## Accessibility
|
|
220
|
-
|
|
221
|
-
### Informative vs Decorative Icons
|
|
222
|
-
|
|
223
|
-
**Informative Icons** (convey meaning):
|
|
224
|
-
- MUST include a `<title>` element with descriptive text
|
|
225
|
-
- MUST have `aria-labelledby` pointing to the title element ID
|
|
226
|
-
- Example: Standalone icon buttons, status indicators
|
|
227
|
-
|
|
228
|
-
**Decorative Icons** (purely visual):
|
|
229
|
-
- MUST include `aria-hidden="true"`
|
|
230
|
-
- Should be paired with visible text labels
|
|
231
|
-
- Example: Icons next to text labels in buttons
|
|
232
|
-
|
|
233
|
-
### Best Practices
|
|
234
|
-
|
|
235
|
-
```html
|
|
236
|
-
<!-- ✅ GOOD: Informative icon with proper accessibility -->
|
|
237
|
-
<button>
|
|
238
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" aria-labelledby="close-title">
|
|
239
|
-
<title id="close-title">Close dialog</title>
|
|
240
|
-
<use href="icons/alfa/icons.svg#close"></use>
|
|
241
|
-
</svg>
|
|
242
|
-
</button>
|
|
243
|
-
|
|
244
|
-
<!-- ✅ GOOD: Decorative icon paired with text -->
|
|
245
|
-
<button>
|
|
246
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" aria-hidden="true">
|
|
247
|
-
<use href="icons/alfa/icons.svg#add"></use>
|
|
248
|
-
</svg>
|
|
249
|
-
Add Item
|
|
250
|
-
</button>
|
|
251
|
-
|
|
252
|
-
<!-- ❌ BAD: Informative icon without accessibility support -->
|
|
253
|
-
<button>
|
|
254
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20">
|
|
255
|
-
<use href="icons/alfa/icons.svg#delete"></use>
|
|
256
|
-
</svg>
|
|
257
|
-
</button>
|
|
258
|
-
|
|
259
|
-
<!-- ❌ BAD: Standalone decorative icon -->
|
|
260
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20">
|
|
261
|
-
<use href="icons/alfa/icons.svg#arrow-right"></use>
|
|
262
|
-
</svg>
|
|
263
|
-
```
|
|
264
|
-
|
|
265
|
-
### Keyboard Navigation
|
|
266
|
-
|
|
267
|
-
Icons themselves are not interactive. Always wrap icons in interactive elements like:
|
|
268
|
-
- `<button>` for actions
|
|
269
|
-
- `<a>` for navigation
|
|
270
|
-
- Ensure interactive elements are keyboard accessible with proper focus styles
|
|
271
|
-
|
|
272
|
-
## Common Patterns
|
|
273
|
-
|
|
274
|
-
### Icon Button
|
|
275
|
-
|
|
276
|
-
```html
|
|
277
|
-
<brick-button-v9 data-variant="ghost" data-shape="circle">
|
|
278
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" aria-labelledby="settings-title">
|
|
279
|
-
<title id="settings-title">Open settings</title>
|
|
280
|
-
<use href="https://assets.acdn.no/pkg/@amedia/brick-icons/v2/icons/alfa/icons.svg#settings-fill"></use>
|
|
281
|
-
</svg>
|
|
282
|
-
</brick-button-v9>
|
|
283
|
-
```
|
|
284
|
-
|
|
285
|
-
### Status Indicator with Icon
|
|
286
|
-
|
|
287
|
-
```html
|
|
288
|
-
<div class="status-success" style="display: flex; align-items: center; gap: 8px; color: #00aa00;">
|
|
289
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" aria-hidden="true">
|
|
290
|
-
<use href="https://assets.acdn.no/pkg/@amedia/brick-icons/v2/icons/alfa/icons.svg#check-circle"></use>
|
|
291
|
-
</svg>
|
|
292
|
-
<span>Operation completed successfully</span>
|
|
293
|
-
</div>
|
|
294
|
-
```
|
|
295
|
-
|
|
296
|
-
### Navigation Menu Item
|
|
297
|
-
|
|
298
|
-
```html
|
|
299
|
-
<a href="/profile" style="display: flex; align-items: center; gap: 12px;">
|
|
300
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" aria-hidden="true">
|
|
301
|
-
<use href="https://assets.acdn.no/pkg/@amedia/brick-icons/v2/icons/nettavisen/icons.svg#user"></use>
|
|
302
|
-
</svg>
|
|
303
|
-
<span>My Profile</span>
|
|
304
|
-
</a>
|
|
305
|
-
```
|
|
306
|
-
|
|
307
|
-
### Media Controls
|
|
308
|
-
|
|
309
|
-
```html
|
|
310
|
-
<div class="media-controls" style="display: flex; gap: 16px;">
|
|
311
|
-
<button aria-label="Play video">
|
|
312
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" aria-hidden="true">
|
|
313
|
-
<use href="https://assets.acdn.no/pkg/@amedia/brick-icons/v2/icons/alt/icons.svg#play"></use>
|
|
314
|
-
</svg>
|
|
315
|
-
</button>
|
|
316
|
-
<button aria-label="Mute audio">
|
|
317
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" aria-hidden="true">
|
|
318
|
-
<use href="https://assets.acdn.no/pkg/@amedia/brick-icons/v2/icons/alt/icons.svg#volume-on"></use>
|
|
319
|
-
</svg>
|
|
320
|
-
</button>
|
|
321
|
-
</div>
|
|
322
|
-
```
|
|
323
|
-
|
|
324
|
-
### Social Media Links
|
|
325
|
-
|
|
326
|
-
```html
|
|
327
|
-
<nav aria-label="Social media" style="display: flex; gap: 16px;">
|
|
328
|
-
<a href="https://facebook.com/example" aria-label="Facebook">
|
|
329
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" aria-hidden="true">
|
|
330
|
-
<use href="https://assets.acdn.no/pkg/@amedia/brick-icons/v2/icons/charlie/icons.svg#facebook"></use>
|
|
331
|
-
</svg>
|
|
332
|
-
</a>
|
|
333
|
-
<a href="https://twitter.com/example" aria-label="Twitter">
|
|
334
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" aria-hidden="true">
|
|
335
|
-
<use href="https://assets.acdn.no/pkg/@amedia/brick-icons/v2/icons/charlie/icons.svg#twitter"></use>
|
|
336
|
-
</svg>
|
|
337
|
-
</a>
|
|
338
|
-
<a href="https://instagram.com/example" aria-label="Instagram">
|
|
339
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" aria-hidden="true">
|
|
340
|
-
<use href="https://assets.acdn.no/pkg/@amedia/brick-icons/v2/icons/charlie/icons.svg#instagram"></use>
|
|
341
|
-
</svg>
|
|
342
|
-
</a>
|
|
343
|
-
</nav>
|
|
344
|
-
```
|
|
345
|
-
|
|
346
|
-
## Technical Details
|
|
347
|
-
|
|
348
|
-
- **Package Name**: @amedia/brick-icons
|
|
349
|
-
- **Distribution**: CDN via Eik (https://assets.acdn.no)
|
|
350
|
-
- **Source**: Figma (synced via Figmagic)
|
|
351
|
-
- **Format**: SVG sprite sheets
|
|
352
|
-
- **Themes**: alfa, bravo, charlie, nettavisen, alt
|
|
353
|
-
- **Build Tools**: Figmagic, svg-sprite, svgson
|
|
354
|
-
- **Dependencies**: None (icons are static assets)
|
|
355
|
-
|
|
356
|
-
### CDN URL Structure
|
|
357
|
-
|
|
358
|
-
```
|
|
359
|
-
https://assets.acdn.no/pkg/@amedia/brick-icons/v{major}/icons/{theme}/icons.svg#{icon-name}
|
|
360
|
-
```
|
|
361
|
-
|
|
362
|
-
Example:
|
|
363
|
-
```
|
|
364
|
-
https://assets.acdn.no/pkg/@amedia/brick-icons/v2/icons/alfa/icons.svg#checkmark
|
|
365
|
-
```
|
|
366
|
-
|
|
367
|
-
### Version Aliasing
|
|
368
|
-
|
|
369
|
-
The package uses Eik version aliasing:
|
|
370
|
-
- `v1` → Latest 1.x.x version
|
|
371
|
-
- `v2` → Latest 2.x.x version (current)
|
|
372
|
-
|
|
373
|
-
This allows automatic updates within major versions without changing URLs.
|
|
374
|
-
|
|
375
|
-
## Important Notes
|
|
376
|
-
|
|
377
|
-
### Icon Updates
|
|
378
|
-
|
|
379
|
-
Icons are automatically synced from Figma. To update icons:
|
|
380
|
-
|
|
381
|
-
1. Ensure you have Figma API access token
|
|
382
|
-
2. Run: `npm run build:svg && npm run build:altered-svg && npm run build:sprite`
|
|
383
|
-
3. Create changeset: `npx changeset`
|
|
384
|
-
4. Commit and push changes
|
|
385
|
-
5. After merge, flush Varnish cache if needed
|
|
386
|
-
|
|
387
|
-
### Color Customization
|
|
388
|
-
|
|
389
|
-
Most icons use `currentColor` for fill/stroke, allowing easy color changes via CSS:
|
|
390
|
-
|
|
391
|
-
```html
|
|
392
|
-
<svg style="color: #ff0000;" xmlns="http://www.w3.org/2000/svg" width="24" height="24">
|
|
393
|
-
<use href="icons/alfa/icons.svg#heart"></use>
|
|
394
|
-
</svg>
|
|
395
|
-
```
|
|
396
|
-
|
|
397
|
-
Some multi-colored brand icons (like social media logos) may have fixed colors.
|
|
398
|
-
|
|
399
|
-
### Performance
|
|
400
|
-
|
|
401
|
-
- Icons are served from CDN with aggressive caching
|
|
402
|
-
- Sprite sheets bundle all icons per theme in single HTTP request
|
|
403
|
-
- Use version aliases (v2) for automatic updates within major versions
|
|
404
|
-
- Consider preloading sprite sheets for critical icons:
|
|
405
|
-
|
|
406
|
-
```html
|
|
407
|
-
<link rel="preload" as="image" type="image/svg+xml"
|
|
408
|
-
href="https://assets.acdn.no/pkg/@amedia/brick-icons/v2/icons/alfa/icons.svg">
|
|
409
|
-
```
|
|
410
|
-
|
|
411
|
-
### Browser Compatibility
|
|
412
|
-
|
|
413
|
-
SVG sprites with `<use>` elements are supported in all modern browsers. For legacy browser support, consider using polyfills like svg4everybody.
|
|
414
|
-
|
|
415
|
-
### Icon Availability
|
|
416
|
-
|
|
417
|
-
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.
|
|
418
|
-
|
|
419
|
-
### Non-Interactive Elements
|
|
420
|
-
|
|
421
|
-
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.
|
|
422
|
-
|
|
423
|
-
## Version
|
|
424
|
-
|
|
425
|
-
Current version: 2.1.0
|
|
426
|
-
|
|
427
|
-
Recent updates:
|
|
428
|
-
- **2.1.0**: New icons: gift, camera, settings-outline
|
|
429
|
-
- **2.0.4**: Synced icons
|
|
430
|
-
- **2.0.0**: Removed CommonJS support (ESM only)
|