fiboui 2.8.5 → 2.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/layout.d.ts CHANGED
@@ -94,7 +94,27 @@ declare class Observable<T> implements Subscribable<T> {
94
94
  unsubscribeEffect(effect: Effect): void;
95
95
  private notify;
96
96
  }
97
+ type GestureMask = "all" | "gesture" | "subviews" | "none";
98
+ type TapLocation = {
99
+ x: number;
100
+ y: number;
101
+ };
97
102
  declare abstract class GestureBuilder {
103
+ protected _enabled: boolean;
104
+ protected _including: GestureMask;
105
+ /** When true, wrappers must not stopPropagation (simultaneous). */
106
+ protected _bubble: boolean;
107
+ /** @internal Fired when the gesture successfully recognizes (Sequence / Exclusive). */
108
+ protected _onRecognized?: () => void;
109
+ enabled(value?: boolean): this;
110
+ /** SwiftUI `gesture(_:including:)`. */
111
+ including(mask: GestureMask): this;
112
+ /** Internal — set by SimultaneousGesture / `.simultaneousGesture`. */
113
+ bubble(value?: boolean): this;
114
+ /** @internal Used by SequenceGesture / ExclusiveGesture. */
115
+ onRecognized(callback: () => void): this;
116
+ /** @internal */
117
+ protected notifyRecognized(): void;
98
118
  abstract wrap(children: React$1.ReactNode): React$1.ReactNode;
99
119
  }
