@omkarux/vela 0.7.1 → 0.8.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/CHANGELOG.md +30 -0
- package/README.md +4 -3
- package/flutter/README.md +16 -0
- package/flutter/lib/vela_tokens.dart +1311 -0
- package/flutter/pubspec.yaml +11 -0
- package/guidelines/llms.txt +4 -2
- package/guidelines/setup.md +31 -0
- package/package.json +13 -7
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# GENERATED by scripts/build-tokens-dart.mjs — do not edit. The version tracks @omkarux/vela.
|
|
2
|
+
name: vela_tokens
|
|
3
|
+
description: Vela design tokens for Flutter, generated from tokens/vela.tokens.json — the same source as the CSS and the Figma library.
|
|
4
|
+
version: 0.8.0
|
|
5
|
+
publish_to: none
|
|
6
|
+
environment:
|
|
7
|
+
sdk: ^3.4.0
|
|
8
|
+
flutter: ">=3.22.0"
|
|
9
|
+
dependencies:
|
|
10
|
+
flutter:
|
|
11
|
+
sdk: flutter
|
package/guidelines/llms.txt
CHANGED
|
@@ -7,7 +7,9 @@
|
|
|
7
7
|
> THESE SPECS ARE FRAMEWORK-AGNOSTIC. The published package is a React implementation of them, and
|
|
8
8
|
> the code samples below are React — but the tokens, the closed prop sets, the taxonomies and the
|
|
9
9
|
> accessibility rules hold for any implementation. If you are generating for Angular, Vue or
|
|
10
|
-
> Svelte, follow every rule here and translate only the syntax.
|
|
10
|
+
> Svelte, follow every rule here and translate only the syntax. For Flutter, the same tokens ship as
|
|
11
|
+
> `tokens.dart` (`VelaColors`, `VelaSizing`, `VelaTypography`, `velaThemeData`) — bind `VelaColors`
|
|
12
|
+
> semantics, never `VelaPrimitives`.
|
|
11
13
|
|
|
12
14
|
Read `overview.md` first: it maps a user need to a component and lists the choices agents
|
|
13
15
|
most often get wrong. Then read the per-component file before generating any markup.
|
|
@@ -22,7 +24,7 @@ most often get wrong. Then read the per-component file before generating any mar
|
|
|
22
24
|
## Figma
|
|
23
25
|
|
|
24
26
|
A matching Figma library exists: **Vela Design System**. It is *compiled from this contract*, not
|
|
25
|
-
the source of it —
|
|
27
|
+
the source of it — 234 variables and 6 component sets mirroring the token architecture 1:1, with
|
|
26
28
|
every variable carrying its `var(--vela-*)` name for Dev Mode. Each component's per-file
|
|
27
29
|
`## Figma mapping` section states which Figma property corresponds to which prop, and which
|
|
28
30
|
behaviour has no Figma expression at all.
|
package/guidelines/setup.md
CHANGED
|
@@ -76,3 +76,34 @@ the spacing and sizing scales and the type ramp — with no React in the depende
|
|
|
76
76
|
components against your own framework's idioms and hold them to `guidelines/`, which is written to
|
|
77
77
|
be implementation-independent. On Angular, the closed prop sets become union input types with
|
|
78
78
|
`strictTemplates` enabled; that buys most of what the discriminated unions buy in React.
|
|
79
|
+
|
|
80
|
+
### Flutter
|
|
81
|
+
|
|
82
|
+
The tokens also ship as Dart, generated from the same JSON as the CSS and the Figma library. It lives
|
|
83
|
+
at `flutter/` inside the npm package (and is exported as `@omkarux/vela/tokens.dart`). Add it as a
|
|
84
|
+
path dependency or vendor the single file `flutter/lib/vela_tokens.dart`:
|
|
85
|
+
|
|
86
|
+
```yaml
|
|
87
|
+
dependencies:
|
|
88
|
+
vela_tokens:
|
|
89
|
+
path: ../vela/flutter
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
```dart
|
|
93
|
+
import 'package:vela_tokens/vela_tokens.dart';
|
|
94
|
+
|
|
95
|
+
MaterialApp(
|
|
96
|
+
theme: velaThemeData(Brightness.light),
|
|
97
|
+
darkTheme: velaThemeData(Brightness.dark),
|
|
98
|
+
);
|
|
99
|
+
|
|
100
|
+
// In a widget — bind semantics, never VelaPrimitives:
|
|
101
|
+
final colors = Theme.of(context).extension<VelaColors>()!;
|
|
102
|
+
Container(color: colors.bgContainer, padding: const EdgeInsets.all(VelaSizing.space20));
|
|
103
|
+
Text('Healthy', style: VelaTypography.meta.copyWith(color: colors.signalStatusHealthy));
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
Same rule as the CSS: bind semantics (`VelaColors`), never `VelaPrimitives`. `VelaSizing` values are
|
|
107
|
+
logical pixels, 1:1 with the CSS px values; each `VelaTypography` style carries its line-height as
|
|
108
|
+
Flutter's `height` ratio. Widgets are not generated — build them against `guidelines/` like any other
|
|
109
|
+
stack, and hold them to the same specs.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@omkarux/vela",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "A token-first design system: framework-agnostic tokens and component specs with a React implementation. Two-layer color architecture, separate severity and risk taxonomies, light and dark theming, WCAG AA asserted in CI, zero runtime dependencies.",
|
|
3
|
+
"version": "0.8.0",
|
|
4
|
+
"description": "A token-first design system: framework-agnostic tokens and component specs with a React implementation. Tokens compile to CSS, a Figma library and a Flutter theme from one source. Two-layer color architecture, separate severity and risk taxonomies, light and dark theming, WCAG AA asserted in CI, zero runtime dependencies.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"author": "Omkar Khadamkar",
|
|
@@ -27,7 +27,8 @@
|
|
|
27
27
|
"./tokens.css": "./dist/tokens.css",
|
|
28
28
|
"./guidelines/*": "./guidelines/*",
|
|
29
29
|
"./package.json": "./package.json",
|
|
30
|
-
"./tokens.json": "./tokens/vela.tokens.json"
|
|
30
|
+
"./tokens.json": "./tokens/vela.tokens.json",
|
|
31
|
+
"./tokens.dart": "./flutter/lib/vela_tokens.dart"
|
|
31
32
|
},
|
|
32
33
|
"files": [
|
|
33
34
|
"dist",
|
|
@@ -35,17 +36,19 @@
|
|
|
35
36
|
"README.md",
|
|
36
37
|
"CHANGELOG.md",
|
|
37
38
|
"LICENSE",
|
|
38
|
-
"tokens"
|
|
39
|
+
"tokens",
|
|
40
|
+
"flutter"
|
|
39
41
|
],
|
|
40
42
|
"scripts": {
|
|
41
43
|
"clean": "rm -rf dist",
|
|
42
|
-
"tokens": "node scripts/build-tokens.mjs",
|
|
44
|
+
"tokens": "node scripts/build-tokens.mjs && node scripts/build-tokens-dart.mjs",
|
|
45
|
+
"tokens:dart": "node scripts/build-tokens-dart.mjs",
|
|
43
46
|
"tokens:figma": "node scripts/sync-figma.mjs",
|
|
44
47
|
"tokens:figma:read": "node scripts/figma-drift.mjs --read",
|
|
45
48
|
"tokens:figma:check": "node scripts/figma-drift.mjs",
|
|
46
49
|
"guidelines:figma": "node scripts/sync-figma-descriptions.mjs",
|
|
47
50
|
"figma:build": "node scripts/figma/build-components.mjs",
|
|
48
|
-
"tokens:check": "
|
|
51
|
+
"tokens:check": "npm run tokens && git diff --exit-code -- src/styles/tokens.light.css src/styles/tokens.dark.body.css flutter/lib/vela_tokens.dart flutter/pubspec.yaml",
|
|
49
52
|
"build": "npm run clean && npm run tokens && npm run build:js && npm run build:css",
|
|
50
53
|
"build:js": "vite build",
|
|
51
54
|
"build:css": "node scripts/build-css.mjs",
|
|
@@ -85,7 +88,10 @@
|
|
|
85
88
|
"design-tokens",
|
|
86
89
|
"react",
|
|
87
90
|
"component-library",
|
|
88
|
-
"accessibility"
|
|
91
|
+
"accessibility",
|
|
92
|
+
"flutter",
|
|
93
|
+
"dart",
|
|
94
|
+
"web-components"
|
|
89
95
|
],
|
|
90
96
|
"engines": {
|
|
91
97
|
"node": ">=18"
|