@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,150 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: brick-classnames
|
|
3
|
-
version: 2.1.0
|
|
4
|
-
category: Utility
|
|
5
|
-
tags: [utility, css, theming, design-system, classnames]
|
|
6
|
-
use_cases: [theming, styling, design-tokens, css-variables]
|
|
7
|
-
related: [brick-themes, brick-tokens]
|
|
8
|
-
---
|
|
9
|
-
|
|
10
|
-
# Brick Classnames
|
|
11
|
-
|
|
12
|
-
A utility module that converts design theme names into CSS-safe class names for use with Brick design tokens.
|
|
13
|
-
|
|
14
|
-
## Key Capabilities
|
|
15
|
-
|
|
16
|
-
- Converts design theme names to CSS-safe class names
|
|
17
|
-
- Ensures correct scoping for theme-specific CSS variables
|
|
18
|
-
- Works seamlessly with brick-tokens theme CSS files
|
|
19
|
-
- TypeScript support with type-safe design names
|
|
20
|
-
- Simple, single-function API
|
|
21
|
-
|
|
22
|
-
## API
|
|
23
|
-
|
|
24
|
-
### `designNameToClassName(designName: Design): string`
|
|
25
|
-
|
|
26
|
-
Converts a design theme name to a CSS-safe class name that corresponds with theme classes in brick-tokens.
|
|
27
|
-
|
|
28
|
-
**Parameters:**
|
|
29
|
-
- `designName`: `Design` - One of: `'nettavisen' | 'alt' | 'alfa' | 'bravo' | 'charlie'`
|
|
30
|
-
|
|
31
|
-
**Returns:** `string` - A CSS class name (e.g., `'themeAlt'`, `'themeBravo'`)
|
|
32
|
-
|
|
33
|
-
## Examples
|
|
34
|
-
|
|
35
|
-
### Basic Usage
|
|
36
|
-
|
|
37
|
-
```javascript
|
|
38
|
-
import { designNameToClassName } from '@amedia/brick-classnames';
|
|
39
|
-
|
|
40
|
-
const cssClass = designNameToClassName('alt');
|
|
41
|
-
// Returns: 'themeAlt'
|
|
42
|
-
|
|
43
|
-
const html = `<div class="${cssClass}">
|
|
44
|
-
<amedia-foo>bar</amedia-foo>
|
|
45
|
-
</div>`;
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
### With CSS Variables
|
|
49
|
-
|
|
50
|
-
```javascript
|
|
51
|
-
const className = designNameToClassName('bravo');
|
|
52
|
-
// Returns: 'themeBravo'
|
|
53
|
-
|
|
54
|
-
// In your HTML
|
|
55
|
-
const markup = `<div class="${className}">
|
|
56
|
-
<button>Styled with Bravo theme</button>
|
|
57
|
-
</div>`;
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
```css
|
|
61
|
-
/* Your component CSS can reference theme variables */
|
|
62
|
-
.button {
|
|
63
|
-
color: var(--brick-colors-adText);
|
|
64
|
-
background: var(--brick-colors-primary);
|
|
65
|
-
}
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
### All Available Themes
|
|
69
|
-
|
|
70
|
-
```javascript
|
|
71
|
-
import { designNameToClassName } from '@amedia/brick-classnames';
|
|
72
|
-
|
|
73
|
-
designNameToClassName('nettavisen'); // 'themeNettavisen'
|
|
74
|
-
designNameToClassName('alt'); // 'themeAlt'
|
|
75
|
-
designNameToClassName('alfa'); // 'themeAlfa'
|
|
76
|
-
designNameToClassName('bravo'); // 'themeBravo'
|
|
77
|
-
designNameToClassName('charlie'); // 'themeCharlie'
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
## Framework Integration
|
|
81
|
-
|
|
82
|
-
### Svelte
|
|
83
|
-
|
|
84
|
-
```svelte
|
|
85
|
-
<script>
|
|
86
|
-
import { designNameToClassName } from '@amedia/brick-classnames';
|
|
87
|
-
|
|
88
|
-
export let design = 'alt';
|
|
89
|
-
|
|
90
|
-
$: themeClass = designNameToClassName(design);
|
|
91
|
-
</script>
|
|
92
|
-
|
|
93
|
-
<div class={themeClass}>
|
|
94
|
-
<slot />
|
|
95
|
-
</div>
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
### React
|
|
99
|
-
|
|
100
|
-
```jsx
|
|
101
|
-
import { designNameToClassName } from '@amedia/brick-classnames';
|
|
102
|
-
|
|
103
|
-
function ThemedContainer({ design, children }) {
|
|
104
|
-
const themeClass = designNameToClassName(design);
|
|
105
|
-
|
|
106
|
-
return (
|
|
107
|
-
<div className={themeClass}>
|
|
108
|
-
{children}
|
|
109
|
-
</div>
|
|
110
|
-
);
|
|
111
|
-
}
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
## Technical Details
|
|
115
|
-
|
|
116
|
-
- **Package**: `@amedia/brick-classnames`
|
|
117
|
-
- **Type**: Utility function
|
|
118
|
-
- **Dependencies**: `@amedia/brick-themes`
|
|
119
|
-
- **Output format**: Camel-cased class name with 'theme' prefix
|
|
120
|
-
|
|
121
|
-
## Important Notes
|
|
122
|
-
|
|
123
|
-
- You must load the corresponding theme CSS file from Eik to use the CSS variables
|
|
124
|
-
- Theme CSS files are available at: `https://assets.acdn.no/pkg/@amedia/brick-tokens/v2/css/theme-{name}.css`
|
|
125
|
-
- The class name provides scoping for CSS variables defined in brick-tokens
|
|
126
|
-
- TypeScript provides autocomplete and validation for design names
|
|
127
|
-
|
|
128
|
-
## Common Patterns
|
|
129
|
-
|
|
130
|
-
### Loading Theme CSS
|
|
131
|
-
|
|
132
|
-
```javascript
|
|
133
|
-
import { designNameToClassName } from '@amedia/brick-classnames';
|
|
134
|
-
|
|
135
|
-
const design = 'bravo';
|
|
136
|
-
const className = designNameToClassName(design);
|
|
137
|
-
|
|
138
|
-
// Load the corresponding CSS file
|
|
139
|
-
const link = document.createElement('link');
|
|
140
|
-
link.rel = 'stylesheet';
|
|
141
|
-
link.href = `https://assets.acdn.no/pkg/@amedia/brick-tokens/v2/css/theme-${design}.css`;
|
|
142
|
-
document.head.appendChild(link);
|
|
143
|
-
|
|
144
|
-
// Apply the class to enable scoped variables
|
|
145
|
-
document.body.className = className;
|
|
146
|
-
```
|
|
147
|
-
|
|
148
|
-
## Version
|
|
149
|
-
|
|
150
|
-
Current version: 2.1.0
|
|
@@ -1,179 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: brick-countdown
|
|
3
|
-
version: 2.0.9
|
|
4
|
-
selector: brick-countdown-v2
|
|
5
|
-
category: Feedback
|
|
6
|
-
tags: [countdown, timer, animation, teaser, time-based]
|
|
7
|
-
use_cases: [product-launches, event-countdown, limited-offers, time-sensitive-content]
|
|
8
|
-
related: [brick-teaser]
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
# Brick Countdown
|
|
12
|
-
|
|
13
|
-
An animated countdown component that displays time remaining until a specified date, with automatic updates and localization support.
|
|
14
|
-
|
|
15
|
-
## Key Capabilities
|
|
16
|
-
|
|
17
|
-
- Animated digit transitions with flip animation
|
|
18
|
-
- Automatic countdown updates every second
|
|
19
|
-
- Supports days, hours, minutes, and seconds display
|
|
20
|
-
- Localization support (Norwegian Bokmål and Nynorsk)
|
|
21
|
-
- Automatically hides when countdown reaches zero
|
|
22
|
-
- Server-side rendering support via template function
|
|
23
|
-
- Accessible with screen reader support
|
|
24
|
-
|
|
25
|
-
## Props/Attributes
|
|
26
|
-
|
|
27
|
-
| Attribute | Type | Default | Required | Description |
|
|
28
|
-
|-----------|------|---------|----------|-------------|
|
|
29
|
-
| `data-date` | EpochTimeStamp | - | yes | Unix timestamp in milliseconds for the target date |
|
|
30
|
-
| `data-text` | string | - | no | Optional text to display with the countdown |
|
|
31
|
-
| `data-locale` | 'nb_NO' \| 'nn_NO' | 'nb_NO' | no | Locale for time unit labels |
|
|
32
|
-
|
|
33
|
-
## Examples
|
|
34
|
-
|
|
35
|
-
### Basic Countdown
|
|
36
|
-
|
|
37
|
-
```html
|
|
38
|
-
<brick-countdown-v2
|
|
39
|
-
data-date="1713515269513"
|
|
40
|
-
></brick-countdown-v2>
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
### With Custom Text
|
|
44
|
-
|
|
45
|
-
```html
|
|
46
|
-
<brick-countdown-v2
|
|
47
|
-
data-date="1713515269513"
|
|
48
|
-
data-text="Starts in"
|
|
49
|
-
></brick-countdown-v2>
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
### With Locale
|
|
53
|
-
|
|
54
|
-
```html
|
|
55
|
-
<brick-countdown-v2
|
|
56
|
-
data-date="1713515269513"
|
|
57
|
-
data-text="Tid igjen"
|
|
58
|
-
data-locale="nn_NO"
|
|
59
|
-
></brick-countdown-v2>
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
### JavaScript Creation
|
|
63
|
-
|
|
64
|
-
```javascript
|
|
65
|
-
const el = document.createElement('brick-countdown-v2');
|
|
66
|
-
el.dataset.date = '1713515269513';
|
|
67
|
-
el.dataset.text = 'Event starts in';
|
|
68
|
-
el.dataset.locale = 'nb_NO';
|
|
69
|
-
document.body.appendChild(el);
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
## Server-Side Rendering
|
|
73
|
-
|
|
74
|
-
### Import and Render
|
|
75
|
-
|
|
76
|
-
```javascript
|
|
77
|
-
import { renderBrickCountdown } from '@amedia/brick-countdown/template';
|
|
78
|
-
|
|
79
|
-
const markup = renderBrickCountdown({
|
|
80
|
-
dataDate: 1713515269513,
|
|
81
|
-
dataText: 'Starts in',
|
|
82
|
-
dataLocale: 'nb_NO'
|
|
83
|
-
});
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
### Client-Side Hydration
|
|
87
|
-
|
|
88
|
-
After server-side rendering, load the client-side JavaScript for interactivity:
|
|
89
|
-
|
|
90
|
-
```javascript
|
|
91
|
-
import '@amedia/brick-countdown';
|
|
92
|
-
```
|
|
93
|
-
|
|
94
|
-
## Behavior
|
|
95
|
-
|
|
96
|
-
### Countdown Logic
|
|
97
|
-
|
|
98
|
-
- Updates every second with animated digit transitions
|
|
99
|
-
- Hides days unit when less than 1 day remains
|
|
100
|
-
- Automatically removes itself from DOM when countdown reaches zero
|
|
101
|
-
- Validates date and logs error if invalid timestamp provided
|
|
102
|
-
|
|
103
|
-
### Animation
|
|
104
|
-
|
|
105
|
-
- Digits animate vertically using CSS custom properties
|
|
106
|
-
- Smooth transitions between numbers
|
|
107
|
-
- No animation for units that haven't changed
|
|
108
|
-
|
|
109
|
-
## Accessibility
|
|
110
|
-
|
|
111
|
-
- Uses semantic `<time>` element with `datetime` attribute
|
|
112
|
-
- Screen reader text updates with countdown progress
|
|
113
|
-
- Visual and screen reader content synchronized
|
|
114
|
-
- Proper ARIA labeling for time remaining
|
|
115
|
-
|
|
116
|
-
## Localization
|
|
117
|
-
|
|
118
|
-
### Supported Locales
|
|
119
|
-
|
|
120
|
-
**Norwegian Bokmål (nb_NO - default):**
|
|
121
|
-
- days: "dager"
|
|
122
|
-
- hours: "timer"
|
|
123
|
-
- minutes: "minutter"
|
|
124
|
-
- seconds: "sekunder"
|
|
125
|
-
|
|
126
|
-
**Norwegian Nynorsk (nn_NO):**
|
|
127
|
-
- days: "dagar"
|
|
128
|
-
- hours: "timar"
|
|
129
|
-
- minutes: "minutt"
|
|
130
|
-
- seconds: "sekund"
|
|
131
|
-
|
|
132
|
-
## Common Patterns
|
|
133
|
-
|
|
134
|
-
### Event Countdown in Teaser
|
|
135
|
-
|
|
136
|
-
```html
|
|
137
|
-
<brick-teaser-v9>
|
|
138
|
-
<brick-countdown-v2
|
|
139
|
-
data-date="1713515269513"
|
|
140
|
-
data-text="Direktesending starter om"
|
|
141
|
-
></brick-countdown-v2>
|
|
142
|
-
<!-- Other teaser content -->
|
|
143
|
-
</brick-teaser-v9>
|
|
144
|
-
```
|
|
145
|
-
|
|
146
|
-
### Dynamic Countdown Creation
|
|
147
|
-
|
|
148
|
-
```javascript
|
|
149
|
-
function createCountdown(targetDate, text) {
|
|
150
|
-
const countdown = document.createElement('brick-countdown-v2');
|
|
151
|
-
countdown.dataset.date = targetDate.getTime().toString();
|
|
152
|
-
countdown.dataset.text = text;
|
|
153
|
-
return countdown;
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
const eventDate = new Date('2024-12-31T23:59:59');
|
|
157
|
-
const countdownEl = createCountdown(eventDate, 'New Year in');
|
|
158
|
-
```
|
|
159
|
-
|
|
160
|
-
## Technical Details
|
|
161
|
-
|
|
162
|
-
- **Custom Element**: `brick-countdown-v2`
|
|
163
|
-
- **Base Class**: BrickElement
|
|
164
|
-
- **Dependencies**: `@amedia/brick-template`, `@amedia/brick-tokens`
|
|
165
|
-
- **Renders as**: Custom element with `<time>` element inside
|
|
166
|
-
- **Update Interval**: 1000ms (1 second)
|
|
167
|
-
|
|
168
|
-
## Important Notes
|
|
169
|
-
|
|
170
|
-
- Date must be provided as Unix timestamp in milliseconds
|
|
171
|
-
- Component automatically removes itself when countdown ends
|
|
172
|
-
- Days display is hidden when less than 24 hours remain
|
|
173
|
-
- Invalid dates will log an error and prevent countdown from starting
|
|
174
|
-
- Countdown stops updating when only days remain (no sub-day updates needed)
|
|
175
|
-
- Uses `setInterval` which is automatically cleared on component disconnect
|
|
176
|
-
|
|
177
|
-
## Version
|
|
178
|
-
|
|
179
|
-
Current version: 2.0.9
|