@dynshift/layr 1.0.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/LICENSE +21 -0
- package/README.md +268 -0
- package/dist/index.cjs +838 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +1222 -0
- package/dist/index.d.ts +1222 -0
- package/dist/index.js +807 -0
- package/dist/index.js.map +1 -0
- package/package.json +95 -0
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,1222 @@
|
|
|
1
|
+
import React, { ReactNode, CSSProperties } from 'react';
|
|
2
|
+
|
|
3
|
+
declare enum BoxShape {
|
|
4
|
+
rectangle = "rectangle",
|
|
5
|
+
circle = "circle"
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* EdgeInsets for padding and margin (Flutter pattern)
|
|
9
|
+
*/
|
|
10
|
+
type EdgeInsets = {
|
|
11
|
+
all: number;
|
|
12
|
+
} | {
|
|
13
|
+
horizontal?: number;
|
|
14
|
+
vertical?: number;
|
|
15
|
+
} | {
|
|
16
|
+
top?: number;
|
|
17
|
+
right?: number;
|
|
18
|
+
bottom?: number;
|
|
19
|
+
left?: number;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* BoxShadow - Single shadow definition
|
|
23
|
+
*/
|
|
24
|
+
interface BoxShadow {
|
|
25
|
+
color?: string;
|
|
26
|
+
offset?: {
|
|
27
|
+
dx: number;
|
|
28
|
+
dy: number;
|
|
29
|
+
};
|
|
30
|
+
blurRadius?: number;
|
|
31
|
+
spreadRadius?: number;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* DecorationImage - Background image configuration
|
|
35
|
+
*/
|
|
36
|
+
interface DecorationImage {
|
|
37
|
+
image: string;
|
|
38
|
+
fit?: "cover" | "contain" | "fill" | "none" | "scale-down";
|
|
39
|
+
alignment?: string;
|
|
40
|
+
repeat?: "repeat" | "no-repeat" | "repeat-x" | "repeat-y";
|
|
41
|
+
opacity?: number;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Gradient - Linear or Radial gradient
|
|
45
|
+
*/
|
|
46
|
+
interface Gradient {
|
|
47
|
+
type?: "linear" | "radial";
|
|
48
|
+
colors: string[];
|
|
49
|
+
stops?: number[];
|
|
50
|
+
begin?: string;
|
|
51
|
+
end?: string;
|
|
52
|
+
center?: string;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* BoxBorder - Border configuration
|
|
56
|
+
*/
|
|
57
|
+
interface BoxBorder {
|
|
58
|
+
top?: {
|
|
59
|
+
width: number;
|
|
60
|
+
color: string;
|
|
61
|
+
style?: "solid" | "dashed" | "dotted";
|
|
62
|
+
};
|
|
63
|
+
bottom?: {
|
|
64
|
+
width: number;
|
|
65
|
+
color: string;
|
|
66
|
+
style?: "solid" | "dashed" | "dotted";
|
|
67
|
+
};
|
|
68
|
+
left?: {
|
|
69
|
+
width: number;
|
|
70
|
+
color: string;
|
|
71
|
+
style?: "solid" | "dashed" | "dotted";
|
|
72
|
+
};
|
|
73
|
+
right?: {
|
|
74
|
+
width: number;
|
|
75
|
+
color: string;
|
|
76
|
+
style?: "solid" | "dashed" | "dotted";
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* BoxDecoration - Complete decoration specification (Flutter pattern)
|
|
81
|
+
*/
|
|
82
|
+
interface BoxDecoration {
|
|
83
|
+
color?: string;
|
|
84
|
+
image?: DecorationImage;
|
|
85
|
+
gradient?: Gradient;
|
|
86
|
+
border?: BoxBorder | string;
|
|
87
|
+
borderRadius?: number | string;
|
|
88
|
+
shape?: BoxShape;
|
|
89
|
+
boxShadow?: BoxShadow[];
|
|
90
|
+
backgroundBlendMode?: string;
|
|
91
|
+
opacity?: number;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Box constraints (Flutter pattern)
|
|
95
|
+
*/
|
|
96
|
+
interface BoxConstraints {
|
|
97
|
+
minWidth?: number | string;
|
|
98
|
+
maxWidth?: number | string;
|
|
99
|
+
minHeight?: number | string;
|
|
100
|
+
maxHeight?: number | string;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Alignment options (Flutter pattern)
|
|
104
|
+
*/
|
|
105
|
+
type Alignment = "topLeft" | "topCenter" | "topRight" | "centerLeft" | "center" | "centerRight" | "bottomLeft" | "bottomCenter" | "bottomRight";
|
|
106
|
+
/**
|
|
107
|
+
* Container Props - Mirrors Flutter Container API
|
|
108
|
+
*/
|
|
109
|
+
interface ContainerProps {
|
|
110
|
+
children?: ReactNode;
|
|
111
|
+
width?: number | string;
|
|
112
|
+
height?: number | string;
|
|
113
|
+
padding?: number | EdgeInsets;
|
|
114
|
+
paddingHorizontal?: number;
|
|
115
|
+
paddingVertical?: number;
|
|
116
|
+
paddingTop?: number;
|
|
117
|
+
paddingBottom?: number;
|
|
118
|
+
paddingLeft?: number;
|
|
119
|
+
paddingRight?: number;
|
|
120
|
+
margin?: number | EdgeInsets;
|
|
121
|
+
marginHorizontal?: number;
|
|
122
|
+
marginVertical?: number;
|
|
123
|
+
marginTop?: number;
|
|
124
|
+
marginBottom?: number;
|
|
125
|
+
marginLeft?: number;
|
|
126
|
+
marginRight?: number;
|
|
127
|
+
decoration?: BoxDecoration;
|
|
128
|
+
foregroundDecoration?: BoxDecoration;
|
|
129
|
+
color?: string;
|
|
130
|
+
alignment?: Alignment;
|
|
131
|
+
constraints?: BoxConstraints;
|
|
132
|
+
transform?: string;
|
|
133
|
+
transformAlignment?: Alignment;
|
|
134
|
+
clipBehavior?: "none" | "hardEdge" | "antiAlias";
|
|
135
|
+
onTap?: () => void;
|
|
136
|
+
onClick?: () => void;
|
|
137
|
+
cursor?: "pointer" | "default" | "text" | "none";
|
|
138
|
+
className?: string;
|
|
139
|
+
style?: CSSProperties;
|
|
140
|
+
id?: string;
|
|
141
|
+
role?: string;
|
|
142
|
+
ariaLabel?: string;
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Container - Flutter-style box model component
|
|
146
|
+
*
|
|
147
|
+
* @example Basic usage
|
|
148
|
+
* ```
|
|
149
|
+
* <Container padding={16} color="#eb1660">
|
|
150
|
+
* <Text>Hello</Text>
|
|
151
|
+
* </Container>
|
|
152
|
+
* ```
|
|
153
|
+
*
|
|
154
|
+
* @example Circular container (Flutter BoxShape.circle)
|
|
155
|
+
* ```
|
|
156
|
+
* <Container
|
|
157
|
+
* width={100}
|
|
158
|
+
* height={100}
|
|
159
|
+
* decoration={{
|
|
160
|
+
* color: '#eb1660',
|
|
161
|
+
* shape: BoxShape.circle
|
|
162
|
+
* }}
|
|
163
|
+
* />
|
|
164
|
+
* ```
|
|
165
|
+
*
|
|
166
|
+
* @example Gradient with shadows
|
|
167
|
+
* ```
|
|
168
|
+
* <Container
|
|
169
|
+
* padding={20}
|
|
170
|
+
* decoration={{
|
|
171
|
+
* gradient: {
|
|
172
|
+
* colors: ['#eb1660', '#ff6b9d'],
|
|
173
|
+
* begin: '45deg'
|
|
174
|
+
* },
|
|
175
|
+
* borderRadius: 12,
|
|
176
|
+
* boxShadow: [
|
|
177
|
+
* { color: 'rgba(235, 22, 96, 0.3)', offset: { dx: 0, dy: 4 }, blurRadius: 12 }
|
|
178
|
+
* ]
|
|
179
|
+
* }}
|
|
180
|
+
* />
|
|
181
|
+
* ```
|
|
182
|
+
*/
|
|
183
|
+
declare const Container: React.FC<ContainerProps>;
|
|
184
|
+
declare const EdgeInsetsAll: (value: number) => EdgeInsets;
|
|
185
|
+
declare const EdgeInsetsSymmetric: ({ horizontal, vertical, }: {
|
|
186
|
+
horizontal?: number;
|
|
187
|
+
vertical?: number;
|
|
188
|
+
}) => EdgeInsets;
|
|
189
|
+
declare const EdgeInsetsOnly: ({ top, bottom, left, right, }: {
|
|
190
|
+
top?: number;
|
|
191
|
+
bottom?: number;
|
|
192
|
+
left?: number;
|
|
193
|
+
right?: number;
|
|
194
|
+
}) => EdgeInsets;
|
|
195
|
+
/**
|
|
196
|
+
* Border.all() - Uniform border on all sides (Flutter API)
|
|
197
|
+
*/
|
|
198
|
+
declare const BorderAll: ({ width, color, style, }: {
|
|
199
|
+
width?: number | undefined;
|
|
200
|
+
color?: string | undefined;
|
|
201
|
+
style?: "solid" | "dashed" | "dotted" | undefined;
|
|
202
|
+
}) => BoxBorder;
|
|
203
|
+
/**
|
|
204
|
+
* BorderRadius.circular() - Uniform circular radius (Flutter API)
|
|
205
|
+
*/
|
|
206
|
+
declare const BorderRadiusCircular: (radius: number) => number;
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* Centre Props - Mirrors Flutter Center widget
|
|
210
|
+
*/
|
|
211
|
+
interface CentreProps {
|
|
212
|
+
/**
|
|
213
|
+
* The child widget to center
|
|
214
|
+
*/
|
|
215
|
+
children?: ReactNode;
|
|
216
|
+
/**
|
|
217
|
+
* If non-null, sets its width to the child's width multiplied by this factor.
|
|
218
|
+
*
|
|
219
|
+
* For example, if widthFactor is 2.0, the Centre will be twice as wide as its child.
|
|
220
|
+
* If null (default), the Centre will be as wide as its parent allows.
|
|
221
|
+
*
|
|
222
|
+
* @example
|
|
223
|
+
* ```
|
|
224
|
+
* // Centre will be exactly as wide as the child
|
|
225
|
+
* <Centre widthFactor={1.0}>
|
|
226
|
+
* <Text>Hello</Text>
|
|
227
|
+
* </Centre>
|
|
228
|
+
*
|
|
229
|
+
* // Centre will be 1.5x wider than the child
|
|
230
|
+
* <Centre widthFactor={1.5}>
|
|
231
|
+
* <Text>Hello</Text>
|
|
232
|
+
* </Centre>
|
|
233
|
+
* ```
|
|
234
|
+
*/
|
|
235
|
+
widthFactor?: number;
|
|
236
|
+
/**
|
|
237
|
+
* If non-null, sets its height to the child's height multiplied by this factor.
|
|
238
|
+
*
|
|
239
|
+
* For example, if heightFactor is 2.0, the Centre will be twice as tall as its child.
|
|
240
|
+
* If null (default), the Centre will be as tall as its parent allows.
|
|
241
|
+
*/
|
|
242
|
+
heightFactor?: number;
|
|
243
|
+
/**
|
|
244
|
+
* Additional CSS class names (for Tailwind utilities)
|
|
245
|
+
*/
|
|
246
|
+
className?: string;
|
|
247
|
+
/**
|
|
248
|
+
* Custom inline styles (escape hatch)
|
|
249
|
+
*/
|
|
250
|
+
style?: CSSProperties;
|
|
251
|
+
/**
|
|
252
|
+
* HTML id attribute
|
|
253
|
+
*/
|
|
254
|
+
id?: string;
|
|
255
|
+
}
|
|
256
|
+
/**
|
|
257
|
+
* Centre - Centers its child both horizontally and vertically
|
|
258
|
+
*
|
|
259
|
+
* Behavior (Flutter spec):
|
|
260
|
+
* - If widthFactor and heightFactor are null: expands to fill parent
|
|
261
|
+
* - If widthFactor is set: width = child's width × widthFactor
|
|
262
|
+
* - If heightFactor is set: height = child's height × heightFactor
|
|
263
|
+
* - Always centers the child within the available space
|
|
264
|
+
*
|
|
265
|
+
* @example Basic usage
|
|
266
|
+
* ```
|
|
267
|
+
* <Centre>
|
|
268
|
+
* <Text>Centered text</Text>
|
|
269
|
+
* </Centre>
|
|
270
|
+
* ```
|
|
271
|
+
*
|
|
272
|
+
* @example With size factors
|
|
273
|
+
* ```
|
|
274
|
+
* <Centre widthFactor={1.5} heightFactor={2.0}>
|
|
275
|
+
* <Container width={100} height={50}>
|
|
276
|
+
* <Text>Box</Text>
|
|
277
|
+
* </Container>
|
|
278
|
+
* </Centre>
|
|
279
|
+
* // Result: Centre will be 150px wide (100 × 1.5) and 100px tall (50 × 2.0)
|
|
280
|
+
* ```
|
|
281
|
+
*
|
|
282
|
+
* @example Full screen center
|
|
283
|
+
* ```
|
|
284
|
+
* <Centre style={{ minHeight: '100vh' }}>
|
|
285
|
+
* <Container padding={20}>
|
|
286
|
+
* <Text>Perfectly centered on screen</Text>
|
|
287
|
+
* </Container>
|
|
288
|
+
* </Centre>
|
|
289
|
+
* ```
|
|
290
|
+
*/
|
|
291
|
+
declare const Centre: React.FC<CentreProps>;
|
|
292
|
+
/**
|
|
293
|
+
* Center - American English spelling alias
|
|
294
|
+
*/
|
|
295
|
+
declare const Center: React.FC<CentreProps>;
|
|
296
|
+
|
|
297
|
+
/**
|
|
298
|
+
* MainAxisAlignment - How to distribute children along the main axis (vertical for Column)
|
|
299
|
+
*/
|
|
300
|
+
declare enum MainAxisAlignment$1 {
|
|
301
|
+
/** Place children at the start (top) */
|
|
302
|
+
start = "flex-start",
|
|
303
|
+
/** Place children at the center */
|
|
304
|
+
center = "center",
|
|
305
|
+
/** Place children at the end (bottom) */
|
|
306
|
+
end = "flex-end",
|
|
307
|
+
/** Distribute remaining space evenly between children */
|
|
308
|
+
spaceBetween = "space-between",
|
|
309
|
+
/** Distribute remaining space evenly around children */
|
|
310
|
+
spaceAround = "space-around",
|
|
311
|
+
/** Distribute remaining space evenly, including edges */
|
|
312
|
+
spaceEvenly = "space-evenly"
|
|
313
|
+
}
|
|
314
|
+
/**
|
|
315
|
+
* CrossAxisAlignment - How to align children along the cross axis (horizontal for Column)
|
|
316
|
+
*/
|
|
317
|
+
declare enum CrossAxisAlignment$1 {
|
|
318
|
+
/** Align children to the start (left) */
|
|
319
|
+
start = "flex-start",
|
|
320
|
+
/** Align children to the center */
|
|
321
|
+
center = "center",
|
|
322
|
+
/** Align children to the end (right) */
|
|
323
|
+
end = "flex-end",
|
|
324
|
+
/** Stretch children to fill cross axis */
|
|
325
|
+
stretch = "stretch",
|
|
326
|
+
/** Align children by their baseline (for text) */
|
|
327
|
+
baseline = "baseline"
|
|
328
|
+
}
|
|
329
|
+
/**
|
|
330
|
+
* MainAxisSize - How much space should be occupied in the main axis
|
|
331
|
+
*/
|
|
332
|
+
declare enum MainAxisSize$1 {
|
|
333
|
+
/** Take up maximum available space */
|
|
334
|
+
max = "max",
|
|
335
|
+
/** Take up minimum space (wrap content) */
|
|
336
|
+
min = "min"
|
|
337
|
+
}
|
|
338
|
+
/**
|
|
339
|
+
* VerticalDirection - Order of children
|
|
340
|
+
*/
|
|
341
|
+
declare enum VerticalDirection {
|
|
342
|
+
/** Top to bottom (normal) */
|
|
343
|
+
down = "down",
|
|
344
|
+
/** Bottom to top (reversed) */
|
|
345
|
+
up = "up"
|
|
346
|
+
}
|
|
347
|
+
/**
|
|
348
|
+
* Column Props - Mirrors Flutter Column widget
|
|
349
|
+
*/
|
|
350
|
+
interface ColumnProps {
|
|
351
|
+
/**
|
|
352
|
+
* The widgets to display vertically
|
|
353
|
+
*/
|
|
354
|
+
children?: ReactNode;
|
|
355
|
+
/**
|
|
356
|
+
* How the children should be placed along the main axis (vertical)
|
|
357
|
+
*
|
|
358
|
+
* @default MainAxisAlignment.start
|
|
359
|
+
*
|
|
360
|
+
* @example
|
|
361
|
+
* ```
|
|
362
|
+
* // Children at top
|
|
363
|
+
* <Column mainAxisAlignment={MainAxisAlignment.start}>
|
|
364
|
+
*
|
|
365
|
+
* // Children centered vertically
|
|
366
|
+
* <Column mainAxisAlignment={MainAxisAlignment.center}>
|
|
367
|
+
*
|
|
368
|
+
* // Space between children
|
|
369
|
+
* <Column mainAxisAlignment={MainAxisAlignment.spaceBetween}>
|
|
370
|
+
* ```
|
|
371
|
+
*/
|
|
372
|
+
mainAxisAlignment?: MainAxisAlignment$1;
|
|
373
|
+
/**
|
|
374
|
+
* How the children should be placed along the cross axis (horizontal)
|
|
375
|
+
*
|
|
376
|
+
* @default CrossAxisAlignment.center
|
|
377
|
+
*
|
|
378
|
+
* @example
|
|
379
|
+
* ```
|
|
380
|
+
* // Left-aligned children
|
|
381
|
+
* <Column crossAxisAlignment={CrossAxisAlignment.start}>
|
|
382
|
+
*
|
|
383
|
+
* // Stretch children to full width
|
|
384
|
+
* <Column crossAxisAlignment={CrossAxisAlignment.stretch}>
|
|
385
|
+
* ```
|
|
386
|
+
*/
|
|
387
|
+
crossAxisAlignment?: CrossAxisAlignment$1;
|
|
388
|
+
/**
|
|
389
|
+
* How much space should be occupied in the main axis
|
|
390
|
+
*
|
|
391
|
+
* @default MainAxisSize.max
|
|
392
|
+
*
|
|
393
|
+
* @example
|
|
394
|
+
* ```
|
|
395
|
+
* // Column takes all available height
|
|
396
|
+
* <Column mainAxisSize={MainAxisSize.max}>
|
|
397
|
+
*
|
|
398
|
+
* // Column wraps to fit children height
|
|
399
|
+
* <Column mainAxisSize={MainAxisSize.min}>
|
|
400
|
+
* ```
|
|
401
|
+
*/
|
|
402
|
+
mainAxisSize?: MainAxisSize$1;
|
|
403
|
+
/**
|
|
404
|
+
* The direction to lay children (top-to-bottom or bottom-to-top)
|
|
405
|
+
*
|
|
406
|
+
* @default VerticalDirection.down
|
|
407
|
+
*/
|
|
408
|
+
verticalDirection?: VerticalDirection;
|
|
409
|
+
/**
|
|
410
|
+
* How much space to place between children in the main axis
|
|
411
|
+
*
|
|
412
|
+
* @default 0
|
|
413
|
+
*
|
|
414
|
+
* @example
|
|
415
|
+
* ```
|
|
416
|
+
* // 16px gap between all children
|
|
417
|
+
* <Column spacing={16}>
|
|
418
|
+
* <Container>Child 1</Container>
|
|
419
|
+
* <Container>Child 2</Container>
|
|
420
|
+
* </Column>
|
|
421
|
+
* ```
|
|
422
|
+
*/
|
|
423
|
+
spacing?: number;
|
|
424
|
+
/**
|
|
425
|
+
* Whether to clip children that overflow the column
|
|
426
|
+
*
|
|
427
|
+
* @default 'visible'
|
|
428
|
+
*/
|
|
429
|
+
clipBehavior?: "visible" | "hidden" | "scroll";
|
|
430
|
+
/**
|
|
431
|
+
* Additional CSS class names (for Tailwind utilities)
|
|
432
|
+
*/
|
|
433
|
+
className?: string;
|
|
434
|
+
/**
|
|
435
|
+
* Custom inline styles (escape hatch)
|
|
436
|
+
*/
|
|
437
|
+
style?: CSSProperties;
|
|
438
|
+
/**
|
|
439
|
+
* HTML id attribute
|
|
440
|
+
*/
|
|
441
|
+
id?: string;
|
|
442
|
+
/**
|
|
443
|
+
* Click handler
|
|
444
|
+
*/
|
|
445
|
+
onTap?: () => void;
|
|
446
|
+
onClick?: () => void;
|
|
447
|
+
}
|
|
448
|
+
/**
|
|
449
|
+
* Column - Displays children in a vertical array
|
|
450
|
+
*
|
|
451
|
+
* Layout algorithm (Flutter spec):
|
|
452
|
+
* 1. Layout non-flex children with unbounded vertical constraints
|
|
453
|
+
* 2. Divide remaining vertical space among flex children (Expanded)
|
|
454
|
+
* 3. Width = maximum width of children
|
|
455
|
+
* 4. Height = determined by mainAxisSize (max = fill parent, min = wrap content)
|
|
456
|
+
* 5. Position children according to mainAxisAlignment and crossAxisAlignment
|
|
457
|
+
*
|
|
458
|
+
* @example Basic vertical layout
|
|
459
|
+
* ```
|
|
460
|
+
* <Column>
|
|
461
|
+
* <Text>First</Text>
|
|
462
|
+
* <Text>Second</Text>
|
|
463
|
+
* <Text>Third</Text>
|
|
464
|
+
* </Column>
|
|
465
|
+
* ```
|
|
466
|
+
*
|
|
467
|
+
* @example Centered with spacing
|
|
468
|
+
* ```
|
|
469
|
+
* <Column
|
|
470
|
+
* mainAxisAlignment={MainAxisAlignment.center}
|
|
471
|
+
* crossAxisAlignment={CrossAxisAlignment.center}
|
|
472
|
+
* spacing={16}
|
|
473
|
+
* >
|
|
474
|
+
* <Container padding={10}>Box 1</Container>
|
|
475
|
+
* <Container padding={10}>Box 2</Container>
|
|
476
|
+
* <Container padding={10}>Box 3</Container>
|
|
477
|
+
* </Column>
|
|
478
|
+
* ```
|
|
479
|
+
*
|
|
480
|
+
* @example Left-aligned, wrapping content
|
|
481
|
+
* ```
|
|
482
|
+
* <Column
|
|
483
|
+
* mainAxisSize={MainAxisSize.min}
|
|
484
|
+
* crossAxisAlignment={CrossAxisAlignment.start}
|
|
485
|
+
* spacing={8}
|
|
486
|
+
* >
|
|
487
|
+
* <Text>Line 1</Text>
|
|
488
|
+
* <Text>Line 2</Text>
|
|
489
|
+
* <Text>Line 3</Text>
|
|
490
|
+
* </Column>
|
|
491
|
+
* ```
|
|
492
|
+
*
|
|
493
|
+
* @example Space between items
|
|
494
|
+
* ```
|
|
495
|
+
* <Column
|
|
496
|
+
* mainAxisAlignment={MainAxisAlignment.spaceBetween}
|
|
497
|
+
* style={{ height: '100vh' }}
|
|
498
|
+
* >
|
|
499
|
+
* <Header />
|
|
500
|
+
* <Content />
|
|
501
|
+
* <Footer />
|
|
502
|
+
* </Column>
|
|
503
|
+
* ```
|
|
504
|
+
*/
|
|
505
|
+
declare const Column: React.FC<ColumnProps>;
|
|
506
|
+
|
|
507
|
+
/**
|
|
508
|
+
* MainAxisAlignment - How to distribute children along the main axis (horizontal for Row)
|
|
509
|
+
*/
|
|
510
|
+
declare enum MainAxisAlignment {
|
|
511
|
+
/** Place children at the start (left for LTR, right for RTL) */
|
|
512
|
+
start = "flex-start",
|
|
513
|
+
/** Place children at the center */
|
|
514
|
+
center = "center",
|
|
515
|
+
/** Place children at the end (right for LTR, left for RTL) */
|
|
516
|
+
end = "flex-end",
|
|
517
|
+
/** Distribute remaining space evenly between children */
|
|
518
|
+
spaceBetween = "space-between",
|
|
519
|
+
/** Distribute remaining space evenly around children */
|
|
520
|
+
spaceAround = "space-around",
|
|
521
|
+
/** Distribute remaining space evenly, including edges */
|
|
522
|
+
spaceEvenly = "space-evenly"
|
|
523
|
+
}
|
|
524
|
+
/**
|
|
525
|
+
* CrossAxisAlignment - How to align children along the cross axis (vertical for Row)
|
|
526
|
+
*/
|
|
527
|
+
declare enum CrossAxisAlignment {
|
|
528
|
+
/** Align children to the start (top) */
|
|
529
|
+
start = "flex-start",
|
|
530
|
+
/** Align children to the center */
|
|
531
|
+
center = "center",
|
|
532
|
+
/** Align children to the end (bottom) */
|
|
533
|
+
end = "flex-end",
|
|
534
|
+
/** Stretch children to fill cross axis */
|
|
535
|
+
stretch = "stretch",
|
|
536
|
+
/** Align children by their baseline (for text) */
|
|
537
|
+
baseline = "baseline"
|
|
538
|
+
}
|
|
539
|
+
/**
|
|
540
|
+
* MainAxisSize - How much space should be occupied in the main axis
|
|
541
|
+
*/
|
|
542
|
+
declare enum MainAxisSize {
|
|
543
|
+
/** Take up maximum available space */
|
|
544
|
+
max = "max",
|
|
545
|
+
/** Take up minimum space (wrap content) */
|
|
546
|
+
min = "min"
|
|
547
|
+
}
|
|
548
|
+
/**
|
|
549
|
+
* TextDirection - Horizontal layout direction
|
|
550
|
+
*/
|
|
551
|
+
declare enum TextDirection$1 {
|
|
552
|
+
/** Left to right (default for most languages) */
|
|
553
|
+
ltr = "ltr",
|
|
554
|
+
/** Right to left (for Arabic, Hebrew, etc.) */
|
|
555
|
+
rtl = "rtl"
|
|
556
|
+
}
|
|
557
|
+
/**
|
|
558
|
+
* Row Props - Mirrors Flutter Row widget
|
|
559
|
+
*/
|
|
560
|
+
interface RowProps {
|
|
561
|
+
/**
|
|
562
|
+
* The widgets to display horizontally
|
|
563
|
+
*/
|
|
564
|
+
children?: ReactNode;
|
|
565
|
+
/**
|
|
566
|
+
* How the children should be placed along the main axis (horizontal)
|
|
567
|
+
*
|
|
568
|
+
* @default MainAxisAlignment.start
|
|
569
|
+
*
|
|
570
|
+
* @example
|
|
571
|
+
* ```
|
|
572
|
+
* // Children at left (LTR) or right (RTL)
|
|
573
|
+
* <Row mainAxisAlignment={MainAxisAlignment.start}>
|
|
574
|
+
*
|
|
575
|
+
* // Children centered horizontally
|
|
576
|
+
* <Row mainAxisAlignment={MainAxisAlignment.center}>
|
|
577
|
+
*
|
|
578
|
+
* // Space between children
|
|
579
|
+
* <Row mainAxisAlignment={MainAxisAlignment.spaceBetween}>
|
|
580
|
+
* ```
|
|
581
|
+
*/
|
|
582
|
+
mainAxisAlignment?: MainAxisAlignment;
|
|
583
|
+
/**
|
|
584
|
+
* How the children should be placed along the cross axis (vertical)
|
|
585
|
+
*
|
|
586
|
+
* @default CrossAxisAlignment.center
|
|
587
|
+
*
|
|
588
|
+
* @example
|
|
589
|
+
* ```
|
|
590
|
+
* // Top-aligned children
|
|
591
|
+
* <Row crossAxisAlignment={CrossAxisAlignment.start}>
|
|
592
|
+
*
|
|
593
|
+
* // Stretch children to full height
|
|
594
|
+
* <Row crossAxisAlignment={CrossAxisAlignment.stretch}>
|
|
595
|
+
*
|
|
596
|
+
* // Baseline-aligned text
|
|
597
|
+
* <Row crossAxisAlignment={CrossAxisAlignment.baseline}>
|
|
598
|
+
* ```
|
|
599
|
+
*/
|
|
600
|
+
crossAxisAlignment?: CrossAxisAlignment;
|
|
601
|
+
/**
|
|
602
|
+
* How much space should be occupied in the main axis
|
|
603
|
+
*
|
|
604
|
+
* @default MainAxisSize.max
|
|
605
|
+
*
|
|
606
|
+
* @example
|
|
607
|
+
* ```
|
|
608
|
+
* // Row takes all available width
|
|
609
|
+
* <Row mainAxisSize={MainAxisSize.max}>
|
|
610
|
+
*
|
|
611
|
+
* // Row wraps to fit children width
|
|
612
|
+
* <Row mainAxisSize={MainAxisSize.min}>
|
|
613
|
+
* ```
|
|
614
|
+
*/
|
|
615
|
+
mainAxisSize?: MainAxisSize;
|
|
616
|
+
/**
|
|
617
|
+
* The direction to lay children (left-to-right or right-to-left)
|
|
618
|
+
*
|
|
619
|
+
* @default TextDirection.ltr
|
|
620
|
+
*
|
|
621
|
+
* @example
|
|
622
|
+
* ```
|
|
623
|
+
* // Left to right (English, Spanish, etc.)
|
|
624
|
+
* <Row textDirection={TextDirection.ltr}>
|
|
625
|
+
*
|
|
626
|
+
* // Right to left (Arabic, Hebrew, etc.)
|
|
627
|
+
* <Row textDirection={TextDirection.rtl}>
|
|
628
|
+
* ```
|
|
629
|
+
*/
|
|
630
|
+
textDirection?: TextDirection$1;
|
|
631
|
+
/**
|
|
632
|
+
* How much space to place between children in the main axis
|
|
633
|
+
*
|
|
634
|
+
* @default 0
|
|
635
|
+
*
|
|
636
|
+
* @example
|
|
637
|
+
* ```
|
|
638
|
+
* // 16px gap between all children
|
|
639
|
+
* <Row spacing={16}>
|
|
640
|
+
* <Container>Child 1</Container>
|
|
641
|
+
* <Container>Child 2</Container>
|
|
642
|
+
* </Row>
|
|
643
|
+
* ```
|
|
644
|
+
*/
|
|
645
|
+
spacing?: number;
|
|
646
|
+
/**
|
|
647
|
+
* Whether to clip children that overflow the row
|
|
648
|
+
*
|
|
649
|
+
* @default 'visible'
|
|
650
|
+
*/
|
|
651
|
+
clipBehavior?: "visible" | "hidden" | "scroll";
|
|
652
|
+
/**
|
|
653
|
+
* Additional CSS class names (for Tailwind utilities)
|
|
654
|
+
*/
|
|
655
|
+
className?: string;
|
|
656
|
+
/**
|
|
657
|
+
* Custom inline styles (escape hatch)
|
|
658
|
+
*/
|
|
659
|
+
style?: CSSProperties;
|
|
660
|
+
/**
|
|
661
|
+
* HTML id attribute
|
|
662
|
+
*/
|
|
663
|
+
id?: string;
|
|
664
|
+
/**
|
|
665
|
+
* Click handler
|
|
666
|
+
*/
|
|
667
|
+
onTap?: () => void;
|
|
668
|
+
onClick?: () => void;
|
|
669
|
+
}
|
|
670
|
+
/**
|
|
671
|
+
* Row - Displays children in a horizontal array
|
|
672
|
+
*
|
|
673
|
+
* Layout algorithm (Flutter spec):
|
|
674
|
+
* 1. Layout non-flex children with unbounded horizontal constraints
|
|
675
|
+
* 2. Divide remaining horizontal space among flex children (Expanded)
|
|
676
|
+
* 3. Height = maximum height of children
|
|
677
|
+
* 4. Width = determined by mainAxisSize (max = fill parent, min = wrap content)
|
|
678
|
+
* 5. Position children according to mainAxisAlignment and crossAxisAlignment
|
|
679
|
+
*
|
|
680
|
+
* **Important:** Row does not scroll. If children overflow, consider using ListView.
|
|
681
|
+
*
|
|
682
|
+
* @example Basic horizontal layout
|
|
683
|
+
* ```
|
|
684
|
+
* <Row>
|
|
685
|
+
* <Container padding={10}>Box 1</Container>
|
|
686
|
+
* <Container padding={10}>Box 2</Container>
|
|
687
|
+
* <Container padding={10}>Box 3</Container>
|
|
688
|
+
* </Row>
|
|
689
|
+
* ```
|
|
690
|
+
*
|
|
691
|
+
* @example Centered with spacing
|
|
692
|
+
* ```
|
|
693
|
+
* <Row
|
|
694
|
+
* mainAxisAlignment={MainAxisAlignment.center}
|
|
695
|
+
* crossAxisAlignment={CrossAxisAlignment.center}
|
|
696
|
+
* spacing={16}
|
|
697
|
+
* >
|
|
698
|
+
* <Container padding={10}>Box 1</Container>
|
|
699
|
+
* <Container padding={10}>Box 2</Container>
|
|
700
|
+
* </Row>
|
|
701
|
+
* ```
|
|
702
|
+
*
|
|
703
|
+
* @example Space between items (navbar pattern)
|
|
704
|
+
* ```
|
|
705
|
+
* <Row mainAxisAlignment={MainAxisAlignment.spaceBetween}>
|
|
706
|
+
* <Logo />
|
|
707
|
+
* <NavLinks />
|
|
708
|
+
* <AuthButtons />
|
|
709
|
+
* </Row>
|
|
710
|
+
* ```
|
|
711
|
+
*
|
|
712
|
+
* @example Right-to-left layout
|
|
713
|
+
* ```
|
|
714
|
+
* <Row textDirection={TextDirection.rtl}>
|
|
715
|
+
* <Text>مرحبا</Text>
|
|
716
|
+
* <Text>بالعالم</Text>
|
|
717
|
+
* </Row>
|
|
718
|
+
* ```
|
|
719
|
+
*
|
|
720
|
+
* @example Icon + Text pattern
|
|
721
|
+
* ```
|
|
722
|
+
* <Row spacing={8} crossAxisAlignment={CrossAxisAlignment.center}>
|
|
723
|
+
* <Icon name="star" />
|
|
724
|
+
* <Text>Premium</Text>
|
|
725
|
+
* </Row>
|
|
726
|
+
* ```
|
|
727
|
+
*/
|
|
728
|
+
declare const Row: React.FC<RowProps>;
|
|
729
|
+
|
|
730
|
+
/**
|
|
731
|
+
* StackFit - How to size non-positioned children in the stack
|
|
732
|
+
*/
|
|
733
|
+
declare enum StackFit {
|
|
734
|
+
/** Non-positioned children are as large as the stack allows (default in web) */
|
|
735
|
+
expand = "expand",
|
|
736
|
+
/** Non-positioned children are allowed to be as large as they want */
|
|
737
|
+
loose = "loose",
|
|
738
|
+
/** Non-positioned children are forced to be as small as possible */
|
|
739
|
+
passthrough = "passthrough"
|
|
740
|
+
}
|
|
741
|
+
/**
|
|
742
|
+
* Clip - How content outside bounds should be treated
|
|
743
|
+
*/
|
|
744
|
+
declare enum Clip {
|
|
745
|
+
/** Clip, but without anti-aliasing */
|
|
746
|
+
hardEdge = "hidden",
|
|
747
|
+
/** Clip with anti-aliasing */
|
|
748
|
+
antiAlias = "hidden",
|
|
749
|
+
/** Clip with anti-aliasing and save layer */
|
|
750
|
+
antiAliasWithSaveLayer = "hidden",
|
|
751
|
+
/** Do not clip */
|
|
752
|
+
none = "visible"
|
|
753
|
+
}
|
|
754
|
+
/**
|
|
755
|
+
* Alignment - Predefined alignment positions (Flutter pattern)
|
|
756
|
+
*/
|
|
757
|
+
type StackAlignment = "topLeft" | "topCenter" | "topRight" | "centerLeft" | "center" | "centerRight" | "bottomLeft" | "bottomCenter" | "bottomRight";
|
|
758
|
+
/**
|
|
759
|
+
* TextDirection - For resolving alignment in RTL contexts
|
|
760
|
+
*/
|
|
761
|
+
declare enum TextDirection {
|
|
762
|
+
ltr = "ltr",
|
|
763
|
+
rtl = "rtl"
|
|
764
|
+
}
|
|
765
|
+
/**
|
|
766
|
+
* Stack Props - Mirrors Flutter Stack widget
|
|
767
|
+
*/
|
|
768
|
+
interface StackProps {
|
|
769
|
+
/**
|
|
770
|
+
* The widgets to stack (painted in order: first = bottom, last = top)
|
|
771
|
+
*/
|
|
772
|
+
children?: ReactNode;
|
|
773
|
+
/**
|
|
774
|
+
* How to align non-positioned and partially-positioned children
|
|
775
|
+
*
|
|
776
|
+
* @default 'topLeft' (LTR) or 'topRight' (RTL)
|
|
777
|
+
*
|
|
778
|
+
* @example
|
|
779
|
+
* ```
|
|
780
|
+
* // Center all non-positioned children
|
|
781
|
+
* <Stack alignment="center">
|
|
782
|
+
* <Container>Background</Container>
|
|
783
|
+
* <Container>Centered on top</Container>
|
|
784
|
+
* </Stack>
|
|
785
|
+
* ```
|
|
786
|
+
*/
|
|
787
|
+
alignment?: StackAlignment;
|
|
788
|
+
/**
|
|
789
|
+
* How to size non-positioned children in the stack
|
|
790
|
+
*
|
|
791
|
+
* @default StackFit.loose
|
|
792
|
+
*
|
|
793
|
+
* @example
|
|
794
|
+
* ```
|
|
795
|
+
* // Force children to fill the stack
|
|
796
|
+
* <Stack fit={StackFit.expand}>
|
|
797
|
+
*
|
|
798
|
+
* // Let children size themselves
|
|
799
|
+
* <Stack fit={StackFit.loose}>
|
|
800
|
+
* ```
|
|
801
|
+
*/
|
|
802
|
+
fit?: StackFit;
|
|
803
|
+
/**
|
|
804
|
+
* Text direction for resolving alignment
|
|
805
|
+
*
|
|
806
|
+
* @default TextDirection.ltr
|
|
807
|
+
*/
|
|
808
|
+
textDirection?: TextDirection;
|
|
809
|
+
/**
|
|
810
|
+
* How to clip content that overflows the stack
|
|
811
|
+
*
|
|
812
|
+
* @default Clip.hardEdge
|
|
813
|
+
*/
|
|
814
|
+
clipBehavior?: Clip;
|
|
815
|
+
/**
|
|
816
|
+
* Additional CSS class names
|
|
817
|
+
*/
|
|
818
|
+
className?: string;
|
|
819
|
+
/**
|
|
820
|
+
* Custom inline styles
|
|
821
|
+
*/
|
|
822
|
+
style?: CSSProperties;
|
|
823
|
+
/**
|
|
824
|
+
* HTML id attribute
|
|
825
|
+
*/
|
|
826
|
+
id?: string;
|
|
827
|
+
/**
|
|
828
|
+
* Click handler
|
|
829
|
+
*/
|
|
830
|
+
onTap?: () => void;
|
|
831
|
+
onClick?: () => void;
|
|
832
|
+
}
|
|
833
|
+
/**
|
|
834
|
+
* Stack - Positions children relative to the edges of its box
|
|
835
|
+
*
|
|
836
|
+
* Layout behavior (Flutter spec):
|
|
837
|
+
* 1. Non-positioned children are positioned according to `alignment`
|
|
838
|
+
* 2. Stack sizes itself to contain all non-positioned children
|
|
839
|
+
* 3. Positioned children are placed relative to stack edges
|
|
840
|
+
* 4. Children are painted in order (first = bottom, last = top)
|
|
841
|
+
*
|
|
842
|
+
* **Important:** Stack children are painted in order. To change z-index, reorder children.
|
|
843
|
+
*
|
|
844
|
+
* @example Basic layering
|
|
845
|
+
* ```
|
|
846
|
+
* <Stack>
|
|
847
|
+
* <Container width={100} height={100} color="red" />
|
|
848
|
+
* <Container width={80} height={80} color="green" />
|
|
849
|
+
* <Container width={60} height={60} color="blue" />
|
|
850
|
+
* </Stack>
|
|
851
|
+
* ```
|
|
852
|
+
*
|
|
853
|
+
* @example Positioned children
|
|
854
|
+
* ```
|
|
855
|
+
* <Stack style={{ width: 300, height: 300 }}>
|
|
856
|
+
* <Container color="white" />
|
|
857
|
+
* <Positioned top={10} left={10}>
|
|
858
|
+
* <Container padding={10} color="red">
|
|
859
|
+
* <p>Top Left</p>
|
|
860
|
+
* </Container>
|
|
861
|
+
* </Positioned>
|
|
862
|
+
* <Positioned bottom={10} right={10}>
|
|
863
|
+
* <Container padding={10} color="blue">
|
|
864
|
+
* <p>Bottom Right</p>
|
|
865
|
+
* </Container>
|
|
866
|
+
* </Positioned>
|
|
867
|
+
* </Stack>
|
|
868
|
+
* ```
|
|
869
|
+
*
|
|
870
|
+
* @example Image with gradient overlay (your hero pattern)
|
|
871
|
+
* ```
|
|
872
|
+
* <Stack style={{ width: '100%', height: '100vh' }}>
|
|
873
|
+
* <Container
|
|
874
|
+
* decoration={{
|
|
875
|
+
* image: {
|
|
876
|
+
* image: '/hero-bg.jpg',
|
|
877
|
+
* fit: 'cover',
|
|
878
|
+
* },
|
|
879
|
+
* }}
|
|
880
|
+
* />
|
|
881
|
+
* <Container
|
|
882
|
+
* decoration={{
|
|
883
|
+
* gradient: {
|
|
884
|
+
* type: 'linear',
|
|
885
|
+
* colors: ['rgba(13, 13, 13, 0)', 'rgba(13, 13, 13, 0.9)'],
|
|
886
|
+
* begin: 'to bottom',
|
|
887
|
+
* },
|
|
888
|
+
* }}
|
|
889
|
+
* />
|
|
890
|
+
* <Positioned bottom={40}>
|
|
891
|
+
* <Container padding={40}>
|
|
892
|
+
* <h1>Hero Title</h1>
|
|
893
|
+
* </Container>
|
|
894
|
+
* </Positioned>
|
|
895
|
+
* </Stack>
|
|
896
|
+
* ```
|
|
897
|
+
*/
|
|
898
|
+
declare const Stack: React.FC<StackProps>;
|
|
899
|
+
|
|
900
|
+
/**
|
|
901
|
+
* Positioned Props - Mirrors Flutter Positioned widget
|
|
902
|
+
*/
|
|
903
|
+
interface PositionedProps {
|
|
904
|
+
/**
|
|
905
|
+
* The child widget to position
|
|
906
|
+
*/
|
|
907
|
+
children?: ReactNode;
|
|
908
|
+
/**
|
|
909
|
+
* Distance from top edge of stack
|
|
910
|
+
*
|
|
911
|
+
* @example
|
|
912
|
+
* ```
|
|
913
|
+
* <Positioned top={20}>
|
|
914
|
+
* <Container>20px from top</Container>
|
|
915
|
+
* </Positioned>
|
|
916
|
+
* ```
|
|
917
|
+
*/
|
|
918
|
+
top?: number | string;
|
|
919
|
+
/**
|
|
920
|
+
* Distance from bottom edge of stack
|
|
921
|
+
*/
|
|
922
|
+
bottom?: number | string;
|
|
923
|
+
/**
|
|
924
|
+
* Distance from left edge of stack (in LTR mode)
|
|
925
|
+
*/
|
|
926
|
+
left?: number | string;
|
|
927
|
+
/**
|
|
928
|
+
* Distance from right edge of stack (in LTR mode)
|
|
929
|
+
*/
|
|
930
|
+
right?: number | string;
|
|
931
|
+
/**
|
|
932
|
+
* Width of the positioned child
|
|
933
|
+
*
|
|
934
|
+
* @example
|
|
935
|
+
* ```
|
|
936
|
+
* <Positioned left={0} right={0} width="100%">
|
|
937
|
+
* <Container>Full width</Container>
|
|
938
|
+
* </Positioned>
|
|
939
|
+
* ```
|
|
940
|
+
*/
|
|
941
|
+
width?: number | string;
|
|
942
|
+
/**
|
|
943
|
+
* Height of the positioned child
|
|
944
|
+
*/
|
|
945
|
+
height?: number | string;
|
|
946
|
+
/**
|
|
947
|
+
* Additional CSS class names
|
|
948
|
+
*/
|
|
949
|
+
className?: string;
|
|
950
|
+
/**
|
|
951
|
+
* Custom inline styles
|
|
952
|
+
*/
|
|
953
|
+
style?: CSSProperties;
|
|
954
|
+
}
|
|
955
|
+
/**
|
|
956
|
+
* Positioned - Controls where a child of Stack is positioned
|
|
957
|
+
*
|
|
958
|
+
* Must be a direct child of Stack. At least one of top, bottom, left, or right
|
|
959
|
+
* must be non-null.
|
|
960
|
+
*
|
|
961
|
+
* @example Basic positioning
|
|
962
|
+
* ```
|
|
963
|
+
* <Stack style={{ width: 300, height: 300 }}>
|
|
964
|
+
* <Positioned top={10} left={10}>
|
|
965
|
+
* <Container>Top Left</Container>
|
|
966
|
+
* </Positioned>
|
|
967
|
+
* <Positioned bottom={10} right={10}>
|
|
968
|
+
* <Container>Bottom Right</Container>
|
|
969
|
+
* </Positioned>
|
|
970
|
+
* </Stack>
|
|
971
|
+
* ```
|
|
972
|
+
*
|
|
973
|
+
* @example Full width at bottom
|
|
974
|
+
* ```
|
|
975
|
+
* <Stack style={{ width: '100%', height: '100vh' }}>
|
|
976
|
+
* <Positioned left={0} right={0} bottom={0}>
|
|
977
|
+
* <Container padding={20} color="rgba(0,0,0,0.8)">
|
|
978
|
+
* <p>Footer overlay</p>
|
|
979
|
+
* </Container>
|
|
980
|
+
* </Positioned>
|
|
981
|
+
* </Stack>
|
|
982
|
+
* ```
|
|
983
|
+
*
|
|
984
|
+
* @example Centered with specific size
|
|
985
|
+
* ```
|
|
986
|
+
* <Stack style={{ width: 400, height: 400 }}>
|
|
987
|
+
* <Positioned
|
|
988
|
+
* top="50%"
|
|
989
|
+
* left="50%"
|
|
990
|
+
* width={200}
|
|
991
|
+
* height={200}
|
|
992
|
+
* style={{ transform: 'translate(-50%, -50%)' }}
|
|
993
|
+
* >
|
|
994
|
+
* <Container color="blue">Centered</Container>
|
|
995
|
+
* </Positioned>
|
|
996
|
+
* </Stack>
|
|
997
|
+
* ```
|
|
998
|
+
*
|
|
999
|
+
* @example Privogram hero badge (your design)
|
|
1000
|
+
* ```
|
|
1001
|
+
* <Stack style={{ width: '100%', height: '100vh' }}>
|
|
1002
|
+
* <Container decoration={{ image: { image: '/bg.jpg', fit: 'cover' } }} />
|
|
1003
|
+
*
|
|
1004
|
+
* <Positioned top={20} right={20}>
|
|
1005
|
+
* <Container
|
|
1006
|
+
* padding={8}
|
|
1007
|
+
* paddingHorizontal={16}
|
|
1008
|
+
* decoration={{
|
|
1009
|
+
* color: 'rgba(13, 13, 13, 0.6)',
|
|
1010
|
+
* borderRadius: 99,
|
|
1011
|
+
* }}
|
|
1012
|
+
* >
|
|
1013
|
+
* <span style={{ color: '#eb1660' }}>Early Access</span>
|
|
1014
|
+
* </Container>
|
|
1015
|
+
* </Positioned>
|
|
1016
|
+
* </Stack>
|
|
1017
|
+
* ```
|
|
1018
|
+
*/
|
|
1019
|
+
declare const Positioned: React.FC<PositionedProps>;
|
|
1020
|
+
|
|
1021
|
+
/**
|
|
1022
|
+
* PositionedFill - Shorthand for Positioned that fills the entire stack
|
|
1023
|
+
*
|
|
1024
|
+
* Equivalent to: Positioned(top: 0, bottom: 0, left: 0, right: 0)
|
|
1025
|
+
*
|
|
1026
|
+
* @example Background overlay
|
|
1027
|
+
* ```
|
|
1028
|
+
* <Stack style={{ width: '100%', height: '100vh' }}>
|
|
1029
|
+
* <Container decoration={{ image: { image: '/bg.jpg', fit: 'cover' } }} />
|
|
1030
|
+
*
|
|
1031
|
+
* <PositionedFill>
|
|
1032
|
+
* <Container decoration={{
|
|
1033
|
+
* gradient: {
|
|
1034
|
+
* colors: ['rgba(13,13,13,0)', 'rgba(13,13,13,0.9)'],
|
|
1035
|
+
* begin: 'to bottom',
|
|
1036
|
+
* },
|
|
1037
|
+
* }} />
|
|
1038
|
+
* </PositionedFill>
|
|
1039
|
+
* </Stack>
|
|
1040
|
+
* ```
|
|
1041
|
+
*/
|
|
1042
|
+
declare const PositionedFill: React.FC<Omit<PositionedProps, "top" | "bottom" | "left" | "right">>;
|
|
1043
|
+
|
|
1044
|
+
/**
|
|
1045
|
+
* SizedBox Props - Mirrors Flutter SizedBox widget
|
|
1046
|
+
*/
|
|
1047
|
+
interface SizedBoxProps {
|
|
1048
|
+
/**
|
|
1049
|
+
* The widget below this widget in the tree
|
|
1050
|
+
*/
|
|
1051
|
+
children?: ReactNode;
|
|
1052
|
+
/**
|
|
1053
|
+
* If non-null, requires the child to have exactly this width
|
|
1054
|
+
*
|
|
1055
|
+
* @example
|
|
1056
|
+
* ```
|
|
1057
|
+
* <SizedBox width={200}>
|
|
1058
|
+
* <p>200px wide</p>
|
|
1059
|
+
* </SizedBox>
|
|
1060
|
+
* ```
|
|
1061
|
+
*/
|
|
1062
|
+
width?: number | string;
|
|
1063
|
+
/**
|
|
1064
|
+
* If non-null, requires the child to have exactly this height
|
|
1065
|
+
*
|
|
1066
|
+
* @example
|
|
1067
|
+
* ```
|
|
1068
|
+
* <SizedBox height={100}>
|
|
1069
|
+
* <p>100px tall</p>
|
|
1070
|
+
* </SizedBox>
|
|
1071
|
+
* ```
|
|
1072
|
+
*/
|
|
1073
|
+
height?: number | string;
|
|
1074
|
+
/**
|
|
1075
|
+
* Additional CSS class names
|
|
1076
|
+
*/
|
|
1077
|
+
className?: string;
|
|
1078
|
+
/**
|
|
1079
|
+
* Custom inline styles (escape hatch)
|
|
1080
|
+
*/
|
|
1081
|
+
style?: CSSProperties;
|
|
1082
|
+
/**
|
|
1083
|
+
* HTML id attribute
|
|
1084
|
+
*/
|
|
1085
|
+
id?: string;
|
|
1086
|
+
}
|
|
1087
|
+
/**
|
|
1088
|
+
* SizedBox.expand - Creates a box that fills all available space
|
|
1089
|
+
*
|
|
1090
|
+
* Equivalent to: SizedBox(width: double.infinity, height: double.infinity)
|
|
1091
|
+
*
|
|
1092
|
+
* @example Fill parent container
|
|
1093
|
+
* ```
|
|
1094
|
+
* <Container width={400} height={400}>
|
|
1095
|
+
* <SizedBox.expand>
|
|
1096
|
+
* <Container color="#eb1660" />
|
|
1097
|
+
* </SizedBox.expand>
|
|
1098
|
+
* </Container>
|
|
1099
|
+
* ```
|
|
1100
|
+
*/
|
|
1101
|
+
declare const SizedBoxExpand: React.FC<Omit<SizedBoxProps, "width" | "height">>;
|
|
1102
|
+
/**
|
|
1103
|
+
* SizedBox.shrink - Creates a box that tries to be as small as possible
|
|
1104
|
+
*
|
|
1105
|
+
* Equivalent to: SizedBox(width: 0, height: 0)
|
|
1106
|
+
*
|
|
1107
|
+
* @example Conditional spacer (collapsed when not needed)
|
|
1108
|
+
* ```
|
|
1109
|
+
* {showSpacer ? <SizedBox height={20} /> : <SizedBox.shrink />}
|
|
1110
|
+
* ```
|
|
1111
|
+
*/
|
|
1112
|
+
declare const SizedBoxShrink: React.FC<Omit<SizedBoxProps, "width" | "height">>;
|
|
1113
|
+
/**
|
|
1114
|
+
* SizedBox.square - Creates a box with equal width and height
|
|
1115
|
+
*
|
|
1116
|
+
* @example 100x100 square
|
|
1117
|
+
* ```
|
|
1118
|
+
* <SizedBox.square dimension={100}>
|
|
1119
|
+
* <Container color="#eb1660" />
|
|
1120
|
+
* </SizedBox.square>
|
|
1121
|
+
* ```
|
|
1122
|
+
*/
|
|
1123
|
+
declare const SizedBoxSquare: React.FC<Omit<SizedBoxProps, "width" | "height"> & {
|
|
1124
|
+
dimension?: number | string;
|
|
1125
|
+
}>;
|
|
1126
|
+
/**
|
|
1127
|
+
* SizedBox component with static methods
|
|
1128
|
+
*/
|
|
1129
|
+
interface SizedBoxComponent extends React.FC<SizedBoxProps> {
|
|
1130
|
+
expand: typeof SizedBoxExpand;
|
|
1131
|
+
shrink: typeof SizedBoxShrink;
|
|
1132
|
+
square: typeof SizedBoxSquare;
|
|
1133
|
+
}
|
|
1134
|
+
declare const SizedBox: SizedBoxComponent;
|
|
1135
|
+
|
|
1136
|
+
/**
|
|
1137
|
+
* Padding Props - Mirrors Flutter Padding widget
|
|
1138
|
+
*/
|
|
1139
|
+
interface PaddingProps {
|
|
1140
|
+
/**
|
|
1141
|
+
* The widget below this widget in the tree
|
|
1142
|
+
*/
|
|
1143
|
+
children?: ReactNode;
|
|
1144
|
+
/**
|
|
1145
|
+
* The amount of space by which to inset the child
|
|
1146
|
+
*
|
|
1147
|
+
* @example
|
|
1148
|
+
* ```
|
|
1149
|
+
* // All sides 16px
|
|
1150
|
+
* <Padding padding={16}>
|
|
1151
|
+
*
|
|
1152
|
+
* // Symmetric padding
|
|
1153
|
+
* <Padding padding={{ horizontal: 20, vertical: 10 }}>
|
|
1154
|
+
*
|
|
1155
|
+
* // Individual sides
|
|
1156
|
+
* <Padding padding={{ top: 10, left: 20, right: 20, bottom: 10 }}>
|
|
1157
|
+
* ```
|
|
1158
|
+
*/
|
|
1159
|
+
padding: number | EdgeInsets;
|
|
1160
|
+
/**
|
|
1161
|
+
* Additional CSS class names
|
|
1162
|
+
*/
|
|
1163
|
+
className?: string;
|
|
1164
|
+
/**
|
|
1165
|
+
* Custom inline styles (escape hatch)
|
|
1166
|
+
*/
|
|
1167
|
+
style?: CSSProperties;
|
|
1168
|
+
/**
|
|
1169
|
+
* HTML id attribute
|
|
1170
|
+
*/
|
|
1171
|
+
id?: string;
|
|
1172
|
+
}
|
|
1173
|
+
/**
|
|
1174
|
+
* Padding - A widget that insets its child by the given padding
|
|
1175
|
+
*
|
|
1176
|
+
* When passing layout constraints to its child, padding shrinks the constraints
|
|
1177
|
+
* by the given padding. Padding then sizes itself to its child's size, inflated
|
|
1178
|
+
* by the padding.
|
|
1179
|
+
*
|
|
1180
|
+
* **Lightweight alternative to Container when you only need padding.**
|
|
1181
|
+
*
|
|
1182
|
+
* @example All sides equal
|
|
1183
|
+
* ```
|
|
1184
|
+
* <Padding padding={16}>
|
|
1185
|
+
* <Text>Hello World!</Text>
|
|
1186
|
+
* </Padding>
|
|
1187
|
+
* ```
|
|
1188
|
+
*
|
|
1189
|
+
* @example Symmetric padding
|
|
1190
|
+
* ```
|
|
1191
|
+
* <Padding padding={{ horizontal: 20, vertical: 10 }}>
|
|
1192
|
+
* <Text>Hello World!</Text>
|
|
1193
|
+
* </Padding>
|
|
1194
|
+
* ```
|
|
1195
|
+
*
|
|
1196
|
+
* @example Individual sides
|
|
1197
|
+
* ```
|
|
1198
|
+
* <Padding padding={{ top: 10, left: 20, right: 20, bottom: 30 }}>
|
|
1199
|
+
* <Text>Hello World!</Text>
|
|
1200
|
+
* </Padding>
|
|
1201
|
+
* ```
|
|
1202
|
+
*
|
|
1203
|
+
* @example Card with padding (Flutter pattern)
|
|
1204
|
+
* ```
|
|
1205
|
+
* <Container
|
|
1206
|
+
* decoration={{
|
|
1207
|
+
* color: '#1a1a1a',
|
|
1208
|
+
* borderRadius: 16,
|
|
1209
|
+
* }}
|
|
1210
|
+
* >
|
|
1211
|
+
* <Padding padding={20}>
|
|
1212
|
+
* <Column spacing={8}>
|
|
1213
|
+
* <h3>Card Title</h3>
|
|
1214
|
+
* <p>Card content goes here</p>
|
|
1215
|
+
* </Column>
|
|
1216
|
+
* </Padding>
|
|
1217
|
+
* </Container>
|
|
1218
|
+
* ```
|
|
1219
|
+
*/
|
|
1220
|
+
declare const Padding: React.FC<PaddingProps>;
|
|
1221
|
+
|
|
1222
|
+
export { type Alignment, BorderAll, BorderRadiusCircular, type BoxBorder, type BoxConstraints, type BoxDecoration, type BoxShadow, BoxShape, Center, Centre, type CentreProps, Clip, Column, CrossAxisAlignment$1 as ColumnCrossAxisAlignment, MainAxisAlignment$1 as ColumnMainAxisAlignment, MainAxisSize$1 as ColumnMainAxisSize, type ColumnProps, Container, type ContainerProps, CrossAxisAlignment, type DecorationImage, type EdgeInsets, EdgeInsetsAll, EdgeInsetsOnly, EdgeInsetsSymmetric, type Gradient, MainAxisAlignment, MainAxisSize, Padding, type PaddingProps, Positioned, PositionedFill, type PositionedProps, Row, type RowProps, SizedBox, type SizedBoxProps, Stack, type StackAlignment, StackFit, type StackProps, TextDirection$1 as TextDirection, VerticalDirection };
|