@loworbitstudio/visor-theme-engine 0.1.0 → 0.4.1
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 +29 -0
- package/dist/adapters/index.d.ts +64 -3
- package/dist/adapters/index.js +729 -2
- package/dist/{chunk-ZLXFCNYF.js → chunk-G4B57FB3.js} +51 -23
- package/dist/index.d.ts +108 -6
- package/dist/index.js +230 -16
- package/dist/{types-r7ae3WP2.d.ts → types-gAlkt__C.d.ts} +58 -0
- package/package.json +7 -2
- package/src/visor-theme.schema.json +56 -0
package/README.md
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# @loworbitstudio/visor-theme-engine
|
|
2
|
+
|
|
3
|
+
Theme engine for the [Visor](https://visor.loworbit.studio) design system — shade generation, token mapping, font resolution, and import/export for `.visor.yaml` themes.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @loworbitstudio/visor-theme-engine
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## What It Does
|
|
12
|
+
|
|
13
|
+
- Generates dark and light color scales from a brand anchor color using OKLCH
|
|
14
|
+
- Maps theme configuration (`.visor.yaml`) to CSS custom properties
|
|
15
|
+
- Resolves font declarations against the Visor fonts CDN
|
|
16
|
+
- Exports theme bundles for use in any project
|
|
17
|
+
- Provides a `docsAdapter` for registering themes in fumadocs sites
|
|
18
|
+
|
|
19
|
+
## Usage
|
|
20
|
+
|
|
21
|
+
Themes are typically managed via the Visor CLI (`visor theme sync`). Direct API usage is for advanced cases — building custom theme tooling or integrating with non-CLI workflows.
|
|
22
|
+
|
|
23
|
+
```ts
|
|
24
|
+
import { generateTheme } from '@loworbitstudio/visor-theme-engine'
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Documentation
|
|
28
|
+
|
|
29
|
+
Full docs at [visor.loworbit.studio](https://visor.loworbit.studio).
|
package/dist/adapters/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as GeneratedPrimitives, i as SemanticTokens, R as ResolvedThemeConfig } from '../types-
|
|
1
|
+
import { c as GeneratedPrimitives, i as SemanticTokens, R as ResolvedThemeConfig } from '../types-gAlkt__C.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Adapter types for the Visor theme engine.
|
|
@@ -33,8 +33,39 @@ interface DocsAdapterOptions extends AdapterOptions {
|
|
|
33
33
|
/** Include font imports at the top (default: true) */
|
|
34
34
|
includeFontImports?: boolean;
|
|
35
35
|
}
|
|
36
|
+
/** Options specific to the Flutter adapter. */
|
|
37
|
+
interface FlutterAdapterOptions {
|
|
38
|
+
/** Package name for the generated Dart package (default: "ui") */
|
|
39
|
+
packageName?: string;
|
|
40
|
+
/**
|
|
41
|
+
* Skip full package scaffolding; emit only token files for slot-in to an
|
|
42
|
+
* existing `packages/ui/` (default: false).
|
|
43
|
+
*/
|
|
44
|
+
tokensOnly?: boolean;
|
|
45
|
+
/** Emit only light-brightness theme getters (default: emit both). */
|
|
46
|
+
lightOnly?: boolean;
|
|
47
|
+
/** Emit only dark-brightness theme getters (default: emit both). */
|
|
48
|
+
darkOnly?: boolean;
|
|
49
|
+
/** Name for the generated theme class (default: "VisorAppTheme"). */
|
|
50
|
+
themeClassName?: string;
|
|
51
|
+
/** visor_core pub.dev version constraint (default: "^0.1.0"). */
|
|
52
|
+
visorCoreVersion?: string;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* File-map output produced by adapters that emit a directory tree
|
|
56
|
+
* (e.g. the Flutter adapter emits an entire Dart package).
|
|
57
|
+
*
|
|
58
|
+
* Keys are paths relative to the caller-supplied output directory;
|
|
59
|
+
* values are file contents. Callers walk the map, mkdir each parent,
|
|
60
|
+
* and write each file.
|
|
61
|
+
*/
|
|
62
|
+
interface AdapterFileMap {
|
|
63
|
+
files: Record<string, string>;
|
|
64
|
+
}
|
|
65
|
+
/** Narrow a union [string | AdapterFileMap] to the file-map case. */
|
|
66
|
+
declare function isAdapterFileMap(output: string | AdapterFileMap): output is AdapterFileMap;
|
|
36
67
|
/** Supported adapter names. */
|
|
37
|
-
type AdapterName = "nextjs" | "fumadocs" | "deck" | "docs";
|
|
68
|
+
type AdapterName = "nextjs" | "fumadocs" | "deck" | "docs" | "flutter";
|
|
38
69
|
|
|
39
70
|
/**
|
|
40
71
|
* NextJS Adapter
|
|
@@ -113,6 +144,36 @@ declare function deckAdapter(input: AdapterInput, options?: DeckAdapterOptions):
|
|
|
113
144
|
*/
|
|
114
145
|
declare function docsAdapter(input: AdapterInput, options?: DocsAdapterOptions): string;
|
|
115
146
|
|
|
147
|
+
/**
|
|
148
|
+
* Flutter Adapter
|
|
149
|
+
*
|
|
150
|
+
* Generates a Dart package (or token-only file set) from Visor theme data,
|
|
151
|
+
* matching the Low Orbit canonical `packages/ui/` structure:
|
|
152
|
+
*
|
|
153
|
+
* ```
|
|
154
|
+
* packages/ui/
|
|
155
|
+
* ├── pubspec.yaml
|
|
156
|
+
* ├── lib/
|
|
157
|
+
* │ ├── ui.dart # barrel
|
|
158
|
+
* │ └── src/
|
|
159
|
+
* │ ├── colors/visor_colors.dart # primitives + VisorColors.light/dark
|
|
160
|
+
* │ ├── typography/visor_text_styles.dart
|
|
161
|
+
* │ ├── spacing/visor_spacing.dart
|
|
162
|
+
* │ ├── radius/visor_radius.dart
|
|
163
|
+
* │ ├── shadows/visor_shadows.dart
|
|
164
|
+
* │ ├── strokes/visor_stroke_widths.dart
|
|
165
|
+
* │ ├── motion/visor_motion.dart
|
|
166
|
+
* │ └── theme/visor_theme.dart # VisorAppTheme.{light,dark}
|
|
167
|
+
* ```
|
|
168
|
+
*/
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* Generate a Flutter token package from theme engine output.
|
|
172
|
+
*
|
|
173
|
+
* @returns File map keyed by path relative to the output directory.
|
|
174
|
+
*/
|
|
175
|
+
declare function flutterAdapter(input: AdapterInput, options?: FlutterAdapterOptions): AdapterFileMap;
|
|
176
|
+
|
|
116
177
|
/**
|
|
117
178
|
* CSS @layer utilities for adapter output.
|
|
118
179
|
*
|
|
@@ -147,4 +208,4 @@ interface FumadocsBridgeEntry {
|
|
|
147
208
|
*/
|
|
148
209
|
declare const FUMADOCS_BRIDGE_MAP: Record<string, FumadocsBridgeEntry>;
|
|
149
210
|
|
|
150
|
-
export { type AdapterInput, type AdapterName, type AdapterOptions, type DeckAdapterOptions, type DocsAdapterOptions, FUMADOCS_BRIDGE_MAP, type FumadocsBridgeEntry, LAYER_ORDER, type NextJSAdapterOptions, deckAdapter, docsAdapter, fumadocsAdapter, nextjsAdapter, wrapInLayer };
|
|
211
|
+
export { type AdapterFileMap, type AdapterInput, type AdapterName, type AdapterOptions, type DeckAdapterOptions, type DocsAdapterOptions, FUMADOCS_BRIDGE_MAP, type FlutterAdapterOptions, type FumadocsBridgeEntry, LAYER_ORDER, type NextJSAdapterOptions, deckAdapter, docsAdapter, flutterAdapter, fumadocsAdapter, isAdapterFileMap, nextjsAdapter, wrapInLayer };
|