@loworbitstudio/visor-theme-engine 0.4.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.
@@ -1,4 +1,4 @@
1
- import { c as GeneratedPrimitives, i as SemanticTokens, R as ResolvedThemeConfig } from '../types-DgAumoCX.js';
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 };