@tachui/modifiers 0.8.0-alpha
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/LICENSE +363 -0
- package/README.md +322 -0
- package/dist/allows-hit-testing-DscPrcOw.js +464 -0
- package/dist/allows-hit-testing-DscPrcOw.js.map +1 -0
- package/dist/appearance/background.d.ts +38 -0
- package/dist/appearance/background.d.ts.map +1 -0
- package/dist/appearance/border.d.ts +78 -0
- package/dist/appearance/border.d.ts.map +1 -0
- package/dist/appearance/clip-shape.d.ts +23 -0
- package/dist/appearance/clip-shape.d.ts.map +1 -0
- package/dist/appearance/clipped.d.ts +21 -0
- package/dist/appearance/clipped.d.ts.map +1 -0
- package/dist/appearance/foreground.d.ts +19 -0
- package/dist/appearance/foreground.d.ts.map +1 -0
- package/dist/appearance/index.d.ts +11 -0
- package/dist/appearance/index.d.ts.map +1 -0
- package/dist/appearance/index.js +34 -0
- package/dist/appearance/index.js.map +1 -0
- package/dist/attributes/aria.d.ts +101 -0
- package/dist/attributes/aria.d.ts.map +1 -0
- package/dist/attributes/css-properties.d.ts +229 -0
- package/dist/attributes/css-properties.d.ts.map +1 -0
- package/dist/attributes/html.d.ts +108 -0
- package/dist/attributes/html.d.ts.map +1 -0
- package/dist/attributes/index.d.ts +12 -0
- package/dist/attributes/index.d.ts.map +1 -0
- package/dist/base-CkGf4b9G.js +786 -0
- package/dist/base-CkGf4b9G.js.map +1 -0
- package/dist/base.d.ts +154 -0
- package/dist/base.d.ts.map +1 -0
- package/dist/base.js +842 -0
- package/dist/base.js.map +1 -0
- package/dist/basic/base.d.ts +147 -0
- package/dist/basic/base.d.ts.map +1 -0
- package/dist/basic/index.d.ts +9 -0
- package/dist/basic/index.d.ts.map +1 -0
- package/dist/basic/margin.d.ts +266 -0
- package/dist/basic/margin.d.ts.map +1 -0
- package/dist/basic/margin.js +160 -0
- package/dist/basic/margin.js.map +1 -0
- package/dist/basic/padding.d.ts +258 -0
- package/dist/basic/padding.d.ts.map +1 -0
- package/dist/basic/padding.js +155 -0
- package/dist/basic/padding.js.map +1 -0
- package/dist/basic/size.d.ts +113 -0
- package/dist/basic/size.d.ts.map +1 -0
- package/dist/basic/size.js +78 -0
- package/dist/basic/size.js.map +1 -0
- package/dist/clipped-CCW8gJqJ.js +282 -0
- package/dist/clipped-CCW8gJqJ.js.map +1 -0
- package/dist/css-CJEXRr6H.js +124 -0
- package/dist/css-CJEXRr6H.js.map +1 -0
- package/dist/elements/decorative.d.ts +109 -0
- package/dist/elements/decorative.d.ts.map +1 -0
- package/dist/elements/index.d.ts +6 -0
- package/dist/elements/index.d.ts.map +1 -0
- package/dist/elements/pseudo-elements.d.ts +145 -0
- package/dist/elements/pseudo-elements.d.ts.map +1 -0
- package/dist/font-3qM2Z97N.js +135 -0
- package/dist/font-3qM2Z97N.js.map +1 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +885 -0
- package/dist/index.js.map +1 -0
- package/dist/interaction/allows-hit-testing.d.ts +31 -0
- package/dist/interaction/allows-hit-testing.d.ts.map +1 -0
- package/dist/interaction/focusable.d.ts +33 -0
- package/dist/interaction/focusable.d.ts.map +1 -0
- package/dist/interaction/focused.d.ts +28 -0
- package/dist/interaction/focused.d.ts.map +1 -0
- package/dist/interaction/index.d.ts +11 -0
- package/dist/interaction/index.d.ts.map +1 -0
- package/dist/interaction/index.js +32 -0
- package/dist/interaction/index.js.map +1 -0
- package/dist/interaction/keyboard-shortcut.d.ts +30 -0
- package/dist/interaction/keyboard-shortcut.d.ts.map +1 -0
- package/dist/interaction/on-continuous-hover.d.ts +41 -0
- package/dist/interaction/on-continuous-hover.d.ts.map +1 -0
- package/dist/interaction/on-long-press-gesture.d.ts +26 -0
- package/dist/interaction/on-long-press-gesture.d.ts.map +1 -0
- package/dist/interaction/scroll.d.ts +143 -0
- package/dist/interaction/scroll.d.ts.map +1 -0
- package/dist/layout/aspect-ratio.d.ts +65 -0
- package/dist/layout/aspect-ratio.d.ts.map +1 -0
- package/dist/layout/fixed-size.d.ts +49 -0
- package/dist/layout/fixed-size.d.ts.map +1 -0
- package/dist/layout/flexbox.d.ts +253 -0
- package/dist/layout/flexbox.d.ts.map +1 -0
- package/dist/layout/index.d.ts +19 -0
- package/dist/layout/index.d.ts.map +1 -0
- package/dist/layout/index.js +30 -0
- package/dist/layout/index.js.map +1 -0
- package/dist/layout/offset.d.ts +44 -0
- package/dist/layout/offset.d.ts.map +1 -0
- package/dist/layout/overlay.d.ts +26 -0
- package/dist/layout/overlay.d.ts.map +1 -0
- package/dist/layout/position.d.ts +55 -0
- package/dist/layout/position.d.ts.map +1 -0
- package/dist/layout/scale-effect.d.ts +51 -0
- package/dist/layout/scale-effect.d.ts.map +1 -0
- package/dist/layout/z-index.d.ts +65 -0
- package/dist/layout/z-index.d.ts.map +1 -0
- package/dist/overlay-DDiSLprp.js +774 -0
- package/dist/overlay-DDiSLprp.js.map +1 -0
- package/dist/responsive/index.d.ts +10 -0
- package/dist/responsive/index.d.ts.map +1 -0
- package/dist/types.d.ts +598 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +5 -0
- package/dist/types.js.map +1 -0
- package/dist/typography/font.d.ts +24 -0
- package/dist/typography/font.d.ts.map +1 -0
- package/dist/typography/index.d.ts +9 -0
- package/dist/typography/index.d.ts.map +1 -0
- package/dist/typography/index.js +30 -0
- package/dist/typography/index.js.map +1 -0
- package/dist/typography/text.d.ts +70 -0
- package/dist/typography/text.d.ts.map +1 -0
- package/dist/typography/text.js +129 -0
- package/dist/typography/text.js.map +1 -0
- package/dist/typography/typography.d.ts +52 -0
- package/dist/typography/typography.d.ts.map +1 -0
- package/dist/utility/css.d.ts +86 -0
- package/dist/utility/css.d.ts.map +1 -0
- package/dist/utility/index.d.ts +6 -0
- package/dist/utility/index.d.ts.map +1 -0
- package/dist/utility/index.js +17 -0
- package/dist/utility/index.js.map +1 -0
- package/dist/utility/utility.d.ts +69 -0
- package/dist/utility/utility.d.ts.map +1 -0
- package/package.json +117 -0
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Aspect Ratio Modifier
|
|
3
|
+
*
|
|
4
|
+
* SwiftUI .aspectRatio() modifier for controlling element aspect ratios.
|
|
5
|
+
* Supports both explicit ratios and content mode (fit/fill).
|
|
6
|
+
*/
|
|
7
|
+
import type { DOMNode } from '@tachui/core/runtime/types';
|
|
8
|
+
import { BaseModifier } from '../basic/base';
|
|
9
|
+
import type { ModifierContext } from '@tachui/core/modifiers/types';
|
|
10
|
+
export type ContentMode = 'fit' | 'fill';
|
|
11
|
+
export interface AspectRatioOptions {
|
|
12
|
+
ratio?: number;
|
|
13
|
+
contentMode: ContentMode;
|
|
14
|
+
}
|
|
15
|
+
export declare class AspectRatioModifier extends BaseModifier<AspectRatioOptions> {
|
|
16
|
+
readonly type = "aspectRatio";
|
|
17
|
+
readonly priority = 20;
|
|
18
|
+
apply(_node: DOMNode, context: ModifierContext): DOMNode | undefined;
|
|
19
|
+
private applyAspectRatio;
|
|
20
|
+
private applyContentMode;
|
|
21
|
+
private isMediaElement;
|
|
22
|
+
/**
|
|
23
|
+
* Development mode validation
|
|
24
|
+
*/
|
|
25
|
+
private validateAspectRatio;
|
|
26
|
+
/**
|
|
27
|
+
* Get common aspect ratios
|
|
28
|
+
*/
|
|
29
|
+
static readonly COMMON_RATIOS: {
|
|
30
|
+
readonly square: 1;
|
|
31
|
+
readonly portrait: number;
|
|
32
|
+
readonly landscape: number;
|
|
33
|
+
readonly widescreen: number;
|
|
34
|
+
readonly ultrawide: number;
|
|
35
|
+
readonly golden: 1.618;
|
|
36
|
+
readonly photo: number;
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Create an aspect ratio modifier
|
|
41
|
+
*
|
|
42
|
+
* @param ratio - Aspect ratio (width/height). If undefined, maintains natural aspect ratio
|
|
43
|
+
* @param contentMode - How content should fit within the aspect ratio ('fit' or 'fill')
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```typescript
|
|
47
|
+
* // Square aspect ratio with fit content mode
|
|
48
|
+
* aspectRatio(1, 'fit')
|
|
49
|
+
*
|
|
50
|
+
* // 16:9 widescreen with fill
|
|
51
|
+
* aspectRatio(16/9, 'fill')
|
|
52
|
+
*
|
|
53
|
+
* // Use common ratio
|
|
54
|
+
* aspectRatio(AspectRatioModifier.COMMON_RATIOS.landscape, 'fit')
|
|
55
|
+
*
|
|
56
|
+
* // Content mode only (maintain natural ratio)
|
|
57
|
+
* aspectRatio(undefined, 'fill')
|
|
58
|
+
*
|
|
59
|
+
* // With reactive value
|
|
60
|
+
* const ratio = signal(1.5)
|
|
61
|
+
* aspectRatio(ratio, 'fit')
|
|
62
|
+
* ```
|
|
63
|
+
*/
|
|
64
|
+
export declare function aspectRatio(ratio?: number, contentMode?: ContentMode): AspectRatioModifier;
|
|
65
|
+
//# sourceMappingURL=aspect-ratio.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aspect-ratio.d.ts","sourceRoot":"","sources":["../../src/layout/aspect-ratio.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAC5C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAA;AAGnE,MAAM,MAAM,WAAW,GAAG,KAAK,GAAG,MAAM,CAAA;AAExC,MAAM,WAAW,kBAAkB;IACjC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,WAAW,EAAE,WAAW,CAAA;CACzB;AAED,qBAAa,mBAAoB,SAAQ,YAAY,CAAC,kBAAkB,CAAC;IACvE,QAAQ,CAAC,IAAI,iBAAgB;IAC7B,QAAQ,CAAC,QAAQ,MAAK;IAEtB,KAAK,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,eAAe,GAAG,OAAO,GAAG,SAAS;IAuCpE,OAAO,CAAC,gBAAgB;IAYxB,OAAO,CAAC,gBAAgB;IAuBxB,OAAO,CAAC,cAAc;IAKtB;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAmD3B;;OAEG;IACH,MAAM,CAAC,QAAQ,CAAC,aAAa;;;;;;;;MAQnB;CACX;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,WAAW,CACzB,KAAK,CAAC,EAAE,MAAM,EACd,WAAW,GAAE,WAAmB,GAC/B,mBAAmB,CAErB"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fixed Size Modifier
|
|
3
|
+
*
|
|
4
|
+
* SwiftUI .fixedSize() modifier for preventing elements from growing
|
|
5
|
+
* beyond their intrinsic content size in specified dimensions.
|
|
6
|
+
*/
|
|
7
|
+
import type { DOMNode } from '@tachui/core/runtime/types';
|
|
8
|
+
import { BaseModifier } from '../basic/base';
|
|
9
|
+
import type { ModifierContext } from '@tachui/core/modifiers/types';
|
|
10
|
+
export interface FixedSizeOptions {
|
|
11
|
+
horizontal: boolean;
|
|
12
|
+
vertical: boolean;
|
|
13
|
+
}
|
|
14
|
+
export declare class FixedSizeModifier extends BaseModifier<FixedSizeOptions> {
|
|
15
|
+
readonly type = "fixedSize";
|
|
16
|
+
readonly priority = 25;
|
|
17
|
+
apply(_node: DOMNode, context: ModifierContext): DOMNode | undefined;
|
|
18
|
+
private applyFixedSize;
|
|
19
|
+
private isTextElement;
|
|
20
|
+
private isFlexItem;
|
|
21
|
+
/**
|
|
22
|
+
* Development mode validation
|
|
23
|
+
*/
|
|
24
|
+
private validateFixedSize;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Create a fixed size modifier
|
|
28
|
+
*
|
|
29
|
+
* @param horizontal - Fix horizontal size to content (default: true)
|
|
30
|
+
* @param vertical - Fix vertical size to content (default: true)
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```typescript
|
|
34
|
+
* // Fix both dimensions (equivalent to intrinsic sizing)
|
|
35
|
+
* fixedSize()
|
|
36
|
+
* fixedSize(true, true)
|
|
37
|
+
*
|
|
38
|
+
* // Fix only horizontal (prevent text wrapping)
|
|
39
|
+
* fixedSize(true, false)
|
|
40
|
+
*
|
|
41
|
+
* // Fix only vertical (prevent height expansion)
|
|
42
|
+
* fixedSize(false, true)
|
|
43
|
+
*
|
|
44
|
+
* // No fixed sizing (no-op, but validates parameters)
|
|
45
|
+
* fixedSize(false, false)
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
48
|
+
export declare function fixedSize(horizontal?: boolean, vertical?: boolean): FixedSizeModifier;
|
|
49
|
+
//# sourceMappingURL=fixed-size.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fixed-size.d.ts","sourceRoot":"","sources":["../../src/layout/fixed-size.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAC5C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAA;AAEnE,MAAM,WAAW,gBAAgB;IAC/B,UAAU,EAAE,OAAO,CAAA;IACnB,QAAQ,EAAE,OAAO,CAAA;CAClB;AAED,qBAAa,iBAAkB,SAAQ,YAAY,CAAC,gBAAgB,CAAC;IACnE,QAAQ,CAAC,IAAI,eAAc;IAC3B,QAAQ,CAAC,QAAQ,MAAK;IAEtB,KAAK,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,eAAe,GAAG,OAAO,GAAG,SAAS;IAkBpE,OAAO,CAAC,cAAc;IAuCtB,OAAO,CAAC,aAAa;IAuBrB,OAAO,CAAC,UAAU;IAQlB;;OAEG;IACH,OAAO,CAAC,iBAAiB;CAyC1B;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,SAAS,CACvB,UAAU,GAAE,OAAc,EAC1B,QAAQ,GAAE,OAAc,GACvB,iBAAiB,CAEnB"}
|
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Flexbox Modifier - Best-in-class flexbox layout system
|
|
3
|
+
*
|
|
4
|
+
* Comprehensive interface for flexbox properties with full CSS Grid fallbacks,
|
|
5
|
+
* SwiftUI compatibility, reactive values, design system presets, and modern
|
|
6
|
+
* CSS features including container queries support.
|
|
7
|
+
*/
|
|
8
|
+
import type { DOMNode } from '@tachui/core/runtime/types';
|
|
9
|
+
import { BaseModifier } from '../basic/base';
|
|
10
|
+
import type { ModifierContext, ReactiveModifierProps } from '@tachui/core/modifiers/types';
|
|
11
|
+
export type FlexValue = number | string | `${number}px` | `${number}rem` | `${number}em` | `${number}%` | `${number}fr`;
|
|
12
|
+
export interface FlexboxOptions {
|
|
13
|
+
flexGrow?: number;
|
|
14
|
+
flexShrink?: number;
|
|
15
|
+
flexBasis?: FlexValue | 'auto' | 'content' | 'max-content' | 'min-content' | 'fit-content';
|
|
16
|
+
flex?: string | number | 'auto' | 'initial' | 'none';
|
|
17
|
+
justifyContent?: 'flex-start' | 'start' | 'flex-end' | 'end' | 'center' | 'space-between' | 'space-around' | 'space-evenly';
|
|
18
|
+
alignItems?: 'flex-start' | 'start' | 'flex-end' | 'end' | 'center' | 'stretch' | 'baseline' | 'first baseline' | 'last baseline';
|
|
19
|
+
alignContent?: 'flex-start' | 'start' | 'flex-end' | 'end' | 'center' | 'stretch' | 'space-between' | 'space-around' | 'space-evenly';
|
|
20
|
+
alignSelf?: 'auto' | 'flex-start' | 'start' | 'flex-end' | 'end' | 'center' | 'stretch' | 'baseline' | 'first baseline' | 'last baseline';
|
|
21
|
+
flexDirection?: 'row' | 'row-reverse' | 'column' | 'column-reverse';
|
|
22
|
+
flexWrap?: 'nowrap' | 'wrap' | 'wrap-reverse';
|
|
23
|
+
flexFlow?: string;
|
|
24
|
+
gap?: FlexValue;
|
|
25
|
+
rowGap?: FlexValue;
|
|
26
|
+
columnGap?: FlexValue;
|
|
27
|
+
display?: 'flex' | 'inline-flex';
|
|
28
|
+
placeItems?: string;
|
|
29
|
+
placeContent?: string;
|
|
30
|
+
placeSelf?: string;
|
|
31
|
+
}
|
|
32
|
+
export type ReactiveFlexboxOptions = ReactiveModifierProps<FlexboxOptions>;
|
|
33
|
+
export declare class FlexboxModifier extends BaseModifier<FlexboxOptions> {
|
|
34
|
+
readonly type = "flexbox";
|
|
35
|
+
readonly priority = 60;
|
|
36
|
+
constructor(options: ReactiveFlexboxOptions);
|
|
37
|
+
apply(_node: DOMNode, context: ModifierContext): DOMNode | undefined;
|
|
38
|
+
private computeFlexboxStyles;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Create a flexbox modifier with comprehensive layout control
|
|
42
|
+
*
|
|
43
|
+
* Best-in-class implementation with full type safety, modern CSS support,
|
|
44
|
+
* and enhanced performance optimizations.
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* ```typescript
|
|
48
|
+
* // Complete flexbox layout
|
|
49
|
+
* .flexbox({
|
|
50
|
+
* display: 'flex',
|
|
51
|
+
* flexDirection: 'column',
|
|
52
|
+
* justifyContent: 'center',
|
|
53
|
+
* alignItems: 'stretch',
|
|
54
|
+
* gap: 16
|
|
55
|
+
* })
|
|
56
|
+
*
|
|
57
|
+
* // Responsive flex container
|
|
58
|
+
* .flexbox({
|
|
59
|
+
* flex: 1,
|
|
60
|
+
* gap: '1rem',
|
|
61
|
+
* flexWrap: 'wrap'
|
|
62
|
+
* })
|
|
63
|
+
*
|
|
64
|
+
* // Modern CSS Grid alignment
|
|
65
|
+
* .flexbox({
|
|
66
|
+
* display: 'flex',
|
|
67
|
+
* placeItems: 'center',
|
|
68
|
+
* gap: '2vw'
|
|
69
|
+
* })
|
|
70
|
+
* ```
|
|
71
|
+
*/
|
|
72
|
+
export declare function flexbox(options: ReactiveFlexboxOptions): FlexboxModifier;
|
|
73
|
+
/**
|
|
74
|
+
* Convenience function for flex-grow
|
|
75
|
+
*
|
|
76
|
+
* @example
|
|
77
|
+
* ```typescript
|
|
78
|
+
* .flexGrow(1) // Grow to fill available space
|
|
79
|
+
* .flexGrow(0) // Don't grow
|
|
80
|
+
* ```
|
|
81
|
+
*/
|
|
82
|
+
export declare function flexGrow(value: number): FlexboxModifier;
|
|
83
|
+
/**
|
|
84
|
+
* Convenience function for flex-shrink
|
|
85
|
+
*
|
|
86
|
+
* @example
|
|
87
|
+
* ```typescript
|
|
88
|
+
* .flexShrink(1) // Allow shrinking
|
|
89
|
+
* .flexShrink(0) // Prevent shrinking
|
|
90
|
+
* ```
|
|
91
|
+
*/
|
|
92
|
+
export declare function flexShrink(value: number): FlexboxModifier;
|
|
93
|
+
/**
|
|
94
|
+
* Convenience function for flex-basis
|
|
95
|
+
*
|
|
96
|
+
* @example
|
|
97
|
+
* ```typescript
|
|
98
|
+
* .flexBasis('auto')
|
|
99
|
+
* .flexBasis(200)
|
|
100
|
+
* .flexBasis('50%')
|
|
101
|
+
* ```
|
|
102
|
+
*/
|
|
103
|
+
export declare function flexBasis(value: FlexboxOptions['flexBasis']): FlexboxModifier;
|
|
104
|
+
/**
|
|
105
|
+
* Convenience function for justify-content
|
|
106
|
+
*
|
|
107
|
+
* @example
|
|
108
|
+
* ```typescript
|
|
109
|
+
* .justifyContent('center')
|
|
110
|
+
* .justifyContent('space-between')
|
|
111
|
+
* ```
|
|
112
|
+
*/
|
|
113
|
+
export declare function justifyContent(value: FlexboxOptions['justifyContent']): FlexboxModifier;
|
|
114
|
+
/**
|
|
115
|
+
* Convenience function for align-items
|
|
116
|
+
*
|
|
117
|
+
* @example
|
|
118
|
+
* ```typescript
|
|
119
|
+
* .alignItems('center')
|
|
120
|
+
* .alignItems('stretch')
|
|
121
|
+
* ```
|
|
122
|
+
*/
|
|
123
|
+
export declare function alignItems(value: FlexboxOptions['alignItems']): FlexboxModifier;
|
|
124
|
+
/**
|
|
125
|
+
* Convenience function for align-self
|
|
126
|
+
*
|
|
127
|
+
* @example
|
|
128
|
+
* ```typescript
|
|
129
|
+
* .alignSelf('center')
|
|
130
|
+
* .alignSelf('stretch')
|
|
131
|
+
* ```
|
|
132
|
+
*/
|
|
133
|
+
export declare function alignSelf(value: FlexboxOptions['alignSelf']): FlexboxModifier;
|
|
134
|
+
/**
|
|
135
|
+
* Convenience function for gap
|
|
136
|
+
*
|
|
137
|
+
* @example
|
|
138
|
+
* ```typescript
|
|
139
|
+
* .gap(16)
|
|
140
|
+
* .gap('1rem')
|
|
141
|
+
* .gap('2vw')
|
|
142
|
+
* ```
|
|
143
|
+
*/
|
|
144
|
+
export declare function gap(value: FlexValue): FlexboxModifier;
|
|
145
|
+
/**
|
|
146
|
+
* Convenience function for flex-direction
|
|
147
|
+
*
|
|
148
|
+
* @example
|
|
149
|
+
* ```typescript
|
|
150
|
+
* .flexDirection('column')
|
|
151
|
+
* .flexDirection('row-reverse')
|
|
152
|
+
* ```
|
|
153
|
+
*/
|
|
154
|
+
export declare function flexDirection(value: FlexboxOptions['flexDirection']): FlexboxModifier;
|
|
155
|
+
/**
|
|
156
|
+
* Convenience function for flex-wrap
|
|
157
|
+
*
|
|
158
|
+
* @example
|
|
159
|
+
* ```typescript
|
|
160
|
+
* .flexWrap('wrap')
|
|
161
|
+
* .flexWrap('nowrap')
|
|
162
|
+
* ```
|
|
163
|
+
*/
|
|
164
|
+
export declare function flexWrap(value: FlexboxOptions['flexWrap']): FlexboxModifier;
|
|
165
|
+
/**
|
|
166
|
+
* Design system flexbox presets for consistent layouts
|
|
167
|
+
*
|
|
168
|
+
* Based on modern design system principles with semantic naming
|
|
169
|
+
* for common layout patterns and responsive design.
|
|
170
|
+
*/
|
|
171
|
+
export declare const flexboxPresets: {
|
|
172
|
+
/**
|
|
173
|
+
* Standard flex container
|
|
174
|
+
* Sets display: flex for basic flex container
|
|
175
|
+
*/
|
|
176
|
+
readonly container: () => FlexboxModifier;
|
|
177
|
+
/**
|
|
178
|
+
* Inline flex container
|
|
179
|
+
* Sets display: inline-flex for inline flex behavior
|
|
180
|
+
*/
|
|
181
|
+
readonly inline: () => FlexboxModifier;
|
|
182
|
+
/**
|
|
183
|
+
* Horizontal layout with center alignment
|
|
184
|
+
* Perfect for nav bars, button groups
|
|
185
|
+
*/
|
|
186
|
+
readonly hcenter: () => FlexboxModifier;
|
|
187
|
+
/**
|
|
188
|
+
* Vertical layout with center alignment
|
|
189
|
+
* Perfect for cards, modals, centered content
|
|
190
|
+
*/
|
|
191
|
+
readonly vcenter: () => FlexboxModifier;
|
|
192
|
+
/**
|
|
193
|
+
* Space between layout
|
|
194
|
+
* Common for headers, footers, navigation
|
|
195
|
+
*/
|
|
196
|
+
readonly spaceBetween: () => FlexboxModifier;
|
|
197
|
+
/**
|
|
198
|
+
* Space around layout
|
|
199
|
+
* For even distribution with edge spacing
|
|
200
|
+
*/
|
|
201
|
+
readonly spaceAround: () => FlexboxModifier;
|
|
202
|
+
/**
|
|
203
|
+
* Column stack with spacing
|
|
204
|
+
* For vertical component stacks
|
|
205
|
+
*/
|
|
206
|
+
readonly vstack: () => FlexboxModifier;
|
|
207
|
+
/**
|
|
208
|
+
* Row with spacing
|
|
209
|
+
* For horizontal component layouts
|
|
210
|
+
*/
|
|
211
|
+
readonly hstack: () => FlexboxModifier;
|
|
212
|
+
/**
|
|
213
|
+
* Card layout
|
|
214
|
+
* Column with internal spacing
|
|
215
|
+
*/
|
|
216
|
+
readonly card: () => FlexboxModifier;
|
|
217
|
+
/**
|
|
218
|
+
* Form layout
|
|
219
|
+
* Column with form-appropriate spacing
|
|
220
|
+
*/
|
|
221
|
+
readonly form: () => FlexboxModifier;
|
|
222
|
+
/**
|
|
223
|
+
* Button group
|
|
224
|
+
* Horizontal with tight spacing
|
|
225
|
+
*/
|
|
226
|
+
readonly buttonGroup: () => FlexboxModifier;
|
|
227
|
+
/**
|
|
228
|
+
* Sidebar layout
|
|
229
|
+
* Vertical with stretch alignment
|
|
230
|
+
*/
|
|
231
|
+
readonly sidebar: () => FlexboxModifier;
|
|
232
|
+
/**
|
|
233
|
+
* Responsive wrap
|
|
234
|
+
* Wrapping layout with gaps
|
|
235
|
+
*/
|
|
236
|
+
readonly wrap: () => FlexboxModifier;
|
|
237
|
+
/**
|
|
238
|
+
* Full flex item
|
|
239
|
+
* Grows and shrinks to fill space
|
|
240
|
+
*/
|
|
241
|
+
readonly fill: () => FlexboxModifier;
|
|
242
|
+
/**
|
|
243
|
+
* Fixed flex item
|
|
244
|
+
* Doesn't grow or shrink
|
|
245
|
+
*/
|
|
246
|
+
readonly fixed: () => FlexboxModifier;
|
|
247
|
+
/**
|
|
248
|
+
* Stretch alignment
|
|
249
|
+
* Items stretch to container height
|
|
250
|
+
*/
|
|
251
|
+
readonly stretch: () => FlexboxModifier;
|
|
252
|
+
};
|
|
253
|
+
//# sourceMappingURL=flexbox.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flexbox.d.ts","sourceRoot":"","sources":["../../src/layout/flexbox.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Layout and Positioning Modifiers
|
|
3
|
+
*
|
|
4
|
+
* Collection of modifiers for controlling element positioning, sizing, and transformations.
|
|
5
|
+
* These modifiers follow SwiftUI conventions while providing enhanced web-specific functionality.
|
|
6
|
+
*/
|
|
7
|
+
export * from './flexbox';
|
|
8
|
+
export * from './offset';
|
|
9
|
+
export * from './scale-effect';
|
|
10
|
+
export * from './aspect-ratio';
|
|
11
|
+
export * from './fixed-size';
|
|
12
|
+
export * from './position';
|
|
13
|
+
export * from './z-index';
|
|
14
|
+
export * from './overlay';
|
|
15
|
+
export type { ScaleAnchor } from './scale-effect';
|
|
16
|
+
export type { ContentMode } from './aspect-ratio';
|
|
17
|
+
export type { PositionValue } from './position';
|
|
18
|
+
export type { OverlayAlignment } from './overlay';
|
|
19
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/layout/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,cAAc,WAAW,CAAA;AAGzB,cAAc,UAAU,CAAA;AACxB,cAAc,gBAAgB,CAAA;AAG9B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,cAAc,CAAA;AAG5B,cAAc,YAAY,CAAA;AAC1B,cAAc,WAAW,CAAA;AAGzB,cAAc,WAAW,CAAA;AAGzB,YAAY,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AACjD,YAAY,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AACjD,YAAY,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAC/C,YAAY,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAA"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { A as a, m as i, F as f, O as o, q as r, P as t, S as l, Z as x, d, e as n, l as c, n as M, c as p, h as S, a as b, b as g, i as z, f as m, k as y, g as F, j as I, o as O, r as P, p as h, s as j, z as k } from "../overlay-DDiSLprp.js";
|
|
2
|
+
export {
|
|
3
|
+
a as AspectRatioModifier,
|
|
4
|
+
i as FixedSizeModifier,
|
|
5
|
+
f as FlexboxModifier,
|
|
6
|
+
o as OffsetModifier,
|
|
7
|
+
r as OverlayModifier,
|
|
8
|
+
t as PositionModifier,
|
|
9
|
+
l as ScaleEffectModifier,
|
|
10
|
+
x as ZIndexModifier,
|
|
11
|
+
d as alignItems,
|
|
12
|
+
n as alignSelf,
|
|
13
|
+
c as aspectRatio,
|
|
14
|
+
M as fixedSize,
|
|
15
|
+
p as flexBasis,
|
|
16
|
+
S as flexDirection,
|
|
17
|
+
b as flexGrow,
|
|
18
|
+
g as flexShrink,
|
|
19
|
+
z as flexWrap,
|
|
20
|
+
m as flexbox,
|
|
21
|
+
y as flexboxPresets,
|
|
22
|
+
F as gap,
|
|
23
|
+
I as justifyContent,
|
|
24
|
+
O as offset,
|
|
25
|
+
P as overlay,
|
|
26
|
+
h as position,
|
|
27
|
+
j as scaleEffect,
|
|
28
|
+
k as zIndex
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Offset Modifier
|
|
3
|
+
*
|
|
4
|
+
* SwiftUI .offset(x, y) modifier for translating elements with reactive support.
|
|
5
|
+
* Handles CSS transforms while preserving existing transformations.
|
|
6
|
+
*/
|
|
7
|
+
import type { DOMNode } from '@tachui/core/runtime/types';
|
|
8
|
+
import { BaseModifier } from '../basic/base';
|
|
9
|
+
import type { ModifierContext } from '@tachui/core/modifiers/types';
|
|
10
|
+
export interface OffsetOptions {
|
|
11
|
+
x: number;
|
|
12
|
+
y?: number;
|
|
13
|
+
}
|
|
14
|
+
export declare class OffsetModifier extends BaseModifier<OffsetOptions> {
|
|
15
|
+
readonly type = "offset";
|
|
16
|
+
readonly priority = 35;
|
|
17
|
+
apply(_node: DOMNode, context: ModifierContext): DOMNode | undefined;
|
|
18
|
+
private applyOffset;
|
|
19
|
+
/**
|
|
20
|
+
* Development mode validation
|
|
21
|
+
*/
|
|
22
|
+
private validateOffset;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Create an offset modifier
|
|
26
|
+
*
|
|
27
|
+
* @param x - Horizontal offset in pixels
|
|
28
|
+
* @param y - Vertical offset in pixels (optional, defaults to 0)
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```typescript
|
|
32
|
+
* // Move element 10px right and 5px down
|
|
33
|
+
* offset(10, 5)
|
|
34
|
+
*
|
|
35
|
+
* // Move element only horizontally
|
|
36
|
+
* offset(20)
|
|
37
|
+
*
|
|
38
|
+
* // With reactive values
|
|
39
|
+
* const xOffset = signal(0)
|
|
40
|
+
* offset(xOffset, -10)
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
export declare function offset(x: number, y?: number): OffsetModifier;
|
|
44
|
+
//# sourceMappingURL=offset.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"offset.d.ts","sourceRoot":"","sources":["../../src/layout/offset.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAC5C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAA;AAGnE,MAAM,WAAW,aAAa;IAC5B,CAAC,EAAE,MAAM,CAAA;IACT,CAAC,CAAC,EAAE,MAAM,CAAA;CACX;AAED,qBAAa,cAAe,SAAQ,YAAY,CAAC,aAAa,CAAC;IAC7D,QAAQ,CAAC,IAAI,YAAW;IACxB,QAAQ,CAAC,QAAQ,MAAK;IAEtB,KAAK,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,eAAe,GAAG,OAAO,GAAG,SAAS;IAqBpE,OAAO,CAAC,WAAW;IAmBnB;;OAEG;IACH,OAAO,CAAC,cAAc;CAiDvB;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,MAAM,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,MAAM,GAAG,cAAc,CAY5D"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Overlay Modifier
|
|
3
|
+
*
|
|
4
|
+
* SwiftUI-inspired modifier for overlaying content on top of another view
|
|
5
|
+
*/
|
|
6
|
+
import { BaseModifier } from '../base';
|
|
7
|
+
import type { ModifierContext } from '../types';
|
|
8
|
+
import type { DOMNode } from '@tachui/core/runtime/types';
|
|
9
|
+
export type OverlayAlignment = 'center' | 'top' | 'bottom' | 'leading' | 'trailing' | 'topLeading' | 'topTrailing' | 'bottomLeading' | 'bottomTrailing';
|
|
10
|
+
export interface OverlayOptions {
|
|
11
|
+
content: any;
|
|
12
|
+
alignment?: OverlayAlignment;
|
|
13
|
+
}
|
|
14
|
+
export declare class OverlayModifier extends BaseModifier<OverlayOptions> {
|
|
15
|
+
readonly type = "overlay";
|
|
16
|
+
readonly priority = 10;
|
|
17
|
+
apply(_node: DOMNode, context: ModifierContext): DOMNode | undefined;
|
|
18
|
+
private applyOverlay;
|
|
19
|
+
private renderContent;
|
|
20
|
+
private getOverlayAlignment;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Creates an overlay modifier that overlays content on top of the view
|
|
24
|
+
*/
|
|
25
|
+
export declare function overlay(content: any, alignment?: OverlayAlignment): OverlayModifier;
|
|
26
|
+
//# sourceMappingURL=overlay.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"overlay.d.ts","sourceRoot":"","sources":["../../src/layout/overlay.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AACtC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAC/C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAEzD,MAAM,MAAM,gBAAgB,GACxB,QAAQ,GACR,KAAK,GACL,QAAQ,GACR,SAAS,GACT,UAAU,GACV,YAAY,GACZ,aAAa,GACb,eAAe,GACf,gBAAgB,CAAA;AAEpB,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,GAAG,CAAA;IACZ,SAAS,CAAC,EAAE,gBAAgB,CAAA;CAC7B;AAED,qBAAa,eAAgB,SAAQ,YAAY,CAAC,cAAc,CAAC;IAC/D,QAAQ,CAAC,IAAI,aAAY;IACzB,QAAQ,CAAC,QAAQ,MAAK;IAEtB,KAAK,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,eAAe,GAAG,OAAO,GAAG,SAAS;IAcpE,OAAO,CAAC,YAAY;IA2BpB,OAAO,CAAC,aAAa;IAyBrB,OAAO,CAAC,mBAAmB;CAiD5B;AAED;;GAEG;AACH,wBAAgB,OAAO,CACrB,OAAO,EAAE,GAAG,EACZ,SAAS,GAAE,gBAA2B,GACrC,eAAe,CAEjB"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Position Modifier
|
|
3
|
+
*
|
|
4
|
+
* CSS position property modifier with enhanced validation and utilities.
|
|
5
|
+
*/
|
|
6
|
+
import type { DOMNode } from '@tachui/core/runtime/types';
|
|
7
|
+
import { BaseModifier } from '../basic/base';
|
|
8
|
+
import type { ModifierContext } from '@tachui/core/modifiers/types';
|
|
9
|
+
export type PositionValue = 'static' | 'relative' | 'absolute' | 'fixed' | 'sticky';
|
|
10
|
+
export interface PositionOptions {
|
|
11
|
+
position: PositionValue;
|
|
12
|
+
}
|
|
13
|
+
export declare class PositionModifier extends BaseModifier<PositionOptions> {
|
|
14
|
+
readonly type = "position";
|
|
15
|
+
readonly priority = 50;
|
|
16
|
+
apply(_node: DOMNode, context: ModifierContext): DOMNode | undefined;
|
|
17
|
+
private applyPosition;
|
|
18
|
+
private applyPositionOptimizations;
|
|
19
|
+
private warnIfMissingPositionedParent;
|
|
20
|
+
private warnIfMissingStickyProperties;
|
|
21
|
+
private warnIfHasPositioningProperties;
|
|
22
|
+
/**
|
|
23
|
+
* Development mode validation
|
|
24
|
+
*/
|
|
25
|
+
private validatePosition;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Create a position modifier
|
|
29
|
+
*
|
|
30
|
+
* @param value - CSS position value
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```typescript
|
|
34
|
+
* // Static positioning (default, removes positioning context)
|
|
35
|
+
* position('static')
|
|
36
|
+
*
|
|
37
|
+
* // Relative positioning (creates positioning context)
|
|
38
|
+
* position('relative')
|
|
39
|
+
*
|
|
40
|
+
* // Absolute positioning (positioned relative to nearest positioned parent)
|
|
41
|
+
* position('absolute')
|
|
42
|
+
*
|
|
43
|
+
* // Fixed positioning (positioned relative to viewport)
|
|
44
|
+
* position('fixed')
|
|
45
|
+
*
|
|
46
|
+
* // Sticky positioning (hybrid relative/fixed)
|
|
47
|
+
* position('sticky')
|
|
48
|
+
*
|
|
49
|
+
* // With reactive value
|
|
50
|
+
* const pos = signal('relative')
|
|
51
|
+
* position(pos)
|
|
52
|
+
* ```
|
|
53
|
+
*/
|
|
54
|
+
export declare function position(value: PositionValue): PositionModifier;
|
|
55
|
+
//# sourceMappingURL=position.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"position.d.ts","sourceRoot":"","sources":["../../src/layout/position.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAC5C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAA;AAGnE,MAAM,MAAM,aAAa,GACrB,QAAQ,GACR,UAAU,GACV,UAAU,GACV,OAAO,GACP,QAAQ,CAAA;AAEZ,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,aAAa,CAAA;CACxB;AAED,qBAAa,gBAAiB,SAAQ,YAAY,CAAC,eAAe,CAAC;IACjE,QAAQ,CAAC,IAAI,cAAa;IAC1B,QAAQ,CAAC,QAAQ,MAAK;IAEtB,KAAK,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,eAAe,GAAG,OAAO,GAAG,SAAS;IA2BpE,OAAO,CAAC,aAAa;IAOrB,OAAO,CAAC,0BAA0B;IA6ClC,OAAO,CAAC,6BAA6B;IAoBrC,OAAO,CAAC,6BAA6B;IAerC,OAAO,CAAC,8BAA8B;IAetC;;OAEG;IACH,OAAO,CAAC,gBAAgB;CAwCzB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,aAAa,GAAG,gBAAgB,CAE/D"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Scale Effect Modifier
|
|
3
|
+
*
|
|
4
|
+
* SwiftUI .scaleEffect() modifier for scaling elements with anchor support.
|
|
5
|
+
* Handles CSS transforms while preserving existing transformations.
|
|
6
|
+
*/
|
|
7
|
+
import type { DOMNode } from '@tachui/core/runtime/types';
|
|
8
|
+
import { BaseModifier } from '../basic/base';
|
|
9
|
+
import type { ModifierContext } from '@tachui/core/modifiers/types';
|
|
10
|
+
export type ScaleAnchor = 'center' | 'top' | 'topLeading' | 'topTrailing' | 'bottom' | 'bottomLeading' | 'bottomTrailing' | 'leading' | 'trailing';
|
|
11
|
+
export interface ScaleEffectOptions {
|
|
12
|
+
x: number;
|
|
13
|
+
y?: number;
|
|
14
|
+
anchor?: ScaleAnchor;
|
|
15
|
+
}
|
|
16
|
+
export declare class ScaleEffectModifier extends BaseModifier<ScaleEffectOptions> {
|
|
17
|
+
readonly type = "scaleEffect";
|
|
18
|
+
readonly priority = 35;
|
|
19
|
+
apply(_node: DOMNode, context: ModifierContext): DOMNode | undefined;
|
|
20
|
+
private applyScale;
|
|
21
|
+
private getTransformOrigin;
|
|
22
|
+
/**
|
|
23
|
+
* Development mode validation
|
|
24
|
+
*/
|
|
25
|
+
private validateScale;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Create a scale effect modifier
|
|
29
|
+
*
|
|
30
|
+
* @param x - Horizontal scale factor (1.0 = normal size)
|
|
31
|
+
* @param y - Vertical scale factor (optional, defaults to x for uniform scaling)
|
|
32
|
+
* @param anchor - Transform origin anchor point (default: 'center')
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```typescript
|
|
36
|
+
* // Scale to 150% uniformly
|
|
37
|
+
* scaleEffect(1.5)
|
|
38
|
+
*
|
|
39
|
+
* // Scale with different x/y values
|
|
40
|
+
* scaleEffect(2.0, 0.5)
|
|
41
|
+
*
|
|
42
|
+
* // Scale with custom anchor point
|
|
43
|
+
* scaleEffect(1.2, 1.2, 'topLeading')
|
|
44
|
+
*
|
|
45
|
+
* // With reactive values
|
|
46
|
+
* const scale = signal(1.0)
|
|
47
|
+
* scaleEffect(scale, undefined, 'center')
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
export declare function scaleEffect(x: number, y?: number, anchor?: ScaleAnchor): ScaleEffectModifier;
|
|
51
|
+
//# sourceMappingURL=scale-effect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scale-effect.d.ts","sourceRoot":"","sources":["../../src/layout/scale-effect.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAC5C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAA;AAGnE,MAAM,MAAM,WAAW,GACnB,QAAQ,GACR,KAAK,GACL,YAAY,GACZ,aAAa,GACb,QAAQ,GACR,eAAe,GACf,gBAAgB,GAChB,SAAS,GACT,UAAU,CAAA;AAEd,MAAM,WAAW,kBAAkB;IACjC,CAAC,EAAE,MAAM,CAAA;IACT,CAAC,CAAC,EAAE,MAAM,CAAA;IACV,MAAM,CAAC,EAAE,WAAW,CAAA;CACrB;AAED,qBAAa,mBAAoB,SAAQ,YAAY,CAAC,kBAAkB,CAAC;IACvE,QAAQ,CAAC,IAAI,iBAAgB;IAC7B,QAAQ,CAAC,QAAQ,MAAK;IAEtB,KAAK,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,eAAe,GAAG,OAAO,GAAG,SAAS;IAyCpE,OAAO,CAAC,UAAU;IAyBlB,OAAO,CAAC,kBAAkB;IAgB1B;;OAEG;IACH,OAAO,CAAC,aAAa;CAgEtB;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,WAAW,CACzB,CAAC,EAAE,MAAM,EACT,CAAC,CAAC,EAAE,MAAM,EACV,MAAM,GAAE,WAAsB,GAC7B,mBAAmB,CAErB"}
|