@ogxjs/core 0.1.2 → 0.2.0-alpha.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.
Files changed (59) hide show
  1. package/dist/cache/hash.d.ts +66 -0
  2. package/dist/cache/hash.d.ts.map +1 -0
  3. package/dist/cache/hash.js +161 -0
  4. package/dist/cache/index.d.ts +10 -0
  5. package/dist/cache/index.d.ts.map +1 -0
  6. package/dist/cache/index.js +12 -0
  7. package/dist/cache/lru.d.ts +122 -0
  8. package/dist/cache/lru.d.ts.map +1 -0
  9. package/dist/cache/lru.js +269 -0
  10. package/dist/cache/snapshot.d.ts +116 -0
  11. package/dist/cache/snapshot.d.ts.map +1 -0
  12. package/dist/cache/snapshot.js +204 -0
  13. package/dist/cache.d.ts +2 -2
  14. package/dist/cache.js +2 -2
  15. package/dist/css.d.ts +19 -6
  16. package/dist/css.d.ts.map +1 -1
  17. package/dist/index.d.ts +17 -3
  18. package/dist/index.d.ts.map +1 -1
  19. package/dist/index.js +40 -9
  20. package/dist/ogx.js +2 -2
  21. package/dist/perf/index.d.ts +8 -0
  22. package/dist/perf/index.d.ts.map +1 -0
  23. package/dist/perf/index.js +7 -0
  24. package/dist/perf/timing.d.ts +160 -0
  25. package/dist/perf/timing.d.ts.map +1 -0
  26. package/dist/perf/timing.js +305 -0
  27. package/dist/presets/blog.js +1 -1
  28. package/dist/presets/docs.d.ts +2 -0
  29. package/dist/presets/docs.d.ts.map +1 -1
  30. package/dist/presets/docs.js +26 -23
  31. package/dist/presets/minimal.d.ts +2 -0
  32. package/dist/presets/minimal.d.ts.map +1 -1
  33. package/dist/presets/minimal.js +8 -16
  34. package/dist/presets/social.d.ts +2 -0
  35. package/dist/presets/social.d.ts.map +1 -1
  36. package/dist/presets/social.js +28 -18
  37. package/dist/render-png.d.ts.map +1 -1
  38. package/dist/render-png.js +9 -1
  39. package/dist/render-svg.d.ts.map +1 -1
  40. package/dist/render-svg.js +11 -1
  41. package/dist/tailwind/class-cache.d.ts +141 -0
  42. package/dist/tailwind/class-cache.d.ts.map +1 -0
  43. package/dist/tailwind/class-cache.js +212 -0
  44. package/dist/tailwind/index.d.ts +14 -1
  45. package/dist/tailwind/index.d.ts.map +1 -1
  46. package/dist/tailwind/index.js +15 -1
  47. package/dist/tailwind/lookup-tables.d.ts +30 -0
  48. package/dist/tailwind/lookup-tables.d.ts.map +1 -0
  49. package/dist/tailwind/lookup-tables.js +427 -0
  50. package/dist/tailwind/parser-v2.d.ts +54 -0
  51. package/dist/tailwind/parser-v2.d.ts.map +1 -0
  52. package/dist/tailwind/parser-v2.js +250 -0
  53. package/dist/tailwind/parser.d.ts +1 -0
  54. package/dist/tailwind/parser.d.ts.map +1 -1
  55. package/dist/tailwind/parser.js +1 -0
  56. package/dist/tailwind/prefix-handlers.d.ts +68 -0
  57. package/dist/tailwind/prefix-handlers.d.ts.map +1 -0
  58. package/dist/tailwind/prefix-handlers.js +931 -0
  59. package/package.json +17 -2
