@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 +105 -2
- package/dist/css/foundations.css +703 -0
- package/dist/css/mantine.css +1777 -0
- package/dist/css/open-color.css +145 -0
- package/dist/css/tokens.css +2733 -0
- package/dist/design-spec.yaml +222 -0
- package/dist/figma/$themes.json +28 -0
- package/dist/figma/brand-palettes-appdirect.json +314 -0
- package/dist/figma/components.dark.json +4754 -0
- package/dist/figma/components.light.json +4754 -0
- package/dist/figma/core.json +376 -0
- package/dist/figma/derived.json +278 -0
- package/dist/figma/open-color.json +604 -0
- package/dist/figma/semantic-brand.appdirect.json +276 -0
- package/dist/figma/semantic.dark.json +300 -0
- package/dist/figma/semantic.light.json +300 -0
- package/dist/glossary.txt +1802 -0
- package/dist/index.js +14303 -0
- package/dist/index.json +14300 -0
- package/dist/resolved/brand-palettes-appdirect.json +314 -0
- package/dist/resolved/components-dark.json +5788 -0
- package/dist/resolved/components-light.json +5788 -0
- package/dist/resolved/core.json +376 -0
- package/dist/resolved/derived.json +278 -0
- package/dist/resolved/open-color.json +604 -0
- package/dist/resolved/semantic-dark.json +572 -0
- package/dist/resolved/semantic-light.json +572 -0
- package/package.json +48 -4
package/README.md
CHANGED
|
@@ -1,3 +1,106 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @appdirect/ad-design-tokens
|
|
2
2
|
|
|
3
|
-
|
|
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
|
+
```
|