@amedia/brick-mcp 0.1.5 → 0.1.7
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/brick-countdown.md +39 -28
- package/data/components/brick-input.md +117 -74
- package/data/components/brick-pill.md +41 -41
- package/data/components/brick-teaser.md +18 -18
- package/data/components-metadata.json +35 -35
- package/data/tokens.json +27 -3
- package/dist/data/components/brick-countdown.md +39 -28
- package/dist/data/components/brick-input.md +117 -74
- package/dist/data/components/brick-pill.md +41 -41
- package/dist/data/components/brick-teaser.md +18 -18
- package/dist/data/components-metadata.json +35 -35
- package/dist/data/tokens.json +27 -3
- package/package.json +35 -35
package/data/tokens.json
CHANGED
|
@@ -3017,6 +3017,14 @@
|
|
|
3017
3017
|
"description": "Primary background color for expand component",
|
|
3018
3018
|
"cssVariable": "var(--brick-colors-expandPrimaryBg)"
|
|
3019
3019
|
},
|
|
3020
|
+
{
|
|
3021
|
+
"path": "color.expand.primary.fg",
|
|
3022
|
+
"name": "expandPrimaryFg",
|
|
3023
|
+
"type": "color",
|
|
3024
|
+
"value": "rgb(41, 40, 39)",
|
|
3025
|
+
"description": "Primary foreground/text color for expand component",
|
|
3026
|
+
"cssVariable": "var(--brick-colors-expandPrimaryFg)"
|
|
3027
|
+
},
|
|
3020
3028
|
{
|
|
3021
3029
|
"path": "color.expand.secondary.border",
|
|
3022
3030
|
"name": "expandSecondaryBorder",
|
|
@@ -3588,6 +3596,14 @@
|
|
|
3588
3596
|
"description": "Spacing token used by ad provider Adnami.",
|
|
3589
3597
|
"cssVariable": "var(--brick-space-adnamiX)"
|
|
3590
3598
|
},
|
|
3599
|
+
{
|
|
3600
|
+
"path": "spacing.card.x.s",
|
|
3601
|
+
"name": "cardXS",
|
|
3602
|
+
"type": "dimension",
|
|
3603
|
+
"value": "0.625rem",
|
|
3604
|
+
"description": "Generell horisontal padding i bokser/containere.",
|
|
3605
|
+
"cssVariable": "var(--brick-space-cardXS)"
|
|
3606
|
+
},
|
|
3591
3607
|
{
|
|
3592
3608
|
"path": "spacing.card.x.m",
|
|
3593
3609
|
"name": "cardXM",
|
|
@@ -3604,6 +3620,14 @@
|
|
|
3604
3620
|
"description": "Generell horisontal padding i bokser/containere.",
|
|
3605
3621
|
"cssVariable": "var(--brick-space-cardXL)"
|
|
3606
3622
|
},
|
|
3623
|
+
{
|
|
3624
|
+
"path": "spacing.card.y.s",
|
|
3625
|
+
"name": "cardYS",
|
|
3626
|
+
"type": "dimension",
|
|
3627
|
+
"value": "0.625rem",
|
|
3628
|
+
"description": "Generell vertikal padding i bokser/containere.",
|
|
3629
|
+
"cssVariable": "var(--brick-space-cardYS)"
|
|
3630
|
+
},
|
|
3607
3631
|
{
|
|
3608
3632
|
"path": "spacing.card.y.m",
|
|
3609
3633
|
"name": "cardYM",
|
|
@@ -4883,7 +4907,7 @@
|
|
|
4883
4907
|
"path": "sizing.icon.s",
|
|
4884
4908
|
"name": "iconS",
|
|
4885
4909
|
"type": "dimension",
|
|
4886
|
-
"value": "0.
|
|
4910
|
+
"value": "0.75rem",
|
|
4887
4911
|
"description": "Height and width of an icon, used anywhere",
|
|
4888
4912
|
"cssVariable": "var(--brick-sizing-iconS)"
|
|
4889
4913
|
},
|
|
@@ -4899,7 +4923,7 @@
|
|
|
4899
4923
|
"path": "sizing.premium-icon.m",
|
|
4900
4924
|
"name": "premiumIconM",
|
|
4901
4925
|
"type": "dimension",
|
|
4902
|
-
"value": "0.
|
|
4926
|
+
"value": "0.875rem",
|
|
4903
4927
|
"description": "Width and height of premium icon in Alfa on small screens ",
|
|
4904
4928
|
"cssVariable": "var(--brick-sizing-premiumIconM)"
|
|
4905
4929
|
},
|
|
@@ -4907,7 +4931,7 @@
|
|
|
4907
4931
|
"path": "sizing.premium-icon.l",
|
|
4908
4932
|
"name": "premiumIconL",
|
|
4909
4933
|
"type": "dimension",
|
|
4910
|
-
"value": "1.
|
|
4934
|
+
"value": "1.125rem",
|
|
4911
4935
|
"description": "Width and height of premium icon in Alfa on large screens.",
|
|
4912
4936
|
"cssVariable": "var(--brick-sizing-premiumIconL)"
|
|
4913
4937
|
},
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: brick-countdown
|
|
3
|
-
version:
|
|
4
|
-
selector: brick-countdown-
|
|
3
|
+
version: 3.0.1
|
|
4
|
+
selector: brick-countdown-v3
|
|
5
5
|
category: Feedback
|
|
6
6
|
tags: [countdown, timer, animation, teaser, time-based]
|
|
7
7
|
use_cases:
|
|
@@ -18,53 +18,53 @@ An animated countdown component that displays time remaining until a specified d
|
|
|
18
18
|
- Animated digit transitions with flip animation
|
|
19
19
|
- Automatic countdown updates every second
|
|
20
20
|
- Supports days, hours, minutes, and seconds display
|
|
21
|
-
- Localization support (Norwegian Bokmål and Nynorsk)
|
|
21
|
+
- Localization support following IETF BCP 47 standard (Norwegian Bokmål and Nynorsk)
|
|
22
22
|
- Automatically hides when countdown reaches zero
|
|
23
23
|
- Server-side rendering support via template function
|
|
24
24
|
- Accessible with screen reader support
|
|
25
25
|
|
|
26
26
|
## Props/Attributes
|
|
27
27
|
|
|
28
|
-
| Attribute | Type | Default
|
|
29
|
-
| ------------- | ------------------ |
|
|
30
|
-
| `data-date` | EpochTimeStamp | -
|
|
31
|
-
| `data-text` | string | -
|
|
32
|
-
| `data-locale` | '
|
|
28
|
+
| Attribute | Type | Default | Required | Description |
|
|
29
|
+
| ------------- | ------------------ | --------- | -------- | -------------------------------------------------- |
|
|
30
|
+
| `data-date` | EpochTimeStamp | - | yes | Unix timestamp in milliseconds for the target date |
|
|
31
|
+
| `data-text` | string | - | no | Optional text to display with the countdown |
|
|
32
|
+
| `data-locale` | 'nb-NO' \| 'nn-NO' | 'nb-NO' | no | Locale for time unit labels (IETF BCP 47 format) |
|
|
33
33
|
|
|
34
34
|
## Examples
|
|
35
35
|
|
|
36
36
|
### Basic Countdown
|
|
37
37
|
|
|
38
38
|
```html
|
|
39
|
-
<brick-countdown-
|
|
39
|
+
<brick-countdown-v3 data-date="1713515269513"></brick-countdown-v3>
|
|
40
40
|
```
|
|
41
41
|
|
|
42
42
|
### With Custom Text
|
|
43
43
|
|
|
44
44
|
```html
|
|
45
|
-
<brick-countdown-
|
|
45
|
+
<brick-countdown-v3
|
|
46
46
|
data-date="1713515269513"
|
|
47
47
|
data-text="Starts in"
|
|
48
|
-
></brick-countdown-
|
|
48
|
+
></brick-countdown-v3>
|
|
49
49
|
```
|
|
50
50
|
|
|
51
51
|
### With Locale
|
|
52
52
|
|
|
53
53
|
```html
|
|
54
|
-
<brick-countdown-
|
|
54
|
+
<brick-countdown-v3
|
|
55
55
|
data-date="1713515269513"
|
|
56
56
|
data-text="Tid igjen"
|
|
57
|
-
data-locale="
|
|
58
|
-
></brick-countdown-
|
|
57
|
+
data-locale="nn-NO"
|
|
58
|
+
></brick-countdown-v3>
|
|
59
59
|
```
|
|
60
60
|
|
|
61
61
|
### JavaScript Creation
|
|
62
62
|
|
|
63
63
|
```javascript
|
|
64
|
-
const el = document.createElement('brick-countdown-
|
|
64
|
+
const el = document.createElement('brick-countdown-v3');
|
|
65
65
|
el.dataset.date = '1713515269513';
|
|
66
66
|
el.dataset.text = 'Event starts in';
|
|
67
|
-
el.dataset.locale = '
|
|
67
|
+
el.dataset.locale = 'nb-NO';
|
|
68
68
|
document.body.appendChild(el);
|
|
69
69
|
```
|
|
70
70
|
|
|
@@ -78,7 +78,7 @@ import { renderBrickCountdown } from '@amedia/brick-countdown/template';
|
|
|
78
78
|
const markup = renderBrickCountdown({
|
|
79
79
|
dataDate: 1713515269513,
|
|
80
80
|
dataText: 'Starts in',
|
|
81
|
-
dataLocale: '
|
|
81
|
+
dataLocale: 'nb-NO',
|
|
82
82
|
});
|
|
83
83
|
```
|
|
84
84
|
|
|
@@ -116,19 +116,21 @@ import '@amedia/brick-countdown';
|
|
|
116
116
|
|
|
117
117
|
### Supported Locales
|
|
118
118
|
|
|
119
|
-
|
|
119
|
+
The component follows the IETF BCP 47 language tag standard for locale values.
|
|
120
|
+
|
|
121
|
+
**Norwegian Bokmål (nb-NO - default):**
|
|
120
122
|
|
|
121
123
|
- days: "dager"
|
|
122
124
|
- hours: "timer"
|
|
123
|
-
- minutes: "
|
|
124
|
-
- seconds: "
|
|
125
|
+
- minutes: "min"
|
|
126
|
+
- seconds: "sek"
|
|
125
127
|
|
|
126
|
-
**Norwegian Nynorsk (
|
|
128
|
+
**Norwegian Nynorsk (nn-NO):**
|
|
127
129
|
|
|
128
130
|
- days: "dagar"
|
|
129
131
|
- hours: "timar"
|
|
130
|
-
- minutes: "
|
|
131
|
-
- seconds: "
|
|
132
|
+
- minutes: "min"
|
|
133
|
+
- seconds: "sek"
|
|
132
134
|
|
|
133
135
|
## Common Patterns
|
|
134
136
|
|
|
@@ -136,10 +138,11 @@ import '@amedia/brick-countdown';
|
|
|
136
138
|
|
|
137
139
|
```html
|
|
138
140
|
<brick-teaser-v9>
|
|
139
|
-
<brick-countdown-
|
|
141
|
+
<brick-countdown-v3
|
|
140
142
|
data-date="1713515269513"
|
|
141
143
|
data-text="Direktesending starter om"
|
|
142
|
-
|
|
144
|
+
data-locale="nb-NO"
|
|
145
|
+
></brick-countdown-v3>
|
|
143
146
|
<!-- Other teaser content -->
|
|
144
147
|
</brick-teaser-v9>
|
|
145
148
|
```
|
|
@@ -148,7 +151,7 @@ import '@amedia/brick-countdown';
|
|
|
148
151
|
|
|
149
152
|
```javascript
|
|
150
153
|
function createCountdown(targetDate, text) {
|
|
151
|
-
const countdown = document.createElement('brick-countdown-
|
|
154
|
+
const countdown = document.createElement('brick-countdown-v3');
|
|
152
155
|
countdown.dataset.date = targetDate.getTime().toString();
|
|
153
156
|
countdown.dataset.text = text;
|
|
154
157
|
return countdown;
|
|
@@ -160,7 +163,7 @@ const countdownEl = createCountdown(eventDate, 'New Year in');
|
|
|
160
163
|
|
|
161
164
|
## Technical Details
|
|
162
165
|
|
|
163
|
-
- **Custom Element**: `brick-countdown-
|
|
166
|
+
- **Custom Element**: `brick-countdown-v3`
|
|
164
167
|
- **Base Class**: BrickElement
|
|
165
168
|
- **Dependencies**: `@amedia/brick-template`, `@amedia/brick-tokens`
|
|
166
169
|
- **Renders as**: Custom element with `<time>` element inside
|
|
@@ -177,4 +180,12 @@ const countdownEl = createCountdown(eventDate, 'New Year in');
|
|
|
177
180
|
|
|
178
181
|
## Version
|
|
179
182
|
|
|
180
|
-
Current version:
|
|
183
|
+
Current version: 3.0.1
|
|
184
|
+
|
|
185
|
+
## Breaking Changes in v3.0.0
|
|
186
|
+
|
|
187
|
+
**Locale format update**: The `data-locale` attribute now follows the IETF BCP 47 standard:
|
|
188
|
+
- Changed from `nb_NO` to `nb-NO` (Norwegian Bokmål)
|
|
189
|
+
- Changed from `nn_NO` to `nn-NO` (Norwegian Nynorsk)
|
|
190
|
+
|
|
191
|
+
If you are upgrading from v2.x, update any hardcoded locale values to use the hyphenated format.
|