@@ -0,0 +1,160 @@
1
+ /**
2
+ * @ogxjs/core - Performance Timing API
3
+ * Profiling and performance measurement tools
4
+ *
5
+ * @description
6
+ * Provides timing utilities for measuring OGX performance:
7
+ * - Timer API for manual measurements
8
+ * - Automatic instrumentation for render pipeline
9
+ * - Report generation with statistics
10
+ *
11
+ * @version 0.2.0 "Turbo"
12
+ */
13
+ export interface TimingEntry {
14
+ label: string;
15
+ startTime: number;
16
+ endTime?: number;
17
+ duration?: number;
18
+ }
19
+ export interface TimingReport {
20
+ entries: TimingEntry[];
21
+ totals: Record<string, TimingAggregate>;
22
+ summary: {
23
+ totalDuration: number;
24
+ entryCount: number;
25
+ averageDuration: number;
26
+ };
27
+ }
28
+ export interface TimingAggregate {
29
+ count: number;
30
+ totalMs: number;
31
+ minMs: number;
32
+ maxMs: number;
33
+ avgMs: number;
34
+ }
35
+ /**
36
+ * Performance timer for measuring code execution
37
+ *
38
+ * @example
39
+ * ```ts
40
+ * const timer = new Timer();
41
+ *
42
+ * timer.start("render");
43
+ * await render(element);
44
+ * timer.end("render");
45
+ *
46
+ * timer.start("png-conversion");
47
+ * const png = convertToPng(svg);
48
+ * timer.end("png-conversion");
49
+ *
50
+ * console.log(timer.getReport());
51
+ * // { entries: [...], totals: {...}, summary: {...} }
52
+ * ```
53
+ */
54
+ export declare class Timer {
55
+ private entries;
56
+ private active;
57
+ private enabled;
58
+ constructor(enabled?: boolean);
59
+ /**
60
+ * Start a timing measurement
61
+ */
62
+ start(label: string): void;
63
+ /**
64
+ * End a timing measurement
65
+ * @returns Duration in milliseconds
66
+ */
67
+ end(label: string): number;
68
+ /**
69
+ * Measure an async operation
70
+ */
71
+ measure<T>(label: string, fn: () => Promise<T>): Promise<T>;
72
+ /**
73
+ * Measure a sync operation
74
+ */
75
+ measureSync<T>(label: string, fn: () => T): T;
76
+ /**
77
+ * Get timing report
78
+ */
79
+ getReport(): TimingReport;
80
+ /**
81
+ * Get formatted report string
82
+ */
83
+ getFormattedReport(): string;
84
+ /**
85
+ * Clear all entries
86
+ */
87
+ clear(): void;
88
+ /**
89
+ * Enable/disable timing
90
+ */
91
+ setEnabled(enabled: boolean): void;
92
+ /**
93
+ * Check if timing is enabled
94
+ */
95
+ isEnabled(): boolean;
96
+ }
97
+ /**
98
+ * Global timing API
99
+ */
100
+ export declare const timing: {
101
+ /**
102
+ * Start a timing measurement
103
+ */
104
+ start(label: string): void;
105
+ /**
106
+ * End a timing measurement
107
+ */
108
+ end(label: string): number;
109
+ /**
110
+ * Measure an async operation
111
+ */
112
+ measure<T>(label: string, fn: () => Promise<T>): Promise<T>;
113
+ /**
114
+ * Measure a sync operation
115
+ */
116
+ measureSync<T>(label: string, fn: () => T): T;
117
+ /**
118
+ * Get timing report
119
+ */
120
+ getReport(): TimingReport;
121
+ /**
122
+ * Get formatted report string
123
+ */
124
+ getFormattedReport(): string;
125
+ /**
126
+ * Clear all timing entries
127
+ */
128
+ clear(): void;
129
+ /**
130
+ * Enable timing (useful for debugging in production)
131
+ */
132
+ enable(): void;
133
+ /**
134
+ * Disable timing
135
+ */
136
+ disable(): void;
137
+ /**
138
+ * Check if timing is enabled
139
+ */
140
+ isEnabled(): boolean;
141
+ };
142
+ /**
143
+ * Quick one-off timing for a function
144
+ * Returns [result, durationMs]
145
+ */
146
+ export declare function quickTime<T>(fn: () => Promise<T>): Promise<[T, number]>;
147
+ /**
148
+ * Quick one-off timing for a sync function
149
+ */
150
+ export declare function quickTimeSync<T>(fn: () => T): [T, number];
151
+ /**
152
+ * Benchmark a function multiple times
153
+ * Returns statistics
154
+ */
155
+ export declare function benchmark(fn: () => Promise<void>, iterations?: number): Promise<TimingAggregate>;
156
+ /**
157
+ * Benchmark a sync function
158
+ */
159
+ export declare function benchmarkSync(fn: () => void, iterations?: number): TimingAggregate;
160
+ //# sourceMappingURL=timing.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"timing.d.ts","sourceRoot":"","sources":["../../src/perf/timing.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAIH,MAAM,WAAW,WAAW;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,YAAY;IAC5B,OAAO,EAAE,WAAW,EAAE,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;IACxC,OAAO,EAAE;QACR,aAAa,EAAE,MAAM,CAAC;QACtB,UAAU,EAAE,MAAM,CAAC;QACnB,eAAe,EAAE,MAAM,CAAC;KACxB,CAAC;CACF;AAED,MAAM,WAAW,eAAe;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACd;AAID;;;;;;;;;;;;;;;;;;GAkBG;AACH,qBAAa,KAAK;IACjB,OAAO,CAAC,OAAO,CAAqB;IACpC,OAAO,CAAC,MAAM,CAAkC;IAChD,OAAO,CAAC,OAAO,CAAU;gBAEb,OAAO,UAAO;IAI1B;;OAEG;IACH,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAW1B;;;OAGG;IACH,GAAG,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAkB1B;;OAEG;IACG,OAAO,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;IASjE;;OAEG;IACH,WAAW,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC;IAS7C;;OAEG;IACH,SAAS,IAAI,YAAY;IAkDzB;;OAEG;IACH,kBAAkB,IAAI,MAAM;IA2B5B;;OAEG;IACH,KAAK,IAAI,IAAI;IAKb;;OAEG;IACH,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI;IAIlC;;OAEG;IACH,SAAS,IAAI,OAAO;CAGpB;AAUD;;GAEG;AACH,eAAO,MAAM,MAAM;IAClB;;OAEG;iBACU,MAAM,GAAG,IAAI;IAI1B;;OAEG;eACQ,MAAM,GAAG,MAAM;IAI1B;;OAEG;YACK,CAAC,SAAS,MAAM,MAAM,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;IAI3D;;OAEG;gBACS,CAAC,SAAS,MAAM,MAAM,MAAM,CAAC,GAAG,CAAC;IAI7C;;OAEG;iBACU,YAAY;IAIzB;;OAEG;0BACmB,MAAM;IAI5B;;OAEG;aACM,IAAI;IAIb;;OAEG;cACO,IAAI;IAId;;OAEG;eACQ,IAAI;IAIf;;OAEG;iBACU,OAAO;CAGpB,CAAC;AAIF;;;GAGG;AACH,wBAAsB,SAAS,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAK7E;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,CAAC,CAKzD;AAED;;;GAGG;AACH,wBAAsB,SAAS,CAC9B,EAAE,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,EACvB,UAAU,SAAM,GACd,OAAO,CAAC,eAAe,CAAC,CAkB1B;AAED;;GAEG;AACH,wBAAgB,aAAa,CAC5B,EAAE,EAAE,MAAM,IAAI,EACd,UAAU,SAAM,GACd,eAAe,CAkBjB"}
@@ -0,0 +1,305 @@
1
+ /**
2
+ * @ogxjs/core - Performance Timing API
3
+ * Profiling and performance measurement tools
4
+ *
5
+ * @description
6
+ * Provides timing utilities for measuring OGX performance:
7
+ * - Timer API for manual measurements
8
+ * - Automatic instrumentation for render pipeline
9
+ * - Report generation with statistics
10
+ *
11
+ * @version 0.2.0 "Turbo"
12
+ */
13
+ // TIMING CLASS
14
+ /**
15
+ * Performance timer for measuring code execution
16
+ *
17
+ * @example
18
+ * ```ts
19
+ * const timer = new Timer();
20
+ *
21
+ * timer.start("render");
22
+ * await render(element);
23
+ * timer.end("render");
24
+ *
25
+ * timer.start("png-conversion");
26
+ * const png = convertToPng(svg);
27
+ * timer.end("png-conversion");
28
+ *
29
+ * console.log(timer.getReport());
30
+ * // { entries: [...], totals: {...}, summary: {...} }
31
+ * ```
32
+ */
33
+ export class Timer {
34
+ entries = [];
35
+ active = new Map();
36
+ enabled;
37
+ constructor(enabled = true) {
38
+ this.enabled = enabled;
39
+ }
40
+ /**
41
+ * Start a timing measurement
42
+ */
43
+ start(label) {
44
+ if (!this.enabled)
45
+ return;
46
+ const entry = {
47
+ label,
48
+ startTime: performance.now(),
49
+ };
50
+ this.active.set(label, entry);
51
+ }
52
+ /**
53
+ * End a timing measurement
54
+ * @returns Duration in milliseconds
55
+ */
56
+ end(label) {
57
+ if (!this.enabled)
58
+ return 0;
59
+ const entry = this.active.get(label);
60
+ if (!entry) {
61
+ console.warn(`Timer: No active timer for "${label}"`);
62
+ return 0;
63
+ }
64
+ entry.endTime = performance.now();
65
+ entry.duration = entry.endTime - entry.startTime;
66
+ this.entries.push(entry);
67
+ this.active.delete(label);
68
+ return entry.duration;
69
+ }
70
+ /**
71
+ * Measure an async operation
72
+ */
73
+ async measure(label, fn) {
74
+ this.start(label);
75
+ try {
76
+ return await fn();
77
+ }
78
+ finally {
79
+ this.end(label);
80
+ }
81
+ }
82
+ /**
83
+ * Measure a sync operation
84
+ */
85
+ measureSync(label, fn) {
86
+ this.start(label);
87
+ try {
88
+ return fn();
89
+ }
90
+ finally {
91
+ this.end(label);
92
+ }
93
+ }
94
+ /**
95
+ * Get timing report
96
+ */
97
+ getReport() {
98
+ // Aggregate by label
99
+ const totals = {};
100
+ for (const entry of this.entries) {
101
+ if (entry.duration === undefined)
102
+ continue;
103
+ if (!totals[entry.label]) {
104
+ totals[entry.label] = {
105
+ count: 0,
106
+ totalMs: 0,
107
+ minMs: Infinity,
108
+ maxMs: -Infinity,
109
+ avgMs: 0,
110
+ };
111
+ }
112
+ const agg = totals[entry.label];
113
+ agg.count++;
114
+ agg.totalMs += entry.duration;
115
+ agg.minMs = Math.min(agg.minMs, entry.duration);
116
+ agg.maxMs = Math.max(agg.maxMs, entry.duration);
117
+ }
118
+ // Calculate averages
119
+ for (const label of Object.keys(totals)) {
120
+ const agg = totals[label];
121
+ agg.avgMs = agg.totalMs / agg.count;
122
+ }
123
+ // Calculate summary
124
+ const totalDuration = this.entries.reduce((sum, e) => sum + (e.duration ?? 0), 0);
125
+ const entryCount = this.entries.filter((e) => e.duration !== undefined).length;
126
+ return {
127
+ entries: [...this.entries],
128
+ totals,
129
+ summary: {
130
+ totalDuration,
131
+ entryCount,
132
+ averageDuration: entryCount > 0 ? totalDuration / entryCount : 0,
133
+ },
134
+ };
135
+ }
136
+ /**
137
+ * Get formatted report string
138
+ */
139
+ getFormattedReport() {
140
+ const report = this.getReport();
141
+ const lines = [
142
+ "┌─────────────────────────────────────────────────────┐",
143
+ "│ OGX Performance Report │",
144
+ "├─────────────────────────────────────────────────────┤",
145
+ ];
146
+ // Totals by label
147
+ for (const [label, agg] of Object.entries(report.totals)) {
148
+ lines.push(`│ ${label.padEnd(20)} │ ${agg.avgMs.toFixed(2).padStart(8)}ms avg │`);
149
+ lines.push(`│ ${"".padEnd(20)} │ ${agg.count.toString().padStart(8)} calls │`);
150
+ }
151
+ lines.push("├─────────────────────────────────────────────────────┤");
152
+ lines.push(`│ Total: ${report.summary.totalDuration.toFixed(2)}ms (${report.summary.entryCount} entries) │`);
153
+ lines.push("└─────────────────────────────────────────────────────┘");
154
+ return lines.join("\n");
155
+ }
156
+ /**
157
+ * Clear all entries
158
+ */
159
+ clear() {
160
+ this.entries = [];
161
+ this.active.clear();
162
+ }
163
+ /**
164
+ * Enable/disable timing
165
+ */
166
+ setEnabled(enabled) {
167
+ this.enabled = enabled;
168
+ }
169
+ /**
170
+ * Check if timing is enabled
171
+ */
172
+ isEnabled() {
173
+ return this.enabled;
174
+ }
175
+ }
176
+ // GLOBAL TIMER
177
+ /**
178
+ * Global timer instance for OGX operations
179
+ * Disabled by default in production
180
+ */
181
+ const globalTimer = new Timer(process.env.NODE_ENV !== "production");
182
+ /**
183
+ * Global timing API
184
+ */
185
+ export const timing = {
186
+ /**
187
+ * Start a timing measurement
188
+ */
189
+ start(label) {
190
+ globalTimer.start(label);
191
+ },
192
+ /**
193
+ * End a timing measurement
194
+ */
195
+ end(label) {
196
+ return globalTimer.end(label);
197
+ },
198
+ /**
199
+ * Measure an async operation
200
+ */
201
+ measure(label, fn) {
202
+ return globalTimer.measure(label, fn);
203
+ },
204
+ /**
205
+ * Measure a sync operation
206
+ */
207
+ measureSync(label, fn) {
208
+ return globalTimer.measureSync(label, fn);
209
+ },
210
+ /**
211
+ * Get timing report
212
+ */
213
+ getReport() {
214
+ return globalTimer.getReport();
215
+ },
216
+ /**
217
+ * Get formatted report string
218
+ */
219
+ getFormattedReport() {
220
+ return globalTimer.getFormattedReport();
221
+ },
222
+ /**
223
+ * Clear all timing entries
224
+ */
225
+ clear() {
226
+ globalTimer.clear();
227
+ },
228
+ /**
229
+ * Enable timing (useful for debugging in production)
230
+ */
231
+ enable() {
232
+ globalTimer.setEnabled(true);
233
+ },
234
+ /**
235
+ * Disable timing
236
+ */
237
+ disable() {
238
+ globalTimer.setEnabled(false);
239
+ },
240
+ /**
241
+ * Check if timing is enabled
242
+ */
243
+ isEnabled() {
244
+ return globalTimer.isEnabled();
245
+ },
246
+ };
247
+ // QUICK TIMING UTILITIES
248
+ /**
249
+ * Quick one-off timing for a function
250
+ * Returns [result, durationMs]
251
+ */
252
+ export async function quickTime(fn) {
253
+ const start = performance.now();
254
+ const result = await fn();
255
+ const duration = performance.now() - start;
256
+ return [result, duration];
257
+ }
258
+ /**
259
+ * Quick one-off timing for a sync function
260
+ */
261
+ export function quickTimeSync(fn) {
262
+ const start = performance.now();
263
+ const result = fn();
264
+ const duration = performance.now() - start;
265
+ return [result, duration];
266
+ }
267
+ /**
268
+ * Benchmark a function multiple times
269
+ * Returns statistics
270
+ */
271
+ export async function benchmark(fn, iterations = 100) {
272
+ const durations = [];
273
+ for (let i = 0; i < iterations; i++) {
274
+ const start = performance.now();
275
+ await fn();
276
+ durations.push(performance.now() - start);
277
+ }
278
+ const totalMs = durations.reduce((sum, d) => sum + d, 0);
279
+ return {
280
+ count: iterations,
281
+ totalMs,
282
+ minMs: Math.min(...durations),
283
+ maxMs: Math.max(...durations),
284
+ avgMs: totalMs / iterations,
285
+ };
286
+ }
287
+ /**
288
+ * Benchmark a sync function
289
+ */
290
+ export function benchmarkSync(fn, iterations = 100) {
291
+ const durations = [];
292
+ for (let i = 0; i < iterations; i++) {
293
+ const start = performance.now();
294
+ fn();
295
+ durations.push(performance.now() - start);
296
+ }
297
+ const totalMs = durations.reduce((sum, d) => sum + d, 0);
298
+ return {
299
+ count: iterations,
300
+ totalMs,
301
+ minMs: Math.min(...durations),
302
+ maxMs: Math.max(...durations),
303
+ avgMs: totalMs / iterations,
304
+ };
305
+ }
@@ -60,7 +60,7 @@ export const blogPreset = (props) => {
60
60
  span([
61
61
  "text-lg",
62
62
  "font-medium",
63
- isDark ? "text-zinc-400" : "text-zinc-500",
63
+ isDark ? "text-zinc-400" : "text-zinc-600",
64
64
  ], [date, readingTime].filter(Boolean).join(" · ")),
65
65
  ]),
