@appdirect/ad-design-tokens 0.0.0-stage → 0.0.2

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 CHANGED
@@ -1,3 +1,106 @@
1
- # Temporary Holding Version
1
+ # @appdirect/ad-design-tokens
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ AppDirect design tokens for frontend applications.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm install @appdirect/ad-design-tokens
9
+ ```
10
+
11
+ ## Available Exports
12
+
13
+ - **Resolved semantic tokens:**
14
+ - `@appdirect/ad-design-tokens/semantic/light`
15
+ - `@appdirect/ad-design-tokens/semantic/dark`
16
+ - **Resolved component tokens:**
17
+ - `@appdirect/ad-design-tokens/components/light`
18
+ - `@appdirect/ad-design-tokens/components/dark`
19
+ - **Resolved token outputs (per layer):**
20
+ - `@appdirect/ad-design-tokens/resolved/core.json`
21
+ - `@appdirect/ad-design-tokens/resolved/open-color.json`
22
+ - `@appdirect/ad-design-tokens/resolved/derived.json`
23
+ - `@appdirect/ad-design-tokens/resolved/semantic-light.json`
24
+ - `@appdirect/ad-design-tokens/resolved/semantic-dark.json`
25
+ - `@appdirect/ad-design-tokens/resolved/components-light.json`
26
+ - `@appdirect/ad-design-tokens/resolved/components-dark.json`
27
+ - **Figma / Tokens Studio (DTCG JSON with `{ref}` aliases intact):**
28
+ - `@appdirect/ad-design-tokens/figma/open-color.json`
29
+ - `@appdirect/ad-design-tokens/figma/core.json`
30
+ - `@appdirect/ad-design-tokens/figma/derived.json`
31
+ - `@appdirect/ad-design-tokens/figma/semantic.light.json`
32
+ - `@appdirect/ad-design-tokens/figma/semantic.dark.json`
33
+ - `@appdirect/ad-design-tokens/figma/components.light.json`
34
+ - `@appdirect/ad-design-tokens/figma/components.dark.json`
35
+ - `@appdirect/ad-design-tokens/figma/$themes.json` (Tokens Studio theme manifest)
36
+ - **CSS variables:**
37
+ - `@appdirect/ad-design-tokens/css/foundations.css` (semantic tokens only — base for framework adapters)
38
+ - `@appdirect/ad-design-tokens/css/mantine.css` (Mantine adapter — component selectors referencing `--ad-*` vars)
39
+ - `@appdirect/ad-design-tokens/css/tokens.css` (foundations + component tokens — full monolith for vanilla consumers)
40
+ - `@appdirect/ad-design-tokens/css/open-color.css` (`--ad-open-color-*` palette)
41
+ - **Design docs adapter:**
42
+ - `@appdirect/ad-design-tokens/design-spec.yaml` (resolved YAML payload for syncing `DESIGN.md` front matter in `ad-design-system`)
43
+ - **JS entrypoint:**
44
+ - `@appdirect/ad-design-tokens` (full resolved bundle)
45
+
46
+ ## Usage
47
+
48
+ ### Figma via Tokens Studio
49
+
50
+ Point Tokens Studio at `dist/figma/` in the published package. The `$themes.json` manifest groups the layer files into two themes (`Light`, `Dark`) so Tokens Studio creates the following Figma variable collections on import:
51
+
52
+ | Collection | Modes |
53
+ |---|---|
54
+ | `Tokens / Open-Color` | Value |
55
+ | `Tokens / Core` | Value |
56
+ | `Tokens / Derived` | Value |
57
+ | `Tokens / Semantic` | Light, Dark |
58
+ | `Tokens / Semantic Brand` | Value |
59
+ | `Tokens / Components` | Light, Dark |
60
+
61
+ Interactive states (hover, active, focus, disabled) are intentionally excluded from the Figma export — they are code-side concerns. Figma binds the default/resting state only.
62
+
63
+ ### Resolved JSON imports
64
+
65
+ ```js
66
+ import semanticLight from '@appdirect/ad-design-tokens/semantic/light' with { type: 'json' };
67
+ import componentsDark from '@appdirect/ad-design-tokens/components/dark' with { type: 'json' };
68
+ import resolvedCore from '@appdirect/ad-design-tokens/resolved/core.json' with { type: 'json' };
69
+ ```
70
+
71
+ ### CSS variables — vanilla consumers
72
+
73
+ ```js
74
+ import '@appdirect/ad-design-tokens/css/tokens.css';
75
+ ```
76
+
77
+ ### CSS variables — palette only
78
+
79
+ ```js
80
+ import '@appdirect/ad-design-tokens/css/open-color.css';
81
+ ```
82
+
83
+ ### CSS variables — Mantine adapter
84
+
85
+ Import after `@mantine/core/styles.css` so the adapter's higher-specificity selectors win:
86
+
87
+ ```js
88
+ import '@mantine/core/styles.css';
89
+ import '@appdirect/ad-design-tokens/css/foundations.css';
90
+ import '@appdirect/ad-design-tokens/css/mantine.css';
91
+ ```
92
+
93
+ ```css
94
+ .button {
95
+ background: var(--ad-color-brand-primary);
96
+ color: var(--ad-color-brand-on-primary);
97
+ }
98
+ ```
99
+
100
+ ### JS entrypoint
101
+
102
+ ```js
103
+ import tokens from '@appdirect/ad-design-tokens';
104
+
105
+ console.log(tokens.semantic.light.color.bg.default.$value);
106
+ ```