@mediaradar/design-tokens 2.0.4 → 2.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.
- package/dist/DESIGN.md +2 -2
- package/dist/tailwind/theme.css +9 -0
- package/package.json +5 -2
package/dist/DESIGN.md
CHANGED
|
@@ -148,7 +148,7 @@ When building UI, follow this order:
|
|
|
148
148
|
|
|
149
149
|
1. **Text:** Is there a `text-style-*` that matches the typographic role? Use it — do not manually compose font-size + weight + line-height.
|
|
150
150
|
2. **Color:** Is there a `sys.color.*` semantic name describing the element's intent? Use it — `bg-{key}`, `text-{key}`, `border-{key}`, etc.
|
|
151
|
-
3. **Spacing:** Is there a spacing
|
|
151
|
+
3. **Spacing:** Is there a *semantic* spacing token for this role (`p-card-padding`, `p-dialog-padding`, `gap-layout-sm`, etc.)? Use it first — this is what keeps equivalent UI (e.g. every card's padding) consistent instead of each usage guessing its own number, especially across apps that don't share component code. Only fall back to the raw discrete scale (`p-4`, `gap-3`, `mt-8`) when no semantic token fits. Avoid arbitrary values either way. Use pixel values (`p-1px`) only for sub-pixel tuning.
|
|
152
152
|
4. **Shape/elevation:** Use `rounded-control` for interactive elements, `rounded-card` for containers. Use `shadow-raised` for resting cards, `shadow-overlay` for floating surfaces.
|
|
153
153
|
5. **Primitives:** Reach into `ref.*` only when no semantic token fits. If the pattern recurs, propose a new `sys.*` token.
|
|
154
154
|
|
|
@@ -312,7 +312,7 @@ Tailwind: `p-{key}`, `m-{key}`, `gap-{key}`, `w-{key}`, `h-{key}`, etc. Integer
|
|
|
312
312
|
| 9px | 9px |
|
|
313
313
|
| 10px | 10px |
|
|
314
314
|
|
|
315
|
-
**Semantic spacing** —
|
|
315
|
+
**Semantic spacing** — named for a specific layout role rather than a raw scale step. Tailwind: `p-{key}`, `gap-{key}`, `m-{key}`, `w-{key}`, `h-{key}`, etc. (same `--spacing-*` namespace as the raw scale above; keys never collide since these are always multi-word). Prefer these over a raw scale value whenever the role matches — `p-card-padding` over guessing `p-4` vs `p-5` for a card, so two components (or two apps) styling "a card" converge on the same value instead of drifting.
|
|
316
316
|
|
|
317
317
|
| Token | Value |
|
|
318
318
|
| --- | --- |
|
package/dist/tailwind/theme.css
CHANGED
|
@@ -92,6 +92,15 @@
|
|
|
92
92
|
--tracking-tight: var(--mr-typography-letter-spacing-tight);
|
|
93
93
|
--radius-control: var(--mr-shape-radius-control);
|
|
94
94
|
--radius-card: var(--mr-shape-radius-card);
|
|
95
|
+
--spacing-control-padding-x: var(--mr-spacing-control-padding-x);
|
|
96
|
+
--spacing-control-padding-y: var(--mr-spacing-control-padding-y);
|
|
97
|
+
--spacing-layout-xs: var(--mr-spacing-layout-xs);
|
|
98
|
+
--spacing-layout-sm: var(--mr-spacing-layout-sm);
|
|
99
|
+
--spacing-layout-md: var(--mr-spacing-layout-md);
|
|
100
|
+
--spacing-layout-lg: var(--mr-spacing-layout-lg);
|
|
101
|
+
--spacing-layout-xl: var(--mr-spacing-layout-xl);
|
|
102
|
+
--spacing-card-padding: var(--mr-spacing-card-padding);
|
|
103
|
+
--spacing-dialog-padding: var(--mr-spacing-dialog-padding);
|
|
95
104
|
--shadow-raised: var(--mr-elevation-raised);
|
|
96
105
|
--shadow-overlay: var(--mr-elevation-overlay);
|
|
97
106
|
--duration-interactive: var(--mr-motion-duration-interactive);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mediaradar/design-tokens",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"main": "dist/js/tokens.js",
|
|
5
5
|
"types": "dist/js/tokens.d.ts",
|
|
6
6
|
"type": "module",
|
|
@@ -24,7 +24,8 @@
|
|
|
24
24
|
"clean": "rm -rf build",
|
|
25
25
|
"clean-ds": "rm -rf dists",
|
|
26
26
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
27
|
-
"build": "node scripts/build-tokens.js --verbose"
|
|
27
|
+
"build": "node scripts/build-tokens.js --verbose",
|
|
28
|
+
"check-token-drift": "node scripts/check-token-drift.mjs"
|
|
28
29
|
},
|
|
29
30
|
"author": "",
|
|
30
31
|
"license": "Apache-2.0",
|
|
@@ -35,6 +36,8 @@
|
|
|
35
36
|
"style-dictionary": "^5.5.0"
|
|
36
37
|
},
|
|
37
38
|
"devDependencies": {
|
|
39
|
+
"@babel/parser": "^7.29.8",
|
|
40
|
+
"@babel/traverse": "^7.29.8",
|
|
38
41
|
"@types/node": "^25.3.0",
|
|
39
42
|
"eslint": "^10.0.1"
|
|
40
43
|
},
|