@vellira-ui/tokens 2.54.0 → 2.56.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/README.md +48 -34
- package/package.json +15 -1
package/README.md
CHANGED
|
@@ -2,18 +2,25 @@
|
|
|
2
2
|
|
|
3
3
|
Shared design tokens for Vellira.
|
|
4
4
|
|
|
5
|
-
This package is the single source of truth for primitive colors, semantic
|
|
5
|
+
This package is the single source of truth for primitive colors, semantic
|
|
6
|
+
tokens, component tokens, typography, spacing, radius, shadows, and z-index
|
|
7
|
+
values used by both the React and React Native packages.
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
pnpm add @vellira-ui/tokens
|
|
13
|
+
```
|
|
6
14
|
|
|
7
15
|
## Features
|
|
8
16
|
|
|
9
17
|
- Shared design tokens
|
|
10
18
|
- Semantic color system
|
|
11
19
|
- Renderer-neutral theme objects
|
|
20
|
+
- Component-level tokens
|
|
12
21
|
- Generated CSS variables
|
|
13
22
|
- TypeScript-first API
|
|
14
23
|
|
|
15
|
-
---
|
|
16
|
-
|
|
17
24
|
## Usage
|
|
18
25
|
|
|
19
26
|
```ts
|
|
@@ -30,7 +37,7 @@ theme.semantic.border.default;
|
|
|
30
37
|
theme.semantic.status.success.fg;
|
|
31
38
|
|
|
32
39
|
theme.components.button.primary.solid.default.bg;
|
|
33
|
-
theme.components.input.default.bg;
|
|
40
|
+
theme.components.input.default.bg;
|
|
34
41
|
|
|
35
42
|
theme.tokens.typography.family.regular;
|
|
36
43
|
theme.tokens.spacing[4];
|
|
@@ -41,22 +48,27 @@ darkTheme.name;
|
|
|
41
48
|
highContrastTheme.name;
|
|
42
49
|
```
|
|
43
50
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
## Semantic Color Tokens
|
|
51
|
+
## Semantic Tokens
|
|
47
52
|
|
|
48
|
-
The package provides semantic
|
|
53
|
+
The package provides semantic groups that describe intent instead of coupling
|
|
54
|
+
components to raw palette values.
|
|
49
55
|
|
|
50
56
|
Current semantic groups include:
|
|
51
57
|
|
|
52
|
-
- `
|
|
53
|
-
- `text`
|
|
58
|
+
- `action`
|
|
54
59
|
- `border`
|
|
55
|
-
- `
|
|
56
|
-
- `focus`
|
|
60
|
+
- `control`
|
|
57
61
|
- `divider`
|
|
62
|
+
- `focus`
|
|
63
|
+
- `icons`
|
|
64
|
+
- `menu`
|
|
58
65
|
- `navigation`
|
|
66
|
+
- `overlay`
|
|
67
|
+
- `shadow`
|
|
59
68
|
- `skeleton`
|
|
69
|
+
- `status`
|
|
70
|
+
- `surface`
|
|
71
|
+
- `text`
|
|
60
72
|
|
|
61
73
|
Example:
|
|
62
74
|
|
|
@@ -73,27 +85,29 @@ theme.semantic.status.success.fg;
|
|
|
73
85
|
theme.semantic.status.error.fg;
|
|
74
86
|
```
|
|
75
87
|
|
|
76
|
-
Using semantic tokens instead of raw palette values
|
|
77
|
-
|
|
78
|
-
---
|
|
88
|
+
Using semantic tokens instead of raw palette values keeps component styling
|
|
89
|
+
consistent across renderers and themes.
|
|
79
90
|
|
|
80
91
|
## Component Tokens
|
|
81
92
|
|
|
82
|
-
Component tokens define renderer-neutral values for component states
|
|
93
|
+
Component tokens define renderer-neutral values for component states and
|
|
94
|
+
surfaces.
|
|
83
95
|
|
|
84
96
|
```ts
|
|
85
97
|
theme.components.button.primary.solid.default.bg;
|
|
86
98
|
theme.components.input.focus.border;
|
|
87
99
|
theme.components.dropdown.content.bg;
|
|
100
|
+
theme.components.popover.content.bg;
|
|
101
|
+
theme.components.modal.content.bg;
|
|
102
|
+
theme.components.tooltip.content.bg;
|
|
88
103
|
```
|
|
89
104
|
|
|
90
|
-
Color-like component tokens may use either
|
|
91
|
-
|
|
92
|
-
---
|
|
105
|
+
Color-like component tokens may use either colors or the literal `transparent`
|
|
106
|
+
when the intended rendered value is transparent.
|
|
93
107
|
|
|
94
108
|
## CSS Variables
|
|
95
109
|
|
|
96
|
-
Generated CSS variables are available for
|
|
110
|
+
Generated CSS variables are available for web projects:
|
|
97
111
|
|
|
98
112
|
```ts
|
|
99
113
|
import '@vellira-ui/tokens/css';
|
|
@@ -109,7 +123,12 @@ Examples:
|
|
|
109
123
|
--button-primary-solid-default-bg
|
|
110
124
|
```
|
|
111
125
|
|
|
112
|
-
|
|
126
|
+
## Documentation
|
|
127
|
+
|
|
128
|
+
- [Design Tokens](https://docs.vellira.dev/design-system/tokens)
|
|
129
|
+
- [Theme Architecture](https://docs.vellira.dev/design-system/theme-architecture)
|
|
130
|
+
- [React](https://docs.vellira.dev/react/)
|
|
131
|
+
- [React Native](https://docs.vellira.dev/react-native/)
|
|
113
132
|
|
|
114
133
|
## Development
|
|
115
134
|
|
|
@@ -119,28 +138,23 @@ Build the package:
|
|
|
119
138
|
pnpm --filter @vellira-ui/tokens build
|
|
120
139
|
```
|
|
121
140
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
- TypeScript declarations
|
|
125
|
-
- CSS variables
|
|
126
|
-
- distributable artifacts
|
|
127
|
-
|
|
128
|
-
Token path unions, CSS variable name unions, and theme structure types are generated from the token source files:
|
|
141
|
+
Token path unions, CSS variable name unions, and theme structure types are
|
|
142
|
+
generated from the token source files:
|
|
129
143
|
|
|
130
144
|
```bash
|
|
131
145
|
pnpm --filter @vellira-ui/tokens generate:types
|
|
132
146
|
```
|
|
133
147
|
|
|
134
|
-
|
|
148
|
+
Verify that generated token types are up to date:
|
|
135
149
|
|
|
136
|
-
|
|
150
|
+
```bash
|
|
151
|
+
pnpm --filter @vellira-ui/tokens generate:types:check
|
|
152
|
+
```
|
|
137
153
|
|
|
138
154
|
## Principles
|
|
139
155
|
|
|
140
|
-
The token system follows a few core principles:
|
|
141
|
-
|
|
142
156
|
- Semantic tokens over hardcoded colors
|
|
143
|
-
- Shared across
|
|
157
|
+
- Shared across React and React Native
|
|
144
158
|
- Stable public API
|
|
145
159
|
- Predictable naming
|
|
146
|
-
-
|
|
160
|
+
- Theme-ready architecture
|
package/package.json
CHANGED
|
@@ -1,7 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vellira-ui/tokens",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.56.0",
|
|
4
4
|
"description": "Design tokens for Vellira Design System",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"vellira",
|
|
7
|
+
"design-tokens",
|
|
8
|
+
"design-system",
|
|
9
|
+
"theming",
|
|
10
|
+
"css-variables",
|
|
11
|
+
"typescript",
|
|
12
|
+
"react",
|
|
13
|
+
"react-native"
|
|
14
|
+
],
|
|
5
15
|
"author": "Roman Bakurov",
|
|
6
16
|
"license": "MIT",
|
|
7
17
|
"repository": {
|
|
@@ -9,6 +19,10 @@
|
|
|
9
19
|
"url": "git+https://github.com/vellira-dev/vellira.git",
|
|
10
20
|
"directory": "packages/tokens"
|
|
11
21
|
},
|
|
22
|
+
"homepage": "https://vellira.dev",
|
|
23
|
+
"bugs": {
|
|
24
|
+
"url": "https://github.com/vellira-dev/vellira/issues"
|
|
25
|
+
},
|
|
12
26
|
"private": false,
|
|
13
27
|
"type": "module",
|
|
14
28
|
"sideEffects": [
|