@loworbitstudio/visor-theme-engine 0.4.0 → 0.4.2
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/dist/adapters/index.d.ts +73 -8
- package/dist/adapters/index.js +719 -21
- package/dist/{chunk-NZF2MS4L.js → chunk-SXT2KY6D.js} +30 -6
- package/dist/index.d.ts +122 -6
- package/dist/index.js +266 -66
- package/dist/{types-DgAumoCX.d.ts → types-ljcTtODU.d.ts} +57 -0
- package/package.json +1 -1
- package/src/visor-theme.schema.json +68 -0
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-ljcTtODU.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
|
|
@@ -108,17 +139,51 @@ declare function deckAdapter(input: AdapterInput, options?: DeckAdapterOptions):
|
|
|
108
139
|
/**
|
|
109
140
|
* Generate docs-site CSS for a theme.
|
|
110
141
|
*
|
|
111
|
-
* Output is class-scoped (.{slug}-theme)
|
|
112
|
-
*
|
|
142
|
+
* Output is class-scoped (.{slug}-theme) and wrapped in @layer visor-adaptive
|
|
143
|
+
* so consumer overrides (unlayered) and visor-core's own visor-adaptive layer
|
|
144
|
+
* cascade correctly. Font @import / @font-face statements stay outside the
|
|
145
|
+
* layer block per CSS spec (VI-312).
|
|
113
146
|
*/
|
|
114
147
|
declare function docsAdapter(input: AdapterInput, options?: DocsAdapterOptions): string;
|
|
115
148
|
|
|
149
|
+
/**
|
|
150
|
+
* Flutter Adapter
|
|
151
|
+
*
|
|
152
|
+
* Generates a Dart package (or token-only file set) from Visor theme data,
|
|
153
|
+
* matching the Low Orbit canonical `packages/ui/` structure:
|
|
154
|
+
*
|
|
155
|
+
* ```
|
|
156
|
+
* packages/ui/
|
|
157
|
+
* ├── pubspec.yaml
|
|
158
|
+
* ├── lib/
|
|
159
|
+
* │ ├── ui.dart # barrel
|
|
160
|
+
* │ └── src/
|
|
161
|
+
* │ ├── colors/visor_colors.dart # primitives + VisorColors.light/dark
|
|
162
|
+
* │ ├── typography/visor_text_styles.dart
|
|
163
|
+
* │ ├── spacing/visor_spacing.dart
|
|
164
|
+
* │ ├── radius/visor_radius.dart
|
|
165
|
+
* │ ├── shadows/visor_shadows.dart
|
|
166
|
+
* │ ├── strokes/visor_stroke_widths.dart
|
|
167
|
+
* │ ├── motion/visor_motion.dart
|
|
168
|
+
* │ └── theme/visor_theme.dart # VisorAppTheme.{light,dark}
|
|
169
|
+
* ```
|
|
170
|
+
*/
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* Generate a Flutter token package from theme engine output.
|
|
174
|
+
*
|
|
175
|
+
* @returns File map keyed by path relative to the output directory.
|
|
176
|
+
*/
|
|
177
|
+
declare function flutterAdapter(input: AdapterInput, options?: FlutterAdapterOptions): AdapterFileMap;
|
|
178
|
+
|
|
116
179
|
/**
|
|
117
180
|
* CSS @layer utilities for adapter output.
|
|
118
181
|
*
|
|
119
|
-
* Establishes a specificity ordering so theme overrides work
|
|
120
|
-
*
|
|
121
|
-
*
|
|
182
|
+
* Establishes a specificity ordering so theme overrides work without
|
|
183
|
+
* !important. Both adapter output (here) and visor-core's emitted CSS
|
|
184
|
+
* (packages/tokens/src/generate/generate-css.ts) declare this same layer
|
|
185
|
+
* order — defense in depth, so whichever stylesheet loads first establishes
|
|
186
|
+
* the cascade.
|
|
122
187
|
*/
|
|
123
188
|
/** Layer order declaration — must appear before any @layer blocks. */
|
|
124
189
|
declare const LAYER_ORDER = "@layer visor-primitives, visor-semantic, visor-adaptive, visor-bridge;";
|
|
@@ -147,4 +212,4 @@ interface FumadocsBridgeEntry {
|
|
|
147
212
|
*/
|
|
148
213
|
declare const FUMADOCS_BRIDGE_MAP: Record<string, FumadocsBridgeEntry>;
|
|
149
214
|
|
|
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 };
|
|
215
|
+
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 };
|