@idealyst/theme 1.1.6 → 1.1.8

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.
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Idealyst Configuration Module
3
+ *
4
+ * Provides tools for defining theme configuration and generating
5
+ * flat, Unistyles-compatible style files.
6
+ */
7
+
8
+ export { defineConfig } from './types';
9
+ export { generateStyles } from './generator';
10
+ export type { IdealystConfig, ComponentExtensions, ComponentExtension } from './types';
@@ -0,0 +1,112 @@
1
+ /**
2
+ * Idealyst Configuration Types
3
+ *
4
+ * This module defines the structure for idealyst.config.ts files.
5
+ * The config is used to generate flat, Unistyles-compatible style files.
6
+ */
7
+
8
+ import type { Theme } from '../theme';
9
+
10
+ /**
11
+ * Component extension definition.
12
+ * Can be either static styles or a function that receives the theme.
13
+ */
14
+ export type ComponentExtension<T = Record<string, any>> =
15
+ | T
16
+ | ((theme: Theme) => T);
17
+
18
+ /**
19
+ * Extension definitions for all components.
20
+ */
21
+ export interface ComponentExtensions {
22
+ View?: ComponentExtension<{
23
+ view?: Record<string, any>;
24
+ }>;
25
+ Button?: ComponentExtension<{
26
+ button?: Record<string, any>;
27
+ text?: Record<string, any>;
28
+ icon?: Record<string, any>;
29
+ iconContainer?: Record<string, any>;
30
+ }>;
31
+ Text?: ComponentExtension<{
32
+ text?: Record<string, any>;
33
+ }>;
34
+ Card?: ComponentExtension<{
35
+ card?: Record<string, any>;
36
+ }>;
37
+ Input?: ComponentExtension<{
38
+ wrapper?: Record<string, any>;
39
+ input?: Record<string, any>;
40
+ label?: Record<string, any>;
41
+ hint?: Record<string, any>;
42
+ }>;
43
+ Screen?: ComponentExtension<{
44
+ screen?: Record<string, any>;
45
+ screenContent?: Record<string, any>;
46
+ }>;
47
+ // Add more components as needed...
48
+ [key: string]: ComponentExtension | undefined;
49
+ }
50
+
51
+ /**
52
+ * Theme definition in the config.
53
+ */
54
+ export interface ThemeDefinition {
55
+ /**
56
+ * The built theme object.
57
+ * Created using createTheme() or fromTheme() builders.
58
+ */
59
+ theme: Theme;
60
+
61
+ /**
62
+ * Optional name for this theme variant.
63
+ * Defaults to 'light' for the first theme, 'dark' for the second.
64
+ */
65
+ name?: string;
66
+ }
67
+
68
+ /**
69
+ * Main Idealyst configuration structure.
70
+ */
71
+ export interface IdealystConfig {
72
+ /**
73
+ * Theme definitions.
74
+ * At minimum, define light and dark themes.
75
+ */
76
+ themes: {
77
+ light: Theme;
78
+ dark: Theme;
79
+ [key: string]: Theme;
80
+ };
81
+
82
+ /**
83
+ * Global component style extensions.
84
+ * These are merged with base component styles.
85
+ */
86
+ extensions?: ComponentExtensions;
87
+
88
+ /**
89
+ * Output configuration.
90
+ */
91
+ output?: {
92
+ /**
93
+ * Directory to output generated style files.
94
+ * Relative to config file location.
95
+ * @default './generated'
96
+ */
97
+ dir?: string;
98
+
99
+ /**
100
+ * Whether to generate TypeScript or JavaScript.
101
+ * @default 'typescript'
102
+ */
103
+ format?: 'typescript' | 'javascript';
104
+ };
105
+ }
106
+
107
+ /**
108
+ * Helper to define a config with full type inference.
109
+ */
110
+ export function defineConfig(config: IdealystConfig): IdealystConfig {
111
+ return config;
112
+ }