@amedia/brick-mcp 0.1.3 → 0.1.4

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 (82) hide show
  1. package/README.md +50 -1
  2. package/data/components/brick-mcp.md +259 -0
  3. package/data/components/brick-pill.md +362 -0
  4. package/data/components/brick-player.md +331 -0
  5. package/data/components/brick-published.md +219 -0
  6. package/data/components/brick-share.md +335 -0
  7. package/data/components/brick-stepper.md +319 -0
  8. package/data/components/brick-tab.md +241 -0
  9. package/data/components/brick-tabs.md +420 -0
  10. package/data/components/brick-tag.md +335 -0
  11. package/data/components/brick-teaser-player.md +248 -0
  12. package/data/components/brick-teaser-reels.md +190 -0
  13. package/data/components/brick-teaser.md +262 -0
  14. package/data/components/brick-template.md +226 -0
  15. package/data/components/brick-textarea.md +191 -0
  16. package/data/components/brick-themes.md +104 -0
  17. package/data/components/brick-toast.md +271 -0
  18. package/data/components/brick-toggle.md +268 -0
  19. package/data/components/brick-tokens.md +287 -0
  20. package/data/components/brick-tooltip.md +249 -0
  21. package/data/components-metadata.json +34 -34
  22. package/data/tokens.json +0 -7
  23. package/dist/data/components/brick-mcp.md +259 -0
  24. package/dist/data/components/brick-pill.md +362 -0
  25. package/dist/data/components/brick-player.md +331 -0
  26. package/dist/data/components/brick-published.md +219 -0
  27. package/dist/data/components/brick-share.md +335 -0
  28. package/dist/data/components/brick-stepper.md +319 -0
  29. package/dist/data/components/brick-tab.md +241 -0
  30. package/dist/data/components/brick-tabs.md +420 -0
  31. package/dist/data/components/brick-tag.md +335 -0
  32. package/dist/data/components/brick-teaser-player.md +248 -0
  33. package/dist/data/components/brick-teaser-reels.md +190 -0
  34. package/dist/data/components/brick-teaser.md +262 -0
  35. package/dist/data/components/brick-template.md +226 -0
  36. package/dist/data/components/brick-textarea.md +191 -0
  37. package/dist/data/components/brick-themes.md +104 -0
  38. package/dist/data/components/brick-toast.md +271 -0
  39. package/dist/data/components/brick-toggle.md +268 -0
  40. package/dist/data/components/brick-tokens.md +287 -0
  41. package/dist/data/components/brick-tooltip.md +249 -0
  42. package/dist/data/components-metadata.json +34 -34
  43. package/dist/data/tokens.json +0 -7
  44. package/package.json +37 -37
  45. package/data/components/brick-mcp.json +0 -6
  46. package/data/components/brick-pill.json +0 -6
  47. package/data/components/brick-player.json +0 -7
  48. package/data/components/brick-published.json +0 -7
  49. package/data/components/brick-share.json +0 -7
  50. package/data/components/brick-stepper.json +0 -7
  51. package/data/components/brick-tab.json +0 -7
  52. package/data/components/brick-tabs.json +0 -9
  53. package/data/components/brick-tag.json +0 -7
  54. package/data/components/brick-teaser-player.json +0 -9
  55. package/data/components/brick-teaser-reels.json +0 -9
  56. package/data/components/brick-teaser.json +0 -9
  57. package/data/components/brick-template.json +0 -9
  58. package/data/components/brick-textarea.json +0 -7
  59. package/data/components/brick-themes.json +0 -6
  60. package/data/components/brick-toast.json +0 -9
  61. package/data/components/brick-toggle.json +0 -7
  62. package/data/components/brick-tokens.json +0 -8
  63. package/data/components/brick-tooltip.json +0 -7
  64. package/dist/data/components/brick-mcp.json +0 -6
  65. package/dist/data/components/brick-pill.json +0 -6
  66. package/dist/data/components/brick-player.json +0 -7
  67. package/dist/data/components/brick-published.json +0 -7
  68. package/dist/data/components/brick-share.json +0 -7
  69. package/dist/data/components/brick-stepper.json +0 -7
  70. package/dist/data/components/brick-tab.json +0 -7
  71. package/dist/data/components/brick-tabs.json +0 -9
  72. package/dist/data/components/brick-tag.json +0 -7
  73. package/dist/data/components/brick-teaser-player.json +0 -9
  74. package/dist/data/components/brick-teaser-reels.json +0 -9
  75. package/dist/data/components/brick-teaser.json +0 -9
  76. package/dist/data/components/brick-template.json +0 -9
  77. package/dist/data/components/brick-textarea.json +0 -7
  78. package/dist/data/components/brick-themes.json +0 -6
  79. package/dist/data/components/brick-toast.json +0 -9
  80. package/dist/data/components/brick-toggle.json +0 -7
  81. package/dist/data/components/brick-tokens.json +0 -8
  82. package/dist/data/components/brick-tooltip.json +0 -7