100
120
  interface AnimationOptions {
@@ -323,6 +343,144 @@ declare const When: {
323
343
  };
324
344
  type When = (typeof When)[keyof typeof When];
325
345
  type WhenStyle = React$1.CSSProperties | string | ((builder: any) => void);
346
+ declare const Size: {
347
+ readonly full: "full";
348
+ readonly screen: "screen";
349
+ readonly fit: "fit";
350
+ readonly min: "min";
351
+ readonly max: "max";
352
+ /** SwiftUI `.infinity` — expand to the space the parent proposes (`100%`). */
353
+ readonly infinity: "infinity";
354
+ };
355
+ type Size = (typeof Size)[keyof typeof Size];
356
+ declare const StackAlign: {
357
+ readonly center: "center";
358
+ readonly top: "top";
359
+ readonly bottom: "bottom";
360
+ readonly left: "left";
361
+ readonly right: "right";
362
+ readonly topLeft: "topLeft";
363
+ readonly topRight: "topRight";
364
+ readonly bottomLeft: "bottomLeft";
365
+ readonly bottomRight: "bottomRight";
366
+ /** SwiftUI `leading` → `left` */
367
+ readonly leading: "left";
368
+ /** SwiftUI `trailing` → `right` */
369
+ readonly trailing: "right";
370
+ /** SwiftUI `topLeading` → `topLeft` */
371
+ readonly topLeading: "topLeft";
372
+ /** SwiftUI `topTrailing` → `topRight` */
373
+ readonly topTrailing: "topRight";
374
+ /** SwiftUI `bottomLeading` → `bottomLeft` */
375
+ readonly bottomLeading: "bottomLeft";
376
+ /** SwiftUI `bottomTrailing` → `bottomRight` */
377
+ readonly bottomTrailing: "bottomRight";
378
+ };
379
+ type StackAlign = (typeof StackAlign)[keyof typeof StackAlign];
380
+ type FrameSize = number | string | Size;
381
+ interface FrameSpec {
382
+ width?: FrameSize;
383
+ height?: FrameSize;
384
+ minWidth?: FrameSize;
385
+ idealWidth?: FrameSize;
386
+ maxWidth?: FrameSize;
387
+ minHeight?: FrameSize;
388
+ idealHeight?: FrameSize;
389
+ maxHeight?: FrameSize;
390
+ alignment?: StackAlign | keyof typeof StackAlign;
391
+ }
392
+ type ClipShapeName = "circle" | "rounded" | "square";
393
+ interface OffsetSpec {
394
+ x?: number;
395
+ y?: number;
396
+ }
397
+ interface FixedSizeSpec {
398
+ horizontal?: boolean;
399
+ vertical?: boolean;
400
+ }
401
+ interface LayerSpec {
402
+ kind: "overlay" | "background";
403
+ child: FiboChild | (() => FiboChild);
404
+ alignment: StackAlign | keyof typeof StackAlign;
405
+ }
406
+ type ContentShapeName = "rectangle" | ClipShapeName;
407
+ type GeometryRect = {
408
+ x: number;
409
+ y: number;
410
+ width: number;
411
+ height: number;
412
+ };
413
+ type ContainerRelativeFrameSpec = {
414
+ axis?: "horizontal" | "vertical" | "both";
415
+ /** Divisions of the container (SwiftUI `count`). Default 1. */
416
+ count?: number;
417
+ /** Spans claimed (SwiftUI `span`). Default 1. */
418
+ span?: number;
419
+ };
420
+ type AlignmentGuideName = "leading" | "trailing" | "top" | "bottom" | "centerX" | "centerY" | string;
421
+ type AlignmentGuideDims = {
422
+ width: number;
423
+ height: number;
424
+ };
425
+ type AlignmentGuideSpec = {
426
+ guide: AlignmentGuideName;
427
+ /** Absolute guide position, or compute from own size (SwiftUI `ViewDimensions`). */
428
+ compute: number | ((dims: AlignmentGuideDims) => number);
429
+ };
430
+ type MatchedGeometrySpec = {
431
+ id: string;
432
+ namespace?: string;
433
+ /** SwiftUI `isSource` — source owns the shared geometry. Default true. */
434
+ isSource?: boolean;
435
+ };
436
+ type PreferenceKeyDef<T> = {
437
+ readonly __preferenceKey: true;
438
+ readonly id: string | symbol;
439
+ readonly defaultValue: T;
440
+ reduce: (value: T, nextValue: T) => T;
441
+ };
442
+ type PreferenceWriteSpec = {
443
+ key: PreferenceKeyDef<any>;
444
+ value: unknown;
445
+ };
446
+ type PreferenceReadSpec = {
447
+ key: PreferenceKeyDef<any>;
448
+ onChange: (value: any) => void;
449
+ };
450
+ declare const Edge: {
451
+ readonly top: "top";
452
+ readonly bottom: "bottom";
453
+ readonly leading: "leading";
454
+ readonly trailing: "trailing";
455
+ };
456
+ type Edge = (typeof Edge)[keyof typeof Edge];
457
+ declare const EdgeSet: {
458
+ readonly top: "top";
459
+ readonly bottom: "bottom";
460
+ readonly leading: "leading";
461
+ readonly trailing: "trailing";
462
+ readonly horizontal: "horizontal";
463
+ readonly vertical: "vertical";
464
+ readonly all: "all";
465
+ };
466
+ type EdgeSet = (typeof EdgeSet)[keyof typeof EdgeSet];
467
+ type EdgeInsetsValue = {
468
+ top?: number | string;
469
+ bottom?: number | string;
470
+ leading?: number | string;
471
+ trailing?: number | string;
472
+ /** CSS left — alias of leading in LTR */
473
+ left?: number | string;
474
+ /** CSS right — alias of trailing in LTR */
475
+ right?: number | string;
476
+ };
477
+ type SafeAreaInsetEdge = Edge | "top" | "bottom" | "leading" | "trailing" | "left" | "right";
478
+ type SafeAreaInsetSpec = {
479
+ edge: SafeAreaInsetEdge;
480
+ content: FiboChild | (() => FiboChild);
481
+ /** Gap between inset bar and content. Default 0. */
482
+ spacing?: number;
483
+ };
326
484
  interface SpringOptions {
327
485
  stiffness?: number;
328
486
  damping?: number;
@@ -532,7 +690,29 @@ declare abstract class FiboBuilder {
532
690
  /** @internal Direct `method(signal.value)` calls replayed when that signal changes. */
533
691
  protected _replays: Array<() => void>;
534
692
  protected _isObserver: boolean;
535
- protected _gesture?: GestureBuilder;
693
+ /** Normal-priority gestures (SwiftUI `.gesture`). Last = outermost. */
694
+ protected _gestures: GestureBuilder[];
695
+ /** SwiftUI `.simultaneousGesture` — bubble / no stopPropagation. */
696
+ protected _simultaneousGestures: GestureBuilder[];
697
+ /** SwiftUI `.highPriorityGesture` — wrapped last (outermost / capture wins). */
698
+ protected _highPriorityGestures: GestureBuilder[];
699
+ protected _offset?: OffsetSpec;
700
+ protected _clipped: boolean;
701
+ protected _clipShape?: ClipShapeName | string;
702
+ protected _contentShape?: ContentShapeName | string;
703
+ protected _fixedSize?: FixedSizeSpec;
704
+ protected _layoutPriority?: number;
705
+ protected _layers: LayerSpec[];
706
+ protected _onGeometryChange?: (rect: GeometryRect) => void;
707
+ protected _compositingGroup: boolean;
708
+ protected _viewMask?: string;
709
+ protected _containerRelativeFrame?: ContainerRelativeFrameSpec;
710
+ protected _alignmentGuide?: AlignmentGuideSpec;
711
+ protected _matchedGeometry?: MatchedGeometrySpec;
712
+ protected _preferences: PreferenceWriteSpec[];
713
+ protected _preferenceReaders: PreferenceReadSpec[];
714
+ protected _safeAreaInsets: SafeAreaInsetSpec[];
715
+ protected _navigationTitle?: string;
536
716
  protected _animationConfig?: Partial<AnimationOptions>;
537
717
  protected _animatedProps: Map<string, Signal<any>>;
538
718
  protected _transforms: string[];
@@ -561,6 +741,11 @@ declare abstract class FiboBuilder {
561
741
  protected _explicitScrollMargin: boolean;
562
742
  /** Shrink-wrap: skip the default `w-full` / `self-stretch` on Row and Column. */
563
743
  protected _hug: boolean;
744
+ /**
745
+ * SwiftUI `.frame(...)` wrappers (outer → inner order of application).
746
+ * Applied in `assembleBuilder` so every widget gets the same DX.
747
+ */
748
+ protected _frames: FrameSpec[];
564
749
  /**
565
750
  * Unset every CSS property on this component and what it renders inside.
566
751
  * Chain `.style()`, `.px()`, `.flex()` and the rest after this to put back only what you want.
@@ -572,6 +757,109 @@ declare abstract class FiboBuilder {
572
757
  protected isReset(): boolean;
573
758
  hug(): this;
574
759
  protected isHug(): boolean;
760
+ /**
761
+ * SwiftUI `View.frame` — invisible box around this view.
762
+ *
763
+ * ```ts
764
+ * Image(url).frame({ width: 300, height: 400 })
765
+ * Text('★★★★').frame({
766
+ * maxWidth: Size.infinity,
767
+ * maxHeight: Size.infinity,
768
+ * alignment: StackAlign.topTrailing,
769
+ * })
770
+ * ```
771
+ *
772
+ * Chainable: each `.frame()` wraps the previous (same as SwiftUI).
773
+ */
774
+ frame(spec: FrameSpec): this;
775
+ /**
776
+ * SwiftUI `.offset(x:y:)` — visual translate; layout size stays.
777
+ * `.offset(8)` ≡ `{ x: 8, y: 8 }`; `.offset({ x: 4 })` only horizontal.
778
+ */
779
+ offset(value: number | OffsetSpec): this;
780
+ /** SwiftUI `.clipped()` — overflow hidden to bounds. */
781
+ clipped(): this;
782
+ /**
783
+ * SwiftUI `.clipShape` — `'circle' | 'rounded' | 'square'` or any CSS radius
784
+ * (`'8px'`, `'50%'`). Clips drawing; hit-testing still follows layout unless
785
+ * you also set {@link contentShape}.
786
+ */
787
+ clipShape(shape: ClipShapeName | string): this;
788
+ /**
789
+ * SwiftUI `.contentShape` — region used for hit-testing (tap / long-press).
790
+ * Default `'rectangle'` = full frame box, even over transparent pixels.
791
+ *
792
+ * ```ts
793
+ * ZStack()…frame({ width: 300, height: 400 })
794
+ * .clipShape('8px')
795
+ * .contentShape('rectangle')
796
+ * .onTapGesture(open)
797
+ * ```
798
+ */
799
+ contentShape(shape?: ContentShapeName | string): this;
800
+ /**
801
+ * SwiftUI `.fixedSize(horizontal:vertical:)` — hug content on those axes.
802
+ * Defaults both axes when called with no args.
803
+ */
804
+ fixedSize(spec?: FixedSizeSpec | boolean): this;
805
+ /**
806
+ * SwiftUI `.layoutPriority` — higher resists compression and claims free space.
807
+ * Web: flex-grow / flex-shrink (not a full multi-axis proposal solver).
808
+ */
809
+ layoutPriority(value: number): this;
810
+ /** SwiftUI `.compositingGroup()`. */
811
+ compositingGroup(): this;
812
+ /** SwiftUI `.mask` — shape name or CSS mask-image value. */
813
+ mask(shapeOrCss: ClipShapeName | "rectangle" | string): this;
814
+ /** SwiftUI `containerRelativeFrame`. */
815
+ containerRelativeFrame(axis?: ContainerRelativeFrameSpec["axis"] | ContainerRelativeFrameSpec, count?: number, span?: number): this;
816
+ /**
817
+ * SwiftUI `alignmentGuide` — named guide + absolute value or compute from size.
818
+ * ```ts
819
+ * Text('Hi').alignmentGuide('leading', (d) => d.width / 2)
820
+ * ```
821
+ */
822
+ alignmentGuide(guide: AlignmentGuideName, compute: number | ((dims: {
823
+ width: number;
824
+ height: number;
825
+ }) => number)): this;
826
+ /**
827
+ * SwiftUI `matchedGeometryEffect` — shared view-transition id + measured rect.
828
+ * ```ts
829
+ * Image(url).matchedGeometryEffect('hero', { namespace: 'gallery', isSource: true })
830
+ * ```
831
+ */
832
+ matchedGeometryEffect(id: string, namespaceOrOpts?: string | {
833
+ namespace?: string;
834
+ isSource?: boolean;
835
+ }): this;
836
+ /** SwiftUI `.preference(key:value:)` — contribute upward to `.onPreferenceChange`. */
837
+ preference<T>(key: PreferenceKeyDef<T>, value: T): this;
838
+ /** SwiftUI `.onPreferenceChange` — reduce descendant preferences. */
839
+ onPreferenceChange<T>(key: PreferenceKeyDef<T>, onChange: (value: T) => void): this;
840
+ /**
841
+ * SwiftUI `.safeAreaInset(edge:)` — reserve a bar on one edge; content fills the rest.
842
+ * Distinct from `SafeArea` (notch padding) and `proxy.safeAreaInsets` (read-only).
843
+ */
844
+ safeAreaInset(edge: SafeAreaInsetEdge, content: SafeAreaInsetSpec["content"], spacing?: number): this;
845
+ /**
846
+ * SwiftUI `.navigationTitle` — stores title for Scaffold (see `Scaffold.navigationTitle`).
847
+ * On non-Scaffold builders, sets `aria-label` / data attribute only (no extra chrome bar).
848
+ */
849
+ navigationTitle(title: string): this;
850
+ /**
851
+ * SwiftUI `.overlay(alignment:) { }` — layer above this view.
852
+ * ```ts
853
+ * Image(url).overlay(Text('NEW'), StackAlign.topTrailing)
854
+ * ```
855
+ */
856
+ overlay(child: FiboChild | (() => FiboChild), alignment?: StackAlign | keyof typeof StackAlign): this;
857
+ /**
858
+ * SwiftUI `.background(alignment:) { }` — layer behind this view.
859
+ */
860
+ background(child: FiboChild | (() => FiboChild), alignment?: StackAlign | keyof typeof StackAlign): this;
861
+ /** SwiftUI `onGeometryChange` — fires on mount + resize. */
862
+ onGeometryChange(handler: (rect: GeometryRect) => void): this;
575
863
  id(value: string): this;
576
864
  /**
577
865
  * Scroll target. Same as `.id()`, plus `scroll-margin-top` so the section
@@ -595,7 +883,18 @@ declare abstract class FiboBuilder {
595
883
  private setBoxShorthand;
596
884
  paddingHorizontal(value: string | number): this;
597
885
  paddingVertical(value: string | number): this;
886
+ /**
887
+ * SwiftUI `.padding`:
888
+ * - `.padding(8)` — all sides
889
+ * - `.padding(EdgeSet.horizontal, 12)` — Edge.Set + value
890
+ * - `.padding({ top: 8, leading: 12 })` — EdgeInsets
891
+ */
598
892
  padding(value: string | number): this;
893
+ padding(edges: EdgeSet, value: string | number): this;
894
+ padding(insets: EdgeInsetsValue): this;
895
+ /** SwiftUI `.padding` with {@link EdgeSet} — alias clarity. */
896
+ /** @deprecated Prefer `.padding(EdgeSet, n)` — same implementation. */
897
+ paddingEdges(edges: EdgeSet, value: string | number): this;
599
898
  marginHorizontal(value: string | number): this;
600
899
  marginVertical(value: string | number): this;
601
900
  margin(value: string | number): this;
@@ -705,6 +1004,9 @@ declare abstract class FiboBuilder {
705
1004
  * (the Scaffold body) cannot divide the viewport across these children.
706
1005
  * `400`, `'320px'`, `Size.full`, and `Space.md` all count. `flex(1)` afterwards
707
1006
  * opts back into sharing space.
1007
+ *
1008
+ * Percentages / `auto` do not lock `min-*` — `minWidth: 100%` on a flex
1009
+ * child fights clamping and lets long text blow past the ZStack box.
708
1010
  */
709
1011
  private lockAxis;
710
1012
  width(value: string | number): this;
@@ -735,8 +1037,58 @@ declare abstract class FiboBuilder {
735
1037
  translateX(value: Signal<number> | number): this;
736
1038
  translateY(value: Signal<number> | number): this;
737
1039
  scale(value: Signal<number> | number): this;
1040
+ /** SwiftUI `scaleEffect` — alias of {@link scale}. */
1041
+ scaleEffect(value: Signal<number> | number): this;
738
1042
  rotate(degrees: Signal<number> | number): this;
1043
+ /** SwiftUI `rotationEffect` — alias of {@link rotate} (degrees). */
1044
+ rotationEffect(degrees: Signal<number> | number): this;
1045
+ /**
1046
+ * SwiftUI `.allowsHitTesting` — when `false`, this view and descendants
1047
+ * ignore pointer hits (`pointer-events: none`).
1048
+ */
1049
+ allowsHitTesting(value?: boolean): this;
1050
+ /**
1051
+ * SwiftUI scroll target id — used by {@link ScrollViewReader} `.scrollTo(id)`.
1052
+ * Sets `data-scroll-id` on the host.
1053
+ */
1054
+ scrollTarget(id: string): this;
1055
+ /**
1056
+ * SwiftUI: taps on *containers* (ZStack / Column / …) only hit drawn content
1057
+ * unless `.contentShape(Rectangle())` is set. We default that shape when the
1058
+ * first gesture is attached and the caller did not set one — same as the
1059
+ * usual SwiftUI fix, without forcing it on chrome-only views.
1060
+ */
1061
+ protected ensureGestureContentShape(): void;
1062
+ /**
1063
+ * SwiftUI `.gesture` — attach Tap / LongPress / Drag / Magnify / Rotate / …
1064
+ * Chainable: each call wraps the previous (outermost = last).
1065
+ */
739
1066
  gesture(gesture: GestureBuilder): this;
1067
+ /** SwiftUI `.simultaneousGesture` — runs alongside other gestures (no steal). */
1068
+ simultaneousGesture(gesture: GestureBuilder): this;
1069
+ /** SwiftUI `.highPriorityGesture` — recognized before the view's own gestures. */
1070
+ highPriorityGesture(gesture: GestureBuilder): this;
1071
+ /**
1072
+ * Sugar for {@link TapGesture}`.onEnd(handler)`.
1073
+ * Note: `Button` / `List` / `ListTile` keep domain-specific `.onPress`.
1074
+ */
1075
+ onPress(handler: () => void): this;
1076
+ /** Flutter-style alias of {@link onPress}. */
1077
+ onTap(handler: () => void): this;
1078
+ /**
1079
+ * SwiftUI `onTapGesture(count:perform:)` — default count 1.
1080
+ * Pass a location callback for SpatialTap behavior.
1081
+ */
1082
+ onTapGesture(countOrHandler: number | ((location?: TapLocation) => void) | (() => void), handler?: ((location?: TapLocation) => void) | (() => void)): this;
1083
+ /**
1084
+ * SwiftUI `onLongPressGesture(minimumDuration:perform:onPressingChanged:)`.
1085
+ */
1086
+ onLongPressGesture(handlerOrOpts: (() => void) | {
1087
+ minimumDuration?: number;
1088
+ maximumDistance?: number;
1089
+ perform: () => void;
1090
+ onPressingChanged?: (pressing: boolean) => void;
1091
+ }, onPressingChanged?: (pressing: boolean) => void): this;
740
1092
  animation(config: Partial<AnimationOptions>): this;
741
1093
  protected hasStateManagement(): boolean;
742
1094
  className(className: string): this;
@@ -966,6 +1318,8 @@ declare class ContainerBuilder extends FiboBuilder {
966
1318
  children(children: FiboChildren): this;
967
1319
  props(value: Record<string, any>): this;
968
1320
  padding(value: string | number): this;
1321
+ padding(edges: EdgeSet, value: string | number): this;
1322
+ padding(insets: EdgeInsetsValue): this;
969
1323
  paddingHorizontal(value: string | number): this;
970
1324
  paddingVertical(value: string | number): this;
971
1325
  paddingLeft(value: string | number): this;
@@ -1064,6 +1418,12 @@ declare class ScaffoldBuilder extends FiboBuilder {
1064
1418
  headerBar(config: FiboChild | LayoutBarConfig): this;
1065
1419
  /** Flutter `Scaffold.appBar`. Same slot as `.headerBar()`. */
1066
1420
  appBar(config: FiboChild | LayoutBarConfig): this;
1421
+ /**
1422
+ * SwiftUI `.navigationTitle` — fills the header bar via existing `Header` chrome.
1423
+ * Does **not** add a sixth title component; if `.headerBar()` / `.appBar()` is already
1424
+ * set, this is a no-op (explicit chrome wins).
1425
+ */
1426
+ navigationTitle(title: string | FiboChild): this;
1067
1427
  footerBar(config: FiboChild | LayoutBarConfig): this;
1068
1428
  sideBarLeft(config: FiboChild | LayoutBarConfig): this;
1069
1429
  sideBarRight(config: FiboChild | LayoutBarConfig): this;
@@ -1134,11 +1494,24 @@ declare class DashboardLayoutBuilder extends FiboBuilder {
1134
1494
  build(): React$1.ReactElement;
1135
1495
  }
1136
1496
  export declare const DashboardLayout: () => StyleBuilder<DashboardLayoutBuilder>;
1497
+ type ZStackAlignment = StackAlign | keyof typeof StackAlign;
1498
+ type ZStackFit = "content" | "expand";
1137
1499
  declare class ZStackBuilder extends FiboBuilder {
1138
1500
  private _alignment;
1501
+ private _fit;
1502
+ /** Copied from base child’s fixed frame, if any. */
1503
+ private _baseFixedFrame?;
1139
1504
  children(children: FiboChildren): this;
1140
1505
  props(value: Record<string, any>): this;
1141
- alignment(align: "center" | "top" | "bottom" | "left" | "right" | "topLeft" | "topRight" | "bottomLeft" | "bottomRight"): this;
1506
+ alignment(align: ZStackAlignment): this;
1507
+ /**
1508
+ * How the stack sizes itself.
1509
+ * - `content` (default): hug the base child — SwiftUI ideal size / `StackFit.loose`
1510
+ * - `expand`: fill the parent — `StackFit.expand`
1511
+ *
1512
+ * `.hug()` still forces content; explicit `.width('100%')` still fills.
1513
+ */
1514
+ fit(value: ZStackFit): this;
1142
1515
  build(): React$1.ReactElement;
1143
1516
  }
1144
1517
  export declare const ZStack: () => StyleBuilder<ZStackBuilder>;
@@ -1172,6 +1545,33 @@ export declare class ScrollController {
1172
1545
  scrollByChild(dir?: -1 | 1, gap?: number): void;
1173
1546
  scrollToChild(index: number, gap?: number): void;
1174
1547
  }
1548
+ /** Proxy passed to `ScrollViewReader` builder — SwiftUI `ScrollViewProxy`. */
1549
+ export type ScrollViewProxy = {
1550
+ /** Scroll the nearest ancestor scroller so `[data-scroll-id=id]` is visible. */
1551
+ scrollTo: (id: string, options?: ScrollIntoViewOptions) => void;
1552
+ };
1553
+ declare class ScrollViewReaderBuilder extends FiboBuilder {
1554
+ private _builder?;
1555
+ builder(fn: (proxy: ScrollViewProxy) => unknown): this;
1556
+ build(): React$1.ReactElement;
1557
+ }
1558
+ /**
1559
+ * SwiftUI `ScrollViewReader` — wrap a ScrollView; call `proxy.scrollTo(id)`
1560
+ * for children marked with `.scrollTarget(id)`.
1561
+ *
1562
+ * ```ts
1563
+ * ScrollViewReader().builder((proxy) =>
1564
+ * Column().children(
1565
+ * Button('Go').onPress(() => proxy.scrollTo('row-3')),
1566
+ * ScrollView().children(
1567
+ * Text('A').scrollTarget('row-1'),
1568
+ * Text('C').scrollTarget('row-3'),
1569
+ * )
1570
+ * )
1571
+ * )
1572
+ * ```
1573
+ */
1574
+ export declare const ScrollViewReader: () => StyleBuilder<ScrollViewReaderBuilder>;
1175
1575
  type ScrollDirection = "vertical" | "horizontal" | "both";
1176
1576
  type ScrollbarVisibility = "hidden" | "visible" | "auto";
1177
1577
  type ScrollAnchor = "start" | "center" | "end";
@@ -1181,6 +1581,8 @@ declare class ScrollViewBuilder extends FiboBuilder {
1181
1581
  private _controller?;
1182
1582
  private _anchor?;
1183
1583
  private _refresh?;
1584
+ private _scrollTargetLayout;
1585
+ private _scrollPosition?;
1184
1586
  children(children: FiboChildren): this;
1185
1587
  props(value: Record<string, any>): this;
1186
1588
  direction(direction: ScrollDirection): this;
@@ -1191,6 +1593,16 @@ declare class ScrollViewBuilder extends FiboBuilder {
1191
1593
  controller(controller: ScrollController): this;
1192
1594
  scrollAnchor(anchor: ScrollAnchor): this;
1193
1595
  refreshable(handler: () => void): this;
1596
+ /**
1597
+ * SwiftUI `scrollTargetLayout` — children participate as scroll targets
1598
+ * (snap + `data-scroll-target-layout`).
1599
+ */
1600
+ scrollTargetLayout(enabled?: boolean): this;
1601
+ /**
1602
+ * SwiftUI `scrollPosition(id:)` — initial / programmatic target id
1603
+ * (`data-scroll-position`). Pair with `.scrollTarget(id)` on children.
1604
+ */
1605
+ scrollPosition(id: string): this;
1194
1606
  /**
1195
1607
  * Native scroll listener on the overflow host.
1196
1608
  * String presets still alias `.reveal()` from FiboBuilder.
@@ -1214,5 +1626,55 @@ declare class VirtualColumnBuilder extends FiboBuilder {
1214
1626
  build(): React$1.ReactElement;
1215
1627
  }
1216
1628
  export declare const VirtualColumn: () => StyleBuilder<VirtualColumnBuilder>;
1629
+ declare class VirtualRowBuilder extends FiboBuilder {
1630
+ private _itemWidth?;
1631
+ private _estimatedItemWidth?;
1632
+ private _measureItems;
1633
+ private _overscan;
1634
+ private _containerWidth;
1635
+ itemWidth(width: number): this;
1636
+ estimatedItemWidth(width: number): this;
1637
+ measureItems(measure?: boolean): this;
1638
+ overscan(count: number): this;
1639
+ containerWidth(width: number): this;
1640
+ build(): React$1.ReactElement;
1641
+ }
1642
+ export declare const VirtualRow: () => StyleBuilder<VirtualRowBuilder>;
1643
+ export type LayoutSize = {
1644
+ width: number;
1645
+ height: number;
1646
+ };
1647
+ /** SwiftUI-ish safe-area insets (CSS env when available). */
1648
+ export type EdgeInsets = {
1649
+ top: number;
1650
+ bottom: number;
1651
+ leading: number;
1652
+ trailing: number;
1653
+ };
1654
+ /**
1655
+ * SwiftUI `GeometryProxy` — size + safe-area + local / global / named frames.
1656
+ */
1657
+ export type GeometryProxy = LayoutSize & {
1658
+ size: LayoutSize;
1659
+ safeAreaInsets: EdgeInsets;
1660
+ /** Frame in `local` | `global` | `CoordinateSpace.named('foo')`. */
1661
+ frame: (inSpace?: "local" | "global" | string) => {
1662
+ x: number;
1663
+ y: number;
1664
+ width: number;
1665
+ height: number;
1666
+ };
1667
+ };
1668
+ declare class LayoutBuilderBuilder extends FiboBuilder {
1669
+ private _builder?;
1670
+ private _coordinateSpace?;
1671
+ builder(fn: (proxy: GeometryProxy) => unknown): this;
1672
+ /** Publish this reader as `CoordinateSpace.named(name)`. */
1673
+ coordinateSpace(name: string): this;
1674
+ build(): React$1.ReactElement;
1675
+ }
1676
+ export declare const LayoutBuilder: () => StyleBuilder<LayoutBuilderBuilder>;
1677
+ /** SwiftUI `GeometryReader` — same as {@link LayoutBuilder}, receives {@link GeometryProxy}. */
1678
+ export declare const GeometryReader: () => StyleBuilder<LayoutBuilderBuilder>;
1217
1679
 
1218
1680
  export {};
package/dist/layout.js CHANGED
@@ -1,19 +1,23 @@
1
- import { C as r, a as s, H as e, L as l, b as t, S, Z as n } from "./index-Bgt9DiVJ.js";
2
- import { C as c, S as d } from "./index-DU4n9axe.js";
3
- import { ac as i, a9 as m, aa as b, ab as p, ad as u } from "./client-BzMPiV64.js";
1
+ import { C as e, a as o, L as s, b as l, S as t, Z as i } from "./index-FuD1J3Qo.js";
2
+ import { C as d, S as c } from "./index-BLEG6Nql.js";
3
+ import { ad as u, ai as C, ab as f, ah as m, a9 as b, aa as p, ae as w, ac as L, af as R, ag as V } from "./client-3NdKI2xE.js";
4
4
  export {
5
- r as Center,
6
- c as Column,
7
- s as Container,
8
- i as DashboardLayout,
9
- e as Header,
10
- l as Line,
11
- m as Row,
12
- b as Scaffold,
13
- t as ScrollController,
14
- S as ScrollView,
15
- p as Sidebar,
16
- d as Spacer,
17
- u as VirtualColumn,
18
- n as ZStack
5
+ e as Center,
6
+ d as Column,
7
+ o as Container,
8
+ u as DashboardLayout,
9
+ C as GeometryReader,
10
+ f as Header,
11
+ m as LayoutBuilder,
12
+ s as Line,
13
+ b as Row,
14
+ p as Scaffold,
15
+ l as ScrollController,
16
+ t as ScrollView,
17
+ w as ScrollViewReader,
18
+ L as Sidebar,
19
+ c as Spacer,
20
+ R as VirtualColumn,
21
+ V as VirtualRow,
22
+ i as ZStack
19
23
  };