nuclo 0.1.47 → 0.1.49
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/core/attributeManager.d.ts +1 -1
- package/dist/core/attributeManager.d.ts.map +1 -1
- package/dist/core/runtimeBootstrap.d.ts.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/nuclo.cjs +1 -1
- package/dist/nuclo.cjs.map +1 -1
- package/dist/nuclo.js +1 -1
- package/dist/nuclo.js.map +1 -1
- package/dist/nuclo.umd.js +1 -1
- package/dist/nuclo.umd.js.map +1 -1
- package/dist/style/index.d.ts +87 -1
- package/dist/style/index.d.ts.map +1 -1
- package/package.json +4 -4
- package/types/features/style.d.ts +133 -0
- package/types/index.d.ts +1 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/style/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/style/index.ts"],"names":[],"mappings":"AAkKA,cAAM,YAAY;IACjB,OAAO,CAAC,UAAU,CAAgB;IAClC,OAAO,CAAC,gBAAgB,CAAqE;IAG7F,aAAa,IAAI,MAAM,EAAE;IAKzB,mBAAmB,IAAI,KAAK,CAAC;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IAKpF,QAAQ,IAAI,MAAM;IAKlB,OAAO,CAAC,QAAQ;IAkBhB,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;IAK1C,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAKvB,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAK1B,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAK5B,OAAO,CAAC,KAAK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W,CAAC,KAAK,EAAE,MAAM,GAAG,YAAY,CAEvD;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,YAAY,CAEtD;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,YAAY,CAEtD;AAED,wBAAgB,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,YAAY,CAEnD;AAED,wBAAgB,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,YAAY,CAEnD"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nuclo",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.49",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/nuclo.cjs",
|
|
7
7
|
"module": "./dist/nuclo.js",
|
|
@@ -28,15 +28,15 @@
|
|
|
28
28
|
"@eslint/markdown": "^7.5.1",
|
|
29
29
|
"@rollup/plugin-terser": "^0.4.4",
|
|
30
30
|
"@rollup/plugin-typescript": "^12.3.0",
|
|
31
|
-
"@types/node": "^24.10.
|
|
31
|
+
"@types/node": "^24.10.1",
|
|
32
32
|
"@vitest/coverage-v8": "4.0.8",
|
|
33
33
|
"eslint": "^9.39.1",
|
|
34
34
|
"globals": "^16.5.0",
|
|
35
35
|
"jsdom": "^27.1.0",
|
|
36
|
-
"rollup": "^4.53.
|
|
36
|
+
"rollup": "^4.53.2",
|
|
37
37
|
"tslib": "^2.8.1",
|
|
38
38
|
"typescript": "^5.9.3",
|
|
39
|
-
"typescript-eslint": "^8.46.
|
|
39
|
+
"typescript-eslint": "^8.46.4",
|
|
40
40
|
"vitest": "^4.0.8"
|
|
41
41
|
},
|
|
42
42
|
"repository": {
|
|
@@ -0,0 +1,133 @@
|
|
|
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
|
+
* Supports two signatures:
|
|
13
|
+
* 1. cn(breakpointStyles) - Only breakpoint-specific styles
|
|
14
|
+
* 2. cn(defaultStyles, breakpointStyles) - Default styles + breakpoint overrides
|
|
15
|
+
*/
|
|
16
|
+
function createBreakpoints<T extends string>(
|
|
17
|
+
breakpoints: Record<T, string>
|
|
18
|
+
): {
|
|
19
|
+
(styles?: Partial<Record<T, StyleBuilder>>): { className: string } | string;
|
|
20
|
+
(defaultStyles: StyleBuilder, breakpointStyles?: Partial<Record<T, StyleBuilder>>): { className: string } | string;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Style builder class for chaining CSS properties
|
|
25
|
+
*/
|
|
26
|
+
class StyleBuilder {
|
|
27
|
+
getStyles(): Record<string, string>;
|
|
28
|
+
add(property: string, value: string): this;
|
|
29
|
+
|
|
30
|
+
// Display
|
|
31
|
+
display(value: string): this;
|
|
32
|
+
flex(value?: string): this;
|
|
33
|
+
grid(): this;
|
|
34
|
+
|
|
35
|
+
// Colors
|
|
36
|
+
bg(color: string): this;
|
|
37
|
+
color(color: string): this;
|
|
38
|
+
accentColor(value: string): this;
|
|
39
|
+
|
|
40
|
+
// Typography
|
|
41
|
+
fontSize(size: string): this;
|
|
42
|
+
fontWeight(value: string): this;
|
|
43
|
+
fontFamily(value: string): this;
|
|
44
|
+
lineHeight(value: string): this;
|
|
45
|
+
letterSpacing(value: string): this;
|
|
46
|
+
textAlign(value: string): this;
|
|
47
|
+
textDecoration(value: string): this;
|
|
48
|
+
bold(): this;
|
|
49
|
+
|
|
50
|
+
// Layout
|
|
51
|
+
position(value: string): this;
|
|
52
|
+
padding(value: string): this;
|
|
53
|
+
margin(value: string): this;
|
|
54
|
+
width(value: string): this;
|
|
55
|
+
height(value: string): this;
|
|
56
|
+
minWidth(value: string): this;
|
|
57
|
+
maxWidth(value: string): this;
|
|
58
|
+
minHeight(value: string): this;
|
|
59
|
+
|
|
60
|
+
// Flexbox
|
|
61
|
+
flexDirection(value: string): this;
|
|
62
|
+
alignItems(value: string): this;
|
|
63
|
+
justifyContent(value: string): this;
|
|
64
|
+
center(): this;
|
|
65
|
+
gap(value: string): this;
|
|
66
|
+
|
|
67
|
+
// Borders
|
|
68
|
+
border(value: string): this;
|
|
69
|
+
borderRadius(value: string): this;
|
|
70
|
+
outline(value: string): this;
|
|
71
|
+
|
|
72
|
+
// Effects
|
|
73
|
+
boxShadow(value: string): this;
|
|
74
|
+
opacity(value: string): this;
|
|
75
|
+
transition(value: string): this;
|
|
76
|
+
|
|
77
|
+
// Interaction
|
|
78
|
+
cursor(value: string): this;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// Utility functions that return StyleBuilders
|
|
82
|
+
// Display
|
|
83
|
+
function display(value: string): StyleBuilder;
|
|
84
|
+
function flex(value?: string): StyleBuilder;
|
|
85
|
+
function grid(): StyleBuilder;
|
|
86
|
+
|
|
87
|
+
// Colors
|
|
88
|
+
function bg(color: string): StyleBuilder;
|
|
89
|
+
function color(colorValue: string): StyleBuilder;
|
|
90
|
+
function accentColor(value: string): StyleBuilder;
|
|
91
|
+
|
|
92
|
+
// Typography
|
|
93
|
+
function fontSize(size: string): StyleBuilder;
|
|
94
|
+
function fontWeight(value: string): StyleBuilder;
|
|
95
|
+
function fontFamily(value: string): StyleBuilder;
|
|
96
|
+
function lineHeight(value: string): StyleBuilder;
|
|
97
|
+
function letterSpacing(value: string): StyleBuilder;
|
|
98
|
+
function textAlign(value: string): StyleBuilder;
|
|
99
|
+
function textDecoration(value: string): StyleBuilder;
|
|
100
|
+
function bold(): StyleBuilder;
|
|
101
|
+
|
|
102
|
+
// Layout
|
|
103
|
+
function position(value: string): StyleBuilder;
|
|
104
|
+
function padding(value: string): StyleBuilder;
|
|
105
|
+
function margin(value: string): StyleBuilder;
|
|
106
|
+
function width(value: string): StyleBuilder;
|
|
107
|
+
function height(value: string): StyleBuilder;
|
|
108
|
+
function minWidth(value: string): StyleBuilder;
|
|
109
|
+
function maxWidth(value: string): StyleBuilder;
|
|
110
|
+
function minHeight(value: string): StyleBuilder;
|
|
111
|
+
|
|
112
|
+
// Flexbox
|
|
113
|
+
function flexDirection(value: string): StyleBuilder;
|
|
114
|
+
function alignItems(value: string): StyleBuilder;
|
|
115
|
+
function justifyContent(value: string): StyleBuilder;
|
|
116
|
+
function center(): StyleBuilder;
|
|
117
|
+
function gap(value: string): StyleBuilder;
|
|
118
|
+
|
|
119
|
+
// Borders
|
|
120
|
+
function border(value: string): StyleBuilder;
|
|
121
|
+
function borderRadius(value: string): StyleBuilder;
|
|
122
|
+
function outline(value: string): StyleBuilder;
|
|
123
|
+
|
|
124
|
+
// Effects
|
|
125
|
+
function boxShadow(value: string): StyleBuilder;
|
|
126
|
+
function opacity(value: string): StyleBuilder;
|
|
127
|
+
function transition(value: string): StyleBuilder;
|
|
128
|
+
|
|
129
|
+
// Interaction
|
|
130
|
+
function cursor(value: string): StyleBuilder;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
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>(
|