@@ -0,0 +1,268 @@
1
+ ---
2
+ name: brick-toggle
3
+ version: 3.1.14
4
+ selector: brick-toggle-v3
5
+ category: Forms
6
+ tags: [toggle, switch, checkbox, button, form-control, binary, state]
7
+ use_cases: [settings, preferences, feature-toggles, binary-options, form-inputs]
8
+ related: [brick-icon, brick-tokens, brick-template]
9
+ ---
10
+
11
+ # Brick Toggle
12
+
13
+ A customizable toggle switch component with two visual variants (toggle and button), optional icons, and analytics tracking support.
14
+
15
+ ## Key Capabilities
16
+
17
+ - Two visual variants: toggle switch and button
18
+ - On/off state management
19
+ - Optional custom text for on/off states
20
+ - Optional icons for on/off states
21
+ - Accessible with ARIA labels
22
+ - ADP analytics integration
23
+ - Keyboard accessible
24
+ - Checked state persistence
25
+ - Server-side rendering support
26
+
27
+ ## Props/Attributes
28
+
29
+ | Attribute | Type | Default | Required | Description |
30
+ | --------------------- | ------------------------ | -------- | -------- | --------------------------------------------------- |
31
+ | `data-key` | string | - | yes | Unique identifier for the toggle |
32
+ | `data-label` | string | - | no | Label text for the toggle |
33
+ | `data-aria-label` | string | - | no | ARIA label for accessibility |
34
+ | `data-version` | `"toggle" \| "button"` | `toggle` | no | Visual variant style |
35
+ | `checked` | boolean | `false` | no | Initial checked state |
36
+ | `data-on-text` | string | - | no | Custom text when toggle is on |
37
+ | `data-off-text` | string | - | no | Custom text when toggle is off |
38
+ | `data-on-icon-id` | string | - | no | Icon ID from brick-icon when toggle is on |
39
+ | `data-off-icon-id` | string | - | no | Icon ID from brick-icon when toggle is off |
40
+ | `data-adp-clicklabel` | string | - | no | ADP analytics click label |
41
+
42
+ ## Examples
43
+
44
+ ### Basic Toggle Switch
45
+
46
+ ```html
47
+ <brick-toggle-v3
48
+ data-key="notifications"
49
+ data-label="Enable Notifications"
50
+ >
51
+ </brick-toggle-v3>
52
+ ```
53
+
54
+ ### Pre-checked Toggle
55
+
56
+ ```html
57
+ <brick-toggle-v3
58
+ data-key="dark-mode"
59
+ data-label="Dark Mode"
60
+ checked
61
+ >
62
+ </brick-toggle-v3>
63
+ ```
64
+
65
+ ### Button Variant
66
+
67
+ ```html
68
+ <brick-toggle-v3
69
+ data-key="subscribe"
70
+ data-label="Subscribe to Newsletter"
71
+ data-version="button"
72
+ >
73
+ </brick-toggle-v3>
74
+ ```
75
+
76
+ ### With Custom On/Off Text
77
+
78
+ ```html
79
+ <brick-toggle-v3
80
+ data-key="autoplay"
81
+ data-label="Autoplay Videos"
82
+ data-on-text="On"
83
+ data-off-text="Off"
84
+ >
85
+ </brick-toggle-v3>
86
+ ```
87
+
88
+ ### With Icons
89
+
90
+ ```html
91
+ <brick-toggle-v3
92
+ data-key="sound"
93
+ data-label="Sound"
94
+ data-on-icon-id="volume-on"
95
+ data-off-icon-id="volume-off"
96
+ >
97
+ </brick-toggle-v3>
98
+ ```
99
+
100
+ ### With Analytics
101
+
102
+ ```html
103
+ <brick-toggle-v3
104
+ data-key="marketing"
105
+ data-label="Marketing Emails"
106
+ data-adp-clicklabel="marketing-consent-toggle"
107
+ >
108
+ </brick-toggle-v3>
109
+ ```
110
+
111
+ ### ARIA Label (No Visible Label)
112
+
113
+ ```html
114
+ <brick-toggle-v3
115
+ data-key="compact-view"
116
+ data-aria-label="Toggle compact view"
117
+ >
118
+ </brick-toggle-v3>
119
+ ```
120
+
121
+ ## Programmatic Usage
122
+
123
+ ```javascript
124
+ const toggle = document.querySelector('brick-toggle-v3');
125
+
126
+ // Get checked state
127
+ const isChecked = toggle.checked;
128
+
129
+ // Set checked state
130
+ toggle.checked = true;
131
+
132
+ // Listen for change events
133
+ toggle.addEventListener('change', (event) => {
134
+ console.log('Toggle state:', event.target.checked);
135
+ });
136
+ ```
137
+
138
+ ## Server-Side Rendering
139
+
140
+ ```javascript
141
+ import { renderBrickToggle } from '@amedia/brick-toggle/template';
142
+
143
+ const html = renderBrickToggle({
144
+ dataKey: 'notifications',
145
+ dataLabel: 'Enable Notifications',
146
+ dataVersion: 'toggle',
147
+ checked: false,
148
+ dataOnText: 'Enabled',
149
+ dataOffText: 'Disabled',
150
+ });
151
+ ```
152
+
153
+ ## Accessibility
154
+
155
+ - Proper checkbox semantics
156
+ - ARIA label support via `data-aria-label`
157
+ - Keyboard accessible (Space to toggle)
158
+ - Focus visible states
159
+ - State announcements for screen readers
160
+ - Visual and programmatic state indication
161
+
162
+ ## Common Patterns
163
+
164
+ ### Settings Panel
165
+
166
+ ```html
167
+ <div class="settings">
168
+ <brick-toggle-v3
169
+ data-key="dark-mode"
170
+ data-label="Dark Mode"
171
+ checked
172
+ ></brick-toggle-v3>
173
+
174
+ <brick-toggle-v3
175
+ data-key="notifications"
176
+ data-label="Push Notifications"
177
+ ></brick-toggle-v3>
178
+
179
+ <brick-toggle-v3
180
+ data-key="autoplay"
181
+ data-label="Autoplay Videos"
182
+ ></brick-toggle-v3>
183
+ </div>
184
+ ```
185
+
186
+ ### Feature Toggles
187
+
188
+ ```html
189
+ <brick-toggle-v3
190
+ data-key="experimental-feature"
191
+ data-label="Enable Experimental Features"
192
+ data-version="button"
193
+ ></brick-toggle-v3>
194
+ ```
195
+
196
+ ### Volume Control
197
+
198
+ ```html
199
+ <brick-toggle-v3
200
+ data-key="mute"
201
+ data-aria-label="Mute audio"
202
+ data-on-icon-id="volume-on"
203
+ data-off-icon-id="volume-off"
204
+ data-version="button"
205
+ ></brick-toggle-v3>
206
+ ```
207
+
208
+ ## Framework Integration
209
+
210
+ ### Svelte
211
+
212
+ ```svelte
213
+ <script>
214
+ let darkMode = false;
215
+
216
+ function handleToggle(event) {
217
+ darkMode = event.target.checked;
218
+ }
219
+ </script>
220
+
221
+ <brick-toggle-v3
222
+ data-key="dark-mode"
223
+ data-label="Dark Mode"
224
+ checked={darkMode}
225
+ on:change={handleToggle}
226
+ />
227
+ ```
228
+
229
+ ### React
230
+
231
+ ```jsx
232
+ function Settings() {
233
+ const [enabled, setEnabled] = useState(false);
234
+
235
+ return (
236
+ <brick-toggle-v3
237
+ data-key="feature"
238
+ data-label="Enable Feature"
239
+ checked={enabled}
240
+ onChange={(e) => setEnabled(e.target.checked)}
241
+ />
242
+ );
243
+ }
244
+ ```
245
+
246
+ ## Technical Details
247
+
248
+ - **Custom Element**: `brick-toggle-v3`
249
+ - **Base Class**: BrickElement
250
+ - **Dependencies**:
251
+ - @amedia/brick-icon (for icon support)
252
+ - @amedia/brick-template (base class)
253
+ - @amedia/brick-tokens (design tokens)
254
+ - **Renders as**: `<input type="checkbox">` with custom styling
255
+ - **SSR Compatible**: Yes, with template function
256
+
257
+ ## Important Notes
258
+
259
+ - The `data-key` is required and should be unique within the form/page
260
+ - State changes emit standard `change` events
261
+ - The `checked` property/attribute controls the state
262
+ - Icons require valid brick-icon IDs
263
+ - Button variant provides different visual styling but same functionality
264
+ - Analytics tracking via `data-adp-clicklabel` integrates with ADP
265
+
266
+ ## Version
267
+
268
+ Current version: 3.1.14
@@ -0,0 +1,287 @@
1
+ ---
2
+ name: brick-tokens
3
+ version: 6.0.0
4
+ selector: N/A
5
+ category: Utilities
6
+ tags: [design-tokens, css, styling, themes, colors, spacing, typography, shadows]
7
+ use_cases: [theming, consistent-styling, design-system, css-variables, component-styling]
8
+ related: [brick-themes, brick-template, brick-classnames]
9
+ ---
10
+
11
+ # Brick Tokens
12
+
13
+ The foundational design tokens package providing colors, spacing, typography, shadows, and other design primitives for the Brick design system, with Stitches CSS-in-JS integration and theme support.
14
+
15
+ ## Key Capabilities
16
+
17
+ - Comprehensive design token system (colors, spacing, typography, shadows, borders)
18
+ - Multiple publication themes (Alfa, Bergen, BT, etc.)
19
+ - CSS custom properties generation
20
+ - Stitches CSS-in-JS integration
21
+ - Style Dictionary based token transformation
22
+ - TypeScript type definitions
23
+ - CDN distribution via Eik
24
+ - Framework-agnostic
25
+
26
+ ## Core Token Categories
27
+
28
+ ### Colors
29
+
30
+ - Text colors (primary, secondary, tertiary)
31
+ - Background colors
32
+ - Border colors
33
+ - Utility colors (success, warning, error, info)
34
+ - Theme-specific publication colors
35
+
36
+ ### Spacing
37
+
38
+ - Consistent spacing scale
39
+ - Padding tokens
40
+ - Margin tokens
41
+ - Gap tokens
42
+ - Inset tokens
43
+
44
+ ### Typography
45
+
46
+ - Font families
47
+ - Font sizes
48
+ - Font weights
49
+ - Line heights
50
+ - Letter spacing
51
+
52
+ ### Shadows
53
+
54
+ - Elevation shadows
55
+ - Focus shadows
56
+ - Component-specific shadows
57
+
58
+ ### Borders
59
+
60
+ - Border widths
61
+ - Border radii
62
+ - Border styles
63
+
64
+ ## Examples
65
+
66
+ ### Using with Stitches (CSS-in-JS)
67
+
68
+ ```javascript
69
+ import { css } from '@amedia/brick-tokens';
70
+
71
+ const button = css({
72
+ color: '$supportiveBlackText',
73
+ backgroundColor: '$supportiveBlackBg',
74
+ padding: '$spacing-m',
75
+ borderRadius: '$radii-button',
76
+ fontSize: '$fontSize-body',
77
+ });
78
+ ```
79
+
80
+ ### Using CSS Custom Properties
81
+
82
+ ```css
83
+ .my-component {
84
+ color: var(--brick-colors-textPrimary);
85
+ background-color: var(--brick-colors-bgPrimary);
86
+ padding: var(--brick-spacing-m);
87
+ border-radius: var(--brick-radii-button);
88
+ font-size: var(--brick-fontSize-body);
89
+ }
90
+ ```
91
+
92
+ ### Importing Theme Styles
93
+
94
+ ```javascript
95
+ // Import base tokens
96
+ import '@amedia/brick-tokens';
97
+
98
+ // Import specific theme
99
+ import '@amedia/brick-tokens/dist/themes/bergen/index.js';
100
+ ```
101
+
102
+ ### Using in Components
103
+
104
+ ```typescript
105
+ import { css } from '@amedia/brick-tokens';
106
+ import { BrickElement, defineCustomElement } from '@amedia/brick-template';
107
+
108
+ const titleClass = css({
109
+ color: '$textPrimary',
110
+ fontSize: '$fontSize-heading-l',
111
+ fontWeight: '$fontWeight-bold',
112
+ marginBottom: '$spacing-l',
113
+ });
114
+
115
+ @defineCustomElement({
116
+ selector: 'my-component',
117
+ })
118
+ class MyComponent extends BrickElement {
119
+ get HTML() {
120
+ return `<h1 class="${titleClass}">Hello</h1>`;
121
+ }
122
+ }
123
+ ```
124
+
125
+ ## Token Access Patterns
126
+
127
+ ### Via Stitches
128
+
129
+ ```javascript
130
+ import { css, theme } from '@amedia/brick-tokens';
131
+
132
+ // Using in css function
133
+ const styles = css({
134
+ color: '$textPrimary',
135
+ padding: '$spacing-m',
136
+ });
137
+
138
+ // Accessing token values
139
+ const primaryColor = theme.colors.textPrimary;
140
+ ```
141
+
142
+ ### Via CSS Variables
143
+
144
+ ```html
145
+ <style>
146
+ .custom-button {
147
+ background: var(--brick-colors-buttonPrimaryBg);
148
+ color: var(--brick-colors-buttonPrimaryFg);
149
+ padding: var(--brick-spacing-s) var(--brick-spacing-m);
150
+ }
151
+ </style>
152
+ ```
153
+
154
+ ## Theme System
155
+
156
+ Brick tokens supports multiple publication themes:
157
+
158
+ ```javascript
159
+ // Available themes
160
+ import '@amedia/brick-tokens/dist/themes/alfa/index.js';
161
+ import '@amedia/brick-tokens/dist/themes/bergen/index.js';
162
+ import '@amedia/brick-tokens/dist/themes/bt/index.js';
163
+ // ... and more
164
+ ```
165
+
166
+ Each theme provides:
167
+ - Publication-specific color palettes
168
+ - Brand colors
169
+ - Typography settings
170
+ - Spacing overrides (if needed)
171
+
172
+ ## Build Output
173
+
174
+ The package provides multiple formats:
175
+
176
+ - **ES Modules**: `dist/index.mjs`
177
+ - **Stitches**: `dist/stitches.js`
178
+ - **CSS**: `dist/css/**`
179
+ - **Themes**: `dist/themes/*`
180
+ - **Style Dictionary**: `build/style-dictionary/**`
181
+ - **TypeScript Types**: `dist/index.d.ts`
182
+
183
+ ## CDN Usage
184
+
185
+ ```html
186
+ <!-- Load tokens via Eik CDN -->
187
+ <script src="https://assets.acdn.no/pkg/@amedia/brick-tokens/6.0.0/brick-tokens.js" type="module"></script>
188
+
189
+ <!-- Load specific theme -->
190
+ <script src="https://assets.acdn.no/pkg/@amedia/brick-tokens/6.0.0/themes/bergen/index.js" type="module"></script>
191
+
192
+ <!-- Load CSS variables -->
193
+ <link rel="stylesheet" href="https://assets.acdn.no/pkg/@amedia/brick-tokens/6.0.0/css/tokens.css">
194
+ ```
195
+
196
+ ## Common Token Examples
197
+
198
+ ### Spacing Tokens
199
+
200
+ ```javascript
201
+ const spacing = {
202
+ xs: '$spacing-xs', // Extra small
203
+ s: '$spacing-s', // Small
204
+ m: '$spacing-m', // Medium
205
+ l: '$spacing-l', // Large
206
+ xl: '$spacing-xl', // Extra large
207
+ };
208
+ ```
209
+
210
+ ### Color Tokens
211
+
212
+ ```javascript
213
+ const colors = {
214
+ // Text
215
+ textPrimary: '$textPrimary',
216
+ textSecondary: '$textSecondary',
217
+
218
+ // Backgrounds
219
+ bgPrimary: '$bgPrimary',
220
+ bgSecondary: '$bgSecondary',
221
+
222
+ // Utilities
223
+ success: '$utilitySuccessBg',
224
+ error: '$utilityErrorBg',
225
+ warning: '$utilityWarningBg',
226
+ };
227
+ ```
228
+
229
+ ### Typography Tokens
230
+
231
+ ```javascript
232
+ const typography = {
233
+ // Font sizes
234
+ headingL: '$fontSize-heading-l',
235
+ headingM: '$fontSize-heading-m',
236
+ body: '$fontSize-body',
237
+
238
+ // Font weights
239
+ bold: '$fontWeight-bold',
240
+ regular: '$fontWeight-regular',
241
+
242
+ // Line heights
243
+ tight: '$lineHeight-tight',
244
+ normal: '$lineHeight-normal',
245
+ };
246
+ ```
247
+
248
+ ## Development
249
+
250
+ ### Transform Tokens
251
+
252
+ ```bash
253
+ npm run transform-figma # Transform Figma tokens
254
+ npm run style-dictionary # Build Style Dictionary
255
+ npm run build:tokens # Build all tokens
256
+ ```
257
+
258
+ ### Validation
259
+
260
+ ```bash
261
+ npm run validate # Validate CSS files
262
+ ```
263
+
264
+ ## Technical Details
265
+
266
+ - **Package Type**: Design tokens and CSS-in-JS utilities
267
+ - **Token Format**: Style Dictionary compatible
268
+ - **CSS-in-JS**: Stitches integration
269
+ - **TypeScript**: Full type definitions
270
+ - **Dependencies**:
271
+ - @amedia/brick-classnames (utility classes)
272
+ - @amedia/brick-themes (theme definitions)
273
+ - @stitches/core (CSS-in-JS runtime)
274
+
275
+ ## Important Notes
276
+
277
+ - Version 6.0.0 is the current stable version
278
+ - Tokens are generated from Figma via tokens-studio
279
+ - All tokens follow consistent naming conventions
280
+ - CSS custom properties use `--brick-*` prefix
281
+ - Stitches tokens use `$` prefix
282
+ - Themes override base tokens with publication-specific values
283
+ - The package is used by all Brick components for consistent styling
284
+
285
+ ## Version
286
+
287
+ Current version: 6.0.0