66
66
  ]),
@@ -15,6 +15,8 @@ export interface DocsPresetProps {
15
15
  header?: OGXElement;
16
16
  footer?: OGXElement;
17
17
  };
18
+ /** Details Image */
19
+ detailsOG?: boolean;
18
20
  }
19
21
  /**
20
22
  * Docs preset - ideal for documentation sites
@@ -1 +1 @@
1
- {"version":3,"file":"docs.d.ts","sourceRoot":"","sources":["../../src/presets/docs.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAEnD,MAAM,WAAW,eAAe;IAC/B,iBAAiB;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,uBAAuB;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,yBAAyB;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,gBAAgB;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,mBAAmB;IACnB,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC/B,4BAA4B;IAC5B,KAAK,CAAC,EAAE;QACP,MAAM,CAAC,EAAE,UAAU,CAAC;QACpB,MAAM,CAAC,EAAE,UAAU,CAAC;KACpB,CAAC;CACF;AAED;;GAEG;AACH,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,eAAe,CAuH9C,CAAC"}
1
+ {"version":3,"file":"docs.d.ts","sourceRoot":"","sources":["../../src/presets/docs.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAEnD,MAAM,WAAW,eAAe;IAC/B,iBAAiB;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,uBAAuB;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,yBAAyB;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,gBAAgB;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,mBAAmB;IACnB,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC/B,4BAA4B;IAC5B,KAAK,CAAC,EAAE;QACP,MAAM,CAAC,EAAE,UAAU,CAAC;QACpB,MAAM,CAAC,EAAE,UAAU,CAAC;KACpB,CAAC;IACF,oBAAoB;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;GAEG;AACH,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,eAAe,CA2H9C,CAAC"}
@@ -3,7 +3,7 @@ import { absolute, div, h1, img, p, row, span, stack } from "../builder";
3
3
  * Docs preset - ideal for documentation sites
4
4
  */
