flexium 0.8.14
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/README.md +219 -0
- package/dist/DrawText-CeXBL8Ev.d.ts +309 -0
- package/dist/DrawText-JB58mpQT.d.cts +309 -0
- package/dist/Motion-BrOAJzgH.d.cts +87 -0
- package/dist/Motion-BrOAJzgH.d.ts +87 -0
- package/dist/advanced.d.cts +30 -0
- package/dist/advanced.d.ts +30 -0
- package/dist/advanced.js +2 -0
- package/dist/advanced.js.map +1 -0
- package/dist/advanced.mjs +2 -0
- package/dist/advanced.mjs.map +1 -0
- package/dist/canvas.d.cts +22 -0
- package/dist/canvas.d.ts +22 -0
- package/dist/canvas.js +2 -0
- package/dist/canvas.js.map +1 -0
- package/dist/canvas.mjs +2 -0
- package/dist/canvas.mjs.map +1 -0
- package/dist/chunk-2MVKTSFR.mjs +3 -0
- package/dist/chunk-2MVKTSFR.mjs.map +1 -0
- package/dist/chunk-2U4DW375.mjs +2 -0
- package/dist/chunk-2U4DW375.mjs.map +1 -0
- package/dist/chunk-3P6DMEGB.js +2 -0
- package/dist/chunk-3P6DMEGB.js.map +1 -0
- package/dist/chunk-5S3ZQ2LB.mjs +3 -0
- package/dist/chunk-5S3ZQ2LB.mjs.map +1 -0
- package/dist/chunk-CNY6FPKJ.js +2 -0
- package/dist/chunk-CNY6FPKJ.js.map +1 -0
- package/dist/chunk-CZYIK6FD.mjs +2 -0
- package/dist/chunk-CZYIK6FD.mjs.map +1 -0
- package/dist/chunk-DOGIWSDA.js +2 -0
- package/dist/chunk-DOGIWSDA.js.map +1 -0
- package/dist/chunk-EX2GURH5.mjs +3 -0
- package/dist/chunk-EX2GURH5.mjs.map +1 -0
- package/dist/chunk-GDBJ322I.js +2 -0
- package/dist/chunk-GDBJ322I.js.map +1 -0
- package/dist/chunk-I7UCVARB.js +2 -0
- package/dist/chunk-I7UCVARB.js.map +1 -0
- package/dist/chunk-KNF5ERPK.mjs +2 -0
- package/dist/chunk-KNF5ERPK.mjs.map +1 -0
- package/dist/chunk-MLZTCKTH.mjs +2 -0
- package/dist/chunk-MLZTCKTH.mjs.map +1 -0
- package/dist/chunk-OPAQ4R4M.mjs +2 -0
- package/dist/chunk-OPAQ4R4M.mjs.map +1 -0
- package/dist/chunk-Q7IWDVJ4.js +2 -0
- package/dist/chunk-Q7IWDVJ4.js.map +1 -0
- package/dist/chunk-R5CS7UZG.mjs +2 -0
- package/dist/chunk-R5CS7UZG.mjs.map +1 -0
- package/dist/chunk-REETNY2Z.js +3 -0
- package/dist/chunk-REETNY2Z.js.map +1 -0
- package/dist/chunk-ROYFUJN5.js +3 -0
- package/dist/chunk-ROYFUJN5.js.map +1 -0
- package/dist/chunk-U6C6VDVZ.js +2 -0
- package/dist/chunk-U6C6VDVZ.js.map +1 -0
- package/dist/chunk-V4K6WOXN.js +3 -0
- package/dist/chunk-V4K6WOXN.js.map +1 -0
- package/dist/chunk-WQFQO5LK.js +2 -0
- package/dist/chunk-WQFQO5LK.js.map +1 -0
- package/dist/chunk-WVEJT7HD.mjs +2 -0
- package/dist/chunk-WVEJT7HD.mjs.map +1 -0
- package/dist/chunk-ZNPYN2TZ.mjs +2 -0
- package/dist/chunk-ZNPYN2TZ.mjs.map +1 -0
- package/dist/core.d.cts +24 -0
- package/dist/core.d.ts +24 -0
- package/dist/core.js +2 -0
- package/dist/core.js.map +1 -0
- package/dist/core.mjs +2 -0
- package/dist/core.mjs.map +1 -0
- package/dist/dom.d.cts +36 -0
- package/dist/dom.d.ts +36 -0
- package/dist/dom.js +2 -0
- package/dist/dom.js.map +1 -0
- package/dist/dom.mjs +2 -0
- package/dist/dom.mjs.map +1 -0
- package/dist/index.d.cts +26 -0
- package/dist/index.d.ts +26 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +2 -0
- package/dist/index.mjs.map +1 -0
- package/dist/interactive.d.cts +161 -0
- package/dist/interactive.d.ts +161 -0
- package/dist/interactive.js +2 -0
- package/dist/interactive.js.map +1 -0
- package/dist/interactive.mjs +2 -0
- package/dist/interactive.mjs.map +1 -0
- package/dist/jsx-dev-runtime.d.cts +2 -0
- package/dist/jsx-dev-runtime.d.ts +2 -0
- package/dist/jsx-dev-runtime.js +2 -0
- package/dist/jsx-dev-runtime.js.map +1 -0
- package/dist/jsx-dev-runtime.mjs +2 -0
- package/dist/jsx-dev-runtime.mjs.map +1 -0
- package/dist/jsx-runtime.d.cts +78 -0
- package/dist/jsx-runtime.d.ts +78 -0
- package/dist/jsx-runtime.js +2 -0
- package/dist/jsx-runtime.js.map +1 -0
- package/dist/jsx-runtime.mjs +2 -0
- package/dist/jsx-runtime.mjs.map +1 -0
- package/dist/metafile-cjs.json +1 -0
- package/dist/metafile-esm.json +1 -0
- package/dist/portal-BpcIlK9y.d.cts +206 -0
- package/dist/portal-DBwz7gD0.d.ts +206 -0
- package/dist/primitives/layout.d.cts +295 -0
- package/dist/primitives/layout.d.ts +295 -0
- package/dist/primitives/layout.js +2 -0
- package/dist/primitives/layout.js.map +1 -0
- package/dist/primitives/layout.mjs +2 -0
- package/dist/primitives/layout.mjs.map +1 -0
- package/dist/primitives/motion.d.cts +230 -0
- package/dist/primitives/motion.d.ts +230 -0
- package/dist/primitives/motion.js +2 -0
- package/dist/primitives/motion.js.map +1 -0
- package/dist/primitives/motion.mjs +2 -0
- package/dist/primitives/motion.mjs.map +1 -0
- package/dist/primitives/ui.d.cts +81 -0
- package/dist/primitives/ui.d.ts +81 -0
- package/dist/primitives/ui.js +2 -0
- package/dist/primitives/ui.js.map +1 -0
- package/dist/primitives/ui.mjs +2 -0
- package/dist/primitives/ui.mjs.map +1 -0
- package/dist/primitives.d.cts +92 -0
- package/dist/primitives.d.ts +92 -0
- package/dist/primitives.js +2 -0
- package/dist/primitives.js.map +1 -0
- package/dist/primitives.mjs +2 -0
- package/dist/primitives.mjs.map +1 -0
- package/dist/renderer-DSLb-FGg.d.cts +135 -0
- package/dist/renderer-DSLb-FGg.d.ts +135 -0
- package/dist/router.d.cts +126 -0
- package/dist/router.d.ts +126 -0
- package/dist/router.js +2 -0
- package/dist/router.js.map +1 -0
- package/dist/router.mjs +2 -0
- package/dist/router.mjs.map +1 -0
- package/dist/server.d.cts +3 -0
- package/dist/server.d.ts +3 -0
- package/dist/server.js +2 -0
- package/dist/server.js.map +1 -0
- package/dist/server.mjs +2 -0
- package/dist/server.mjs.map +1 -0
- package/dist/signal-PWBIM6JV.mjs +2 -0
- package/dist/signal-PWBIM6JV.mjs.map +1 -0
- package/dist/signal-XZXQ4VYQ.js +2 -0
- package/dist/signal-XZXQ4VYQ.js.map +1 -0
- package/dist/signal-mNtlF8-v.d.cts +158 -0
- package/dist/signal-mNtlF8-v.d.ts +158 -0
- package/dist/state-kK9sQh9s.d.cts +73 -0
- package/dist/state-kK9sQh9s.d.ts +73 -0
- package/dist/test-exports.d.cts +17 -0
- package/dist/test-exports.d.ts +17 -0
- package/dist/test-exports.js +2 -0
- package/dist/test-exports.js.map +1 -0
- package/dist/test-exports.mjs +2 -0
- package/dist/test-exports.mjs.map +1 -0
- package/package.json +173 -0
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
import { R as Renderer, E as EventHandler, F as FNode } from './renderer-DSLb-FGg.js';
|
|
2
|
+
import { S as Signal, C as Computed } from './signal-mNtlF8-v.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* DOM Renderer implementation
|
|
6
|
+
*/
|
|
7
|
+
declare class DOMRenderer implements Renderer {
|
|
8
|
+
createNode(type: string, props: Record<string, any>): HTMLElement | SVGElement;
|
|
9
|
+
updateNode(node: HTMLElement | SVGElement, oldProps: Record<string, any>, newProps: Record<string, any>): void;
|
|
10
|
+
appendChild(parent: Node, child: Node): void;
|
|
11
|
+
insertBefore(parent: Node, child: Node, beforeChild: Node | null): void;
|
|
12
|
+
nextSibling(node: Node): Node | null;
|
|
13
|
+
removeChild(parent: Node, child: Node): void;
|
|
14
|
+
createTextNode(text: string): Text;
|
|
15
|
+
updateTextNode(node: Text, text: string): void;
|
|
16
|
+
addEventListener(node: Node, event: string, handler: EventHandler): void;
|
|
17
|
+
removeEventListener(node: Node, event: string, _handler: EventHandler): void;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Default DOM renderer instance
|
|
21
|
+
*/
|
|
22
|
+
declare const domRenderer: DOMRenderer;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* JSX Factory Function (f)
|
|
26
|
+
*
|
|
27
|
+
* This module provides the JSX factory function for creating Flexium nodes.
|
|
28
|
+
* It's used by the JSX transpiler to convert JSX syntax into function calls.
|
|
29
|
+
*
|
|
30
|
+
* Usage in tsconfig.json:
|
|
31
|
+
* {
|
|
32
|
+
* "compilerOptions": {
|
|
33
|
+
* "jsx": "react",
|
|
34
|
+
* "jsxFactory": "f",
|
|
35
|
+
* "jsxFragmentFactory": "Fragment"
|
|
36
|
+
* }
|
|
37
|
+
* }
|
|
38
|
+
*/
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* JSX factory function for Flexium
|
|
42
|
+
* Creates a Flexium node from JSX syntax
|
|
43
|
+
*
|
|
44
|
+
* @param type - Element type (string for built-in, function for components)
|
|
45
|
+
* @param props - Element properties
|
|
46
|
+
* @param children - Child elements
|
|
47
|
+
* @returns Flexium node
|
|
48
|
+
*/
|
|
49
|
+
declare function f(type: string | Function, props: Record<string, any> | null, ...children: any[]): FNode;
|
|
50
|
+
/**
|
|
51
|
+
* Fragment component
|
|
52
|
+
* Renders children without a wrapper element
|
|
53
|
+
*/
|
|
54
|
+
declare function Fragment(props: {
|
|
55
|
+
children?: any[];
|
|
56
|
+
}): FNode;
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* DOM Render Function
|
|
60
|
+
*
|
|
61
|
+
* This module provides the main render function for mounting components to the DOM.
|
|
62
|
+
* It includes simple reconciliation logic for mounting and unmounting components.
|
|
63
|
+
*
|
|
64
|
+
* Note: This module uses reactive rendering internally via mountReactive.
|
|
65
|
+
* For root-level rendering with cleanup support, use createReactiveRoot.
|
|
66
|
+
*/
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Render a component to a DOM container with automatic reactivity
|
|
70
|
+
*
|
|
71
|
+
* This function uses reactive rendering by default, which means:
|
|
72
|
+
* - Signals passed as children automatically update the DOM
|
|
73
|
+
* - Signals in props automatically update element properties
|
|
74
|
+
* - Component functions automatically re-render when signals change
|
|
75
|
+
*
|
|
76
|
+
* @param vnode - Flexium node to render
|
|
77
|
+
* @returns The rendered DOM node
|
|
78
|
+
*
|
|
79
|
+
* @example
|
|
80
|
+
* const count = signal(0);
|
|
81
|
+
* render(f('div', {}, [count]), document.body);
|
|
82
|
+
* // The div will automatically update when count changes
|
|
83
|
+
*/
|
|
84
|
+
/**
|
|
85
|
+
* Mounts a Flexium node to a container
|
|
86
|
+
* @param node - Flexium node to render
|
|
87
|
+
* @param container - DOM element to mount to
|
|
88
|
+
*/
|
|
89
|
+
declare function render(node: FNode | string | number | null | undefined | Function, container: HTMLElement): Node | null;
|
|
90
|
+
/**
|
|
91
|
+
* Create a root for rendering with automatic reactivity
|
|
92
|
+
*
|
|
93
|
+
* This creates a root that supports fine-grained reactive updates.
|
|
94
|
+
* Signals are automatically tracked and only the affected DOM nodes are updated.
|
|
95
|
+
*
|
|
96
|
+
* @param container - DOM element to render into
|
|
97
|
+
* @returns Root object with render and unmount methods
|
|
98
|
+
*
|
|
99
|
+
* @example
|
|
100
|
+
* const root = createRoot(document.body);
|
|
101
|
+
* const count = signal(0);
|
|
102
|
+
* root.render(f('div', {}, [count]));
|
|
103
|
+
* // Later: count.value++ will automatically update the DOM
|
|
104
|
+
*/
|
|
105
|
+
declare function createRoot(container: HTMLElement): {
|
|
106
|
+
render(node: FNode): void;
|
|
107
|
+
unmount(): void;
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Getter function that returns the current value (signal-like)
|
|
112
|
+
*/
|
|
113
|
+
type ItemsGetter<T> = () => T[];
|
|
114
|
+
/**
|
|
115
|
+
* Fixed-height item configuration
|
|
116
|
+
*/
|
|
117
|
+
interface FixedSizeConfig {
|
|
118
|
+
mode: 'fixed';
|
|
119
|
+
itemHeight: number;
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Variable-height item configuration
|
|
123
|
+
*/
|
|
124
|
+
interface VariableSizeConfig {
|
|
125
|
+
mode: 'variable';
|
|
126
|
+
estimatedItemHeight: number;
|
|
127
|
+
getItemHeight?: (index: number, item: unknown) => number;
|
|
128
|
+
}
|
|
129
|
+
type SizeConfig = FixedSizeConfig | VariableSizeConfig;
|
|
130
|
+
/**
|
|
131
|
+
* List component marker
|
|
132
|
+
*/
|
|
133
|
+
interface ListComponent<T> {
|
|
134
|
+
[key: symbol]: true;
|
|
135
|
+
each: ItemsGetter<T>;
|
|
136
|
+
renderItem: (item: T, index: () => number) => FNode;
|
|
137
|
+
virtual: boolean;
|
|
138
|
+
height?: number | string;
|
|
139
|
+
width?: number | string;
|
|
140
|
+
itemSize?: number | SizeConfig;
|
|
141
|
+
overscan: number;
|
|
142
|
+
getKey?: (item: T, index: number) => string | number;
|
|
143
|
+
onScroll?: (scrollTop: number) => void;
|
|
144
|
+
onVisibleRangeChange?: (startIndex: number, endIndex: number) => void;
|
|
145
|
+
class?: string;
|
|
146
|
+
style?: Record<string, string | number>;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Reactive DOM Rendering
|
|
151
|
+
*
|
|
152
|
+
* Integrates the signal system with the DOM renderer to enable fine-grained
|
|
153
|
+
* reactive updates. Only the specific DOM nodes that depend on changed signals
|
|
154
|
+
* will be updated, without re-rendering the entire component tree.
|
|
155
|
+
*/
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* Mount a virtual node reactively to the DOM.
|
|
159
|
+
*
|
|
160
|
+
* This is the core rendering function that handles all node types:
|
|
161
|
+
* - FNodes (both built-in elements and function components)
|
|
162
|
+
* - Strings and numbers (text nodes)
|
|
163
|
+
* - Signals and computed values (reactive children)
|
|
164
|
+
* - StateValues from the state() API
|
|
165
|
+
* - ListComponents
|
|
166
|
+
* - Arrays and fragments
|
|
167
|
+
*
|
|
168
|
+
* Reactive values are automatically tracked and DOM updates occur
|
|
169
|
+
* only when the specific values change (fine-grained reactivity).
|
|
170
|
+
*
|
|
171
|
+
* @param vnode - The virtual node to mount
|
|
172
|
+
* @param container - Optional parent node to append to
|
|
173
|
+
* @returns The created DOM node, or null for empty/boolean values
|
|
174
|
+
*
|
|
175
|
+
* @example
|
|
176
|
+
* ```tsx
|
|
177
|
+
* // Mount a simple element
|
|
178
|
+
* const node = mountReactive(<div>Hello</div>, document.body)
|
|
179
|
+
*
|
|
180
|
+
* // Mount a reactive signal
|
|
181
|
+
* const count = signal(0)
|
|
182
|
+
* mountReactive(() => <span>{count.value}</span>, container)
|
|
183
|
+
* ```
|
|
184
|
+
*/
|
|
185
|
+
declare function mountReactive(node: FNode | string | number | boolean | Signal<any> | Computed<any> | null | undefined | Function | any[] | ListComponent<any>, container?: Node): Node | null;
|
|
186
|
+
declare function createReactiveRoot(container: HTMLElement): {
|
|
187
|
+
render(node: FNode): void;
|
|
188
|
+
unmount(): void;
|
|
189
|
+
};
|
|
190
|
+
|
|
191
|
+
interface PortalProps {
|
|
192
|
+
mount?: HTMLElement;
|
|
193
|
+
children: any;
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* <Portal> component renders its children into a different part of the DOM.
|
|
197
|
+
* Useful for modals, tooltips, etc.
|
|
198
|
+
*
|
|
199
|
+
* @example
|
|
200
|
+
* <Portal mount={document.body}>
|
|
201
|
+
* <div class="modal">...</div>
|
|
202
|
+
* </Portal>
|
|
203
|
+
*/
|
|
204
|
+
declare function Portal(props: PortalProps): Comment | null;
|
|
205
|
+
|
|
206
|
+
export { DOMRenderer as D, Fragment as F, type ListComponent as L, Portal as P, createReactiveRoot as a, createRoot as c, domRenderer as d, f, mountReactive as m, render as r };
|
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
import { F as FNode } from '../renderer-DSLb-FGg.cjs';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Layout Primitives Types
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Responsive value type supporting base and breakpoint-specific values
|
|
8
|
+
*/
|
|
9
|
+
type ResponsiveValue<T> = T | {
|
|
10
|
+
base?: T;
|
|
11
|
+
sm?: T;
|
|
12
|
+
md?: T;
|
|
13
|
+
lg?: T;
|
|
14
|
+
xl?: T;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* CSS Properties type
|
|
18
|
+
*/
|
|
19
|
+
interface CSSProperties {
|
|
20
|
+
[key: string]: string | number | undefined;
|
|
21
|
+
}
|
|
22
|
+
type FlexDirection = 'row' | 'column' | 'row-reverse' | 'column-reverse';
|
|
23
|
+
type JustifyContent = 'start' | 'center' | 'end' | 'between' | 'around' | 'evenly' | 'flex-start' | 'flex-end' | 'space-between' | 'space-around' | 'space-evenly';
|
|
24
|
+
type AlignItems = 'start' | 'center' | 'end' | 'stretch' | 'baseline' | 'flex-start' | 'flex-end';
|
|
25
|
+
type Overflow = 'visible' | 'hidden' | 'scroll' | 'auto';
|
|
26
|
+
type Position = 'static' | 'relative' | 'absolute' | 'fixed' | 'sticky';
|
|
27
|
+
type Display = 'flex' | 'none' | 'block' | 'inline-block' | 'inline' | 'grid' | 'initial';
|
|
28
|
+
type FlexWrap = 'wrap' | 'nowrap' | 'wrap-reverse';
|
|
29
|
+
type TextAlign = 'left' | 'center' | 'right' | 'justify';
|
|
30
|
+
type FontStyle = 'normal' | 'italic' | 'oblique';
|
|
31
|
+
type FontWeight = 'normal' | 'bold' | 'bolder' | 'lighter' | number | string;
|
|
32
|
+
type TextTransform = 'none' | 'capitalize' | 'uppercase' | 'lowercase';
|
|
33
|
+
type TextDecoration = 'none' | 'underline' | 'overline' | 'line-through' | 'blink';
|
|
34
|
+
type WhiteSpace = 'normal' | 'nowrap' | 'pre' | 'pre-line' | 'pre-wrap';
|
|
35
|
+
type TextOverflow = 'clip' | 'ellipsis';
|
|
36
|
+
type WordBreak = 'normal' | 'break-all' | 'keep-all' | 'break-word';
|
|
37
|
+
type VerticalAlign = 'baseline' | 'sub' | 'super' | 'top' | 'text-top' | 'middle' | 'bottom' | 'text-bottom' | string | number;
|
|
38
|
+
type Cursor = 'auto' | 'default' | 'none' | 'context-menu' | 'help' | 'pointer' | 'progress' | 'wait' | 'cell' | 'crosshair' | 'text' | 'vertical-text' | 'alias' | 'copy' | 'move' | 'no-drop' | 'not-allowed' | 'grab' | 'grabbing' | string;
|
|
39
|
+
type Visibility = 'visible' | 'hidden' | 'collapse';
|
|
40
|
+
type BoxSizing = 'content-box' | 'border-box';
|
|
41
|
+
type PointerEvents = 'auto' | 'none' | 'visiblePainted' | 'visibleFill' | 'visibleStroke' | 'visible' | 'painted' | 'fill' | 'stroke' | 'all' | 'inherit';
|
|
42
|
+
interface BaseStyleProps {
|
|
43
|
+
display?: ResponsiveValue<Display>;
|
|
44
|
+
flex?: ResponsiveValue<number | string>;
|
|
45
|
+
flexGrow?: ResponsiveValue<number>;
|
|
46
|
+
flexShrink?: ResponsiveValue<number>;
|
|
47
|
+
flexBasis?: ResponsiveValue<string>;
|
|
48
|
+
flexDirection?: ResponsiveValue<FlexDirection>;
|
|
49
|
+
justifyContent?: ResponsiveValue<JustifyContent>;
|
|
50
|
+
alignItems?: ResponsiveValue<AlignItems>;
|
|
51
|
+
alignSelf?: ResponsiveValue<AlignItems>;
|
|
52
|
+
gap?: ResponsiveValue<number | string>;
|
|
53
|
+
flexWrap?: ResponsiveValue<FlexWrap>;
|
|
54
|
+
padding?: ResponsiveValue<number | string>;
|
|
55
|
+
paddingTop?: ResponsiveValue<number | string>;
|
|
56
|
+
paddingRight?: ResponsiveValue<number | string>;
|
|
57
|
+
paddingBottom?: ResponsiveValue<number | string>;
|
|
58
|
+
paddingLeft?: ResponsiveValue<number | string>;
|
|
59
|
+
margin?: ResponsiveValue<number | string>;
|
|
60
|
+
marginTop?: ResponsiveValue<number | string>;
|
|
61
|
+
marginRight?: ResponsiveValue<number | string>;
|
|
62
|
+
marginBottom?: ResponsiveValue<number | string>;
|
|
63
|
+
marginLeft?: ResponsiveValue<number | string>;
|
|
64
|
+
width?: ResponsiveValue<number | string>;
|
|
65
|
+
height?: ResponsiveValue<number | string>;
|
|
66
|
+
minWidth?: ResponsiveValue<number | string>;
|
|
67
|
+
maxWidth?: ResponsiveValue<number | string>;
|
|
68
|
+
minHeight?: ResponsiveValue<number | string>;
|
|
69
|
+
maxHeight?: ResponsiveValue<number | string>;
|
|
70
|
+
backgroundColor?: ResponsiveValue<string>;
|
|
71
|
+
background?: ResponsiveValue<string>;
|
|
72
|
+
borderRadius?: ResponsiveValue<number | string>;
|
|
73
|
+
borderWidth?: ResponsiveValue<number | string>;
|
|
74
|
+
borderColor?: ResponsiveValue<string>;
|
|
75
|
+
borderStyle?: ResponsiveValue<string>;
|
|
76
|
+
border?: ResponsiveValue<string>;
|
|
77
|
+
opacity?: ResponsiveValue<number>;
|
|
78
|
+
overflow?: ResponsiveValue<Overflow>;
|
|
79
|
+
boxShadow?: ResponsiveValue<string>;
|
|
80
|
+
position?: ResponsiveValue<Position>;
|
|
81
|
+
top?: ResponsiveValue<number | string>;
|
|
82
|
+
right?: ResponsiveValue<number | string>;
|
|
83
|
+
bottom?: ResponsiveValue<number | string>;
|
|
84
|
+
left?: ResponsiveValue<number | string>;
|
|
85
|
+
zIndex?: ResponsiveValue<number>;
|
|
86
|
+
color?: ResponsiveValue<string>;
|
|
87
|
+
fontSize?: ResponsiveValue<number | string>;
|
|
88
|
+
fontWeight?: ResponsiveValue<FontWeight>;
|
|
89
|
+
fontFamily?: ResponsiveValue<string>;
|
|
90
|
+
fontStyle?: ResponsiveValue<FontStyle>;
|
|
91
|
+
textAlign?: ResponsiveValue<TextAlign>;
|
|
92
|
+
lineHeight?: ResponsiveValue<number | string>;
|
|
93
|
+
letterSpacing?: ResponsiveValue<number | string>;
|
|
94
|
+
textTransform?: ResponsiveValue<TextTransform>;
|
|
95
|
+
textDecoration?: ResponsiveValue<TextDecoration>;
|
|
96
|
+
whiteSpace?: ResponsiveValue<WhiteSpace>;
|
|
97
|
+
textOverflow?: ResponsiveValue<TextOverflow>;
|
|
98
|
+
wordBreak?: ResponsiveValue<WordBreak>;
|
|
99
|
+
verticalAlign?: ResponsiveValue<VerticalAlign>;
|
|
100
|
+
cursor?: ResponsiveValue<Cursor>;
|
|
101
|
+
visibility?: ResponsiveValue<Visibility>;
|
|
102
|
+
boxSizing?: ResponsiveValue<BoxSizing>;
|
|
103
|
+
pointerEvents?: ResponsiveValue<PointerEvents>;
|
|
104
|
+
}
|
|
105
|
+
interface BaseComponentProps extends BaseStyleProps {
|
|
106
|
+
id?: string;
|
|
107
|
+
/** CSS class name (unified API) */
|
|
108
|
+
class?: string;
|
|
109
|
+
style?: CSSProperties;
|
|
110
|
+
'aria-label'?: string;
|
|
111
|
+
'aria-labelledby'?: string;
|
|
112
|
+
'aria-describedby'?: string;
|
|
113
|
+
role?: string;
|
|
114
|
+
tabIndex?: number;
|
|
115
|
+
/** Press/click handler (unified API for web and mobile) */
|
|
116
|
+
onPress?: (event: MouseEvent) => void;
|
|
117
|
+
onMouseEnter?: (event: MouseEvent) => void;
|
|
118
|
+
onMouseLeave?: (event: MouseEvent) => void;
|
|
119
|
+
children?: any;
|
|
120
|
+
}
|
|
121
|
+
declare function stylePropsToCSS(props: BaseStyleProps): CSSProperties;
|
|
122
|
+
declare function mergeStyles(baseStyles: CSSProperties, userStyles?: CSSProperties): CSSProperties;
|
|
123
|
+
declare function getBaseValue<T>(responsiveValue: ResponsiveValue<T> | undefined): T | undefined;
|
|
124
|
+
declare function toCSSValue(value: number | string | undefined): string | number | undefined;
|
|
125
|
+
/** Map justify shorthand to CSS value */
|
|
126
|
+
declare function mapJustifyContent(value: JustifyContent): string;
|
|
127
|
+
/** Map align shorthand to CSS value */
|
|
128
|
+
declare function mapAlignItems(value: AlignItems): string;
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Props for Row component - horizontal flex container
|
|
132
|
+
*/
|
|
133
|
+
interface RowProps extends BaseComponentProps {
|
|
134
|
+
/** Align items on cross axis (vertical) */
|
|
135
|
+
align?: ResponsiveValue<AlignItems>;
|
|
136
|
+
/** Justify items on main axis (horizontal) */
|
|
137
|
+
justify?: ResponsiveValue<JustifyContent>;
|
|
138
|
+
/** Enable wrapping of items */
|
|
139
|
+
wrap?: ResponsiveValue<boolean>;
|
|
140
|
+
/** Reverse the direction */
|
|
141
|
+
reverse?: boolean;
|
|
142
|
+
/** HTML element to render */
|
|
143
|
+
as?: string;
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Row - Horizontal flex container
|
|
147
|
+
*
|
|
148
|
+
* A primitive layout component for arranging children in a horizontal row
|
|
149
|
+
* using flexbox. Supports alignment, justification, and responsive props.
|
|
150
|
+
*
|
|
151
|
+
* @example
|
|
152
|
+
* ```tsx
|
|
153
|
+
* <Row gap={16} align="center" justify="between">
|
|
154
|
+
* <div>Left</div>
|
|
155
|
+
* <div>Right</div>
|
|
156
|
+
* </Row>
|
|
157
|
+
* ```
|
|
158
|
+
*
|
|
159
|
+
* @example
|
|
160
|
+
* ```tsx
|
|
161
|
+
* // Responsive gap
|
|
162
|
+
* <Row gap={{ base: 8, md: 16, lg: 24 }}>
|
|
163
|
+
* <Button>One</Button>
|
|
164
|
+
* <Button>Two</Button>
|
|
165
|
+
* </Row>
|
|
166
|
+
* ```
|
|
167
|
+
*/
|
|
168
|
+
declare function Row(props: RowProps): FNode;
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* Props for Column component - vertical flex container
|
|
172
|
+
*/
|
|
173
|
+
interface ColumnProps extends BaseComponentProps {
|
|
174
|
+
/** Align items on cross axis (horizontal) */
|
|
175
|
+
align?: ResponsiveValue<AlignItems>;
|
|
176
|
+
/** Justify items on main axis (vertical) */
|
|
177
|
+
justify?: ResponsiveValue<JustifyContent>;
|
|
178
|
+
/** Enable wrapping of items */
|
|
179
|
+
wrap?: ResponsiveValue<boolean>;
|
|
180
|
+
/** Reverse the direction */
|
|
181
|
+
reverse?: boolean;
|
|
182
|
+
/** HTML element to render */
|
|
183
|
+
as?: string;
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Column - Vertical flex container
|
|
187
|
+
*
|
|
188
|
+
* A primitive layout component for arranging children in a vertical column
|
|
189
|
+
* using flexbox. Supports alignment, justification, and responsive props.
|
|
190
|
+
*
|
|
191
|
+
* @example
|
|
192
|
+
* ```tsx
|
|
193
|
+
* <Column gap={8} padding={16}>
|
|
194
|
+
* <div>Top</div>
|
|
195
|
+
* <div>Bottom</div>
|
|
196
|
+
* </Column>
|
|
197
|
+
* ```
|
|
198
|
+
*
|
|
199
|
+
* @example
|
|
200
|
+
* ```tsx
|
|
201
|
+
* // Center content vertically and horizontally
|
|
202
|
+
* <Column align="center" justify="center" height="100vh">
|
|
203
|
+
* <h1>Centered Content</h1>
|
|
204
|
+
* </Column>
|
|
205
|
+
* ```
|
|
206
|
+
*/
|
|
207
|
+
declare function Column(props: ColumnProps): FNode;
|
|
208
|
+
|
|
209
|
+
interface SpacerProps extends BaseComponentProps {
|
|
210
|
+
/** Size on main axis (width for Row, height for Column) */
|
|
211
|
+
size?: ResponsiveValue<number | string>;
|
|
212
|
+
/** Explicit width */
|
|
213
|
+
width?: ResponsiveValue<number | string>;
|
|
214
|
+
/** Explicit height */
|
|
215
|
+
height?: ResponsiveValue<number | string>;
|
|
216
|
+
/** Flex grow factor (defaults to 1 if no size specified) */
|
|
217
|
+
flex?: ResponsiveValue<number>;
|
|
218
|
+
/** HTML element to render */
|
|
219
|
+
as?: string;
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* Spacer - Flexible spacing component
|
|
223
|
+
*
|
|
224
|
+
* Used to create space between elements or push elements apart.
|
|
225
|
+
* By default, it grows to fill available space using flex: 1.
|
|
226
|
+
* Can be used in both horizontal (Row) and vertical (Column) layouts.
|
|
227
|
+
*
|
|
228
|
+
* @example
|
|
229
|
+
* ```tsx
|
|
230
|
+
* <Row>
|
|
231
|
+
* <Text>Left</Text>
|
|
232
|
+
* <Spacer />
|
|
233
|
+
* <Text>Right</Text>
|
|
234
|
+
* </Row>
|
|
235
|
+
* ```
|
|
236
|
+
*/
|
|
237
|
+
declare function Spacer(props: SpacerProps): FNode;
|
|
238
|
+
|
|
239
|
+
interface GridProps extends BaseComponentProps {
|
|
240
|
+
/** Number of columns or column template */
|
|
241
|
+
cols?: ResponsiveValue<number | string>;
|
|
242
|
+
/** Number of rows or row template */
|
|
243
|
+
rows?: ResponsiveValue<number | string>;
|
|
244
|
+
/** Column gap */
|
|
245
|
+
columnGap?: ResponsiveValue<number | string>;
|
|
246
|
+
/** Row gap */
|
|
247
|
+
rowGap?: ResponsiveValue<number | string>;
|
|
248
|
+
/** Grid auto flow */
|
|
249
|
+
flow?: 'row' | 'column' | 'dense' | 'row dense' | 'column dense';
|
|
250
|
+
/** Auto columns size */
|
|
251
|
+
autoColumns?: ResponsiveValue<string>;
|
|
252
|
+
/** Auto rows size */
|
|
253
|
+
autoRows?: ResponsiveValue<string>;
|
|
254
|
+
as?: string;
|
|
255
|
+
}
|
|
256
|
+
/**
|
|
257
|
+
* Grid - 2D layout container
|
|
258
|
+
*
|
|
259
|
+
* A primitive layout component based on CSS Grid.
|
|
260
|
+
* Supports responsive columns, rows, gaps, and all standard grid properties.
|
|
261
|
+
*
|
|
262
|
+
* @example
|
|
263
|
+
* ```tsx
|
|
264
|
+
* // 3-column grid
|
|
265
|
+
* <Grid cols={3} gap={16}>
|
|
266
|
+
* <div />
|
|
267
|
+
* <div />
|
|
268
|
+
* <div />
|
|
269
|
+
* </Grid>
|
|
270
|
+
* ```
|
|
271
|
+
*/
|
|
272
|
+
declare function Grid(props: GridProps): FNode;
|
|
273
|
+
|
|
274
|
+
interface StackProps extends BaseComponentProps {
|
|
275
|
+
align?: ResponsiveValue<AlignItems>;
|
|
276
|
+
justify?: ResponsiveValue<JustifyContent>;
|
|
277
|
+
as?: string;
|
|
278
|
+
}
|
|
279
|
+
/**
|
|
280
|
+
* Stack - Layered positioning container
|
|
281
|
+
*
|
|
282
|
+
* A primitive layout component for layering children on top of each other.
|
|
283
|
+
* Uses CSS Grid for perfect overlap.
|
|
284
|
+
*
|
|
285
|
+
* @example
|
|
286
|
+
* ```tsx
|
|
287
|
+
* <Stack>
|
|
288
|
+
* <Image src="bg.jpg" />
|
|
289
|
+
* <Text>Overlay</Text>
|
|
290
|
+
* </Stack>
|
|
291
|
+
* ```
|
|
292
|
+
*/
|
|
293
|
+
declare function Stack(props: StackProps): FNode;
|
|
294
|
+
|
|
295
|
+
export { type AlignItems, type BaseComponentProps, type BaseStyleProps, type BoxSizing, type CSSProperties, Column, type ColumnProps, type BaseStyleProps as CommonStyle, type Cursor, type Display, type FlexDirection, type FlexWrap, type FontStyle, type FontWeight, Grid, type GridProps, type JustifyContent, type Overflow, type PointerEvents, type Position, type ResponsiveValue, Row, type RowProps, Spacer, type SpacerProps, Stack, type StackProps, type TextAlign, type TextDecoration, type TextOverflow, type TextTransform, type VerticalAlign, type Visibility, type WhiteSpace, type WordBreak, getBaseValue, mapAlignItems, mapJustifyContent, mergeStyles, stylePropsToCSS, toCSSValue };
|