@vellira-ui/tokens 2.19.6
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/LICENSE +21 -0
- package/README.md +146 -0
- package/dist/css/tokens.css +1453 -0
- package/dist/dark/components/button.d.ts +59 -0
- package/dist/dark/components/button.d.ts.map +1 -0
- package/dist/dark/components/button.js +26 -0
- package/dist/dark/components/checkbox.d.ts +42 -0
- package/dist/dark/components/checkbox.d.ts.map +1 -0
- package/dist/dark/components/checkbox.js +34 -0
- package/dist/dark/components/dropdown.d.ts +75 -0
- package/dist/dark/components/dropdown.d.ts.map +1 -0
- package/dist/dark/components/dropdown.js +77 -0
- package/dist/dark/components/formField.d.ts +34 -0
- package/dist/dark/components/formField.d.ts.map +1 -0
- package/dist/dark/components/formField.js +35 -0
- package/dist/dark/components/index.d.ts +12 -0
- package/dist/dark/components/index.d.ts.map +1 -0
- package/dist/dark/components/index.js +11 -0
- package/dist/dark/components/input.d.ts +36 -0
- package/dist/dark/components/input.d.ts.map +1 -0
- package/dist/dark/components/input.js +40 -0
- package/dist/dark/components/menu.d.ts +50 -0
- package/dist/dark/components/menu.d.ts.map +1 -0
- package/dist/dark/components/menu.js +47 -0
- package/dist/dark/components/modal.d.ts +31 -0
- package/dist/dark/components/modal.d.ts.map +1 -0
- package/dist/dark/components/modal.js +34 -0
- package/dist/dark/components/radio.d.ts +38 -0
- package/dist/dark/components/radio.d.ts.map +1 -0
- package/dist/dark/components/radio.js +32 -0
- package/dist/dark/components/select.d.ts +63 -0
- package/dist/dark/components/select.d.ts.map +1 -0
- package/dist/dark/components/select.js +64 -0
- package/dist/dark/components/tabs.d.ts +67 -0
- package/dist/dark/components/tabs.d.ts.map +1 -0
- package/dist/dark/components/tabs.js +72 -0
- package/dist/dark/components/tooltip.d.ts +11 -0
- package/dist/dark/components/tooltip.d.ts.map +1 -0
- package/dist/dark/components/tooltip.js +13 -0
- package/dist/dark/semantic/action.d.ts +72 -0
- package/dist/dark/semantic/action.d.ts.map +1 -0
- package/dist/dark/semantic/action.js +73 -0
- package/dist/dark/semantic/border.d.ts +9 -0
- package/dist/dark/semantic/border.d.ts.map +1 -0
- package/dist/dark/semantic/border.js +9 -0
- package/dist/dark/semantic/control.d.ts +30 -0
- package/dist/dark/semantic/control.d.ts.map +1 -0
- package/dist/dark/semantic/control.js +32 -0
- package/dist/dark/semantic/divider.d.ts +6 -0
- package/dist/dark/semantic/divider.d.ts.map +1 -0
- package/dist/dark/semantic/divider.js +6 -0
- package/dist/dark/semantic/focus.d.ts +5 -0
- package/dist/dark/semantic/focus.d.ts.map +1 -0
- package/dist/dark/semantic/focus.js +5 -0
- package/dist/dark/semantic/index.d.ts +11 -0
- package/dist/dark/semantic/index.d.ts.map +1 -0
- package/dist/dark/semantic/index.js +10 -0
- package/dist/dark/semantic/navigation.d.ts +34 -0
- package/dist/dark/semantic/navigation.d.ts.map +1 -0
- package/dist/dark/semantic/navigation.js +36 -0
- package/dist/dark/semantic/skeleton.d.ts +5 -0
- package/dist/dark/semantic/skeleton.d.ts.map +1 -0
- package/dist/dark/semantic/skeleton.js +5 -0
- package/dist/dark/semantic/status.d.ts +27 -0
- package/dist/dark/semantic/status.d.ts.map +1 -0
- package/dist/dark/semantic/status.js +27 -0
- package/dist/dark/semantic/surface.d.ts +10 -0
- package/dist/dark/semantic/surface.d.ts.map +1 -0
- package/dist/dark/semantic/surface.js +10 -0
- package/dist/dark/semantic/text.d.ts +12 -0
- package/dist/dark/semantic/text.d.ts.map +1 -0
- package/dist/dark/semantic/text.js +12 -0
- package/dist/dark/theme.d.ts +228 -0
- package/dist/dark/theme.d.ts.map +1 -0
- package/dist/dark/theme.js +17 -0
- package/dist/generated/color-preview.d.ts +120 -0
- package/dist/generated/color-preview.d.ts.map +1 -0
- package/dist/generated/color-preview.js +119 -0
- package/dist/generated/token-types.d.ts +38 -0
- package/dist/generated/token-types.d.ts.map +1 -0
- package/dist/generated/token-types.js +2124 -0
- package/dist/highContrast/components/button.d.ts +59 -0
- package/dist/highContrast/components/button.d.ts.map +1 -0
- package/dist/highContrast/components/button.js +26 -0
- package/dist/highContrast/components/checkbox.d.ts +42 -0
- package/dist/highContrast/components/checkbox.d.ts.map +1 -0
- package/dist/highContrast/components/checkbox.js +31 -0
- package/dist/highContrast/components/dropdown.d.ts +75 -0
- package/dist/highContrast/components/dropdown.d.ts.map +1 -0
- package/dist/highContrast/components/dropdown.js +77 -0
- package/dist/highContrast/components/formField.d.ts +34 -0
- package/dist/highContrast/components/formField.d.ts.map +1 -0
- package/dist/highContrast/components/formField.js +35 -0
- package/dist/highContrast/components/index.d.ts +12 -0
- package/dist/highContrast/components/index.d.ts.map +1 -0
- package/dist/highContrast/components/index.js +11 -0
- package/dist/highContrast/components/input.d.ts +36 -0
- package/dist/highContrast/components/input.d.ts.map +1 -0
- package/dist/highContrast/components/input.js +41 -0
- package/dist/highContrast/components/menu.d.ts +50 -0
- package/dist/highContrast/components/menu.d.ts.map +1 -0
- package/dist/highContrast/components/menu.js +48 -0
- package/dist/highContrast/components/modal.d.ts +31 -0
- package/dist/highContrast/components/modal.d.ts.map +1 -0
- package/dist/highContrast/components/modal.js +34 -0
- package/dist/highContrast/components/radio.d.ts +38 -0
- package/dist/highContrast/components/radio.d.ts.map +1 -0
- package/dist/highContrast/components/radio.js +32 -0
- package/dist/highContrast/components/select.d.ts +63 -0
- package/dist/highContrast/components/select.d.ts.map +1 -0
- package/dist/highContrast/components/select.js +65 -0
- package/dist/highContrast/components/tabs.d.ts +67 -0
- package/dist/highContrast/components/tabs.d.ts.map +1 -0
- package/dist/highContrast/components/tabs.js +70 -0
- package/dist/highContrast/components/tooltip.d.ts +11 -0
- package/dist/highContrast/components/tooltip.d.ts.map +1 -0
- package/dist/highContrast/components/tooltip.js +13 -0
- package/dist/highContrast/semantic/action.d.ts +72 -0
- package/dist/highContrast/semantic/action.d.ts.map +1 -0
- package/dist/highContrast/semantic/action.js +73 -0
- package/dist/highContrast/semantic/border.d.ts +10 -0
- package/dist/highContrast/semantic/border.d.ts.map +1 -0
- package/dist/highContrast/semantic/border.js +10 -0
- package/dist/highContrast/semantic/control.d.ts +40 -0
- package/dist/highContrast/semantic/control.d.ts.map +1 -0
- package/dist/highContrast/semantic/control.js +41 -0
- package/dist/highContrast/semantic/divider.d.ts +6 -0
- package/dist/highContrast/semantic/divider.d.ts.map +1 -0
- package/dist/highContrast/semantic/divider.js +6 -0
- package/dist/highContrast/semantic/focus.d.ts +5 -0
- package/dist/highContrast/semantic/focus.d.ts.map +1 -0
- package/dist/highContrast/semantic/focus.js +5 -0
- package/dist/highContrast/semantic/index.d.ts +11 -0
- package/dist/highContrast/semantic/index.d.ts.map +1 -0
- package/dist/highContrast/semantic/index.js +10 -0
- package/dist/highContrast/semantic/navigation.d.ts +45 -0
- package/dist/highContrast/semantic/navigation.d.ts.map +1 -0
- package/dist/highContrast/semantic/navigation.js +47 -0
- package/dist/highContrast/semantic/skeleton.d.ts +5 -0
- package/dist/highContrast/semantic/skeleton.d.ts.map +1 -0
- package/dist/highContrast/semantic/skeleton.js +5 -0
- package/dist/highContrast/semantic/status.d.ts +27 -0
- package/dist/highContrast/semantic/status.d.ts.map +1 -0
- package/dist/highContrast/semantic/status.js +27 -0
- package/dist/highContrast/semantic/surface.d.ts +10 -0
- package/dist/highContrast/semantic/surface.d.ts.map +1 -0
- package/dist/highContrast/semantic/surface.js +10 -0
- package/dist/highContrast/semantic/text.d.ts +11 -0
- package/dist/highContrast/semantic/text.d.ts.map +1 -0
- package/dist/highContrast/semantic/text.js +12 -0
- package/dist/highContrast/theme.d.ts +228 -0
- package/dist/highContrast/theme.d.ts.map +1 -0
- package/dist/highContrast/theme.js +17 -0
- package/dist/index.d.ts +97 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +11 -0
- package/dist/light/components/button.d.ts +59 -0
- package/dist/light/components/button.d.ts.map +1 -0
- package/dist/light/components/button.js +26 -0
- package/dist/light/components/checkbox.d.ts +42 -0
- package/dist/light/components/checkbox.d.ts.map +1 -0
- package/dist/light/components/checkbox.js +31 -0
- package/dist/light/components/dropdown.d.ts +75 -0
- package/dist/light/components/dropdown.d.ts.map +1 -0
- package/dist/light/components/dropdown.js +77 -0
- package/dist/light/components/formField.d.ts +34 -0
- package/dist/light/components/formField.d.ts.map +1 -0
- package/dist/light/components/formField.js +35 -0
- package/dist/light/components/index.d.ts +12 -0
- package/dist/light/components/index.d.ts.map +1 -0
- package/dist/light/components/index.js +11 -0
- package/dist/light/components/input.d.ts +36 -0
- package/dist/light/components/input.d.ts.map +1 -0
- package/dist/light/components/input.js +41 -0
- package/dist/light/components/menu.d.ts +50 -0
- package/dist/light/components/menu.d.ts.map +1 -0
- package/dist/light/components/menu.js +48 -0
- package/dist/light/components/modal.d.ts +31 -0
- package/dist/light/components/modal.d.ts.map +1 -0
- package/dist/light/components/modal.js +34 -0
- package/dist/light/components/radio.d.ts +38 -0
- package/dist/light/components/radio.d.ts.map +1 -0
- package/dist/light/components/radio.js +32 -0
- package/dist/light/components/select.d.ts +63 -0
- package/dist/light/components/select.d.ts.map +1 -0
- package/dist/light/components/select.js +61 -0
- package/dist/light/components/tabs.d.ts +67 -0
- package/dist/light/components/tabs.d.ts.map +1 -0
- package/dist/light/components/tabs.js +72 -0
- package/dist/light/components/tooltip.d.ts +11 -0
- package/dist/light/components/tooltip.d.ts.map +1 -0
- package/dist/light/components/tooltip.js +13 -0
- package/dist/light/semantic/action.d.ts +72 -0
- package/dist/light/semantic/action.d.ts.map +1 -0
- package/dist/light/semantic/action.js +73 -0
- package/dist/light/semantic/border.d.ts +9 -0
- package/dist/light/semantic/border.d.ts.map +1 -0
- package/dist/light/semantic/border.js +9 -0
- package/dist/light/semantic/control.d.ts +30 -0
- package/dist/light/semantic/control.d.ts.map +1 -0
- package/dist/light/semantic/control.js +31 -0
- package/dist/light/semantic/divider.d.ts +6 -0
- package/dist/light/semantic/divider.d.ts.map +1 -0
- package/dist/light/semantic/divider.js +6 -0
- package/dist/light/semantic/focus.d.ts +5 -0
- package/dist/light/semantic/focus.d.ts.map +1 -0
- package/dist/light/semantic/focus.js +5 -0
- package/dist/light/semantic/index.d.ts +11 -0
- package/dist/light/semantic/index.d.ts.map +1 -0
- package/dist/light/semantic/index.js +10 -0
- package/dist/light/semantic/navigation.d.ts +30 -0
- package/dist/light/semantic/navigation.d.ts.map +1 -0
- package/dist/light/semantic/navigation.js +31 -0
- package/dist/light/semantic/skeleton.d.ts +5 -0
- package/dist/light/semantic/skeleton.d.ts.map +1 -0
- package/dist/light/semantic/skeleton.js +5 -0
- package/dist/light/semantic/status.d.ts +27 -0
- package/dist/light/semantic/status.d.ts.map +1 -0
- package/dist/light/semantic/status.js +27 -0
- package/dist/light/semantic/surface.d.ts +10 -0
- package/dist/light/semantic/surface.d.ts.map +1 -0
- package/dist/light/semantic/surface.js +10 -0
- package/dist/light/semantic/text.d.ts +11 -0
- package/dist/light/semantic/text.d.ts.map +1 -0
- package/dist/light/semantic/text.js +12 -0
- package/dist/light/theme.d.ts +228 -0
- package/dist/light/theme.d.ts.map +1 -0
- package/dist/light/theme.js +17 -0
- package/dist/primitives/colors.d.ts +142 -0
- package/dist/primitives/colors.d.ts.map +1 -0
- package/dist/primitives/colors.js +141 -0
- package/dist/primitives/selectionControl.d.ts +1 -0
- package/dist/primitives/selectionControl.d.ts.map +1 -0
- package/dist/primitives/selectionControl.js +1 -0
- package/dist/semantic/index.d.ts +3 -0
- package/dist/semantic/index.d.ts.map +1 -0
- package/dist/semantic/index.js +2 -0
- package/dist/semantic/overlay.d.ts +5 -0
- package/dist/semantic/overlay.d.ts.map +1 -0
- package/dist/semantic/overlay.js +4 -0
- package/dist/semantic/selection.d.ts +5 -0
- package/dist/semantic/selection.d.ts.map +1 -0
- package/dist/semantic/selection.js +5 -0
- package/dist/tokens/index.d.ts +6 -0
- package/dist/tokens/index.d.ts.map +1 -0
- package/dist/tokens/index.js +5 -0
- package/dist/tokens/radius.d.ts +8 -0
- package/dist/tokens/radius.d.ts.map +1 -0
- package/dist/tokens/radius.js +7 -0
- package/dist/tokens/shadows.d.ts +27 -0
- package/dist/tokens/shadows.d.ts.map +1 -0
- package/dist/tokens/shadows.js +27 -0
- package/dist/tokens/spacing.d.ts +14 -0
- package/dist/tokens/spacing.d.ts.map +1 -0
- package/dist/tokens/spacing.js +13 -0
- package/dist/tokens/typography.d.ts +30 -0
- package/dist/tokens/typography.d.ts.map +1 -0
- package/dist/tokens/typography.js +29 -0
- package/dist/tokens/zIndex.d.ts +9 -0
- package/dist/tokens/zIndex.d.ts.map +1 -0
- package/dist/tokens/zIndex.js +8 -0
- package/package.json +46 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Roman Bakurov
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
# @vellira-ui/tokens
|
|
2
|
+
|
|
3
|
+
Shared design tokens for Vellira.
|
|
4
|
+
|
|
5
|
+
This package is the single source of truth for primitive colors, semantic colors, component tokens, typography, spacing, radius, shadows, and z-index values used by both the Web and React Native packages.
|
|
6
|
+
|
|
7
|
+
## Features
|
|
8
|
+
|
|
9
|
+
- Shared design tokens
|
|
10
|
+
- Semantic color system
|
|
11
|
+
- Renderer-neutral theme objects
|
|
12
|
+
- Generated CSS variables
|
|
13
|
+
- TypeScript-first API
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Usage
|
|
18
|
+
|
|
19
|
+
```ts
|
|
20
|
+
import {
|
|
21
|
+
darkTheme,
|
|
22
|
+
highContrastTheme,
|
|
23
|
+
lightTheme,
|
|
24
|
+
theme,
|
|
25
|
+
} from '@vellira-ui/tokens';
|
|
26
|
+
|
|
27
|
+
theme.semantic.surface.default;
|
|
28
|
+
theme.semantic.text.primary;
|
|
29
|
+
theme.semantic.border.default;
|
|
30
|
+
theme.semantic.status.success.fg;
|
|
31
|
+
|
|
32
|
+
theme.components.button.primary.default.bg;
|
|
33
|
+
theme.components.input.default.bg; // may be a hex color or transparent
|
|
34
|
+
|
|
35
|
+
theme.tokens.typography.family.regular;
|
|
36
|
+
theme.tokens.spacing[4];
|
|
37
|
+
theme.tokens.radius.md;
|
|
38
|
+
|
|
39
|
+
lightTheme.name;
|
|
40
|
+
darkTheme.name;
|
|
41
|
+
highContrastTheme.name;
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## Semantic Color Tokens
|
|
47
|
+
|
|
48
|
+
The package provides semantic color groups in addition to the base palette.
|
|
49
|
+
|
|
50
|
+
Current semantic groups include:
|
|
51
|
+
|
|
52
|
+
- `surface`
|
|
53
|
+
- `text`
|
|
54
|
+
- `border`
|
|
55
|
+
- `status`
|
|
56
|
+
- `focus`
|
|
57
|
+
- `divider`
|
|
58
|
+
- `navigation`
|
|
59
|
+
- `skeleton`
|
|
60
|
+
|
|
61
|
+
Example:
|
|
62
|
+
|
|
63
|
+
```ts
|
|
64
|
+
theme.semantic.surface.default;
|
|
65
|
+
theme.semantic.surface.elevated;
|
|
66
|
+
|
|
67
|
+
theme.semantic.text.primary;
|
|
68
|
+
theme.semantic.text.secondary;
|
|
69
|
+
|
|
70
|
+
theme.semantic.border.default;
|
|
71
|
+
|
|
72
|
+
theme.semantic.status.success.fg;
|
|
73
|
+
theme.semantic.status.error.fg;
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Using semantic tokens instead of raw palette values makes components easier to maintain and prepares the design system for future theming.
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
## Component Tokens
|
|
81
|
+
|
|
82
|
+
Component tokens define renderer-neutral values for component states.
|
|
83
|
+
|
|
84
|
+
```ts
|
|
85
|
+
theme.components.button.primary.default.bg;
|
|
86
|
+
theme.components.input.focus.border;
|
|
87
|
+
theme.components.dropdown.content.bg;
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Color-like component tokens may use either hex colors or the literal `transparent` when the intended rendered value is transparent.
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
## CSS Variables
|
|
95
|
+
|
|
96
|
+
Generated CSS variables are available for Web projects.
|
|
97
|
+
|
|
98
|
+
```ts
|
|
99
|
+
import '@vellira-ui/tokens/css';
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
Examples:
|
|
103
|
+
|
|
104
|
+
```css
|
|
105
|
+
--color-mono-0
|
|
106
|
+
--surface-default
|
|
107
|
+
--text-primary
|
|
108
|
+
--border-default
|
|
109
|
+
--button-primary-default-bg
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
## Development
|
|
115
|
+
|
|
116
|
+
Build the package:
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
pnpm --filter @vellira-ui/tokens build
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
The build generates:
|
|
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:
|
|
129
|
+
|
|
130
|
+
```bash
|
|
131
|
+
pnpm --filter @vellira-ui/tokens generate:types
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
Use `generate:types:check` or the package test script to verify the generated token types are up to date.
|
|
135
|
+
|
|
136
|
+
---
|
|
137
|
+
|
|
138
|
+
## Principles
|
|
139
|
+
|
|
140
|
+
The token system follows a few core principles:
|
|
141
|
+
|
|
142
|
+
- Semantic tokens over hardcoded colors
|
|
143
|
+
- Shared across Web and React Native
|
|
144
|
+
- Stable public API
|
|
145
|
+
- Predictable naming
|
|
146
|
+
- Easy future support for multiple themes
|