@takumi-rs/helpers 0.27.6 → 0.28.0
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/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as ContainerNode, P as PartialStyle, T as TextNode, I as ImageNode, S as Style, a as Color } from './types-
|
|
2
|
-
export { A as AnyNode, J as JsonValue, N as Node } from './types-
|
|
1
|
+
import { C as ContainerNode, P as PartialStyle, T as TextNode, I as ImageNode, S as Style, a as Color } from './types-8M7fRh4t.cjs';
|
|
2
|
+
export { A as AnyNode, J as JsonValue, N as Node } from './types-8M7fRh4t.cjs';
|
|
3
3
|
|
|
4
4
|
declare function container(props: Omit<ContainerNode, "type">): ContainerNode;
|
|
5
5
|
declare function text(text: string, style?: PartialStyle): TextNode;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as ContainerNode, P as PartialStyle, T as TextNode, I as ImageNode, S as Style, a as Color } from './types-
|
|
2
|
-
export { A as AnyNode, J as JsonValue, N as Node } from './types-
|
|
1
|
+
import { C as ContainerNode, P as PartialStyle, T as TextNode, I as ImageNode, S as Style, a as Color } from './types-8M7fRh4t.js';
|
|
2
|
+
export { A as AnyNode, J as JsonValue, N as Node } from './types-8M7fRh4t.js';
|
|
3
3
|
|
|
4
4
|
declare function container(props: Omit<ContainerNode, "type">): ContainerNode;
|
|
5
5
|
declare function text(text: string, style?: PartialStyle): TextNode;
|
package/dist/jsx/jsx.d.cts
CHANGED
package/dist/jsx/jsx.d.ts
CHANGED
|
@@ -32,6 +32,18 @@ type LengthUnit = "auto" | {
|
|
|
32
32
|
"vh": number;
|
|
33
33
|
} | {
|
|
34
34
|
"vw": number;
|
|
35
|
+
} | {
|
|
36
|
+
"cm": number;
|
|
37
|
+
} | {
|
|
38
|
+
"mm": number;
|
|
39
|
+
} | {
|
|
40
|
+
"in": number;
|
|
41
|
+
} | {
|
|
42
|
+
"Q": number;
|
|
43
|
+
} | {
|
|
44
|
+
"Pt": number;
|
|
45
|
+
} | {
|
|
46
|
+
"Pc": number;
|
|
35
47
|
} | number | string;
|
|
36
48
|
|
|
37
49
|
/**
|
|
@@ -51,7 +63,7 @@ type GradientStop = {
|
|
|
51
63
|
/**
|
|
52
64
|
* The position of the gradient stop.
|
|
53
65
|
*/
|
|
54
|
-
hint
|
|
66
|
+
hint?: StopPosition;
|
|
55
67
|
} | StopPosition;
|
|
56
68
|
|
|
57
69
|
/**
|
|
@@ -68,6 +80,38 @@ type LinearGradient = {
|
|
|
68
80
|
stops: Array<GradientStop>;
|
|
69
81
|
} | string;
|
|
70
82
|
|
|
83
|
+
/**
|
|
84
|
+
* Procedural noise gradient that generates organic, natural-looking patterns using fractal Brownian motion.
|
|
85
|
+
* This creates dynamic textures that can be used as backgrounds or overlays with customizable parameters
|
|
86
|
+
* for controlling the noise characteristics and visual appearance.
|
|
87
|
+
*/
|
|
88
|
+
type NoiseV1 = {
|
|
89
|
+
/**
|
|
90
|
+
* Controls the scale of the noise pattern. Higher values create finer, more detailed patterns
|
|
91
|
+
*/
|
|
92
|
+
frequency?: number;
|
|
93
|
+
/**
|
|
94
|
+
* Random seed value that determines the unique noise pattern generated
|
|
95
|
+
*/
|
|
96
|
+
seed?: number;
|
|
97
|
+
/**
|
|
98
|
+
* Number of noise layers combined to create complex patterns. More octaves add detail
|
|
99
|
+
*/
|
|
100
|
+
octaves?: number;
|
|
101
|
+
/**
|
|
102
|
+
* Controls how much each octave contributes to the final pattern. Lower values create smoother patterns
|
|
103
|
+
*/
|
|
104
|
+
persistence?: number;
|
|
105
|
+
/**
|
|
106
|
+
* Controls the frequency multiplier between octaves. Higher values create more varied patterns
|
|
107
|
+
*/
|
|
108
|
+
lacunarity?: number;
|
|
109
|
+
/**
|
|
110
|
+
* Controls the opacity of the noise pattern. 0.0 is fully transparent, 1.0 is fully opaque
|
|
111
|
+
*/
|
|
112
|
+
opacity?: number;
|
|
113
|
+
};
|
|
114
|
+
|
|
71
115
|
/**
|
|
72
116
|
* Supported shapes for radial gradients
|
|
73
117
|
*/
|
|
@@ -103,7 +147,7 @@ type RadialGradient = {
|
|
|
103
147
|
/**
|
|
104
148
|
* Background image variants supported by Takumi.
|
|
105
149
|
*/
|
|
106
|
-
type BackgroundImage = LinearGradient | RadialGradient;
|
|
150
|
+
type BackgroundImage = LinearGradient | RadialGradient | NoiseV1;
|
|
107
151
|
|
|
108
152
|
/**
|
|
109
153
|
* A collection of background images.
|
|
@@ -134,16 +178,7 @@ type PositionComponent = {
|
|
|
134
178
|
/**
|
|
135
179
|
* Parsed `background-position` value for one layer.
|
|
136
180
|
*/
|
|
137
|
-
type BackgroundPosition =
|
|
138
|
-
/**
|
|
139
|
-
* X-axis position component.
|
|
140
|
-
*/
|
|
141
|
-
x: PositionComponent;
|
|
142
|
-
/**
|
|
143
|
-
* Y-axis position component.
|
|
144
|
-
*/
|
|
145
|
-
y: PositionComponent;
|
|
146
|
-
};
|
|
181
|
+
type BackgroundPosition = [PositionComponent, PositionComponent] | string;
|
|
147
182
|
|
|
148
183
|
/**
|
|
149
184
|
* A list of `background-position` values (one per layer).
|
|
@@ -306,11 +341,11 @@ type GridLine = {
|
|
|
306
341
|
/**
|
|
307
342
|
* The start line placement
|
|
308
343
|
*/
|
|
309
|
-
start
|
|
344
|
+
start?: GridPlacement;
|
|
310
345
|
/**
|
|
311
346
|
* The end line placement
|
|
312
347
|
*/
|
|
313
|
-
end
|
|
348
|
+
end?: GridPlacement;
|
|
314
349
|
};
|
|
315
350
|
|
|
316
351
|
/**
|
|
@@ -363,7 +398,7 @@ type GridRepeatTrack = {
|
|
|
363
398
|
* The names for the final line after the last track within the repeat() clause
|
|
364
399
|
* Only set on the last track of the repeat fragment. For other tracks this is None.
|
|
365
400
|
*/
|
|
366
|
-
endNames
|
|
401
|
+
endNames?: Array<string>;
|
|
367
402
|
};
|
|
368
403
|
|
|
369
404
|
/**
|
|
@@ -407,11 +442,6 @@ type JustifyContent = "start" | "end" | "flex-start" | "flex-end" | "center" | "
|
|
|
407
442
|
*/
|
|
408
443
|
type LineHeight = number | string | LengthUnit;
|
|
409
444
|
|
|
410
|
-
/**
|
|
411
|
-
* Represents either a linear gradient or a solid color.
|
|
412
|
-
*/
|
|
413
|
-
type LinearGradientOrColor = LinearGradient | Color;
|
|
414
|
-
|
|
415
445
|
/**
|
|
416
446
|
* Defines how an image should be resized to fit its container.
|
|
417
447
|
*
|
|
@@ -429,7 +459,7 @@ type Position = "relative" | "absolute";
|
|
|
429
459
|
/**
|
|
430
460
|
* Represents the values for the four sides of a box (top, right, bottom, left).
|
|
431
461
|
*/
|
|
432
|
-
type Sides<T> =
|
|
462
|
+
type Sides<T> = string | [T, T, T, T] | [T, T] | T;
|
|
433
463
|
|
|
434
464
|
/**
|
|
435
465
|
* Text alignment options for text rendering.
|
|
@@ -455,6 +485,22 @@ type TextStyle = "normal" | "italic" | "oblique";
|
|
|
455
485
|
*/
|
|
456
486
|
type TextTransform = "none" | "uppercase" | "lowercase" | "capitalize";
|
|
457
487
|
|
|
488
|
+
/**
|
|
489
|
+
* Represents a single CSS transform operation
|
|
490
|
+
*/
|
|
491
|
+
type Transform = {
|
|
492
|
+
"translate": [LengthUnit, LengthUnit];
|
|
493
|
+
} | {
|
|
494
|
+
"scale": [number, number];
|
|
495
|
+
} | {
|
|
496
|
+
"rotate": Angle;
|
|
497
|
+
};
|
|
498
|
+
|
|
499
|
+
/**
|
|
500
|
+
* A collection of transform operations that can be applied together
|
|
501
|
+
*/
|
|
502
|
+
type Transforms = Array<Transform> | string;
|
|
503
|
+
|
|
458
504
|
/**
|
|
459
505
|
* Main styling structure that contains all layout and visual properties.
|
|
460
506
|
*/
|
|
@@ -591,6 +637,30 @@ type Style = {
|
|
|
591
637
|
* Positioning method (relative, absolute, etc.).
|
|
592
638
|
*/
|
|
593
639
|
position: Position;
|
|
640
|
+
/**
|
|
641
|
+
* Transform for the element.
|
|
642
|
+
*/
|
|
643
|
+
transform?: Transforms;
|
|
644
|
+
/**
|
|
645
|
+
* Transform origin for the element.
|
|
646
|
+
*/
|
|
647
|
+
transformOrigin?: BackgroundPosition;
|
|
648
|
+
/**
|
|
649
|
+
* Mask image for the element.
|
|
650
|
+
*/
|
|
651
|
+
maskImage?: BackgroundImages;
|
|
652
|
+
/**
|
|
653
|
+
* Mask size for the element.
|
|
654
|
+
*/
|
|
655
|
+
maskSize?: BackgroundSizes;
|
|
656
|
+
/**
|
|
657
|
+
* Mask position for the element.
|
|
658
|
+
*/
|
|
659
|
+
maskPosition?: BackgroundPositions;
|
|
660
|
+
/**
|
|
661
|
+
* Mask repeat for the element.
|
|
662
|
+
*/
|
|
663
|
+
maskRepeat?: BackgroundRepeats;
|
|
594
664
|
/**
|
|
595
665
|
* Spacing between rows and columns in flex or grid layouts.
|
|
596
666
|
*/
|
|
@@ -726,7 +796,7 @@ type Style = {
|
|
|
726
796
|
/**
|
|
727
797
|
* Text color for child text elements.
|
|
728
798
|
*/
|
|
729
|
-
color?:
|
|
799
|
+
color?: Color;
|
|
730
800
|
/**
|
|
731
801
|
* Font size for text rendering.
|
|
732
802
|
*/
|
|
@@ -32,6 +32,18 @@ type LengthUnit = "auto" | {
|
|
|
32
32
|
"vh": number;
|
|
33
33
|
} | {
|
|
34
34
|
"vw": number;
|
|
35
|
+
} | {
|
|
36
|
+
"cm": number;
|
|
37
|
+
} | {
|
|
38
|
+
"mm": number;
|
|
39
|
+
} | {
|
|
40
|
+
"in": number;
|
|
41
|
+
} | {
|
|
42
|
+
"Q": number;
|
|
43
|
+
} | {
|
|
44
|
+
"Pt": number;
|
|
45
|
+
} | {
|
|
46
|
+
"Pc": number;
|
|
35
47
|
} | number | string;
|
|
36
48
|
|
|
37
49
|
/**
|
|
@@ -51,7 +63,7 @@ type GradientStop = {
|
|
|
51
63
|
/**
|
|
52
64
|
* The position of the gradient stop.
|
|
53
65
|
*/
|
|
54
|
-
hint
|
|
66
|
+
hint?: StopPosition;
|
|
55
67
|
} | StopPosition;
|
|
56
68
|
|
|
57
69
|
/**
|
|
@@ -68,6 +80,38 @@ type LinearGradient = {
|
|
|
68
80
|
stops: Array<GradientStop>;
|
|
69
81
|
} | string;
|
|
70
82
|
|
|
83
|
+
/**
|
|
84
|
+
* Procedural noise gradient that generates organic, natural-looking patterns using fractal Brownian motion.
|
|
85
|
+
* This creates dynamic textures that can be used as backgrounds or overlays with customizable parameters
|
|
86
|
+
* for controlling the noise characteristics and visual appearance.
|
|
87
|
+
*/
|
|
88
|
+
type NoiseV1 = {
|
|
89
|
+
/**
|
|
90
|
+
* Controls the scale of the noise pattern. Higher values create finer, more detailed patterns
|
|
91
|
+
*/
|
|
92
|
+
frequency?: number;
|
|
93
|
+
/**
|
|
94
|
+
* Random seed value that determines the unique noise pattern generated
|
|
95
|
+
*/
|
|
96
|
+
seed?: number;
|
|
97
|
+
/**
|
|
98
|
+
* Number of noise layers combined to create complex patterns. More octaves add detail
|
|
99
|
+
*/
|
|
100
|
+
octaves?: number;
|
|
101
|
+
/**
|
|
102
|
+
* Controls how much each octave contributes to the final pattern. Lower values create smoother patterns
|
|
103
|
+
*/
|
|
104
|
+
persistence?: number;
|
|
105
|
+
/**
|
|
106
|
+
* Controls the frequency multiplier between octaves. Higher values create more varied patterns
|
|
107
|
+
*/
|
|
108
|
+
lacunarity?: number;
|
|
109
|
+
/**
|
|
110
|
+
* Controls the opacity of the noise pattern. 0.0 is fully transparent, 1.0 is fully opaque
|
|
111
|
+
*/
|
|
112
|
+
opacity?: number;
|
|
113
|
+
};
|
|
114
|
+
|
|
71
115
|
/**
|
|
72
116
|
* Supported shapes for radial gradients
|
|
73
117
|
*/
|
|
@@ -103,7 +147,7 @@ type RadialGradient = {
|
|
|
103
147
|
/**
|
|
104
148
|
* Background image variants supported by Takumi.
|
|
105
149
|
*/
|
|
106
|
-
type BackgroundImage = LinearGradient | RadialGradient;
|
|
150
|
+
type BackgroundImage = LinearGradient | RadialGradient | NoiseV1;
|
|
107
151
|
|
|
108
152
|
/**
|
|
109
153
|
* A collection of background images.
|
|
@@ -134,16 +178,7 @@ type PositionComponent = {
|
|
|
134
178
|
/**
|
|
135
179
|
* Parsed `background-position` value for one layer.
|
|
136
180
|
*/
|
|
137
|
-
type BackgroundPosition =
|
|
138
|
-
/**
|
|
139
|
-
* X-axis position component.
|
|
140
|
-
*/
|
|
141
|
-
x: PositionComponent;
|
|
142
|
-
/**
|
|
143
|
-
* Y-axis position component.
|
|
144
|
-
*/
|
|
145
|
-
y: PositionComponent;
|
|
146
|
-
};
|
|
181
|
+
type BackgroundPosition = [PositionComponent, PositionComponent] | string;
|
|
147
182
|
|
|
148
183
|
/**
|
|
149
184
|
* A list of `background-position` values (one per layer).
|
|
@@ -306,11 +341,11 @@ type GridLine = {
|
|
|
306
341
|
/**
|
|
307
342
|
* The start line placement
|
|
308
343
|
*/
|
|
309
|
-
start
|
|
344
|
+
start?: GridPlacement;
|
|
310
345
|
/**
|
|
311
346
|
* The end line placement
|
|
312
347
|
*/
|
|
313
|
-
end
|
|
348
|
+
end?: GridPlacement;
|
|
314
349
|
};
|
|
315
350
|
|
|
316
351
|
/**
|
|
@@ -363,7 +398,7 @@ type GridRepeatTrack = {
|
|
|
363
398
|
* The names for the final line after the last track within the repeat() clause
|
|
364
399
|
* Only set on the last track of the repeat fragment. For other tracks this is None.
|
|
365
400
|
*/
|
|
366
|
-
endNames
|
|
401
|
+
endNames?: Array<string>;
|
|
367
402
|
};
|
|
368
403
|
|
|
369
404
|
/**
|
|
@@ -407,11 +442,6 @@ type JustifyContent = "start" | "end" | "flex-start" | "flex-end" | "center" | "
|
|
|
407
442
|
*/
|
|
408
443
|
type LineHeight = number | string | LengthUnit;
|
|
409
444
|
|
|
410
|
-
/**
|
|
411
|
-
* Represents either a linear gradient or a solid color.
|
|
412
|
-
*/
|
|
413
|
-
type LinearGradientOrColor = LinearGradient | Color;
|
|
414
|
-
|
|
415
445
|
/**
|
|
416
446
|
* Defines how an image should be resized to fit its container.
|
|
417
447
|
*
|
|
@@ -429,7 +459,7 @@ type Position = "relative" | "absolute";
|
|
|
429
459
|
/**
|
|
430
460
|
* Represents the values for the four sides of a box (top, right, bottom, left).
|
|
431
461
|
*/
|
|
432
|
-
type Sides<T> =
|
|
462
|
+
type Sides<T> = string | [T, T, T, T] | [T, T] | T;
|
|
433
463
|
|
|
434
464
|
/**
|
|
435
465
|
* Text alignment options for text rendering.
|
|
@@ -455,6 +485,22 @@ type TextStyle = "normal" | "italic" | "oblique";
|
|
|
455
485
|
*/
|
|
456
486
|
type TextTransform = "none" | "uppercase" | "lowercase" | "capitalize";
|
|
457
487
|
|
|
488
|
+
/**
|
|
489
|
+
* Represents a single CSS transform operation
|
|
490
|
+
*/
|
|
491
|
+
type Transform = {
|
|
492
|
+
"translate": [LengthUnit, LengthUnit];
|
|
493
|
+
} | {
|
|
494
|
+
"scale": [number, number];
|
|
495
|
+
} | {
|
|
496
|
+
"rotate": Angle;
|
|
497
|
+
};
|
|
498
|
+
|
|
499
|
+
/**
|
|
500
|
+
* A collection of transform operations that can be applied together
|
|
501
|
+
*/
|
|
502
|
+
type Transforms = Array<Transform> | string;
|
|
503
|
+
|
|
458
504
|
/**
|
|
459
505
|
* Main styling structure that contains all layout and visual properties.
|
|
460
506
|
*/
|
|
@@ -591,6 +637,30 @@ type Style = {
|
|
|
591
637
|
* Positioning method (relative, absolute, etc.).
|
|
592
638
|
*/
|
|
593
639
|
position: Position;
|
|
640
|
+
/**
|
|
641
|
+
* Transform for the element.
|
|
642
|
+
*/
|
|
643
|
+
transform?: Transforms;
|
|
644
|
+
/**
|
|
645
|
+
* Transform origin for the element.
|
|
646
|
+
*/
|
|
647
|
+
transformOrigin?: BackgroundPosition;
|
|
648
|
+
/**
|
|
649
|
+
* Mask image for the element.
|
|
650
|
+
*/
|
|
651
|
+
maskImage?: BackgroundImages;
|
|
652
|
+
/**
|
|
653
|
+
* Mask size for the element.
|
|
654
|
+
*/
|
|
655
|
+
maskSize?: BackgroundSizes;
|
|
656
|
+
/**
|
|
657
|
+
* Mask position for the element.
|
|
658
|
+
*/
|
|
659
|
+
maskPosition?: BackgroundPositions;
|
|
660
|
+
/**
|
|
661
|
+
* Mask repeat for the element.
|
|
662
|
+
*/
|
|
663
|
+
maskRepeat?: BackgroundRepeats;
|
|
594
664
|
/**
|
|
595
665
|
* Spacing between rows and columns in flex or grid layouts.
|
|
596
666
|
*/
|
|
@@ -726,7 +796,7 @@ type Style = {
|
|
|
726
796
|
/**
|
|
727
797
|
* Text color for child text elements.
|
|
728
798
|
*/
|
|
729
|
-
color?:
|
|
799
|
+
color?: Color;
|
|
730
800
|
/**
|
|
731
801
|
* Font size for text rendering.
|
|
732
802
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@takumi-rs/helpers",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.28.0",
|
|
4
4
|
"author": {
|
|
5
5
|
"email": "me@kane.tw",
|
|
6
6
|
"name": "Kane Wang",
|
|
@@ -11,10 +11,10 @@
|
|
|
11
11
|
},
|
|
12
12
|
"devDependencies": {
|
|
13
13
|
"@types/bun": "catalog:",
|
|
14
|
-
"@types/react": "^19.1.
|
|
15
|
-
"@types/react-dom": "^19.1.
|
|
14
|
+
"@types/react": "^19.1.12",
|
|
15
|
+
"@types/react-dom": "^19.1.9",
|
|
16
16
|
"bun-plugin-dts": "^0.3.0",
|
|
17
|
-
"lucide-react": "^0.
|
|
17
|
+
"lucide-react": "^0.542.0",
|
|
18
18
|
"react": "^19.1.0",
|
|
19
19
|
"tsup": "^8.5.0",
|
|
20
20
|
"typescript": "catalog:"
|