5
5
  export const docsPreset = (props) => {
6
- const { title, description, logo, siteName, colorScheme = "dark", slots = {}, } = props;
6
+ const { title, description, logo, siteName, colorScheme = "dark", slots = {}, detailsOG = false, } = props;
7
7
  const isDark = colorScheme === "dark";
8
8
  return stack([
9
9
  "w-full",
@@ -13,56 +13,59 @@ export const docsPreset = (props) => {
13
13
  "relative",
14
14
  ], [
15
15
  // Background Accent (Subtle Grid + Glow)
16
- absolute([
17
- isDark ? "bg-grid-white/5-64" : "bg-grid-zinc-900/5-64",
18
- "inset-0",
19
- ]),
20
- absolute([
21
- "inset-0",
22
- isDark
23
- ? "bg-gradient-to-tr from-zinc-950 via-transparent to-indigo-500/10"
24
- : "bg-gradient-to-tr from-white via-transparent to-indigo-500/5",
25
- ]),
26
- absolute(["bg-grain/10"]), // Quality Boost: Dithering
16
+ ...(detailsOG
17
+ ? [
18
+ absolute([
19
+ isDark ? "bg-grid-white/5-64" : "bg-grid-zinc-900/5-64",
20
+ "inset-0",
21
+ ]),
22
+ absolute([
23
+ "inset-0",
24
+ isDark
25
+ ? "bg-gradient-to-tr from-zinc-950 via-transparent to-indigo-500/10"
26
+ : "bg-gradient-to-tr from-white via-transparent to-indigo-500/5",
27
+ ]),
28
+ ]
29
+ : []),
27
30
  // Content Layout
28
31
  stack("flex-1 gap-12 relative", [
29
32
  // Header
30
33
  slots.header ??
31
34
  row("items-center justify-between", [
32
35
  row("items-center gap-4", [
33
- logo ? img(logo, "w-10 h-10 rounded-lg shadow-sm") : null,
36
+ logo ? img(logo, "w-10 h-10") : null,
34
37
  siteName
35
38
  ? span([
36
39
  "text-2xl",
37
40
  "font-bold",
38
- isDark ? "text-white" : "text-zinc-900",
41
+ isDark ? "text-white" : "text-zinc-950",
39
42
  "tracking-tight",
40
43
  ], siteName)
41
44
  : null,
42
45
  ]),
43
46
  div([
44
- "px-5 py-1 rounded-full border text-xs font-semibold",
47
+ "px-3 py-1 rounded-full border text-xs font-semibold",
45
48
  isDark
46
- ? "bg-white/5 border-white/10 text-zinc-400"
49
+ ? "border-white/10 text-zinc-400"
47
50
  : "bg-zinc-100 border-zinc-200 text-zinc-600",
48
- ], "DOCUMENTATION"),
51
+ ], "DOCS"),
49
52
  ]),
50
53
  // Main content
51
- stack("flex-1 justify-center gap-8", [
54
+ stack("flex-1 justify-center gap-8 w-full", [
52
55
  h1([
53
56
  "text-8xl",
54
57
  "font-black",
55
58
  isDark ? "text-white" : "text-zinc-950",
56
59
  "leading-[1.1]",
57
- "tracking-tight", // Quality Boost
60
+ "tracking-tight",
61
+ "break-all",
58
62
  ], title),
59
63
  description
60
64
  ? p([
61
- "text-4xl",
62
- isDark ? "text-zinc-400" : "text-zinc-500",
63
- "max-w-[900px]",
65
+ "text-3xl",
66
+ isDark ? "text-zinc-400" : "text-zinc-600",
64
67
  "leading-relaxed",
65
- "font-semibold",
68
+ "font-medium",
66
69
  ], description)
67
70
  : null,
68
71
  ]),
@@ -8,6 +8,8 @@ export interface MinimalPresetProps {
8
8
  background?: string;
9
9
  /** Text color (Tailwind class or hex) */
10
10
  textColor?: string;
11
+ /** Color scheme */
12
+ colorScheme?: "dark" | "light";
11
13
  /** Custom slot overrides */
12
14
  slots?: {
13
15
  content?: OGXElement;
@@ -1 +1 @@
1
- {"version":3,"file":"minimal.d.ts","sourceRoot":"","sources":["../../src/presets/minimal.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAEnD,MAAM,WAAW,kBAAkB;IAClC,gBAAgB;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,qBAAqB;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,+CAA+C;IAC/C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,yCAAyC;IACzC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,4BAA4B;IAC5B,KAAK,CAAC,EAAE;QACP,OAAO,CAAC,EAAE,UAAU,CAAC;KACrB,CAAC;CACF;AAED;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,kBAAkB,CAqEpD,CAAC"}
1
+ {"version":3,"file":"minimal.d.ts","sourceRoot":"","sources":["../../src/presets/minimal.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAEnD,MAAM,WAAW,kBAAkB;IAClC,gBAAgB;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,qBAAqB;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,+CAA+C;IAC/C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,yCAAyC;IACzC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mBAAmB;IACnB,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC/B,4BAA4B;IAC5B,KAAK,CAAC,EAAE;QACP,OAAO,CAAC,EAAE,UAAU,CAAC;KACrB,CAAC;CACF;AAED;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,kBAAkB,CA6DpD,CAAC"}
@@ -1,9 +1,9 @@
1
- import { absolute, h1, p, stack } from "../builder";
1
+ import { h1, p, stack } from "../builder";
2
2
  /**
3
3
  * Minimal preset - ultra clean, just text
4
4
  */
5
5
  export const minimalPreset = (props) => {
6
- const { title, subtitle, background = "bg-zinc-950", textColor = "text-white", slots = {}, } = props;
6
+ const { title, subtitle, colorScheme = "dark", background = colorScheme === "dark" ? "bg-zinc-950" : "bg-white", textColor = colorScheme === "dark" ? "text-white" : "text-zinc-950", slots = {}, } = props;
7
7
  const bgClass = background.startsWith("bg-")
8
8
  ? background
9
9
  : `bg-[${background}]`;
@@ -15,22 +15,14 @@ export const minimalPreset = (props) => {
15
15
  "h-full",
16
16
  "items-center",
17
17
  "justify-center",
18
- "p-24",
18
+ "p-16",
19
19
  "relative",
20
20
  bgClass,
21
21
  ], [
22
- // Subtle Background Texture
23
- absolute([
24
- "inset-0 opacity-[0.03]",
25
- background.includes("light") || background === "bg-white"
26
- ? "bg-grid-black-32"
27
- : "bg-grid-white-32",
28
- ]),
29
- absolute(["bg-grain/5"]), // Quality Boost: Dithering
30
22
  // Content
31
- stack("items-center justify-center relative", slots.content ?? [
23
+ stack("items-center justify-center relative gap-6", slots.content ?? [
32
24
  h1([
33
- "text-9xl",
25
+ "text-8xl",
34
26
  "font-black",
35
27
  "text-center",
36
28
  "tracking-tightest", // Quality Boost
@@ -39,12 +31,12 @@ export const minimalPreset = (props) => {
39
31
  ], title),
40
32
  subtitle
41
33
  ? p([
42
- "text-3xl",
34
+ "text-2xl",
43
35
  "text-center",
44
- "mt-10",
36
+ "mt-2",
45
37
  "opacity-40",
46
38
  "font-medium",
47
- "tracking-wide",
39
+ "tracking-tight",
48
40
  textClass,
49
41
  ], subtitle.toUpperCase())
50
42
  : null,
@@ -16,6 +16,8 @@ export interface SocialPresetProps {
16
16
  fromColor?: string;
17
17
  /** To color (hex) */
18
18
  toColor?: string;
19
+ /** Color scheme */
20
+ colorScheme?: "dark" | "light";
19
21
  /** Custom slot overrides */
20
22
  slots?: {
21
23
  header?: OGXElement;
@@ -1 +1 @@
1
- {"version":3,"file":"social.d.ts","sourceRoot":"","sources":["../../src/presets/social.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAEnD,MAAM,WAAW,iBAAiB;IACjC,6BAA6B;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,yBAAyB;IACzB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,iBAAiB;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,qBAAqB;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,qBAAqB;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,wCAAwC;IACxC,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC;IAC/C,uBAAuB;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,qBAAqB;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,4BAA4B;IAC5B,KAAK,CAAC,EAAE;QACP,MAAM,CAAC,EAAE,UAAU,CAAC;QACpB,MAAM,CAAC,EAAE,UAAU,CAAC;KACpB,CAAC;CACF;AAED;;GAEG;AACH,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,iBAAiB,CAkGlD,CAAC"}
1
+ {"version":3,"file":"social.d.ts","sourceRoot":"","sources":["../../src/presets/social.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAEnD,MAAM,WAAW,iBAAiB;IACjC,6BAA6B;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,yBAAyB;IACzB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,iBAAiB;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,qBAAqB;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,qBAAqB;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,wCAAwC;IACxC,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC;IAC/C,uBAAuB;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,qBAAqB;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,mBAAmB;IACnB,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC/B,4BAA4B;IAC5B,KAAK,CAAC,EAAE;QACP,MAAM,CAAC,EAAE,UAAU,CAAC;QACpB,MAAM,CAAC,EAAE,UAAU,CAAC;KACpB,CAAC;CACF;AAED;;GAEG;AACH,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,iBAAiB,CA6GlD,CAAC"}