nuclo 0.1.47 → 0.1.48

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,126 @@
1
+ // Style utility functions type definitions
2
+
3
+ /**
4
+ * Creates a CSS class with the given styles and injects it into the document
5
+ */
6
+ declare global {
7
+ function createCSSClass(className: string, styles: Record<string, string>): void;
8
+
9
+ /**
10
+ * Creates a breakpoint-aware class name generator
11
+ */
12
+ function createBreakpoints<T extends string>(
13
+ breakpoints: Record<T, string>
14
+ ): (styles?: Partial<Record<T, StyleBuilder>>) => string;
15
+
16
+ /**
17
+ * Style builder class for chaining CSS properties
18
+ */
19
+ class StyleBuilder {
20
+ getStyles(): Record<string, string>;
21
+ add(property: string, value: string): this;
22
+
23
+ // Display
24
+ display(value: string): this;
25
+ flex(value?: string): this;
26
+ grid(): this;
27
+
28
+ // Colors
29
+ bg(color: string): this;
30
+ color(color: string): this;
31
+ accentColor(value: string): this;
32
+
33
+ // Typography
34
+ fontSize(size: string): this;
35
+ fontWeight(value: string): this;
36
+ fontFamily(value: string): this;
37
+ lineHeight(value: string): this;
38
+ letterSpacing(value: string): this;
39
+ textAlign(value: string): this;
40
+ textDecoration(value: string): this;
41
+ bold(): this;
42
+
43
+ // Layout
44
+ position(value: string): this;
45
+ padding(value: string): this;
46
+ margin(value: string): this;
47
+ width(value: string): this;
48
+ height(value: string): this;
49
+ minWidth(value: string): this;
50
+ maxWidth(value: string): this;
51
+ minHeight(value: string): this;
52
+
53
+ // Flexbox
54
+ flexDirection(value: string): this;
55
+ alignItems(value: string): this;
56
+ justifyContent(value: string): this;
57
+ center(): this;
58
+ gap(value: string): this;
59
+
60
+ // Borders
61
+ border(value: string): this;
62
+ borderRadius(value: string): this;
63
+ outline(value: string): this;
64
+
65
+ // Effects
66
+ boxShadow(value: string): this;
67
+ opacity(value: string): this;
68
+ transition(value: string): this;
69
+
70
+ // Interaction
71
+ cursor(value: string): this;
72
+ }
73
+
74
+ // Utility functions that return StyleBuilders
75
+ // Display
76
+ function display(value: string): StyleBuilder;
77
+ function flex(value?: string): StyleBuilder;
78
+ function grid(): StyleBuilder;
79
+
80
+ // Colors
81
+ function bg(color: string): StyleBuilder;
82
+ function color(colorValue: string): StyleBuilder;
83
+ function accentColor(value: string): StyleBuilder;
84
+
85
+ // Typography
86
+ function fontSize(size: string): StyleBuilder;
87
+ function fontWeight(value: string): StyleBuilder;
88
+ function fontFamily(value: string): StyleBuilder;
89
+ function lineHeight(value: string): StyleBuilder;
90
+ function letterSpacing(value: string): StyleBuilder;
91
+ function textAlign(value: string): StyleBuilder;
92
+ function textDecoration(value: string): StyleBuilder;
93
+ function bold(): StyleBuilder;
94
+
95
+ // Layout
96
+ function position(value: string): StyleBuilder;
97
+ function padding(value: string): StyleBuilder;
98
+ function margin(value: string): StyleBuilder;
99
+ function width(value: string): StyleBuilder;
100
+ function height(value: string): StyleBuilder;
101
+ function minWidth(value: string): StyleBuilder;
102
+ function maxWidth(value: string): StyleBuilder;
103
+ function minHeight(value: string): StyleBuilder;
104
+
105
+ // Flexbox
106
+ function flexDirection(value: string): StyleBuilder;
107
+ function alignItems(value: string): StyleBuilder;
108
+ function justifyContent(value: string): StyleBuilder;
109
+ function center(): StyleBuilder;
110
+ function gap(value: string): StyleBuilder;
111
+
112
+ // Borders
113
+ function border(value: string): StyleBuilder;
114
+ function borderRadius(value: string): StyleBuilder;
115
+ function outline(value: string): StyleBuilder;
116
+
117
+ // Effects
118
+ function boxShadow(value: string): StyleBuilder;
119
+ function opacity(value: string): StyleBuilder;
120
+ function transition(value: string): StyleBuilder;
121
+
122
+ // Interaction
123
+ function cursor(value: string): StyleBuilder;
124
+ }
125
+
126
+ export {};
package/types/index.d.ts CHANGED
@@ -8,6 +8,7 @@ import "./features/when";
8
8
  import "./features/update";
9
9
  import "./features/on";
10
10
  import "./features/render";
11
+ import "./features/style";
11
12
 
12
13
  // Re-export on() helper for module-style consumers (import { on } from "nuclo")
13
14
  export function on<K extends keyof HTMLElementEventMap, TTagName extends ElementTagName = ElementTagName>(