nuclo 0.1.44 → 0.1.46

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.
@@ -1,10 +1,83 @@
1
1
  declare global {
2
+ // SVG attribute types that accept string values for all SVG properties
3
+ // This is needed because SVG DOM properties like 'width' are SVGAnimatedLength,
4
+ // but we set them as strings using setAttribute()
5
+ export type SVGAttributes = {
6
+ // Common SVG attributes
7
+ width?: string | number;
8
+ height?: string | number;
9
+ viewBox?: string;
10
+ fill?: string;
11
+ stroke?: string;
12
+ "stroke-width"?: string | number;
13
+ "stroke-linecap"?: "butt" | "round" | "square";
14
+ "stroke-linejoin"?: "miter" | "round" | "bevel";
15
+ "stroke-dasharray"?: string;
16
+ "stroke-dashoffset"?: string | number;
17
+ opacity?: string | number;
18
+ "fill-opacity"?: string | number;
19
+ "stroke-opacity"?: string | number;
20
+ transform?: string;
21
+ className?: string;
22
+ id?: string;
23
+
24
+ // Path attributes
25
+ d?: string;
26
+
27
+ // Circle/Ellipse attributes
28
+ cx?: string | number;
29
+ cy?: string | number;
30
+ r?: string | number;
31
+ rx?: string | number;
32
+ ry?: string | number;
33
+
34
+ // Line attributes
35
+ x1?: string | number;
36
+ y1?: string | number;
37
+ x2?: string | number;
38
+ y2?: string | number;
39
+
40
+ // Rect attributes
41
+ x?: string | number;
42
+ y?: string | number;
43
+
44
+ // Polygon/Polyline attributes
45
+ points?: string;
46
+
47
+ // Text attributes
48
+ "text-anchor"?: "start" | "middle" | "end";
49
+ "dominant-baseline"?: string;
50
+ "font-family"?: string;
51
+ "font-size"?: string | number;
52
+ "font-weight"?: string | number;
53
+
54
+ // Gradient attributes
55
+ offset?: string;
56
+ "stop-color"?: string;
57
+ "stop-opacity"?: string | number;
58
+
59
+ // Use element
60
+ href?: string;
61
+
62
+ // Filter attributes
63
+ filter?: string;
64
+
65
+ // Clipping and masking
66
+ "clip-path"?: string;
67
+ mask?: string;
68
+
69
+ // Allow any other string attributes
70
+ [key: string]: string | number | undefined;
71
+ };
72
+
2
73
  // SVG element modifier types
3
74
  export type SVGElementModifier<TTagName extends keyof SVGElementTagNameMap = keyof SVGElementTagNameMap> =
4
75
  | Primitive
5
76
  | (() => Primitive)
6
- | Partial<SVGElementTagNameMap[TTagName]>
7
- | SVGElementTagNameMap[TTagName];
77
+ | SVGAttributes
78
+ | SVGElementTagNameMap[TTagName]
79
+ | SVGElement // Allow any SVG element as a child
80
+ | ((parent?: any, index?: number) => SVGElement); // Allow SVG element builders as children
8
81
 
9
82
  export type SVGElementModifierFn<TTagName extends keyof SVGElementTagNameMap = keyof SVGElementTagNameMap> = (
10
83
  parent: SVGElementTagNameMap[TTagName],
@@ -57,7 +57,7 @@ declare global {
57
57
  export const svg: ExpandedSVGElementBuilder<"svg">;
58
58
  export const switch_svg: ExpandedSVGElementBuilder<"switch">;
59
59
  export const symbol: ExpandedSVGElementBuilder<"symbol">;
60
- export const text: ExpandedSVGElementBuilder<"text">;
60
+ export const text_svg: ExpandedSVGElementBuilder<"text">;
61
61
  export const textPath: ExpandedSVGElementBuilder<"textPath">;
62
62
  export const title_svg: ExpandedSVGElementBuilder<"title">;
63
63
  export const tspan: ExpandedSVGElementBuilder<"tspan">;