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/{client-BzMPiV64.js → client-3NdKI2xE.js} +7296 -4714
- package/dist/content.d.ts +364 -7
- package/dist/content.js +8 -8
- package/dist/core.d.ts +353 -1
- package/dist/core.js +2 -2
- package/dist/{icons-aP7ZHyqh.js → icons-DS8J4SFk.js} +83 -75
- package/dist/{index-Dd48Ov9N.js → index-B6F3yf3H.js} +10 -10
- package/dist/{index-DU4n9axe.js → index-BLEG6Nql.js} +1 -1
- package/dist/{index-B9YuBkEv.js → index-BaTO66yA.js} +22 -22
- package/dist/index-FuD1J3Qo.js +785 -0
- package/dist/{index-DWBoYvko.js → index-I-MXiId0.js} +7 -7
- package/dist/index.d.ts +1978 -1163
- package/dist/index.js +1144 -1065
- package/dist/interactive.d.ts +353 -1
- package/dist/interactive.js +15 -15
- package/dist/layout.d.ts +464 -2
- package/dist/layout.js +21 -17
- package/dist/{metadata-B5v6sx60.js → metadata-B2MRlDTz.js} +23 -23
- package/dist/navigation.js +6 -6
- package/dist/{page-CHjFSSAF.js → page-xwU8SnoZ.js} +36 -36
- package/dist/server.d.ts +361 -1
- package/dist/server.js +3793 -2400
- package/dist/structure.d.ts +353 -1
- package/dist/structure.js +4 -4
- package/dist/style.css +1 -1
- package/dist/theme.js +3 -3
- package/package.json +1 -1
- package/dist/index-Bgt9DiVJ.js +0 -839
package/dist/index.d.ts
CHANGED
|
@@ -512,9 +512,151 @@ export declare const FIBO_BREAKPOINTS: {
|
|
|
512
512
|
export type BreakpointKey = keyof typeof FIBO_BREAKPOINTS;
|
|
513
513
|
/** Resolve `md` → `(min-width: 768px)`, or pass through a raw media query. */
|
|
514
514
|
export declare function toMediaQuery(query: BreakpointKey | string): string;
|
|
515
|
-
|
|
515
|
+
interface Offset {
|
|
516
|
+
x: number;
|
|
517
|
+
y: number;
|
|
518
|
+
}
|
|
519
|
+
interface GestureEvent {
|
|
520
|
+
translation: Offset;
|
|
521
|
+
delta: Offset;
|
|
522
|
+
velocity: Offset;
|
|
523
|
+
location: Offset;
|
|
524
|
+
/** SwiftUI-style projection: translation + velocity × dt (≈150ms). */
|
|
525
|
+
predictedEndTranslation?: Offset;
|
|
526
|
+
/** location + (predictedEndTranslation − translation). */
|
|
527
|
+
predictedEndLocation?: Offset;
|
|
528
|
+
}
|
|
529
|
+
/** Axis lock for {@link DragGesture}. */
|
|
530
|
+
export type DragAxis = "free" | "horizontal" | "vertical";
|
|
531
|
+
type PanCallback = (event: GestureEvent) => void;
|
|
532
|
+
/** SwiftUI `GestureMask` — which gestures participate. */
|
|
533
|
+
export type GestureMask = "all" | "gesture" | "subviews" | "none";
|
|
534
|
+
export type TapLocation = {
|
|
535
|
+
x: number;
|
|
536
|
+
y: number;
|
|
537
|
+
};
|
|
538
|
+
export type MagnifyValue = {
|
|
539
|
+
magnification: number;
|
|
540
|
+
velocity?: number;
|
|
541
|
+
};
|
|
542
|
+
export type RotateValue = {
|
|
543
|
+
radians: number;
|
|
544
|
+
degrees: number;
|
|
545
|
+
};
|
|
546
|
+
export declare abstract class GestureBuilder {
|
|
547
|
+
protected _enabled: boolean;
|
|
548
|
+
protected _including: GestureMask;
|
|
549
|
+
/** When true, wrappers must not stopPropagation (simultaneous). */
|
|
550
|
+
protected _bubble: boolean;
|
|
551
|
+
/** @internal Fired when the gesture successfully recognizes (Sequence / Exclusive). */
|
|
552
|
+
protected _onRecognized?: () => void;
|
|
553
|
+
enabled(value?: boolean): this;
|
|
554
|
+
/** SwiftUI `gesture(_:including:)`. */
|
|
555
|
+
including(mask: GestureMask): this;
|
|
556
|
+
/** Internal — set by SimultaneousGesture / `.simultaneousGesture`. */
|
|
557
|
+
bubble(value?: boolean): this;
|
|
558
|
+
/** @internal Used by SequenceGesture / ExclusiveGesture. */
|
|
559
|
+
onRecognized(callback: () => void): this;
|
|
560
|
+
/** @internal */
|
|
561
|
+
protected notifyRecognized(): void;
|
|
516
562
|
abstract wrap(children: React$1.ReactNode): React$1.ReactNode;
|
|
517
563
|
}
|
|
564
|
+
declare class DragGestureBuilder extends GestureBuilder {
|
|
565
|
+
private _onStart?;
|
|
566
|
+
private _onUpdate?;
|
|
567
|
+
private _onEnd?;
|
|
568
|
+
private _minimumDistance;
|
|
569
|
+
private _axis;
|
|
570
|
+
/** SwiftUI `minimumDistance` — pixels before the drag begins (default 10). */
|
|
571
|
+
minimumDistance(px: number): this;
|
|
572
|
+
/** Lock drag to one axis (`free` | `horizontal` | `vertical`). */
|
|
573
|
+
axis(value: DragAxis): this;
|
|
574
|
+
onStart(callback: PanCallback): this;
|
|
575
|
+
onUpdate(callback: PanCallback): this;
|
|
576
|
+
onEnd(callback: PanCallback): this;
|
|
577
|
+
wrap(children: React$1.ReactNode): React$1.ReactNode;
|
|
578
|
+
}
|
|
579
|
+
declare class TapGestureBuilder extends GestureBuilder {
|
|
580
|
+
private _count;
|
|
581
|
+
private _reportLocation;
|
|
582
|
+
private _onStart?;
|
|
583
|
+
private _onEnd?;
|
|
584
|
+
/** SwiftUI `TapGesture(count:)` — 2 = double-tap. */
|
|
585
|
+
count(n: number): this;
|
|
586
|
+
/** SwiftUI `SpatialTapGesture` — `onEnd` receives `{ x, y }` in view coords. */
|
|
587
|
+
spatial(value?: boolean): this;
|
|
588
|
+
onStart(callback: () => void): this;
|
|
589
|
+
onEnd(callback: ((location?: TapLocation) => void) | (() => void)): this;
|
|
590
|
+
wrap(children: React$1.ReactNode): React$1.ReactNode;
|
|
591
|
+
}
|
|
592
|
+
/** SwiftUI `SpatialTapGesture` — tap that reports location. */
|
|
593
|
+
export declare function SpatialTapGesture(): TapGestureBuilder;
|
|
594
|
+
declare class LongPressGestureBuilder extends GestureBuilder {
|
|
595
|
+
private _duration;
|
|
596
|
+
private _maximumDistance;
|
|
597
|
+
private _onStart?;
|
|
598
|
+
private _onEnd?;
|
|
599
|
+
private _onPressingChanged?;
|
|
600
|
+
duration(ms: number): this;
|
|
601
|
+
/** Abort if finger moves farther than this (SwiftUI `maximumDistance`). */
|
|
602
|
+
maximumDistance(px: number): this;
|
|
603
|
+
onStart(callback: () => void): this;
|
|
604
|
+
onEnd(callback: () => void): this;
|
|
605
|
+
/** SwiftUI `onPressingChanged`. */
|
|
606
|
+
onPressingChanged(callback: (pressing: boolean) => void): this;
|
|
607
|
+
wrap(children: React$1.ReactNode): React$1.ReactNode;
|
|
608
|
+
}
|
|
609
|
+
declare class MagnifyGestureBuilder extends GestureBuilder {
|
|
610
|
+
private _onStart?;
|
|
611
|
+
private _onUpdate?;
|
|
612
|
+
private _onEnd?;
|
|
613
|
+
onStart(callback: (v: MagnifyValue) => void): this;
|
|
614
|
+
onUpdate(callback: (v: MagnifyValue) => void): this;
|
|
615
|
+
onEnd(callback: (v: MagnifyValue) => void): this;
|
|
616
|
+
wrap(children: React$1.ReactNode): React$1.ReactNode;
|
|
617
|
+
}
|
|
618
|
+
declare class RotateGestureBuilder extends GestureBuilder {
|
|
619
|
+
private _onStart?;
|
|
620
|
+
private _onUpdate?;
|
|
621
|
+
private _onEnd?;
|
|
622
|
+
onStart(callback: (v: RotateValue) => void): this;
|
|
623
|
+
onUpdate(callback: (v: RotateValue) => void): this;
|
|
624
|
+
onEnd(callback: (v: RotateValue) => void): this;
|
|
625
|
+
wrap(children: React$1.ReactNode): React$1.ReactNode;
|
|
626
|
+
}
|
|
627
|
+
declare class SimultaneousGestureBuilder extends GestureBuilder {
|
|
628
|
+
private readonly _gestures;
|
|
629
|
+
constructor(_gestures: GestureBuilder[]);
|
|
630
|
+
wrap(children: React$1.ReactNode): React$1.ReactNode;
|
|
631
|
+
}
|
|
632
|
+
declare class ExclusiveGestureBuilder extends GestureBuilder {
|
|
633
|
+
private readonly _gestures;
|
|
634
|
+
constructor(_gestures: GestureBuilder[]);
|
|
635
|
+
wrap(children: React$1.ReactNode): React$1.ReactNode;
|
|
636
|
+
}
|
|
637
|
+
declare class SequenceGestureBuilder extends GestureBuilder {
|
|
638
|
+
private readonly _first;
|
|
639
|
+
private readonly _second;
|
|
640
|
+
constructor(_first: GestureBuilder, _second: GestureBuilder);
|
|
641
|
+
wrap(children: React$1.ReactNode): React$1.ReactNode;
|
|
642
|
+
}
|
|
643
|
+
export declare function DragGesture(options?: {
|
|
644
|
+
minimumDistance?: number;
|
|
645
|
+
axis?: DragAxis;
|
|
646
|
+
}): DragGestureBuilder;
|
|
647
|
+
export declare function TapGesture(): TapGestureBuilder;
|
|
648
|
+
export declare function LongPressGesture(options?: {
|
|
649
|
+
duration?: number;
|
|
650
|
+
maximumDistance?: number;
|
|
651
|
+
}): LongPressGestureBuilder;
|
|
652
|
+
export declare function MagnifyGesture(): MagnifyGestureBuilder;
|
|
653
|
+
/** Alias of MagnifyGesture (older SwiftUI name). */
|
|
654
|
+
export declare function MagnificationGesture(): MagnifyGestureBuilder;
|
|
655
|
+
export declare function RotateGesture(): RotateGestureBuilder;
|
|
656
|
+
export declare function SimultaneousGesture(...gestures: GestureBuilder[]): SimultaneousGestureBuilder;
|
|
657
|
+
export declare function ExclusiveGesture(...gestures: GestureBuilder[]): ExclusiveGestureBuilder;
|
|
658
|
+
/** SwiftUI `SequenceGesture(first, second)`. */
|
|
659
|
+
export declare function SequenceGesture(first: GestureBuilder, second: GestureBuilder): SequenceGestureBuilder;
|
|
518
660
|
/**
|
|
519
661
|
* Full interaction-effect catalog (Hover.css–inspired names, fiboui-owned CSS).
|
|
520
662
|
* NOT a vendor of Hover.css — reimplemented for commercial use inside fiboui.
|
|
@@ -797,1123 +939,192 @@ export declare const When: {
|
|
|
797
939
|
export type When = (typeof When)[keyof typeof When];
|
|
798
940
|
/** Fluent callback, a style object, or a raw CSS declaration string (list rows). */
|
|
799
941
|
export type WhenStyle = React$1.CSSProperties | string | ((builder: any) => void);
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
942
|
+
/** `.animate(Motion.fadeIn)`. Preset list lives in `motionCss`. */
|
|
943
|
+
export declare const Motion: {
|
|
944
|
+
readonly pop: "pop";
|
|
945
|
+
readonly blur: "blur";
|
|
946
|
+
readonly fadeIn: "fadeIn";
|
|
947
|
+
readonly fadeOut: "fadeOut";
|
|
948
|
+
readonly fade: "fade";
|
|
949
|
+
readonly slideUp: "slideUp";
|
|
950
|
+
readonly slideDown: "slideDown";
|
|
951
|
+
readonly slideLeft: "slideLeft";
|
|
952
|
+
readonly slideRight: "slideRight";
|
|
953
|
+
readonly scaleIn: "scaleIn";
|
|
954
|
+
readonly scaleOut: "scaleOut";
|
|
955
|
+
readonly scale: "scale";
|
|
956
|
+
readonly blurIn: "blurIn";
|
|
957
|
+
readonly blurOut: "blurOut";
|
|
958
|
+
readonly bounce: "bounce";
|
|
959
|
+
};
|
|
960
|
+
export type Motion = (typeof Motion)[keyof typeof Motion];
|
|
961
|
+
/** `.hover(h => h.effect(Effect.sweepToRight))`. */
|
|
962
|
+
declare const Effect$1: {
|
|
963
|
+
readonly trim: "trim";
|
|
964
|
+
readonly pop: "pop";
|
|
965
|
+
readonly push: "push";
|
|
966
|
+
readonly fade: "fade";
|
|
967
|
+
readonly rotate: "rotate";
|
|
968
|
+
readonly grow: "grow";
|
|
969
|
+
readonly shrink: "shrink";
|
|
970
|
+
readonly pulse: "pulse";
|
|
971
|
+
readonly pulseGrow: "pulseGrow";
|
|
972
|
+
readonly pulseShrink: "pulseShrink";
|
|
973
|
+
readonly bounceIn: "bounceIn";
|
|
974
|
+
readonly bounceOut: "bounceOut";
|
|
975
|
+
readonly growRotate: "growRotate";
|
|
976
|
+
readonly float: "float";
|
|
977
|
+
readonly sink: "sink";
|
|
978
|
+
readonly bob: "bob";
|
|
979
|
+
readonly hang: "hang";
|
|
980
|
+
readonly skew: "skew";
|
|
981
|
+
readonly skewForward: "skewForward";
|
|
982
|
+
readonly skewBackward: "skewBackward";
|
|
983
|
+
readonly wobbleHorizontal: "wobbleHorizontal";
|
|
984
|
+
readonly wobbleVertical: "wobbleVertical";
|
|
985
|
+
readonly wobbleToBottomRight: "wobbleToBottomRight";
|
|
986
|
+
readonly wobbleToTopRight: "wobbleToTopRight";
|
|
987
|
+
readonly wobbleTop: "wobbleTop";
|
|
988
|
+
readonly wobbleBottom: "wobbleBottom";
|
|
989
|
+
readonly wobbleSkew: "wobbleSkew";
|
|
990
|
+
readonly buzz: "buzz";
|
|
991
|
+
readonly buzzOut: "buzzOut";
|
|
992
|
+
readonly forward: "forward";
|
|
993
|
+
readonly backward: "backward";
|
|
994
|
+
readonly nudge: "nudge";
|
|
995
|
+
readonly backPulse: "backPulse";
|
|
996
|
+
readonly sweepToRight: "sweepToRight";
|
|
997
|
+
readonly sweepToLeft: "sweepToLeft";
|
|
998
|
+
readonly sweepToBottom: "sweepToBottom";
|
|
999
|
+
readonly sweepToTop: "sweepToTop";
|
|
1000
|
+
readonly bounceToRight: "bounceToRight";
|
|
1001
|
+
readonly bounceToLeft: "bounceToLeft";
|
|
1002
|
+
readonly bounceToBottom: "bounceToBottom";
|
|
1003
|
+
readonly bounceToTop: "bounceToTop";
|
|
1004
|
+
readonly radialOut: "radialOut";
|
|
1005
|
+
readonly radialIn: "radialIn";
|
|
1006
|
+
readonly rectangleIn: "rectangleIn";
|
|
1007
|
+
readonly rectangleOut: "rectangleOut";
|
|
1008
|
+
readonly shutterInHorizontal: "shutterInHorizontal";
|
|
1009
|
+
readonly shutterOutHorizontal: "shutterOutHorizontal";
|
|
1010
|
+
readonly shutterInVertical: "shutterInVertical";
|
|
1011
|
+
readonly shutterOutVertical: "shutterOutVertical";
|
|
1012
|
+
readonly iconBack: "iconBack";
|
|
1013
|
+
readonly iconForward: "iconForward";
|
|
1014
|
+
readonly iconDown: "iconDown";
|
|
1015
|
+
readonly iconUp: "iconUp";
|
|
1016
|
+
readonly iconSpin: "iconSpin";
|
|
1017
|
+
readonly iconDrop: "iconDrop";
|
|
1018
|
+
readonly iconFade: "iconFade";
|
|
1019
|
+
readonly iconFloatAway: "iconFloatAway";
|
|
1020
|
+
readonly iconSinkAway: "iconSinkAway";
|
|
1021
|
+
readonly iconGrow: "iconGrow";
|
|
1022
|
+
readonly iconShrink: "iconShrink";
|
|
1023
|
+
readonly iconPulse: "iconPulse";
|
|
1024
|
+
readonly iconPulseGrow: "iconPulseGrow";
|
|
1025
|
+
readonly iconPulseShrink: "iconPulseShrink";
|
|
1026
|
+
readonly iconPush: "iconPush";
|
|
1027
|
+
readonly iconPop: "iconPop";
|
|
1028
|
+
readonly iconBounce: "iconBounce";
|
|
1029
|
+
readonly iconRotate: "iconRotate";
|
|
1030
|
+
readonly iconGrowRotate: "iconGrowRotate";
|
|
1031
|
+
readonly iconFloat: "iconFloat";
|
|
1032
|
+
readonly iconSink: "iconSink";
|
|
1033
|
+
readonly iconBob: "iconBob";
|
|
1034
|
+
readonly iconHang: "iconHang";
|
|
1035
|
+
readonly iconWobbleHorizontal: "iconWobbleHorizontal";
|
|
1036
|
+
readonly iconWobbleVertical: "iconWobbleVertical";
|
|
1037
|
+
readonly iconBuzz: "iconBuzz";
|
|
1038
|
+
readonly iconBuzzOut: "iconBuzzOut";
|
|
1039
|
+
readonly borderFade: "borderFade";
|
|
1040
|
+
readonly hollow: "hollow";
|
|
1041
|
+
readonly rippleOut: "rippleOut";
|
|
1042
|
+
readonly rippleIn: "rippleIn";
|
|
1043
|
+
readonly outlineOut: "outlineOut";
|
|
1044
|
+
readonly outlineIn: "outlineIn";
|
|
1045
|
+
readonly roundCorners: "roundCorners";
|
|
1046
|
+
readonly underlineFromLeft: "underlineFromLeft";
|
|
1047
|
+
readonly underlineFromCenter: "underlineFromCenter";
|
|
1048
|
+
readonly underlineFromRight: "underlineFromRight";
|
|
1049
|
+
readonly reveal: "reveal";
|
|
1050
|
+
readonly underlineReveal: "underlineReveal";
|
|
1051
|
+
readonly overlineFromLeft: "overlineFromLeft";
|
|
1052
|
+
readonly overlineFromCenter: "overlineFromCenter";
|
|
1053
|
+
readonly overlineFromRight: "overlineFromRight";
|
|
1054
|
+
readonly overlineReveal: "overlineReveal";
|
|
1055
|
+
readonly shadowGrow: "shadowGrow";
|
|
1056
|
+
readonly shadowFloat: "shadowFloat";
|
|
1057
|
+
readonly shadowGlow: "shadowGlow";
|
|
1058
|
+
readonly shadowRadial: "shadowRadial";
|
|
1059
|
+
readonly boxShadowOutset: "boxShadowOutset";
|
|
1060
|
+
readonly boxShadowInset: "boxShadowInset";
|
|
1061
|
+
readonly lift: "lift";
|
|
1062
|
+
readonly glow: "glow";
|
|
1063
|
+
readonly bubbleTop: "bubbleTop";
|
|
1064
|
+
readonly bubbleRight: "bubbleRight";
|
|
1065
|
+
readonly bubbleBottom: "bubbleBottom";
|
|
1066
|
+
readonly bubbleLeft: "bubbleLeft";
|
|
1067
|
+
readonly bubbleFloatTop: "bubbleFloatTop";
|
|
1068
|
+
readonly bubbleFloatRight: "bubbleFloatRight";
|
|
1069
|
+
readonly bubbleFloatBottom: "bubbleFloatBottom";
|
|
1070
|
+
readonly bubbleFloatLeft: "bubbleFloatLeft";
|
|
1071
|
+
readonly curlTopLeft: "curlTopLeft";
|
|
1072
|
+
readonly curlTopRight: "curlTopRight";
|
|
1073
|
+
readonly curlBottomRight: "curlBottomRight";
|
|
1074
|
+
readonly curlBottomLeft: "curlBottomLeft";
|
|
1075
|
+
};
|
|
1076
|
+
type Effect$1 = (typeof Effect$1)[keyof typeof Effect$1];
|
|
1077
|
+
export declare const Align: {
|
|
1078
|
+
readonly start: "start";
|
|
1079
|
+
readonly center: "center";
|
|
1080
|
+
readonly end: "end";
|
|
1081
|
+
readonly stretch: "stretch";
|
|
1082
|
+
readonly baseline: "baseline";
|
|
1083
|
+
readonly between: "between";
|
|
1084
|
+
readonly around: "around";
|
|
1085
|
+
readonly evenly: "evenly";
|
|
1086
|
+
};
|
|
1087
|
+
export type Align = (typeof Align)[keyof typeof Align];
|
|
805
1088
|
/**
|
|
806
|
-
*
|
|
807
|
-
*
|
|
1089
|
+
* Words `.width()` / `.height()` / `.frame()` already accept.
|
|
1090
|
+
* A number or `'320px'` skips this.
|
|
1091
|
+
*
|
|
1092
|
+
* `Size.infinity` ≡ SwiftUI `.infinity` — fill the parent's proposed size.
|
|
808
1093
|
*/
|
|
809
|
-
export declare
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
secondaryVariant?: string;
|
|
818
|
-
secondaryContainer?: string;
|
|
819
|
-
onSecondaryContainer?: string;
|
|
820
|
-
tertiary?: string;
|
|
821
|
-
onTertiary?: string;
|
|
822
|
-
tertiaryContainer?: string;
|
|
823
|
-
onTertiaryContainer?: string;
|
|
824
|
-
background: string;
|
|
825
|
-
surface: string;
|
|
826
|
-
surfaceVariant?: string;
|
|
827
|
-
onSurfaceVariant?: string;
|
|
828
|
-
error: string;
|
|
829
|
-
errorContainer?: string;
|
|
830
|
-
onErrorContainer?: string;
|
|
831
|
-
success?: string;
|
|
832
|
-
warning?: string;
|
|
833
|
-
info?: string;
|
|
834
|
-
onPrimary: string;
|
|
835
|
-
onSecondary: string;
|
|
836
|
-
onBackground: string;
|
|
837
|
-
onSurface: string;
|
|
838
|
-
onError: string;
|
|
839
|
-
/** Borders / hairlines — maps to `--fibo-outline`. */
|
|
840
|
-
outline?: string;
|
|
841
|
-
outlineVariant?: string;
|
|
842
|
-
/** Maps to `--fibo-surface-container-low` (M3 card surfaces). */
|
|
843
|
-
surfaceContainerLow?: string;
|
|
844
|
-
}
|
|
845
|
-
export interface ThemeTypography {
|
|
846
|
-
h1: TextStyle;
|
|
847
|
-
h2: TextStyle;
|
|
848
|
-
h3: TextStyle;
|
|
849
|
-
h4: TextStyle;
|
|
850
|
-
h5: TextStyle;
|
|
851
|
-
h6: TextStyle;
|
|
852
|
-
body: TextStyle;
|
|
853
|
-
caption: TextStyle;
|
|
854
|
-
label: TextStyle;
|
|
855
|
-
}
|
|
856
|
-
interface ThemeSpacing {
|
|
857
|
-
xs: string;
|
|
858
|
-
sm: string;
|
|
859
|
-
md: string;
|
|
860
|
-
lg: string;
|
|
861
|
-
xl: string;
|
|
862
|
-
}
|
|
863
|
-
interface ThemeBorderRadius {
|
|
864
|
-
/** Maps to `--fibo-radius-xs` when set (CSS sheets already define it). */
|
|
865
|
-
xs?: string;
|
|
866
|
-
sm: string;
|
|
867
|
-
md: string;
|
|
868
|
-
lg: string;
|
|
869
|
-
/** Maps to `--fibo-radius-xl` when set (CSS sheets already define it). */
|
|
870
|
-
xl?: string;
|
|
871
|
-
full: string;
|
|
872
|
-
}
|
|
873
|
-
interface ThemeShadows {
|
|
874
|
-
sm: string;
|
|
875
|
-
md: string;
|
|
876
|
-
lg: string;
|
|
877
|
-
}
|
|
878
|
-
export interface FiboTheme {
|
|
879
|
-
name: FiboThemeName;
|
|
880
|
-
colors: ThemeColors;
|
|
881
|
-
typography: ThemeTypography;
|
|
882
|
-
spacing: ThemeSpacing;
|
|
883
|
-
borderRadius: ThemeBorderRadius;
|
|
884
|
-
shadows: ThemeShadows;
|
|
885
|
-
fontFamily: string;
|
|
886
|
-
}
|
|
887
|
-
/** Built-in presets. `noir` is the dark editorial theme (site / dense apps). */
|
|
888
|
-
export declare const FIBO_THEMES: {
|
|
889
|
-
readonly material: FiboTheme;
|
|
890
|
-
readonly cupertino: FiboTheme;
|
|
891
|
-
readonly web: FiboTheme;
|
|
892
|
-
readonly noir: FiboTheme;
|
|
1094
|
+
export declare const Size: {
|
|
1095
|
+
readonly full: "full";
|
|
1096
|
+
readonly screen: "screen";
|
|
1097
|
+
readonly fit: "fit";
|
|
1098
|
+
readonly min: "min";
|
|
1099
|
+
readonly max: "max";
|
|
1100
|
+
/** SwiftUI `.infinity` — expand to the space the parent proposes (`100%`). */
|
|
1101
|
+
readonly infinity: "infinity";
|
|
893
1102
|
};
|
|
894
|
-
export type
|
|
895
|
-
|
|
896
|
-
export declare
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
fontFamily?: string;
|
|
1103
|
+
export type Size = (typeof Size)[keyof typeof Size];
|
|
1104
|
+
/** @deprecated Prefer `Size.infinity` — same token. */
|
|
1105
|
+
export declare const infinity: "infinity";
|
|
1106
|
+
/** Theme spacing. `.padding(Space.md)`, `.gap(Space.sm)`, `.height(Space.xl)`. */
|
|
1107
|
+
export declare const Space: {
|
|
1108
|
+
readonly xs: "var(--fibo-space-xs)";
|
|
1109
|
+
readonly sm: "var(--fibo-space-sm)";
|
|
1110
|
+
readonly md: "var(--fibo-space-md)";
|
|
1111
|
+
readonly lg: "var(--fibo-space-lg)";
|
|
1112
|
+
readonly xl: "var(--fibo-space-xl)";
|
|
905
1113
|
};
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
export
|
|
917
|
-
declare enum Colors {
|
|
918
|
-
Primary = "primary",
|
|
919
|
-
OnPrimary = "on-primary",
|
|
920
|
-
PrimaryContainer = "primary-container",
|
|
921
|
-
OnPrimaryContainer = "on-primary-container",
|
|
922
|
-
Secondary = "secondary",
|
|
923
|
-
OnSecondary = "on-secondary",
|
|
924
|
-
SecondaryContainer = "secondary-container",
|
|
925
|
-
OnSecondaryContainer = "on-secondary-container",
|
|
926
|
-
Tertiary = "tertiary",
|
|
927
|
-
OnTertiary = "on-tertiary",
|
|
928
|
-
TertiaryContainer = "tertiary-container",
|
|
929
|
-
OnTertiaryContainer = "on-tertiary-container",
|
|
930
|
-
Error = "error",
|
|
931
|
-
OnError = "on-error",
|
|
932
|
-
Success = "success",
|
|
933
|
-
Warning = "warning",
|
|
934
|
-
Info = "info",
|
|
935
|
-
Background = "background",
|
|
936
|
-
OnBackground = "on-background",
|
|
937
|
-
Surface = "surface",
|
|
938
|
-
OnSurface = "on-surface",
|
|
939
|
-
SurfaceVariant = "surface-variant",
|
|
940
|
-
OnSurfaceVariant = "on-surface-variant",
|
|
941
|
-
Outline = "outline",
|
|
942
|
-
Transparent = "transparent",
|
|
943
|
-
Black = "black",
|
|
944
|
-
White = "white"
|
|
945
|
-
}
|
|
946
|
-
declare enum ShadowSize {
|
|
947
|
-
Sm = "sm",
|
|
948
|
-
Md = "md",
|
|
949
|
-
Lg = "lg",
|
|
950
|
-
Xl = "xl",
|
|
951
|
-
Xl2 = "2xl"
|
|
952
|
-
}
|
|
953
|
-
declare enum ShadowPreset {
|
|
954
|
-
Card = "card",
|
|
955
|
-
Button = "button",
|
|
956
|
-
Modal = "modal",
|
|
957
|
-
Float = "float",
|
|
958
|
-
Inner = "inner"
|
|
959
|
-
}
|
|
960
|
-
declare enum ShadowDirection {
|
|
961
|
-
Top = "top",
|
|
962
|
-
Bottom = "bottom",
|
|
963
|
-
Left = "left",
|
|
964
|
-
Right = "right",
|
|
965
|
-
TopBottom = "top-bottom",
|
|
966
|
-
LeftRight = "left-right",
|
|
967
|
-
Vertical = "vertical",
|
|
968
|
-
Horizontal = "horizontal",
|
|
969
|
-
All = "all"
|
|
970
|
-
}
|
|
971
|
-
type ShadowConfig = ShadowSize | ShadowPreset | string | 0 | null | [
|
|
972
|
-
string,
|
|
973
|
-
number?
|
|
974
|
-
] | [
|
|
975
|
-
ShadowDirection | string,
|
|
976
|
-
ShadowSize | string
|
|
977
|
-
] | [
|
|
978
|
-
ShadowDirection | string,
|
|
979
|
-
string
|
|
980
|
-
] | [
|
|
981
|
-
ShadowDirection | string,
|
|
982
|
-
string,
|
|
983
|
-
number?
|
|
984
|
-
] | [
|
|
985
|
-
ShadowDirection | string,
|
|
986
|
-
ShadowSize | string,
|
|
987
|
-
string,
|
|
988
|
-
number?
|
|
989
|
-
];
|
|
1114
|
+
export type Space = (typeof Space)[keyof typeof Space];
|
|
1115
|
+
/** Theme radii. `.borderRadius(Radius.md)`. */
|
|
1116
|
+
export declare const Radius: {
|
|
1117
|
+
readonly xs: "var(--fibo-radius-xs)";
|
|
1118
|
+
readonly sm: "var(--fibo-radius-sm)";
|
|
1119
|
+
readonly md: "var(--fibo-radius-md)";
|
|
1120
|
+
readonly lg: "var(--fibo-radius-lg)";
|
|
1121
|
+
readonly xl: "var(--fibo-radius-xl)";
|
|
1122
|
+
readonly full: "var(--fibo-radius-full)";
|
|
1123
|
+
};
|
|
1124
|
+
export type Radius = (typeof Radius)[keyof typeof Radius];
|
|
990
1125
|
/**
|
|
991
|
-
*
|
|
992
|
-
*
|
|
993
|
-
*/
|
|
994
|
-
export type PseudoStateFn = (builder: PseudoStateBuilder) => void | PseudoStateBuilder;
|
|
995
|
-
declare abstract class FiboBuilder {
|
|
996
|
-
/** @internal Extra DOM props forwarded to the host element. */
|
|
997
|
-
protected _props: Record<string, any>;
|
|
998
|
-
protected _style: React$1.CSSProperties;
|
|
999
|
-
protected _cssStyles: React$1.CSSProperties;
|
|
1000
|
-
protected _classNames: string[];
|
|
1001
|
-
protected _children: React$1.ReactNode[];
|
|
1002
|
-
/** Resolved theme for this subtree (SwiftUI Environment / Flutter Theme). */
|
|
1003
|
-
protected _theme?: FiboTheme;
|
|
1004
|
-
protected _state: Map<string, any>;
|
|
1005
|
-
protected _providers: Map<string, any>;
|
|
1006
|
-
protected _observers: Set<Observable<any>>;
|
|
1007
|
-
protected _signals: Set<BindableSignal<any>>;
|
|
1008
|
-
/** Explicit `.bindSignal()` / `.observer()` owns nested reads. A direct wire does not. */
|
|
1009
|
-
protected _ownsReads: boolean;
|
|
1010
|
-
/** @internal Direct `method(signal.value)` calls replayed when that signal changes. */
|
|
1011
|
-
protected _replays: Array<() => void>;
|
|
1012
|
-
protected _isObserver: boolean;
|
|
1013
|
-
protected _gesture?: GestureBuilder;
|
|
1014
|
-
protected _animationConfig?: Partial<AnimationOptions>;
|
|
1015
|
-
protected _animatedProps: Map<string, Signal<any>>;
|
|
1016
|
-
protected _transforms: string[];
|
|
1017
|
-
protected _transitionClass?: string;
|
|
1018
|
-
/** True while transition class was auto-managed for hover/effect presets (expandable). */
|
|
1019
|
-
protected _autoEffectTransition: boolean;
|
|
1020
|
-
protected _effectTransitionProps: string[];
|
|
1021
|
-
/**
|
|
1022
|
-
* When true, getStyle() promotes background/border shorthands to longhands and
|
|
1023
|
-
* (optionally) stamps a resting translate3d so pseudo transforms ease cleanly.
|
|
1024
|
-
*/
|
|
1025
|
-
protected _smoothSurface: boolean;
|
|
1026
|
-
protected _smoothNeedsRestTransform: boolean;
|
|
1027
|
-
protected _motionClass?: string;
|
|
1028
|
-
protected _staggerMs?: number;
|
|
1029
|
-
protected _reveal?: {
|
|
1030
|
-
preset: string;
|
|
1031
|
-
once?: boolean;
|
|
1032
|
-
rootMargin?: string;
|
|
1033
|
-
threshold?: number;
|
|
1034
|
-
};
|
|
1035
|
-
protected _scrollProgress: boolean;
|
|
1036
|
-
protected _viewTransition?: string;
|
|
1037
|
-
protected _reducedMotion: "reduce" | "never";
|
|
1038
|
-
protected _usesCssMotion: boolean;
|
|
1039
|
-
protected _explicitScrollMargin: boolean;
|
|
1040
|
-
/** Shrink-wrap: skip the default `w-full` / `self-stretch` on Row and Column. */
|
|
1041
|
-
protected _hug: boolean;
|
|
1042
|
-
/**
|
|
1043
|
-
* Unset every CSS property on this component and what it renders inside.
|
|
1044
|
-
* Chain `.style()`, `.px()`, `.flex()` and the rest after this to put back only what you want.
|
|
1045
|
-
*/
|
|
1046
|
-
protected _resetStyle: boolean;
|
|
1047
|
-
/** Kebab box longhands already stamped (`padding-left`, …) so later shorthand cannot clobber them. */
|
|
1048
|
-
protected _boxLonghands: Set<string>;
|
|
1049
|
-
resetStyle(): this;
|
|
1050
|
-
protected isReset(): boolean;
|
|
1051
|
-
hug(): this;
|
|
1052
|
-
protected isHug(): boolean;
|
|
1053
|
-
id(value: string): this;
|
|
1054
|
-
/**
|
|
1055
|
-
* Scroll target. Same as `.id()`, plus `scroll-margin-top` so the section
|
|
1056
|
-
* is not hidden under a sticky header. Pair with `scrollTo('#name')`.
|
|
1057
|
-
*/
|
|
1058
|
-
anchor(value: string): this;
|
|
1059
|
-
/**
|
|
1060
|
-
* Explicit `scroll-margin-top` on this node (overrides the sticky CSS variable
|
|
1061
|
-
* that `.anchor()` applies).
|
|
1062
|
-
*/
|
|
1063
|
-
scrollMargin(value: number | string): this;
|
|
1064
|
-
/** Stamp a class onto the host. Used by PseudoStateBuilder (hashed `:hover` etc.). */
|
|
1065
|
-
addClassName(name: string): this;
|
|
1066
|
-
/**
|
|
1067
|
-
* React list key. After this is called, React reads the key as a string
|
|
1068
|
-
* on both the builder element and the inner host wrapper.
|
|
1069
|
-
* Builders are valid elements — you do not need `.build()`.
|
|
1070
|
-
*/
|
|
1071
|
-
key(value: string | number): this;
|
|
1072
|
-
private setBoxLonghand;
|
|
1073
|
-
private setBoxShorthand;
|
|
1074
|
-
paddingHorizontal(value: string | number): this;
|
|
1075
|
-
paddingVertical(value: string | number): this;
|
|
1076
|
-
padding(value: string | number): this;
|
|
1077
|
-
marginHorizontal(value: string | number): this;
|
|
1078
|
-
marginVertical(value: string | number): this;
|
|
1079
|
-
margin(value: string | number): this;
|
|
1080
|
-
/** Inline layout wins over a host that hardcodes flex on the element (Form, Scaffold). */
|
|
1081
|
-
protected layoutStyle(patch: React$1.CSSProperties): this;
|
|
1082
|
-
/** Last write of a key lives in one bag so getStyle() does not let earlier `.css()` beat later `.style()`. */
|
|
1083
|
-
private dropConflictingKeys;
|
|
1084
|
-
private trackBoxLonghandsFrom;
|
|
1085
|
-
flexDirection(direction: "row" | "column" | "row-reverse" | "column-reverse"): this;
|
|
1086
|
-
/** Flutter `textDirection`. */
|
|
1087
|
-
textDirection(direction: "ltr" | "rtl"): this;
|
|
1088
|
-
/** Flutter `textBaseline`. Both modes align on the flex baseline. */
|
|
1089
|
-
textBaseline(baseline: "alphabetic" | "ideographic"): this;
|
|
1090
|
-
/** Flutter `clipBehavior`. `none` shows overflow; the other two clip. */
|
|
1091
|
-
clip(behavior: "none" | "hardEdge" | "antiAlias"): this;
|
|
1092
|
-
/**
|
|
1093
|
-
* Flutter `mainAxisSize`. `min` hugs the current flex direction.
|
|
1094
|
-
* `max` stretches along that same axis.
|
|
1095
|
-
*/
|
|
1096
|
-
mainAxisSize(size: "min" | "max"): this;
|
|
1097
|
-
zIndex(value: number): this;
|
|
1098
|
-
alignItems(alignment: "start" | "center" | "end" | "stretch" | "baseline"): this;
|
|
1099
|
-
alignSelf(alignment: "start" | "center" | "end" | "stretch" | "baseline" | "auto"): this;
|
|
1100
|
-
flexWrap(wrap: "wrap" | "nowrap" | "wrap-reverse"): this;
|
|
1101
|
-
/**
|
|
1102
|
-
* Main-axis distribution. Accepts Tailwind shortcuts (`between`) and CSS/Flutter
|
|
1103
|
-
* names (`space-between` / `spaceBetween`).
|
|
1104
|
-
*/
|
|
1105
|
-
justifyContent(justify: "start" | "center" | "end" | "between" | "around" | "evenly" | "space-between" | "space-around" | "space-evenly" | "spaceBetween" | "spaceAround" | "spaceEvenly"): this;
|
|
1106
|
-
/** True when flexDirection is column / column-reverse (default is row). */
|
|
1107
|
-
protected isVerticalFlex(): boolean;
|
|
1108
|
-
/**
|
|
1109
|
-
* Both screen axes. `.align(Align.center)` and `.align('center')` do the same.
|
|
1110
|
-
* `between` packs the main axis and starts the cross axis.
|
|
1111
|
-
*/
|
|
1112
|
-
align(alignment: AlignAxis): this;
|
|
1113
|
-
/**
|
|
1114
|
-
* Horizontal (screen X) alignment. Same meaning on Row and Column:
|
|
1115
|
-
* left / center / right of the container — not “main axis”.
|
|
1116
|
-
*/
|
|
1117
|
-
alignX(alignment: AlignAxis): this;
|
|
1118
|
-
/**
|
|
1119
|
-
* Vertical (screen Y) alignment. Same meaning on Row and Column:
|
|
1120
|
-
* top / center / bottom of the container — not “cross axis”.
|
|
1121
|
-
*/
|
|
1122
|
-
alignY(alignment: AlignAxis): this;
|
|
1123
|
-
protected applyMainAlign(alignment: AlignAxis | string): this;
|
|
1124
|
-
protected applyCrossAlign(alignment: AlignAxis | string): this;
|
|
1125
|
-
flex(value?: number | string): this;
|
|
1126
|
-
grid(): this;
|
|
1127
|
-
inlineFlex(): this;
|
|
1128
|
-
inlineGrid(): this;
|
|
1129
|
-
block(): this;
|
|
1130
|
-
inlineBlock(): this;
|
|
1131
|
-
hidden(): this;
|
|
1132
|
-
center(): this;
|
|
1133
|
-
/** Center on the horizontal screen axis (uses `.alignX('center')`). */
|
|
1134
|
-
centerX(): this;
|
|
1135
|
-
/** Center on the vertical screen axis (uses `.alignY('center')`). */
|
|
1136
|
-
centerY(): this;
|
|
1137
|
-
spaceBetween(): this;
|
|
1138
|
-
spaceAround(): this;
|
|
1139
|
-
spaceEvenly(): this;
|
|
1140
|
-
fill(): this;
|
|
1141
|
-
fillWidth(): this;
|
|
1142
|
-
fillHeight(): this;
|
|
1143
|
-
square(size: number | string): this;
|
|
1144
|
-
circle(): this;
|
|
1145
|
-
opacity(value: number): this;
|
|
1146
|
-
p(value: number | string): this;
|
|
1147
|
-
px(value: number | string): this;
|
|
1148
|
-
py(value: number | string): this;
|
|
1149
|
-
paddingX(value: number | string): this;
|
|
1150
|
-
paddingY(value: number | string): this;
|
|
1151
|
-
m(value: number | string): this;
|
|
1152
|
-
mx(value: number | string): this;
|
|
1153
|
-
my(value: number | string): this;
|
|
1154
|
-
marginX(value: number | string): this;
|
|
1155
|
-
marginY(value: number | string): this;
|
|
1156
|
-
bg(color: string | Colors): this;
|
|
1157
|
-
text(color: string | Colors): this;
|
|
1158
|
-
color(value: string | Colors): this;
|
|
1159
|
-
private resolveSemanticColor;
|
|
1160
|
-
shadow(config?: ShadowConfig): this;
|
|
1161
|
-
/**
|
|
1162
|
-
* Breakpoint styles compiled to CSS `@media` (same engine as `.md()`).
|
|
1163
|
-
* Tiers stay mutually exclusive: mobile `<768`, tablet `768–1023`, desktop `≥1024`.
|
|
1164
|
-
* No `window.innerWidth` — hydrate-safe.
|
|
1165
|
-
*/
|
|
1166
|
-
responsive(styles: ResponsiveStyles): this;
|
|
1167
|
-
/**
|
|
1168
|
-
* CSS `@media` (min-width or a raw query). Compiles to a class — no resize JS.
|
|
1169
|
-
*
|
|
1170
|
-
* @example Box().padding(8).media('md', { padding: 16 }).media('(prefers-color-scheme: dark)', { backgroundColor: '#111' })
|
|
1171
|
-
*/
|
|
1172
|
-
media(query: BreakpointKey | string, styles: React$1.CSSProperties): this;
|
|
1173
|
-
private registerMediaStyles;
|
|
1174
|
-
sm(styles: React$1.CSSProperties): this;
|
|
1175
|
-
md(styles: React$1.CSSProperties): this;
|
|
1176
|
-
lg(styles: React$1.CSSProperties): this;
|
|
1177
|
-
xl(styles: React$1.CSSProperties): this;
|
|
1178
|
-
rounded(value: string | number): this;
|
|
1179
|
-
borderRadius(value: string | number): this;
|
|
1180
|
-
borderColor(value: string): this;
|
|
1181
|
-
/**
|
|
1182
|
-
* A passed size is a lock: `min-*` plus `flex-shrink: 0`, so a flex parent
|
|
1183
|
-
* (the Scaffold body) cannot divide the viewport across these children.
|
|
1184
|
-
* `400`, `'320px'`, `Size.full`, and `Space.md` all count. `flex(1)` afterwards
|
|
1185
|
-
* opts back into sharing space.
|
|
1186
|
-
*/
|
|
1187
|
-
private lockAxis;
|
|
1188
|
-
width(value: string | number): this;
|
|
1189
|
-
paint(property: string, value: string): this;
|
|
1190
|
-
height(value: string | number): this;
|
|
1191
|
-
gap(value: string | number): this;
|
|
1192
|
-
clean(): this;
|
|
1193
|
-
borderInput(color?: string, focusColor?: string): this;
|
|
1194
|
-
weight(value: string | number): this;
|
|
1195
|
-
onClick(handler: (event: React$1.MouseEvent<any>) => void): this;
|
|
1196
|
-
state<T>(key: string, initialValue: T): this;
|
|
1197
|
-
getState<T>(key: string): T | undefined;
|
|
1198
|
-
setState<T>(key: string, value: T): this;
|
|
1199
|
-
provide<T>(key: string, value: T): this;
|
|
1200
|
-
consume<T>(key: string): T | undefined;
|
|
1201
|
-
observer(options?: string | number | {
|
|
1202
|
-
key?: string | number;
|
|
1203
|
-
}): this;
|
|
1204
|
-
observe<T>(observable: Observable<T>): this;
|
|
1205
|
-
bindSignal<T>(signal: BindableSignal<T>): this;
|
|
1206
|
-
/**
|
|
1207
|
-
* @internal Wire a direct `method(signal.value)` to this node.
|
|
1208
|
-
* Does not claim reads that happen later in a children function.
|
|
1209
|
-
*/
|
|
1210
|
-
adoptWire(signals: Subscribable<unknown>[], replay: () => void): void;
|
|
1211
|
-
/** @internal */
|
|
1212
|
-
runReplays(): void;
|
|
1213
|
-
translateX(value: Signal<number> | number): this;
|
|
1214
|
-
translateY(value: Signal<number> | number): this;
|
|
1215
|
-
scale(value: Signal<number> | number): this;
|
|
1216
|
-
rotate(degrees: Signal<number> | number): this;
|
|
1217
|
-
gesture(gesture: GestureBuilder): this;
|
|
1218
|
-
animation(config: Partial<AnimationOptions>): this;
|
|
1219
|
-
protected hasStateManagement(): boolean;
|
|
1220
|
-
className(className: string): this;
|
|
1221
|
-
classNames(classNames: string[]): this;
|
|
1222
|
-
css(styles: React$1.CSSProperties): this;
|
|
1223
|
-
style(style: React$1.CSSProperties): this;
|
|
1224
|
-
props(props: Record<string, any>): this;
|
|
1225
|
-
protected _transitionDuration: number;
|
|
1226
|
-
protected _transitionEasing: string;
|
|
1227
|
-
protected _transitionDelay: number;
|
|
1228
|
-
protected _transitionProperties: string[];
|
|
1229
|
-
/**
|
|
1230
|
-
* Apply CSS transition
|
|
1231
|
-
*
|
|
1232
|
-
* Overload 1: String syntax
|
|
1233
|
-
* Example: .transition('all 0.2s ease-in-out')
|
|
1234
|
-
*
|
|
1235
|
-
* Overload 2: Shorthand with parameters
|
|
1236
|
-
* Example: .transition('all', 200, 'ease-out')
|
|
1237
|
-
* Example: .transition('all', 200, 'ease-out', 50)
|
|
1238
|
-
*/
|
|
1239
|
-
transition(value: string): this;
|
|
1240
|
-
transition(properties: string | string[], duration: number, easing?: string, delay?: number): this;
|
|
1241
|
-
/**
|
|
1242
|
-
* Set transition duration in milliseconds
|
|
1243
|
-
* Example: .duration(200) → 200ms
|
|
1244
|
-
*/
|
|
1245
|
-
duration(ms: number): this;
|
|
1246
|
-
/**
|
|
1247
|
-
* Set transition easing function
|
|
1248
|
-
* Example: .easing('ease-in-out')
|
|
1249
|
-
*/
|
|
1250
|
-
easing(value: "linear" | "ease" | "ease-in" | "ease-out" | "ease-in-out" | "spring" | string): this;
|
|
1251
|
-
/** Alias of `.easing()`. `'spring'` becomes CSS `linear()`. */
|
|
1252
|
-
ease(value: string): this;
|
|
1253
|
-
/**
|
|
1254
|
-
* Set transition delay in milliseconds
|
|
1255
|
-
* Example: .delay(100) → 100ms delay
|
|
1256
|
-
*/
|
|
1257
|
-
delay(ms: number): this;
|
|
1258
|
-
/**
|
|
1259
|
-
* Set which properties to transition
|
|
1260
|
-
* Example: .properties(['color', 'transform'])
|
|
1261
|
-
*/
|
|
1262
|
-
properties(props: string[]): this;
|
|
1263
|
-
/**
|
|
1264
|
-
* Apply the built transition to the element
|
|
1265
|
-
*/
|
|
1266
|
-
protected _applyTransition(): void;
|
|
1267
|
-
private replaceTransitionClass;
|
|
1268
|
-
/**
|
|
1269
|
-
* CSS enter/exit preset. Compiles to `@keyframes` — no rAF.
|
|
1270
|
-
* @example Box().animate('fadeIn').duration(300).ease('spring')
|
|
1271
|
-
*/
|
|
1272
|
-
animate(preset: MotionPreset | string, options?: {
|
|
1273
|
-
duration?: number;
|
|
1274
|
-
ease?: string;
|
|
1275
|
-
delay?: number;
|
|
1276
|
-
from?: number | string;
|
|
1277
|
-
stiffness?: number;
|
|
1278
|
-
damping?: number;
|
|
1279
|
-
mass?: number;
|
|
1280
|
-
}): this;
|
|
1281
|
-
animate(custom: CustomMotion): this;
|
|
1282
|
-
/** CSS `linear()` spring. Works on `.animate()` and `.transition()` / `.hover()`. */
|
|
1283
|
-
spring(options?: SpringOptions): this;
|
|
1284
|
-
reducedMotion(mode?: "reduce" | "never"): this;
|
|
1285
|
-
press(callback?: (builder: PseudoStateBuilder) => void | PseudoStateBuilder): this;
|
|
1286
|
-
/**
|
|
1287
|
-
* Shortcut: `.hover(h => h.effect(name))`.
|
|
1288
|
-
* Named interaction effect on `:hover` (forward, float, grow, nudge, …).
|
|
1289
|
-
*/
|
|
1290
|
-
hoverEffect(name: string): this;
|
|
1291
|
-
/**
|
|
1292
|
-
* Shortcut: `.press(p => p.effect(name))` (maps to `:active`).
|
|
1293
|
-
*/
|
|
1294
|
-
pressEffect(name: string): this;
|
|
1295
|
-
/**
|
|
1296
|
-
* Shortcut: `.focus(f => f.effect(name))`.
|
|
1297
|
-
*/
|
|
1298
|
-
focusEffect(name: string): this;
|
|
1299
|
-
/**
|
|
1300
|
-
* Shortcut: `.active(a => a.effect(name))`.
|
|
1301
|
-
*/
|
|
1302
|
-
activeEffect(name: string): this;
|
|
1303
|
-
/**
|
|
1304
|
-
* Shortcut: `.groupHover(h => h.effect(name))`.
|
|
1305
|
-
*/
|
|
1306
|
-
groupHoverEffect(name: string): this;
|
|
1307
|
-
focusVisible(): PseudoStateBuilder;
|
|
1308
|
-
focusVisible(callback: PseudoStateFn): this;
|
|
1309
|
-
stagger(ms: number): this;
|
|
1310
|
-
/** Scroll-reveal: IntersectionObserver toggles `.fibo-inview`. */
|
|
1311
|
-
reveal(preset?: string | {
|
|
1312
|
-
preset?: string;
|
|
1313
|
-
once?: boolean;
|
|
1314
|
-
rootMargin?: string;
|
|
1315
|
-
threshold?: number;
|
|
1316
|
-
}, options?: {
|
|
1317
|
-
once?: boolean;
|
|
1318
|
-
rootMargin?: string;
|
|
1319
|
-
threshold?: number;
|
|
1320
|
-
}): this;
|
|
1321
|
-
/** Alias of `.reveal()` for scroll-triggered presets. */
|
|
1322
|
-
onScroll(preset?: string): this;
|
|
1323
|
-
/** CSS `animation-timeline: view()` / `scroll()`; IntersectionObserver reveal is the fallback. */
|
|
1324
|
-
scrollTimeline(kind?: "view" | "scroll"): this;
|
|
1325
|
-
scrollProgress(): this;
|
|
1326
|
-
smoothScroll(): this;
|
|
1327
|
-
scrollSnap(axis?: "x" | "y" | "both"): this;
|
|
1328
|
-
scrollSnapAlign(align?: "start" | "center" | "end"): this;
|
|
1329
|
-
sticky(top?: number | string | boolean): this;
|
|
1330
|
-
/**
|
|
1331
|
-
* Publish `--fibo-sticky-offset` on `:root` so `.anchor()` / `html` scroll-padding
|
|
1332
|
-
* clear this bar. Header uses the real bar height.
|
|
1333
|
-
*/
|
|
1334
|
-
protected publishStickyOffset(value: number | string): void;
|
|
1335
|
-
viewTransition(name: string): this;
|
|
1336
|
-
/** Default `:focus-visible` ring. Pass a callback to customize. */
|
|
1337
|
-
focusRing(color?: string): this;
|
|
1338
|
-
protected ensureInteractiveTransition(): void;
|
|
1339
|
-
/**
|
|
1340
|
-
* Prepare resting styles + transition so pseudo-state longhands (bg/border/transform)
|
|
1341
|
-
* interpolate instead of snapping. Safe to call repeatedly from PseudoStateBuilder.
|
|
1342
|
-
* @internal
|
|
1343
|
-
*/
|
|
1344
|
-
prepareSmoothInteraction(properties: string[]): void;
|
|
1345
|
-
/** @internal Convert inline background/border shorthands → longhands. */
|
|
1346
|
-
promoteSurfaceLonghands(): void;
|
|
1347
|
-
/** @internal Stamp translate3d(0,0,0) when no resting transform exists. */
|
|
1348
|
-
ensureRestTransform(): void;
|
|
1349
|
-
/**
|
|
1350
|
-
* Ensure the base element transitions the properties an interaction effect needs.
|
|
1351
|
-
* Expands an auto-managed transition; no-ops if the caller set `.transition(...)`
|
|
1352
|
-
* explicitly or a motion animation class is present.
|
|
1353
|
-
* @internal Used by PseudoStateBuilder.effect() and hover/press shortcuts.
|
|
1354
|
-
*/
|
|
1355
|
-
ensureEffectTransition(properties: string[]): void;
|
|
1356
|
-
/**
|
|
1357
|
-
* Apply a theme to this node and descendants (CSS vars inherit).
|
|
1358
|
-
* Fluent: `.theme("noir")` | `.theme(noirTheme)` | `.theme(extendTheme(webTheme, {…}))`.
|
|
1359
|
-
* SSR-safe: class + inline vars on first paint (no useEffect).
|
|
1360
|
-
*/
|
|
1361
|
-
theme(input: ThemeInput): this;
|
|
1362
|
-
/** Prefer dark/light system chrome for native controls under this subtree. */
|
|
1363
|
-
colorScheme(scheme: "light" | "dark" | "light dark"): this;
|
|
1364
|
-
hover(): PseudoStateBuilder;
|
|
1365
|
-
hover(callback: PseudoStateFn): this;
|
|
1366
|
-
/**
|
|
1367
|
-
* Paint for a `When` state. Hover / focus / active / visited / disabled
|
|
1368
|
-
* write a CSS pseudo on this node. `on` / `off` are for Checkbox and Switch.
|
|
1369
|
-
*
|
|
1370
|
-
* ```ts
|
|
1371
|
-
* Row().when(When.hover, (s) => s.bg('#c8ff00'))
|
|
1372
|
-
* ```
|
|
1373
|
-
*/
|
|
1374
|
-
when(state: When, style: WhenStyle): this;
|
|
1375
|
-
focus(): PseudoStateBuilder;
|
|
1376
|
-
focus(callback: PseudoStateFn): this;
|
|
1377
|
-
active(): PseudoStateBuilder;
|
|
1378
|
-
active(callback: PseudoStateFn): this;
|
|
1379
|
-
visited(): PseudoStateBuilder;
|
|
1380
|
-
visited(callback: PseudoStateFn): this;
|
|
1381
|
-
disabledState(): PseudoStateBuilder;
|
|
1382
|
-
disabledState(callback: PseudoStateFn): this;
|
|
1383
|
-
focusWithin(): PseudoStateBuilder;
|
|
1384
|
-
focusWithin(callback: PseudoStateFn): this;
|
|
1385
|
-
firstChild(): PseudoStateBuilder;
|
|
1386
|
-
firstChild(callback: PseudoStateFn): this;
|
|
1387
|
-
lastChild(): PseudoStateBuilder;
|
|
1388
|
-
lastChild(callback: PseudoStateFn): this;
|
|
1389
|
-
groupHover(): PseudoStateBuilder;
|
|
1390
|
-
groupHover(callback: PseudoStateFn): this;
|
|
1391
|
-
groupFocus(): PseudoStateBuilder;
|
|
1392
|
-
groupFocus(callback: PseudoStateFn): this;
|
|
1393
|
-
groupActive(): PseudoStateBuilder;
|
|
1394
|
-
groupActive(callback: PseudoStateFn): this;
|
|
1395
|
-
groupFocusWithin(): PseudoStateBuilder;
|
|
1396
|
-
groupFocusWithin(callback: PseudoStateFn): this;
|
|
1397
|
-
group(): this;
|
|
1398
|
-
protected _childFunction?: () => FiboChild | FiboChild[];
|
|
1399
|
-
children(children: FiboChildren): this;
|
|
1400
|
-
protected getClassName(): string;
|
|
1401
|
-
protected getStyle(): React$1.CSSProperties;
|
|
1402
|
-
protected processChildren(): React$1.ReactNode[];
|
|
1403
|
-
protected getChildFunction(): (() => FiboChild | FiboChild[]) | undefined;
|
|
1404
|
-
/**
|
|
1405
|
-
* @deprecated Builders are React elements. Returning or nesting the builder is enough.
|
|
1406
|
-
* `.build()` still assembles the host tree for older call sites.
|
|
1407
|
-
*/
|
|
1408
|
-
abstract build(): React$1.ReactElement;
|
|
1409
|
-
}
|
|
1410
|
-
type KnownKeys<T> = {
|
|
1411
|
-
[K in keyof T]: string extends K ? never : number extends K ? never : K;
|
|
1412
|
-
} extends {
|
|
1413
|
-
[_ in keyof T]: infer U;
|
|
1414
|
-
} ? U : never;
|
|
1415
|
-
type StyleBuilder<T> = T & LogicalAxes & {
|
|
1416
|
-
[K in KnownKeys<React$1.CSSProperties>]-?: (value: React$1.CSSProperties[K]) => StyleBuilder<T>;
|
|
1417
|
-
} & React$1.ReactElement;
|
|
1418
|
-
interface SignalLike<T> {
|
|
1419
|
-
value: T;
|
|
1420
|
-
subscribe: (listener: (val: T) => void) => () => void;
|
|
1421
|
-
}
|
|
1422
|
-
declare class FluentValueBuilder<T> {
|
|
1423
|
-
private _signal;
|
|
1424
|
-
private _loading?;
|
|
1425
|
-
private _error?;
|
|
1426
|
-
private _builder?;
|
|
1427
|
-
constructor(_signal: SignalLike<T>);
|
|
1428
|
-
loading(component: React$1.ReactNode | (() => React$1.ReactNode)): this;
|
|
1429
|
-
error(component: (error: Error | unknown) => React$1.ReactNode): this;
|
|
1430
|
-
builder(fn: (value: T) => React$1.ReactNode): this;
|
|
1431
|
-
children(fn: (value: T) => React$1.ReactNode): this;
|
|
1432
|
-
build(): React$1.ReactElement;
|
|
1433
|
-
}
|
|
1434
|
-
export declare function ValueBuilder<T>(signal: SignalLike<T>): FluentValueBuilder<T>;
|
|
1435
|
-
type PresenceShow = boolean | BindableSignal<boolean>;
|
|
1436
|
-
export interface PresenceProps {
|
|
1437
|
-
show: PresenceShow;
|
|
1438
|
-
enter?: MotionPreset | string;
|
|
1439
|
-
exit?: MotionPreset | string;
|
|
1440
|
-
duration?: number;
|
|
1441
|
-
reducedMotion?: "reduce" | "never";
|
|
1442
|
-
children?: React$1.ReactNode;
|
|
1443
|
-
}
|
|
1444
|
-
declare class PresenceBuilder extends FiboBuilder {
|
|
1445
|
-
private _show;
|
|
1446
|
-
private _enter;
|
|
1447
|
-
private _exit;
|
|
1448
|
-
constructor(show?: PresenceShow);
|
|
1449
|
-
show(value: PresenceShow): this;
|
|
1450
|
-
enter(preset: MotionPreset | string): this;
|
|
1451
|
-
exit(preset: MotionPreset | string): this;
|
|
1452
|
-
duration(ms: number): this;
|
|
1453
|
-
build(): React$1.ReactElement;
|
|
1454
|
-
}
|
|
1455
|
-
declare const presenceBuilder: (show?: PresenceShow | undefined) => StyleBuilder<PresenceBuilder>;
|
|
1456
|
-
export declare function Presence(show?: PresenceShow): ReturnType<typeof presenceBuilder>;
|
|
1457
|
-
export declare function Presence(props: PresenceProps): React$1.ReactElement;
|
|
1458
|
-
export declare namespace Presence {
|
|
1459
|
-
var displayName: string;
|
|
1460
|
-
}
|
|
1461
|
-
export interface RevealProps {
|
|
1462
|
-
preset?: string;
|
|
1463
|
-
once?: boolean;
|
|
1464
|
-
rootMargin?: string;
|
|
1465
|
-
threshold?: number;
|
|
1466
|
-
forceMotion?: boolean;
|
|
1467
|
-
/** @deprecated Ignored — view-timeline never skips IO (was forcing fibo-inview on load). */
|
|
1468
|
-
preferTimeline?: boolean;
|
|
1469
|
-
/** CSS vars (`--fibo-dur`, `--fibo-ease`, `--fibo-delay`) for the reveal wrapper. */
|
|
1470
|
-
style?: React$1.CSSProperties;
|
|
1471
|
-
children?: React$1.ReactNode;
|
|
1472
|
-
}
|
|
1473
|
-
/** IntersectionObserver toggles `.fibo-inview`. Motion is CSS — no rAF. */
|
|
1474
|
-
export declare function Reveal({ preset, once, rootMargin, threshold, forceMotion, style, children, }: RevealProps): React$1.DetailedReactHTMLElement<{
|
|
1475
|
-
ref: React$1.RefObject<HTMLDivElement>;
|
|
1476
|
-
className: string;
|
|
1477
|
-
style: React$1.CSSProperties | undefined;
|
|
1478
|
-
"data-fibo-reveal": string;
|
|
1479
|
-
}, HTMLDivElement>;
|
|
1480
|
-
interface ScrollProgressProps {
|
|
1481
|
-
children: React$1.ReactElement;
|
|
1482
|
-
}
|
|
1483
|
-
/** Binds `--fibo-progress` from scroll when `animation-timeline: scroll()` is missing. No rAF. */
|
|
1484
|
-
export declare function ScrollProgress({ children }: ScrollProgressProps): React$1.DetailedReactHTMLElement<{
|
|
1485
|
-
ref: React$1.RefObject<HTMLDivElement>;
|
|
1486
|
-
"data-fibo-scroll-progress": string;
|
|
1487
|
-
style: {
|
|
1488
|
-
display: "contents";
|
|
1489
|
-
};
|
|
1490
|
-
}, HTMLDivElement>;
|
|
1491
|
-
type ScrollToOptions$1 = {
|
|
1492
|
-
behavior?: ScrollBehavior;
|
|
1493
|
-
block?: ScrollLogicalPosition;
|
|
1494
|
-
/** Also set `location.hash` (in-page anchor navigation). */
|
|
1495
|
-
hash?: boolean;
|
|
1496
|
-
};
|
|
1497
|
-
/**
|
|
1498
|
-
* Smooth-scroll to an element id / selector / Element.
|
|
1499
|
-
* Pass `hash: true` to update the URL hash (replaces the old site-only `goHash`).
|
|
1500
|
-
*/
|
|
1501
|
-
declare function scrollTo$1(target: string | Element, options?: ScrollToOptions$1): void;
|
|
1502
|
-
export declare function startViewTransition(update: () => void): void;
|
|
1503
|
-
export declare function supportsViewTimeline(): boolean;
|
|
1504
|
-
export declare function supportsScrollTimeline(): boolean;
|
|
1505
|
-
/** Write text to the system clipboard. Returns false if unavailable. */
|
|
1506
|
-
export declare function writeClipboard(text: string): Promise<boolean>;
|
|
1507
|
-
/** Open a URL (default: new tab + noopener). Canonical name. */
|
|
1508
|
-
declare function open$1(url: string, options?: {
|
|
1509
|
-
target?: "_blank" | "_self";
|
|
1510
|
-
features?: string;
|
|
1511
|
-
}): void;
|
|
1512
|
-
/** Alias — name the fibogrid site already used. Do not remove (no break). */
|
|
1513
|
-
export declare const openExternal: typeof open$1;
|
|
1514
|
-
/**
|
|
1515
|
-
* In-page hash jump. Name the site already used.
|
|
1516
|
-
* Implementation = existing `scrollTo(id, { hash: true })` (no parallel logic).
|
|
1517
|
-
*/
|
|
1518
|
-
export declare function goHash(id: string, options?: {
|
|
1519
|
-
behavior?: ScrollBehavior;
|
|
1520
|
-
block?: ScrollLogicalPosition;
|
|
1521
|
-
}): void;
|
|
1522
|
-
export type HotkeyChord = {
|
|
1523
|
-
key: string;
|
|
1524
|
-
meta?: boolean;
|
|
1525
|
-
ctrl?: boolean;
|
|
1526
|
-
alt?: boolean;
|
|
1527
|
-
shift?: boolean;
|
|
1528
|
-
/** Require meta OR ctrl (⌘K / Ctrl+K). */
|
|
1529
|
-
metaOrCtrl?: boolean;
|
|
1530
|
-
preventDefault?: boolean;
|
|
1531
|
-
when?: () => boolean;
|
|
1532
|
-
run: () => void;
|
|
1533
|
-
};
|
|
1534
|
-
/** Bind global keydown chords. Returns unsubscribe. SSR-safe. */
|
|
1535
|
-
export declare function bindHotkeys(chords: HotkeyChord[]): () => void;
|
|
1536
|
-
/**
|
|
1537
|
-
* AUTO-GENERATED by scripts/gen-interaction-fx.mjs — do not edit by hand.
|
|
1538
|
-
* Fiboui-owned interaction effects (Hover.css–inspired names, not a vendor dump).
|
|
1539
|
-
*/
|
|
1540
|
-
export declare const FIBO_INTERACTION_FX_CSS: string;
|
|
1541
|
-
/**
|
|
1542
|
-
* Inject the full interaction-effect sheet once.
|
|
1543
|
-
* Idempotent via StyleManager cache — must NOT use a module flag, or
|
|
1544
|
-
* `endSsrRequest()` / `StyleManager.reset()` would skip re-injection on the
|
|
1545
|
-
* next SSR request and drop FX CSS from the snapshot.
|
|
1546
|
-
*/
|
|
1547
|
-
export declare function ensureInteractionFxCss(): void;
|
|
1548
|
-
export declare function ensureMotionCss(): void;
|
|
1549
|
-
export declare function getMotionCss(): string;
|
|
1550
|
-
export declare function getCss(): string;
|
|
1551
|
-
/** `<style id="fibo-dynamic-styles">` HTML. Call **after** `renderToString` so rules are collected. */
|
|
1552
|
-
export declare function getStyleTag(): string;
|
|
1553
|
-
/**
|
|
1554
|
-
* Reset the StyleManager singleton between SSR requests (Next.js / custom servers).
|
|
1555
|
-
* Call after the response CSS has been captured when using `<FiboStyles />` mid-tree.
|
|
1556
|
-
*/
|
|
1557
|
-
export declare function endSsrRequest(): void;
|
|
1558
|
-
/**
|
|
1559
|
-
* Inject collected CSS into a document. Place as a **later sibling** of the app
|
|
1560
|
-
* so registrations from children run first during SSR.
|
|
1561
|
-
*/
|
|
1562
|
-
export declare function FiboStyles(): React$1.ReactElement;
|
|
1563
|
-
export declare function MotionStyles(): React$1.ReactElement;
|
|
1564
|
-
export type FiboPageBuild = () => FiboChild | React$1.ReactNode;
|
|
1565
|
-
type FiboPageMeta = {
|
|
1566
|
-
title?: string;
|
|
1567
|
-
description?: string;
|
|
1568
|
-
};
|
|
1569
|
-
export type FiboPageOptions = {
|
|
1570
|
-
/** Append `<FiboStyles />` after the tree (SSR dynamic CSS). Default true. */
|
|
1571
|
-
styles?: boolean;
|
|
1572
|
-
/** SSR `<title>` / `<meta name="description">` (React 19 hoists into `<head>`). */
|
|
1573
|
-
meta?: FiboPageMeta;
|
|
1574
|
-
};
|
|
1575
|
-
type FiboPageComponent = React$1.ComponentType & {
|
|
1576
|
-
meta?: FiboPageMeta;
|
|
1577
|
-
};
|
|
1578
|
-
/**
|
|
1579
|
-
* Next/Vite page helper — **zero JSX** in app code, SSR-safe.
|
|
1580
|
-
*
|
|
1581
|
-
* Next App Router still SSRs Client Components: HTML is rendered on the server,
|
|
1582
|
-
* then hydrated. Import `fiboui/style.css` once from `app/layout.tsx` (or the
|
|
1583
|
-
* Vite entry) so the base sheet is in the document on first paint.
|
|
1584
|
-
*
|
|
1585
|
-
* ```ts
|
|
1586
|
-
* // app/page.tsx — Server Component (no 'use client')
|
|
1587
|
-
* import { page, Column, Text } from 'fiboui'
|
|
1588
|
-
*
|
|
1589
|
-
* export default page(() =>
|
|
1590
|
-
* Column().gap(12).children([Text('Hello')])
|
|
1591
|
-
* )
|
|
1592
|
-
* ```
|
|
1593
|
-
*
|
|
1594
|
-
* App Router resolves `fiboui` via the `react-server` export (static builders).
|
|
1595
|
-
* `build()` runs during RSC render so StyleManager rules exist before `<FiboStyles />`.
|
|
1596
|
-
*/
|
|
1597
|
-
export declare function page(build: FiboPageBuild, options?: FiboPageOptions): FiboPageComponent;
|
|
1598
|
-
/**
|
|
1599
|
-
* Alias of `page()`. Prefer `export default page(() => …)` from a Server Component.
|
|
1600
|
-
*/
|
|
1601
|
-
export declare const createPage: typeof page;
|
|
1602
|
-
/**
|
|
1603
|
-
* Wrap any builder / node with `FiboStyles` without JSX.
|
|
1604
|
-
*
|
|
1605
|
-
* ```ts
|
|
1606
|
-
* export default function Home() {
|
|
1607
|
-
* return withFiboStyles(Column().children([Text('Hi')]))
|
|
1608
|
-
* }
|
|
1609
|
-
* ```
|
|
1610
|
-
*/
|
|
1611
|
-
export declare function withFiboStyles(child: FiboChild | React$1.ReactNode): React$1.ReactElement;
|
|
1612
|
-
/**
|
|
1613
|
-
* Current viewport width. Hydration uses 1024 (desktop) so the first client
|
|
1614
|
-
* render matches SSR; the real width arrives after mount.
|
|
1615
|
-
* Prefer `.md()` / `.responsive()` (CSS `@media`) over this hook.
|
|
1616
|
-
*/
|
|
1617
|
-
export declare function useViewportWidth(): number;
|
|
1618
|
-
type Constructor<T = any> = new (...args: any[]) => T;
|
|
1619
|
-
type Factory<T = any> = () => T;
|
|
1620
|
-
type Provider<T = any> = Constructor<T> | Factory<T> | T;
|
|
1621
|
-
type Token<T = any> = string | symbol | Constructor<T>;
|
|
1622
|
-
export interface RouteDefinition {
|
|
1623
|
-
path: string;
|
|
1624
|
-
component: () => FiboBuilder;
|
|
1625
|
-
meta?: Record<string, any>;
|
|
1626
|
-
}
|
|
1627
|
-
export interface SidebarConfig {
|
|
1628
|
-
label: string;
|
|
1629
|
-
icon?: any;
|
|
1630
|
-
path: string;
|
|
1631
|
-
order?: number;
|
|
1632
|
-
}
|
|
1633
|
-
export interface FiboContext {
|
|
1634
|
-
registerService<T>(token: Token<T>, implementation: Provider<T>): void;
|
|
1635
|
-
registerStore(store: unknown, name?: string): void;
|
|
1636
|
-
getStore?<T = unknown>(name: string): T | undefined;
|
|
1637
|
-
registerRoute(route: RouteDefinition): void;
|
|
1638
|
-
registerSidebarItem(item: SidebarConfig): void;
|
|
1639
|
-
registerTopbarAction(component: () => FiboBuilder): void;
|
|
1640
|
-
registerOverlay(component: () => FiboBuilder): void;
|
|
1641
|
-
}
|
|
1642
|
-
type PluginSetup = (context: FiboContext) => void;
|
|
1643
|
-
export interface FiboPlugin {
|
|
1644
|
-
name: string;
|
|
1645
|
-
version?: string;
|
|
1646
|
-
setup: PluginSetup;
|
|
1647
|
-
teardown?: PluginSetup;
|
|
1648
|
-
}
|
|
1649
|
-
export declare class FiboAppBuilder {
|
|
1650
|
-
private _rootComponent;
|
|
1651
|
-
private _rootElement;
|
|
1652
|
-
private _plugins;
|
|
1653
|
-
private _reactRoot;
|
|
1654
|
-
private _installed;
|
|
1655
|
-
use(plugin: FiboPlugin): this;
|
|
1656
|
-
plugins(pluginsList: FiboPlugin[]): this;
|
|
1657
|
-
root(component: React$1.ComponentType): this;
|
|
1658
|
-
mount(elementId: string, options?: {
|
|
1659
|
-
strict?: boolean;
|
|
1660
|
-
}): () => void;
|
|
1661
|
-
unmount(): void;
|
|
1662
|
-
private build;
|
|
1663
|
-
}
|
|
1664
|
-
export declare const FiboApp: () => FiboAppBuilder;
|
|
1665
|
-
/** Turn a builder (or already-built node) into a React node. */
|
|
1666
|
-
export declare function toElement(node: FiboChild): React$1.ReactNode;
|
|
1667
|
-
/**
|
|
1668
|
-
* Optional wrapper. Builders are already React elements:
|
|
1669
|
-
*
|
|
1670
|
-
* ```tsx
|
|
1671
|
-
* function App() {
|
|
1672
|
-
* return Button('Save').onPress(save);
|
|
1673
|
-
* }
|
|
1674
|
-
* ```
|
|
1675
|
-
*/
|
|
1676
|
-
export declare function Fibo({ children }: {
|
|
1677
|
-
children: FiboChild;
|
|
1678
|
-
}): React$1.ReactElement;
|
|
1679
|
-
/**
|
|
1680
|
-
* Mount a page that returns a builder — no `.build()` on the root.
|
|
1681
|
-
*
|
|
1682
|
-
* ```ts
|
|
1683
|
-
* function App() {
|
|
1684
|
-
* return Column().children([Text('Hi')]);
|
|
1685
|
-
* }
|
|
1686
|
-
* mount('#root', App);
|
|
1687
|
-
* ```
|
|
1688
|
-
*/
|
|
1689
|
-
export declare function mount(target: string | Element, app: (() => FiboChild) | FiboChild, options?: {
|
|
1690
|
-
strict?: boolean;
|
|
1691
|
-
}): Root;
|
|
1692
|
-
/**
|
|
1693
|
-
* Client: process singleton via `getInstance()`.
|
|
1694
|
-
* SSR: wrap a request in `run()` for an isolated instance, or call `reset()`
|
|
1695
|
-
* between requests. `endSsrRequest()` also resets this manager when `window`
|
|
1696
|
-
* is missing (Node). FiboApp is `'use client'` and uninstalls on unmount.
|
|
1697
|
-
*/
|
|
1698
|
-
export declare class PluginManager implements FiboContext {
|
|
1699
|
-
private static instance;
|
|
1700
|
-
private static scopeStack;
|
|
1701
|
-
/** Shared across `run()` scopes — the DI container is process-wide. */
|
|
1702
|
-
private static serviceRefs;
|
|
1703
|
-
private plugins;
|
|
1704
|
-
/** `setup()` in flight — not yet in `plugins`, so Map order stays completion/LIFO. */
|
|
1705
|
-
private installing;
|
|
1706
|
-
private routes;
|
|
1707
|
-
private sidebarItems;
|
|
1708
|
-
private topbarActions;
|
|
1709
|
-
private overlays;
|
|
1710
|
-
private stores;
|
|
1711
|
-
private storeSeq;
|
|
1712
|
-
private constructor();
|
|
1713
|
-
static getInstance(): PluginManager;
|
|
1714
|
-
/** Isolated manager for one SSR request (or test). Client `getInstance()` is unchanged. */
|
|
1715
|
-
static run<T>(fn: () => T): T;
|
|
1716
|
-
/** Drop every plugin (runs teardown) and replace the process singleton. */
|
|
1717
|
-
static reset(): void;
|
|
1718
|
-
/** @see reset */
|
|
1719
|
-
static resetForTests(): void;
|
|
1720
|
-
has(name: string): boolean;
|
|
1721
|
-
use(plugin: FiboPlugin): this;
|
|
1722
|
-
uninstall(name: string): boolean;
|
|
1723
|
-
private uninstallAllSafe;
|
|
1724
|
-
private createOwned;
|
|
1725
|
-
private dropOwned;
|
|
1726
|
-
registerService<T>(token: Token<T>, implementation: Provider<T>): void;
|
|
1727
|
-
registerStore(store: unknown, name?: string): void;
|
|
1728
|
-
private registerStoreKeyed;
|
|
1729
|
-
getStore<T = unknown>(name: string): T | undefined;
|
|
1730
|
-
getStores(): Map<string, unknown>;
|
|
1731
|
-
registerRoute(route: RouteDefinition): void;
|
|
1732
|
-
registerSidebarItem(item: SidebarConfig): void;
|
|
1733
|
-
registerTopbarAction(component: () => FiboBuilder): void;
|
|
1734
|
-
registerOverlay(component: () => FiboBuilder): void;
|
|
1735
|
-
getRoutes(): RouteDefinition[];
|
|
1736
|
-
getSidebarItems(): SidebarConfig[];
|
|
1737
|
-
getTopbarActions(): (() => FiboBuilder)[];
|
|
1738
|
-
getOverlays(): (() => FiboBuilder)[];
|
|
1739
|
-
}
|
|
1740
|
-
/** `.animate(Motion.fadeIn)`. Preset list lives in `motionCss`. */
|
|
1741
|
-
export declare const Motion: {
|
|
1742
|
-
readonly pop: "pop";
|
|
1743
|
-
readonly blur: "blur";
|
|
1744
|
-
readonly fadeIn: "fadeIn";
|
|
1745
|
-
readonly fadeOut: "fadeOut";
|
|
1746
|
-
readonly fade: "fade";
|
|
1747
|
-
readonly slideUp: "slideUp";
|
|
1748
|
-
readonly slideDown: "slideDown";
|
|
1749
|
-
readonly slideLeft: "slideLeft";
|
|
1750
|
-
readonly slideRight: "slideRight";
|
|
1751
|
-
readonly scaleIn: "scaleIn";
|
|
1752
|
-
readonly scaleOut: "scaleOut";
|
|
1753
|
-
readonly scale: "scale";
|
|
1754
|
-
readonly blurIn: "blurIn";
|
|
1755
|
-
readonly blurOut: "blurOut";
|
|
1756
|
-
readonly bounce: "bounce";
|
|
1757
|
-
};
|
|
1758
|
-
export type Motion = (typeof Motion)[keyof typeof Motion];
|
|
1759
|
-
/** `.hover(h => h.effect(Effect.sweepToRight))`. */
|
|
1760
|
-
declare const Effect$1: {
|
|
1761
|
-
readonly trim: "trim";
|
|
1762
|
-
readonly pop: "pop";
|
|
1763
|
-
readonly push: "push";
|
|
1764
|
-
readonly fade: "fade";
|
|
1765
|
-
readonly rotate: "rotate";
|
|
1766
|
-
readonly grow: "grow";
|
|
1767
|
-
readonly shrink: "shrink";
|
|
1768
|
-
readonly pulse: "pulse";
|
|
1769
|
-
readonly pulseGrow: "pulseGrow";
|
|
1770
|
-
readonly pulseShrink: "pulseShrink";
|
|
1771
|
-
readonly bounceIn: "bounceIn";
|
|
1772
|
-
readonly bounceOut: "bounceOut";
|
|
1773
|
-
readonly growRotate: "growRotate";
|
|
1774
|
-
readonly float: "float";
|
|
1775
|
-
readonly sink: "sink";
|
|
1776
|
-
readonly bob: "bob";
|
|
1777
|
-
readonly hang: "hang";
|
|
1778
|
-
readonly skew: "skew";
|
|
1779
|
-
readonly skewForward: "skewForward";
|
|
1780
|
-
readonly skewBackward: "skewBackward";
|
|
1781
|
-
readonly wobbleHorizontal: "wobbleHorizontal";
|
|
1782
|
-
readonly wobbleVertical: "wobbleVertical";
|
|
1783
|
-
readonly wobbleToBottomRight: "wobbleToBottomRight";
|
|
1784
|
-
readonly wobbleToTopRight: "wobbleToTopRight";
|
|
1785
|
-
readonly wobbleTop: "wobbleTop";
|
|
1786
|
-
readonly wobbleBottom: "wobbleBottom";
|
|
1787
|
-
readonly wobbleSkew: "wobbleSkew";
|
|
1788
|
-
readonly buzz: "buzz";
|
|
1789
|
-
readonly buzzOut: "buzzOut";
|
|
1790
|
-
readonly forward: "forward";
|
|
1791
|
-
readonly backward: "backward";
|
|
1792
|
-
readonly nudge: "nudge";
|
|
1793
|
-
readonly backPulse: "backPulse";
|
|
1794
|
-
readonly sweepToRight: "sweepToRight";
|
|
1795
|
-
readonly sweepToLeft: "sweepToLeft";
|
|
1796
|
-
readonly sweepToBottom: "sweepToBottom";
|
|
1797
|
-
readonly sweepToTop: "sweepToTop";
|
|
1798
|
-
readonly bounceToRight: "bounceToRight";
|
|
1799
|
-
readonly bounceToLeft: "bounceToLeft";
|
|
1800
|
-
readonly bounceToBottom: "bounceToBottom";
|
|
1801
|
-
readonly bounceToTop: "bounceToTop";
|
|
1802
|
-
readonly radialOut: "radialOut";
|
|
1803
|
-
readonly radialIn: "radialIn";
|
|
1804
|
-
readonly rectangleIn: "rectangleIn";
|
|
1805
|
-
readonly rectangleOut: "rectangleOut";
|
|
1806
|
-
readonly shutterInHorizontal: "shutterInHorizontal";
|
|
1807
|
-
readonly shutterOutHorizontal: "shutterOutHorizontal";
|
|
1808
|
-
readonly shutterInVertical: "shutterInVertical";
|
|
1809
|
-
readonly shutterOutVertical: "shutterOutVertical";
|
|
1810
|
-
readonly iconBack: "iconBack";
|
|
1811
|
-
readonly iconForward: "iconForward";
|
|
1812
|
-
readonly iconDown: "iconDown";
|
|
1813
|
-
readonly iconUp: "iconUp";
|
|
1814
|
-
readonly iconSpin: "iconSpin";
|
|
1815
|
-
readonly iconDrop: "iconDrop";
|
|
1816
|
-
readonly iconFade: "iconFade";
|
|
1817
|
-
readonly iconFloatAway: "iconFloatAway";
|
|
1818
|
-
readonly iconSinkAway: "iconSinkAway";
|
|
1819
|
-
readonly iconGrow: "iconGrow";
|
|
1820
|
-
readonly iconShrink: "iconShrink";
|
|
1821
|
-
readonly iconPulse: "iconPulse";
|
|
1822
|
-
readonly iconPulseGrow: "iconPulseGrow";
|
|
1823
|
-
readonly iconPulseShrink: "iconPulseShrink";
|
|
1824
|
-
readonly iconPush: "iconPush";
|
|
1825
|
-
readonly iconPop: "iconPop";
|
|
1826
|
-
readonly iconBounce: "iconBounce";
|
|
1827
|
-
readonly iconRotate: "iconRotate";
|
|
1828
|
-
readonly iconGrowRotate: "iconGrowRotate";
|
|
1829
|
-
readonly iconFloat: "iconFloat";
|
|
1830
|
-
readonly iconSink: "iconSink";
|
|
1831
|
-
readonly iconBob: "iconBob";
|
|
1832
|
-
readonly iconHang: "iconHang";
|
|
1833
|
-
readonly iconWobbleHorizontal: "iconWobbleHorizontal";
|
|
1834
|
-
readonly iconWobbleVertical: "iconWobbleVertical";
|
|
1835
|
-
readonly iconBuzz: "iconBuzz";
|
|
1836
|
-
readonly iconBuzzOut: "iconBuzzOut";
|
|
1837
|
-
readonly borderFade: "borderFade";
|
|
1838
|
-
readonly hollow: "hollow";
|
|
1839
|
-
readonly rippleOut: "rippleOut";
|
|
1840
|
-
readonly rippleIn: "rippleIn";
|
|
1841
|
-
readonly outlineOut: "outlineOut";
|
|
1842
|
-
readonly outlineIn: "outlineIn";
|
|
1843
|
-
readonly roundCorners: "roundCorners";
|
|
1844
|
-
readonly underlineFromLeft: "underlineFromLeft";
|
|
1845
|
-
readonly underlineFromCenter: "underlineFromCenter";
|
|
1846
|
-
readonly underlineFromRight: "underlineFromRight";
|
|
1847
|
-
readonly reveal: "reveal";
|
|
1848
|
-
readonly underlineReveal: "underlineReveal";
|
|
1849
|
-
readonly overlineFromLeft: "overlineFromLeft";
|
|
1850
|
-
readonly overlineFromCenter: "overlineFromCenter";
|
|
1851
|
-
readonly overlineFromRight: "overlineFromRight";
|
|
1852
|
-
readonly overlineReveal: "overlineReveal";
|
|
1853
|
-
readonly shadowGrow: "shadowGrow";
|
|
1854
|
-
readonly shadowFloat: "shadowFloat";
|
|
1855
|
-
readonly shadowGlow: "shadowGlow";
|
|
1856
|
-
readonly shadowRadial: "shadowRadial";
|
|
1857
|
-
readonly boxShadowOutset: "boxShadowOutset";
|
|
1858
|
-
readonly boxShadowInset: "boxShadowInset";
|
|
1859
|
-
readonly lift: "lift";
|
|
1860
|
-
readonly glow: "glow";
|
|
1861
|
-
readonly bubbleTop: "bubbleTop";
|
|
1862
|
-
readonly bubbleRight: "bubbleRight";
|
|
1863
|
-
readonly bubbleBottom: "bubbleBottom";
|
|
1864
|
-
readonly bubbleLeft: "bubbleLeft";
|
|
1865
|
-
readonly bubbleFloatTop: "bubbleFloatTop";
|
|
1866
|
-
readonly bubbleFloatRight: "bubbleFloatRight";
|
|
1867
|
-
readonly bubbleFloatBottom: "bubbleFloatBottom";
|
|
1868
|
-
readonly bubbleFloatLeft: "bubbleFloatLeft";
|
|
1869
|
-
readonly curlTopLeft: "curlTopLeft";
|
|
1870
|
-
readonly curlTopRight: "curlTopRight";
|
|
1871
|
-
readonly curlBottomRight: "curlBottomRight";
|
|
1872
|
-
readonly curlBottomLeft: "curlBottomLeft";
|
|
1873
|
-
};
|
|
1874
|
-
type Effect$1 = (typeof Effect$1)[keyof typeof Effect$1];
|
|
1875
|
-
export declare const Align: {
|
|
1876
|
-
readonly start: "start";
|
|
1877
|
-
readonly center: "center";
|
|
1878
|
-
readonly end: "end";
|
|
1879
|
-
readonly stretch: "stretch";
|
|
1880
|
-
readonly baseline: "baseline";
|
|
1881
|
-
readonly between: "between";
|
|
1882
|
-
readonly around: "around";
|
|
1883
|
-
readonly evenly: "evenly";
|
|
1884
|
-
};
|
|
1885
|
-
export type Align = (typeof Align)[keyof typeof Align];
|
|
1886
|
-
/** Words `.width()` / `.height()` already accept. A number or `'320px'` skips this. */
|
|
1887
|
-
export declare const Size: {
|
|
1888
|
-
readonly full: "full";
|
|
1889
|
-
readonly screen: "screen";
|
|
1890
|
-
readonly fit: "fit";
|
|
1891
|
-
readonly min: "min";
|
|
1892
|
-
readonly max: "max";
|
|
1893
|
-
};
|
|
1894
|
-
export type Size = (typeof Size)[keyof typeof Size];
|
|
1895
|
-
/** Theme spacing. `.padding(Space.md)`, `.gap(Space.sm)`, `.height(Space.xl)`. */
|
|
1896
|
-
export declare const Space: {
|
|
1897
|
-
readonly xs: "var(--fibo-space-xs)";
|
|
1898
|
-
readonly sm: "var(--fibo-space-sm)";
|
|
1899
|
-
readonly md: "var(--fibo-space-md)";
|
|
1900
|
-
readonly lg: "var(--fibo-space-lg)";
|
|
1901
|
-
readonly xl: "var(--fibo-space-xl)";
|
|
1902
|
-
};
|
|
1903
|
-
export type Space = (typeof Space)[keyof typeof Space];
|
|
1904
|
-
/** Theme radii. `.borderRadius(Radius.md)`. */
|
|
1905
|
-
export declare const Radius: {
|
|
1906
|
-
readonly xs: "var(--fibo-radius-xs)";
|
|
1907
|
-
readonly sm: "var(--fibo-radius-sm)";
|
|
1908
|
-
readonly md: "var(--fibo-radius-md)";
|
|
1909
|
-
readonly lg: "var(--fibo-radius-lg)";
|
|
1910
|
-
readonly xl: "var(--fibo-radius-xl)";
|
|
1911
|
-
readonly full: "var(--fibo-radius-full)";
|
|
1912
|
-
};
|
|
1913
|
-
export type Radius = (typeof Radius)[keyof typeof Radius];
|
|
1914
|
-
/**
|
|
1915
|
-
* Theme colors. `.bg(Color.primary)` and `.color(Color.onSurface)` resolve to
|
|
1916
|
-
* `--fibo-*`. A hex, `rgb()`, or any other string still paints as-is.
|
|
1126
|
+
* Theme colors. `.bg(Color.primary)` and `.color(Color.onSurface)` resolve to
|
|
1127
|
+
* `--fibo-*`. A hex, `rgb()`, or any other string still paints as-is.
|
|
1917
1128
|
*/
|
|
1918
1129
|
export declare const Color: {
|
|
1919
1130
|
readonly primary: "var(--fibo-primary)";
|
|
@@ -1971,6 +1182,10 @@ export declare const Clip: {
|
|
|
1971
1182
|
readonly antiAlias: "antiAlias";
|
|
1972
1183
|
};
|
|
1973
1184
|
export type Clip = (typeof Clip)[keyof typeof Clip];
|
|
1185
|
+
/**
|
|
1186
|
+
* Corner / edge alignment for `ZStack`, `.frame({ alignment })`, overlays.
|
|
1187
|
+
* SwiftUI aliases (`topTrailing`, `leading`, …) resolve to the FiboUI names.
|
|
1188
|
+
*/
|
|
1974
1189
|
export declare const StackAlign: {
|
|
1975
1190
|
readonly center: "center";
|
|
1976
1191
|
readonly top: "top";
|
|
@@ -1981,8 +1196,25 @@ export declare const StackAlign: {
|
|
|
1981
1196
|
readonly topRight: "topRight";
|
|
1982
1197
|
readonly bottomLeft: "bottomLeft";
|
|
1983
1198
|
readonly bottomRight: "bottomRight";
|
|
1199
|
+
/** SwiftUI `leading` → `left` */
|
|
1200
|
+
readonly leading: "left";
|
|
1201
|
+
/** SwiftUI `trailing` → `right` */
|
|
1202
|
+
readonly trailing: "right";
|
|
1203
|
+
/** SwiftUI `topLeading` → `topLeft` */
|
|
1204
|
+
readonly topLeading: "topLeft";
|
|
1205
|
+
/** SwiftUI `topTrailing` → `topRight` */
|
|
1206
|
+
readonly topTrailing: "topRight";
|
|
1207
|
+
/** SwiftUI `bottomLeading` → `bottomLeft` */
|
|
1208
|
+
readonly bottomLeading: "bottomLeft";
|
|
1209
|
+
/** SwiftUI `bottomTrailing` → `bottomRight` */
|
|
1210
|
+
readonly bottomTrailing: "bottomRight";
|
|
1984
1211
|
};
|
|
1985
1212
|
export type StackAlign = (typeof StackAlign)[keyof typeof StackAlign];
|
|
1213
|
+
/** Flex longhands for a {@link StackAlign} value (frame / ZStack overlay slot). */
|
|
1214
|
+
export declare function stackAlignFlex(align?: StackAlign | keyof typeof StackAlign): {
|
|
1215
|
+
alignItems: string;
|
|
1216
|
+
justifyContent: string;
|
|
1217
|
+
};
|
|
1986
1218
|
export declare const Theme: {
|
|
1987
1219
|
readonly material: "material";
|
|
1988
1220
|
readonly cupertino: "cupertino";
|
|
@@ -2185,51 +1417,1485 @@ export declare const Side: {
|
|
|
2185
1417
|
readonly start: "start";
|
|
2186
1418
|
readonly end: "end";
|
|
2187
1419
|
};
|
|
2188
|
-
export type Side = (typeof Side)[keyof typeof Side];
|
|
2189
|
-
export declare const Place: {
|
|
2190
|
-
readonly leading: "leading";
|
|
2191
|
-
readonly principal: "principal";
|
|
2192
|
-
readonly trailing: "trailing";
|
|
1420
|
+
export type Side = (typeof Side)[keyof typeof Side];
|
|
1421
|
+
export declare const Place: {
|
|
1422
|
+
readonly leading: "leading";
|
|
1423
|
+
readonly principal: "principal";
|
|
1424
|
+
readonly trailing: "trailing";
|
|
1425
|
+
};
|
|
1426
|
+
export type Place = (typeof Place)[keyof typeof Place];
|
|
1427
|
+
export declare const FormMethod: {
|
|
1428
|
+
readonly get: "get";
|
|
1429
|
+
readonly post: "post";
|
|
1430
|
+
};
|
|
1431
|
+
export type FormMethod = (typeof FormMethod)[keyof typeof FormMethod];
|
|
1432
|
+
export declare const Trend: {
|
|
1433
|
+
readonly up: "up";
|
|
1434
|
+
readonly down: "down";
|
|
1435
|
+
readonly neutral: "neutral";
|
|
1436
|
+
};
|
|
1437
|
+
export type Trend = (typeof Trend)[keyof typeof Trend];
|
|
1438
|
+
export declare const Stroke: {
|
|
1439
|
+
readonly butt: "butt";
|
|
1440
|
+
readonly round: "round";
|
|
1441
|
+
readonly square: "square";
|
|
1442
|
+
};
|
|
1443
|
+
export type Stroke = (typeof Stroke)[keyof typeof Stroke];
|
|
1444
|
+
export declare const Join: {
|
|
1445
|
+
readonly miter: "miter";
|
|
1446
|
+
readonly round: "round";
|
|
1447
|
+
readonly bevel: "bevel";
|
|
1448
|
+
};
|
|
1449
|
+
export type Join = (typeof Join)[keyof typeof Join];
|
|
1450
|
+
export declare const Scale: {
|
|
1451
|
+
readonly small: "small";
|
|
1452
|
+
readonly medium: "medium";
|
|
1453
|
+
readonly large: "large";
|
|
1454
|
+
};
|
|
1455
|
+
export type Scale = (typeof Scale)[keyof typeof Scale];
|
|
1456
|
+
export declare const Density: {
|
|
1457
|
+
readonly small: "small";
|
|
1458
|
+
readonly medium: "medium";
|
|
1459
|
+
readonly large: "large";
|
|
1460
|
+
};
|
|
1461
|
+
export type Density = Scale;
|
|
1462
|
+
export declare function isSizeWord(value: string): value is Size;
|
|
1463
|
+
/** CSS length a size word locks to, so a flex parent cannot squash it. */
|
|
1464
|
+
export declare function sizeWordCss(word: string, axis: "width" | "height"): string | undefined;
|
|
1465
|
+
/** Fixed px, CSS length, `%`, or a {@link Size} word (`Size.infinity`, `Size.full`, …). */
|
|
1466
|
+
export type FrameSize = number | string | Size;
|
|
1467
|
+
/**
|
|
1468
|
+
* SwiftUI `View.frame` — both overloads in one object.
|
|
1469
|
+
*
|
|
1470
|
+
* ```ts
|
|
1471
|
+
* .frame({ width: 300, height: 400 })
|
|
1472
|
+
* .frame({ maxWidth: Size.infinity, maxHeight: Size.infinity, alignment: StackAlign.topTrailing })
|
|
1473
|
+
* ```
|
|
1474
|
+
*/
|
|
1475
|
+
export interface FrameSpec {
|
|
1476
|
+
width?: FrameSize;
|
|
1477
|
+
height?: FrameSize;
|
|
1478
|
+
minWidth?: FrameSize;
|
|
1479
|
+
idealWidth?: FrameSize;
|
|
1480
|
+
maxWidth?: FrameSize;
|
|
1481
|
+
minHeight?: FrameSize;
|
|
1482
|
+
idealHeight?: FrameSize;
|
|
1483
|
+
maxHeight?: FrameSize;
|
|
1484
|
+
alignment?: StackAlign | keyof typeof StackAlign;
|
|
1485
|
+
}
|
|
1486
|
+
/** Resolve a frame size to a CSS length. `Size.infinity` → fill parent (`100%`). */
|
|
1487
|
+
export declare function resolveFrameSize(value: FrameSize | undefined, role: "min" | "ideal" | "max" | "fixed", axis?: "width" | "height"): string | undefined;
|
|
1488
|
+
export declare function isFixedNumericFrame(spec: FrameSpec): spec is FrameSpec & {
|
|
1489
|
+
width: number;
|
|
1490
|
+
height: number;
|
|
1491
|
+
};
|
|
1492
|
+
/** Invisible SwiftUI-style frame wrapper around a built host element. */
|
|
1493
|
+
export declare function wrapFrame(child: React$1.ReactElement, spec: FrameSpec): React$1.ReactElement;
|
|
1494
|
+
export type ClipShapeName = "circle" | "rounded" | "square";
|
|
1495
|
+
export interface OffsetSpec {
|
|
1496
|
+
x?: number;
|
|
1497
|
+
y?: number;
|
|
1498
|
+
}
|
|
1499
|
+
export interface FixedSizeSpec {
|
|
1500
|
+
horizontal?: boolean;
|
|
1501
|
+
vertical?: boolean;
|
|
1502
|
+
}
|
|
1503
|
+
export interface LayerSpec {
|
|
1504
|
+
kind: "overlay" | "background";
|
|
1505
|
+
child: FiboChild | (() => FiboChild);
|
|
1506
|
+
alignment: StackAlign | keyof typeof StackAlign;
|
|
1507
|
+
}
|
|
1508
|
+
/** SwiftUI `.offset(x:y:)` — visual translate; layout size unchanged. */
|
|
1509
|
+
export declare function wrapOffset(child: React$1.ReactElement, offset: OffsetSpec): React$1.ReactElement;
|
|
1510
|
+
/** SwiftUI `.clipped()` — clip to bounds. */
|
|
1511
|
+
export declare function wrapClipped(child: React$1.ReactElement): React$1.ReactElement;
|
|
1512
|
+
/** SwiftUI `.clipShape` — circle / rounded / square / custom radius. */
|
|
1513
|
+
export declare function wrapClipShape(child: React$1.ReactElement, shape: ClipShapeName | string): React$1.ReactElement;
|
|
1514
|
+
/**
|
|
1515
|
+
* Transparent click film — sits above visual content and owns the full box hit
|
|
1516
|
+
* target (inset:0). Gestures listen via capture on ancestor hosts; the film is
|
|
1517
|
+
* the actual event target so empty/transparent pixels still receive taps.
|
|
1518
|
+
*/
|
|
1519
|
+
export declare const HIT_FILM_STYLE: React$1.CSSProperties;
|
|
1520
|
+
export declare function HitFilm(): React$1.ReactElement;
|
|
1521
|
+
/**
|
|
1522
|
+
* SwiftUI `.contentShape` — hit-testing region (independent of visual clip).
|
|
1523
|
+
* Implemented as a transparent film above the view (full frame tappable).
|
|
1524
|
+
*
|
|
1525
|
+
* ```ts
|
|
1526
|
+
* ZStack()…frame({ width: 300, height: 400 }).contentShape('rectangle').onTapGesture(…)
|
|
1527
|
+
* Image()…frame({ width: 120, height: 120 }).clipShape('circle').contentShape('circle')
|
|
1528
|
+
* ```
|
|
1529
|
+
*/
|
|
1530
|
+
export type ContentShapeName = "rectangle" | ClipShapeName;
|
|
1531
|
+
export declare function wrapContentShape(child: React$1.ReactElement, shape?: ContentShapeName | string): React$1.ReactElement;
|
|
1532
|
+
/**
|
|
1533
|
+
* SwiftUI `.layoutPriority` — higher = resist compression first, then claim free space.
|
|
1534
|
+
* Web mapping: flex-shrink 0 + flex-grow for priority>0; negative priority shrinks first.
|
|
1535
|
+
* Not a full multi-axis SwiftUI proposal solver (DOM limitation).
|
|
1536
|
+
*/
|
|
1537
|
+
export declare function wrapLayoutPriority(child: React$1.ReactElement, priority: number): React$1.ReactElement;
|
|
1538
|
+
/** SwiftUI `.fixedSize(horizontal:vertical:)` — hug content on those axes. */
|
|
1539
|
+
export declare function wrapFixedSize(child: React$1.ReactElement, spec: FixedSizeSpec): React$1.ReactElement;
|
|
1540
|
+
/**
|
|
1541
|
+
* SwiftUI `.overlay` / `.background` — layer above/below the view.
|
|
1542
|
+
* Base keeps intrinsic size; layer is `position:absolute; inset:0` + flex align.
|
|
1543
|
+
*/
|
|
1544
|
+
export declare function wrapLayer(child: React$1.ReactElement, layer: LayerSpec): React$1.ReactElement;
|
|
1545
|
+
export type GeometryRect = {
|
|
1546
|
+
x: number;
|
|
1547
|
+
y: number;
|
|
1548
|
+
width: number;
|
|
1549
|
+
height: number;
|
|
1550
|
+
};
|
|
1551
|
+
/** SwiftUI-ish `onGeometryChange` — ResizeObserver on a host around the view. */
|
|
1552
|
+
export declare function wrapOnGeometryChange(child: React$1.ReactElement, onChange: (rect: GeometryRect) => void): React$1.ReactElement;
|
|
1553
|
+
/** SwiftUI `.compositingGroup()` — flatten into one compositing layer. */
|
|
1554
|
+
export declare function wrapCompositingGroup(child: React$1.ReactElement): React$1.ReactElement;
|
|
1555
|
+
/**
|
|
1556
|
+
* SwiftUI `.mask` — CSS mask from a shape name or custom CSS mask value.
|
|
1557
|
+
* Shape names reuse clip radii / circle clip-path.
|
|
1558
|
+
*/
|
|
1559
|
+
export declare function wrapMask(child: React$1.ReactElement, mask: ClipShapeName | "rectangle" | string): React$1.ReactElement;
|
|
1560
|
+
export type ContainerRelativeFrameSpec = {
|
|
1561
|
+
axis?: "horizontal" | "vertical" | "both";
|
|
1562
|
+
/** Divisions of the container (SwiftUI `count`). Default 1. */
|
|
1563
|
+
count?: number;
|
|
1564
|
+
/** Spans claimed (SwiftUI `span`). Default 1. */
|
|
1565
|
+
span?: number;
|
|
1566
|
+
};
|
|
1567
|
+
/** SwiftUI `containerRelativeFrame` — size vs nearest sized ancestor (px after measure). */
|
|
1568
|
+
export declare function wrapContainerRelativeFrame(child: React$1.ReactElement, spec?: ContainerRelativeFrameSpec): React$1.ReactElement;
|
|
1569
|
+
export type AlignmentGuideName = "leading" | "trailing" | "top" | "bottom" | "centerX" | "centerY" | string;
|
|
1570
|
+
export type AlignmentGuideDims = {
|
|
1571
|
+
width: number;
|
|
1572
|
+
height: number;
|
|
1573
|
+
};
|
|
1574
|
+
export type AlignmentGuideSpec = {
|
|
1575
|
+
guide: AlignmentGuideName;
|
|
1576
|
+
/** Absolute guide position, or compute from own size (SwiftUI `ViewDimensions`). */
|
|
1577
|
+
compute: number | ((dims: AlignmentGuideDims) => number);
|
|
1578
|
+
};
|
|
1579
|
+
/**
|
|
1580
|
+
* SwiftUI `alignmentGuide` — shifts the view so the named guide sits at `compute`.
|
|
1581
|
+
* Also publishes `--fibo-align-{guide}` for CSS consumers.
|
|
1582
|
+
*/
|
|
1583
|
+
export declare function wrapAlignmentGuide(child: React$1.ReactElement, spec: AlignmentGuideSpec): React$1.ReactElement;
|
|
1584
|
+
export type MatchedGeometrySpec = {
|
|
1585
|
+
id: string;
|
|
1586
|
+
namespace?: string;
|
|
1587
|
+
/** SwiftUI `isSource` — source owns the shared geometry. Default true. */
|
|
1588
|
+
isSource?: boolean;
|
|
1589
|
+
};
|
|
1590
|
+
/**
|
|
1591
|
+
* SwiftUI `matchedGeometryEffect` — shared `view-transition-name` + measured rect store.
|
|
1592
|
+
* Pair with `startViewTransition` / browser VT for morph; `isSource` marks the owner.
|
|
1593
|
+
*/
|
|
1594
|
+
export declare function wrapMatchedGeometry(child: React$1.ReactElement, spec: MatchedGeometrySpec): React$1.ReactElement;
|
|
1595
|
+
export declare function matchedGeometryKeys(): string[];
|
|
1596
|
+
export declare function matchedGeometryRect(id: string, namespace?: string): DOMRect | undefined;
|
|
1597
|
+
/**
|
|
1598
|
+
* SwiftUI `PreferenceKey` — typed key with default + reduce.
|
|
1599
|
+
*
|
|
1600
|
+
* ```ts
|
|
1601
|
+
* const WidthKey = PreferenceKey({ defaultValue: 0, reduce: (a, b) => Math.max(a, b) })
|
|
1602
|
+
* Column()
|
|
1603
|
+
* .onPreferenceChange(WidthKey, (w) => console.log(w))
|
|
1604
|
+
* .children(Box().preference(WidthKey, 120))
|
|
1605
|
+
* ```
|
|
1606
|
+
*/
|
|
1607
|
+
export type PreferenceKeyDef<T> = {
|
|
1608
|
+
readonly __preferenceKey: true;
|
|
1609
|
+
readonly id: string | symbol;
|
|
1610
|
+
readonly defaultValue: T;
|
|
1611
|
+
reduce: (value: T, nextValue: T) => T;
|
|
1612
|
+
};
|
|
1613
|
+
export declare function PreferenceKey<T>(opts: {
|
|
1614
|
+
id?: string;
|
|
1615
|
+
defaultValue: T;
|
|
1616
|
+
reduce?: (value: T, nextValue: T) => T;
|
|
1617
|
+
}): PreferenceKeyDef<T>;
|
|
1618
|
+
export type PreferenceWriteSpec = {
|
|
1619
|
+
key: PreferenceKeyDef<any>;
|
|
1620
|
+
value: unknown;
|
|
1621
|
+
};
|
|
1622
|
+
export type PreferenceReadSpec = {
|
|
1623
|
+
key: PreferenceKeyDef<any>;
|
|
1624
|
+
onChange: (value: any) => void;
|
|
1625
|
+
};
|
|
1626
|
+
/** Contribute a preference value to the nearest `.onPreferenceChange` ancestor. */
|
|
1627
|
+
export declare function wrapPreference(child: React$1.ReactElement, spec: PreferenceWriteSpec): React$1.ReactElement;
|
|
1628
|
+
/** Listen for reduced preference values from descendants. */
|
|
1629
|
+
export declare function wrapOnPreferenceChange(child: React$1.ReactElement, spec: PreferenceReadSpec): React$1.ReactElement;
|
|
1630
|
+
/** Test helper — reduce contributions manually. */
|
|
1631
|
+
export declare function reducePreferences<T>(key: PreferenceKeyDef<T>, values: T[]): T;
|
|
1632
|
+
/**
|
|
1633
|
+
* SwiftUI-facing enums / const objects for FiboUI.
|
|
1634
|
+
* Prefer these over raw strings in app code.
|
|
1635
|
+
*/
|
|
1636
|
+
/** SwiftUI `Edge` */
|
|
1637
|
+
export declare const Edge: {
|
|
1638
|
+
readonly top: "top";
|
|
1639
|
+
readonly bottom: "bottom";
|
|
1640
|
+
readonly leading: "leading";
|
|
1641
|
+
readonly trailing: "trailing";
|
|
1642
|
+
};
|
|
1643
|
+
export type Edge = (typeof Edge)[keyof typeof Edge];
|
|
1644
|
+
/**
|
|
1645
|
+
* SwiftUI `Edge.Set` — which sides receive padding/margin.
|
|
1646
|
+
* `leading`/`trailing` map to left/right in LTR (CSS).
|
|
1647
|
+
*/
|
|
1648
|
+
export declare const EdgeSet: {
|
|
1649
|
+
readonly top: "top";
|
|
1650
|
+
readonly bottom: "bottom";
|
|
1651
|
+
readonly leading: "leading";
|
|
1652
|
+
readonly trailing: "trailing";
|
|
1653
|
+
readonly horizontal: "horizontal";
|
|
1654
|
+
readonly vertical: "vertical";
|
|
1655
|
+
readonly all: "all";
|
|
1656
|
+
};
|
|
1657
|
+
export type EdgeSet = (typeof EdgeSet)[keyof typeof EdgeSet];
|
|
1658
|
+
/** SwiftUI `ContentShape` / hit region names */
|
|
1659
|
+
export declare const ContentShape: {
|
|
1660
|
+
readonly rectangle: "rectangle";
|
|
1661
|
+
readonly circle: "circle";
|
|
1662
|
+
readonly rounded: "rounded";
|
|
1663
|
+
readonly square: "square";
|
|
1664
|
+
};
|
|
1665
|
+
export type ContentShape = (typeof ContentShape)[keyof typeof ContentShape];
|
|
1666
|
+
/** SwiftUI `ClipShape` names */
|
|
1667
|
+
export declare const ClipShape: {
|
|
1668
|
+
readonly circle: "circle";
|
|
1669
|
+
readonly rounded: "rounded";
|
|
1670
|
+
readonly square: "square";
|
|
1671
|
+
readonly rectangle: "rectangle";
|
|
1672
|
+
};
|
|
1673
|
+
export type ClipShape = (typeof ClipShape)[keyof typeof ClipShape];
|
|
1674
|
+
/** Named / built-in coordinate spaces for GeometryProxy */
|
|
1675
|
+
export declare const CoordinateSpace: {
|
|
1676
|
+
readonly local: "local";
|
|
1677
|
+
readonly global: "global";
|
|
1678
|
+
readonly named: (name: string) => string;
|
|
1679
|
+
};
|
|
1680
|
+
/** Drag axis lock */
|
|
1681
|
+
declare const DragAxis$1: {
|
|
1682
|
+
readonly free: "free";
|
|
1683
|
+
readonly horizontal: "horizontal";
|
|
1684
|
+
readonly vertical: "vertical";
|
|
1685
|
+
};
|
|
1686
|
+
/** GestureMask (also on GestureBuilders) */
|
|
1687
|
+
export declare const GestureMaskEnum: {
|
|
1688
|
+
readonly all: "all";
|
|
1689
|
+
readonly gesture: "gesture";
|
|
1690
|
+
readonly subviews: "subviews";
|
|
1691
|
+
readonly none: "none";
|
|
1692
|
+
};
|
|
1693
|
+
/** Scroll target / position anchors */
|
|
1694
|
+
export declare const ScrollAnchor: {
|
|
1695
|
+
readonly start: "start";
|
|
1696
|
+
readonly center: "center";
|
|
1697
|
+
readonly end: "end";
|
|
1698
|
+
};
|
|
1699
|
+
export type ScrollAnchor = (typeof ScrollAnchor)[keyof typeof ScrollAnchor];
|
|
1700
|
+
/** Unit for containerRelativeFrame */
|
|
1701
|
+
export declare const ContainerRelativeAxis: {
|
|
1702
|
+
readonly horizontal: "horizontal";
|
|
1703
|
+
readonly vertical: "vertical";
|
|
1704
|
+
readonly both: "both";
|
|
1705
|
+
};
|
|
1706
|
+
export type ContainerRelativeAxis = (typeof ContainerRelativeAxis)[keyof typeof ContainerRelativeAxis];
|
|
1707
|
+
export type EdgeInsetsValue = {
|
|
1708
|
+
top?: number | string;
|
|
1709
|
+
bottom?: number | string;
|
|
1710
|
+
leading?: number | string;
|
|
1711
|
+
trailing?: number | string;
|
|
1712
|
+
/** CSS left — alias of leading in LTR */
|
|
1713
|
+
left?: number | string;
|
|
1714
|
+
/** CSS right — alias of trailing in LTR */
|
|
1715
|
+
right?: number | string;
|
|
1716
|
+
};
|
|
1717
|
+
export declare function resolveEdgeInsets(insets: EdgeInsetsValue): {
|
|
1718
|
+
top?: number | string;
|
|
1719
|
+
right?: number | string;
|
|
1720
|
+
bottom?: number | string;
|
|
1721
|
+
left?: number | string;
|
|
1722
|
+
};
|
|
1723
|
+
export declare function applyEdgeSet(set: EdgeSet, value: number | string): {
|
|
1724
|
+
top?: number | string;
|
|
1725
|
+
right?: number | string;
|
|
1726
|
+
bottom?: number | string;
|
|
1727
|
+
left?: number | string;
|
|
1728
|
+
};
|
|
1729
|
+
export type SafeAreaInsetEdge = Edge | "top" | "bottom" | "leading" | "trailing" | "left" | "right";
|
|
1730
|
+
export type SafeAreaInsetSpec = {
|
|
1731
|
+
edge: SafeAreaInsetEdge;
|
|
1732
|
+
content: FiboChild | (() => FiboChild);
|
|
1733
|
+
/** Gap between inset bar and content. Default 0. */
|
|
1734
|
+
spacing?: number;
|
|
1735
|
+
};
|
|
1736
|
+
/**
|
|
1737
|
+
* SwiftUI `.safeAreaInset(edge:)` — reserves a bar on one edge; content fills the rest.
|
|
1738
|
+
* Does **not** replace `SafeArea` (pad for notch) or `GeometryProxy.safeAreaInsets` (read).
|
|
1739
|
+
*/
|
|
1740
|
+
export declare function wrapSafeAreaInset(child: React$1.ReactElement, spec: SafeAreaInsetSpec): React$1.ReactElement;
|
|
1741
|
+
export interface SpringOptions {
|
|
1742
|
+
stiffness?: number;
|
|
1743
|
+
damping?: number;
|
|
1744
|
+
mass?: number;
|
|
1745
|
+
}
|
|
1746
|
+
/**
|
|
1747
|
+
* CSS `linear()` spring sampled once. stiffness/damping/mass change the curve.
|
|
1748
|
+
* The browser interpolates — no rAF on the CSS path.
|
|
1749
|
+
*/
|
|
1750
|
+
export declare function springEase(options?: SpringOptions): string;
|
|
1751
|
+
export declare function resolveCssEase(value: string, spring?: SpringOptions): string;
|
|
1752
|
+
export interface ThemeColors {
|
|
1753
|
+
primary: string;
|
|
1754
|
+
primaryVariant?: string;
|
|
1755
|
+
primaryContainer?: string;
|
|
1756
|
+
onPrimaryContainer?: string;
|
|
1757
|
+
secondary: string;
|
|
1758
|
+
secondaryVariant?: string;
|
|
1759
|
+
secondaryContainer?: string;
|
|
1760
|
+
onSecondaryContainer?: string;
|
|
1761
|
+
tertiary?: string;
|
|
1762
|
+
onTertiary?: string;
|
|
1763
|
+
tertiaryContainer?: string;
|
|
1764
|
+
onTertiaryContainer?: string;
|
|
1765
|
+
background: string;
|
|
1766
|
+
surface: string;
|
|
1767
|
+
surfaceVariant?: string;
|
|
1768
|
+
onSurfaceVariant?: string;
|
|
1769
|
+
error: string;
|
|
1770
|
+
errorContainer?: string;
|
|
1771
|
+
onErrorContainer?: string;
|
|
1772
|
+
success?: string;
|
|
1773
|
+
warning?: string;
|
|
1774
|
+
info?: string;
|
|
1775
|
+
onPrimary: string;
|
|
1776
|
+
onSecondary: string;
|
|
1777
|
+
onBackground: string;
|
|
1778
|
+
onSurface: string;
|
|
1779
|
+
onError: string;
|
|
1780
|
+
/** Borders / hairlines — maps to `--fibo-outline`. */
|
|
1781
|
+
outline?: string;
|
|
1782
|
+
outlineVariant?: string;
|
|
1783
|
+
/** Maps to `--fibo-surface-container-low` (M3 card surfaces). */
|
|
1784
|
+
surfaceContainerLow?: string;
|
|
1785
|
+
}
|
|
1786
|
+
export interface ThemeTypography {
|
|
1787
|
+
h1: TextStyle;
|
|
1788
|
+
h2: TextStyle;
|
|
1789
|
+
h3: TextStyle;
|
|
1790
|
+
h4: TextStyle;
|
|
1791
|
+
h5: TextStyle;
|
|
1792
|
+
h6: TextStyle;
|
|
1793
|
+
body: TextStyle;
|
|
1794
|
+
caption: TextStyle;
|
|
1795
|
+
label: TextStyle;
|
|
1796
|
+
}
|
|
1797
|
+
interface ThemeSpacing {
|
|
1798
|
+
xs: string;
|
|
1799
|
+
sm: string;
|
|
1800
|
+
md: string;
|
|
1801
|
+
lg: string;
|
|
1802
|
+
xl: string;
|
|
1803
|
+
}
|
|
1804
|
+
interface ThemeBorderRadius {
|
|
1805
|
+
/** Maps to `--fibo-radius-xs` when set (CSS sheets already define it). */
|
|
1806
|
+
xs?: string;
|
|
1807
|
+
sm: string;
|
|
1808
|
+
md: string;
|
|
1809
|
+
lg: string;
|
|
1810
|
+
/** Maps to `--fibo-radius-xl` when set (CSS sheets already define it). */
|
|
1811
|
+
xl?: string;
|
|
1812
|
+
full: string;
|
|
1813
|
+
}
|
|
1814
|
+
interface ThemeShadows {
|
|
1815
|
+
sm: string;
|
|
1816
|
+
md: string;
|
|
1817
|
+
lg: string;
|
|
1818
|
+
}
|
|
1819
|
+
export interface FiboTheme {
|
|
1820
|
+
name: FiboThemeName;
|
|
1821
|
+
colors: ThemeColors;
|
|
1822
|
+
typography: ThemeTypography;
|
|
1823
|
+
spacing: ThemeSpacing;
|
|
1824
|
+
borderRadius: ThemeBorderRadius;
|
|
1825
|
+
shadows: ThemeShadows;
|
|
1826
|
+
fontFamily: string;
|
|
1827
|
+
}
|
|
1828
|
+
/** Built-in presets. `noir` is the dark editorial theme (site / dense apps). */
|
|
1829
|
+
export declare const FIBO_THEMES: {
|
|
1830
|
+
readonly material: FiboTheme;
|
|
1831
|
+
readonly cupertino: FiboTheme;
|
|
1832
|
+
readonly web: FiboTheme;
|
|
1833
|
+
readonly noir: FiboTheme;
|
|
1834
|
+
};
|
|
1835
|
+
export type FiboThemePreset = keyof typeof FIBO_THEMES;
|
|
1836
|
+
export type ThemeInput = FiboTheme | FiboThemePreset;
|
|
1837
|
+
export declare function resolveTheme(input: ThemeInput): FiboTheme;
|
|
1838
|
+
export type FiboThemePatch = {
|
|
1839
|
+
name?: string;
|
|
1840
|
+
colors?: Partial<ThemeColors>;
|
|
1841
|
+
typography?: Partial<Record<keyof ThemeTypography, Partial<TextStyle>>>;
|
|
1842
|
+
spacing?: Partial<ThemeSpacing>;
|
|
1843
|
+
borderRadius?: Partial<ThemeBorderRadius>;
|
|
1844
|
+
shadows?: Partial<ThemeShadows>;
|
|
1845
|
+
fontFamily?: string;
|
|
2193
1846
|
};
|
|
2194
|
-
|
|
2195
|
-
export declare
|
|
2196
|
-
|
|
2197
|
-
|
|
1847
|
+
/** Flutter-style copyWith / SwiftUI environment override. */
|
|
1848
|
+
export declare function copyWithTheme(base: FiboTheme, patch: FiboThemePatch): FiboTheme;
|
|
1849
|
+
/** Alias — SwiftUI/Flutter mental model. */
|
|
1850
|
+
export declare const extendTheme: typeof copyWithTheme;
|
|
1851
|
+
/** Flat CSS custom properties for a theme (inline style or :root block). */
|
|
1852
|
+
export declare function themeToCssVars(theme: FiboTheme): Record<string, string>;
|
|
1853
|
+
/** Inline style object safe for React (CSSProperties + custom props). */
|
|
1854
|
+
export declare function themeToInlineStyle(theme: FiboTheme): React$1.CSSProperties;
|
|
1855
|
+
/** CSS rule body for `.fibo-theme-{name}` — SSR-safe, no useEffect. */
|
|
1856
|
+
export declare function themeToCssRule(theme: FiboTheme): string;
|
|
1857
|
+
export declare function themeClassName(theme: FiboTheme): string;
|
|
1858
|
+
declare enum Colors {
|
|
1859
|
+
Primary = "primary",
|
|
1860
|
+
OnPrimary = "on-primary",
|
|
1861
|
+
PrimaryContainer = "primary-container",
|
|
1862
|
+
OnPrimaryContainer = "on-primary-container",
|
|
1863
|
+
Secondary = "secondary",
|
|
1864
|
+
OnSecondary = "on-secondary",
|
|
1865
|
+
SecondaryContainer = "secondary-container",
|
|
1866
|
+
OnSecondaryContainer = "on-secondary-container",
|
|
1867
|
+
Tertiary = "tertiary",
|
|
1868
|
+
OnTertiary = "on-tertiary",
|
|
1869
|
+
TertiaryContainer = "tertiary-container",
|
|
1870
|
+
OnTertiaryContainer = "on-tertiary-container",
|
|
1871
|
+
Error = "error",
|
|
1872
|
+
OnError = "on-error",
|
|
1873
|
+
Success = "success",
|
|
1874
|
+
Warning = "warning",
|
|
1875
|
+
Info = "info",
|
|
1876
|
+
Background = "background",
|
|
1877
|
+
OnBackground = "on-background",
|
|
1878
|
+
Surface = "surface",
|
|
1879
|
+
OnSurface = "on-surface",
|
|
1880
|
+
SurfaceVariant = "surface-variant",
|
|
1881
|
+
OnSurfaceVariant = "on-surface-variant",
|
|
1882
|
+
Outline = "outline",
|
|
1883
|
+
Transparent = "transparent",
|
|
1884
|
+
Black = "black",
|
|
1885
|
+
White = "white"
|
|
1886
|
+
}
|
|
1887
|
+
declare enum ShadowSize {
|
|
1888
|
+
Sm = "sm",
|
|
1889
|
+
Md = "md",
|
|
1890
|
+
Lg = "lg",
|
|
1891
|
+
Xl = "xl",
|
|
1892
|
+
Xl2 = "2xl"
|
|
1893
|
+
}
|
|
1894
|
+
declare enum ShadowPreset {
|
|
1895
|
+
Card = "card",
|
|
1896
|
+
Button = "button",
|
|
1897
|
+
Modal = "modal",
|
|
1898
|
+
Float = "float",
|
|
1899
|
+
Inner = "inner"
|
|
1900
|
+
}
|
|
1901
|
+
declare enum ShadowDirection {
|
|
1902
|
+
Top = "top",
|
|
1903
|
+
Bottom = "bottom",
|
|
1904
|
+
Left = "left",
|
|
1905
|
+
Right = "right",
|
|
1906
|
+
TopBottom = "top-bottom",
|
|
1907
|
+
LeftRight = "left-right",
|
|
1908
|
+
Vertical = "vertical",
|
|
1909
|
+
Horizontal = "horizontal",
|
|
1910
|
+
All = "all"
|
|
1911
|
+
}
|
|
1912
|
+
type ShadowConfig = ShadowSize | ShadowPreset | string | 0 | null | [
|
|
1913
|
+
string,
|
|
1914
|
+
number?
|
|
1915
|
+
] | [
|
|
1916
|
+
ShadowDirection | string,
|
|
1917
|
+
ShadowSize | string
|
|
1918
|
+
] | [
|
|
1919
|
+
ShadowDirection | string,
|
|
1920
|
+
string
|
|
1921
|
+
] | [
|
|
1922
|
+
ShadowDirection | string,
|
|
1923
|
+
string,
|
|
1924
|
+
number?
|
|
1925
|
+
] | [
|
|
1926
|
+
ShadowDirection | string,
|
|
1927
|
+
ShadowSize | string,
|
|
1928
|
+
string,
|
|
1929
|
+
number?
|
|
1930
|
+
];
|
|
1931
|
+
/**
|
|
1932
|
+
* Callback form of `.hover()` / `.focus()` / … Contextual typing uses the *last*
|
|
1933
|
+
* overload, so this signature must stay last or `h` becomes implicit `any` inside `.map()`.
|
|
1934
|
+
*/
|
|
1935
|
+
export type PseudoStateFn = (builder: PseudoStateBuilder) => void | PseudoStateBuilder;
|
|
1936
|
+
declare abstract class FiboBuilder {
|
|
1937
|
+
/** @internal Extra DOM props forwarded to the host element. */
|
|
1938
|
+
protected _props: Record<string, any>;
|
|
1939
|
+
protected _style: React$1.CSSProperties;
|
|
1940
|
+
protected _cssStyles: React$1.CSSProperties;
|
|
1941
|
+
protected _classNames: string[];
|
|
1942
|
+
protected _children: React$1.ReactNode[];
|
|
1943
|
+
/** Resolved theme for this subtree (SwiftUI Environment / Flutter Theme). */
|
|
1944
|
+
protected _theme?: FiboTheme;
|
|
1945
|
+
protected _state: Map<string, any>;
|
|
1946
|
+
protected _providers: Map<string, any>;
|
|
1947
|
+
protected _observers: Set<Observable<any>>;
|
|
1948
|
+
protected _signals: Set<BindableSignal<any>>;
|
|
1949
|
+
/** Explicit `.bindSignal()` / `.observer()` owns nested reads. A direct wire does not. */
|
|
1950
|
+
protected _ownsReads: boolean;
|
|
1951
|
+
/** @internal Direct `method(signal.value)` calls replayed when that signal changes. */
|
|
1952
|
+
protected _replays: Array<() => void>;
|
|
1953
|
+
protected _isObserver: boolean;
|
|
1954
|
+
/** Normal-priority gestures (SwiftUI `.gesture`). Last = outermost. */
|
|
1955
|
+
protected _gestures: GestureBuilder[];
|
|
1956
|
+
/** SwiftUI `.simultaneousGesture` — bubble / no stopPropagation. */
|
|
1957
|
+
protected _simultaneousGestures: GestureBuilder[];
|
|
1958
|
+
/** SwiftUI `.highPriorityGesture` — wrapped last (outermost / capture wins). */
|
|
1959
|
+
protected _highPriorityGestures: GestureBuilder[];
|
|
1960
|
+
protected _offset?: OffsetSpec;
|
|
1961
|
+
protected _clipped: boolean;
|
|
1962
|
+
protected _clipShape?: ClipShapeName | string;
|
|
1963
|
+
protected _contentShape?: ContentShapeName | string;
|
|
1964
|
+
protected _fixedSize?: FixedSizeSpec;
|
|
1965
|
+
protected _layoutPriority?: number;
|
|
1966
|
+
protected _layers: LayerSpec[];
|
|
1967
|
+
protected _onGeometryChange?: (rect: GeometryRect) => void;
|
|
1968
|
+
protected _compositingGroup: boolean;
|
|
1969
|
+
protected _viewMask?: string;
|
|
1970
|
+
protected _containerRelativeFrame?: ContainerRelativeFrameSpec;
|
|
1971
|
+
protected _alignmentGuide?: AlignmentGuideSpec;
|
|
1972
|
+
protected _matchedGeometry?: MatchedGeometrySpec;
|
|
1973
|
+
protected _preferences: PreferenceWriteSpec[];
|
|
1974
|
+
protected _preferenceReaders: PreferenceReadSpec[];
|
|
1975
|
+
protected _safeAreaInsets: SafeAreaInsetSpec[];
|
|
1976
|
+
protected _navigationTitle?: string;
|
|
1977
|
+
protected _animationConfig?: Partial<AnimationOptions>;
|
|
1978
|
+
protected _animatedProps: Map<string, Signal<any>>;
|
|
1979
|
+
protected _transforms: string[];
|
|
1980
|
+
protected _transitionClass?: string;
|
|
1981
|
+
/** True while transition class was auto-managed for hover/effect presets (expandable). */
|
|
1982
|
+
protected _autoEffectTransition: boolean;
|
|
1983
|
+
protected _effectTransitionProps: string[];
|
|
1984
|
+
/**
|
|
1985
|
+
* When true, getStyle() promotes background/border shorthands to longhands and
|
|
1986
|
+
* (optionally) stamps a resting translate3d so pseudo transforms ease cleanly.
|
|
1987
|
+
*/
|
|
1988
|
+
protected _smoothSurface: boolean;
|
|
1989
|
+
protected _smoothNeedsRestTransform: boolean;
|
|
1990
|
+
protected _motionClass?: string;
|
|
1991
|
+
protected _staggerMs?: number;
|
|
1992
|
+
protected _reveal?: {
|
|
1993
|
+
preset: string;
|
|
1994
|
+
once?: boolean;
|
|
1995
|
+
rootMargin?: string;
|
|
1996
|
+
threshold?: number;
|
|
1997
|
+
};
|
|
1998
|
+
protected _scrollProgress: boolean;
|
|
1999
|
+
protected _viewTransition?: string;
|
|
2000
|
+
protected _reducedMotion: "reduce" | "never";
|
|
2001
|
+
protected _usesCssMotion: boolean;
|
|
2002
|
+
protected _explicitScrollMargin: boolean;
|
|
2003
|
+
/** Shrink-wrap: skip the default `w-full` / `self-stretch` on Row and Column. */
|
|
2004
|
+
protected _hug: boolean;
|
|
2005
|
+
/**
|
|
2006
|
+
* SwiftUI `.frame(...)` wrappers (outer → inner order of application).
|
|
2007
|
+
* Applied in `assembleBuilder` so every widget gets the same DX.
|
|
2008
|
+
*/
|
|
2009
|
+
protected _frames: FrameSpec[];
|
|
2010
|
+
/**
|
|
2011
|
+
* Unset every CSS property on this component and what it renders inside.
|
|
2012
|
+
* Chain `.style()`, `.px()`, `.flex()` and the rest after this to put back only what you want.
|
|
2013
|
+
*/
|
|
2014
|
+
protected _resetStyle: boolean;
|
|
2015
|
+
/** Kebab box longhands already stamped (`padding-left`, …) so later shorthand cannot clobber them. */
|
|
2016
|
+
protected _boxLonghands: Set<string>;
|
|
2017
|
+
resetStyle(): this;
|
|
2018
|
+
protected isReset(): boolean;
|
|
2019
|
+
hug(): this;
|
|
2020
|
+
protected isHug(): boolean;
|
|
2021
|
+
/**
|
|
2022
|
+
* SwiftUI `View.frame` — invisible box around this view.
|
|
2023
|
+
*
|
|
2024
|
+
* ```ts
|
|
2025
|
+
* Image(url).frame({ width: 300, height: 400 })
|
|
2026
|
+
* Text('★★★★').frame({
|
|
2027
|
+
* maxWidth: Size.infinity,
|
|
2028
|
+
* maxHeight: Size.infinity,
|
|
2029
|
+
* alignment: StackAlign.topTrailing,
|
|
2030
|
+
* })
|
|
2031
|
+
* ```
|
|
2032
|
+
*
|
|
2033
|
+
* Chainable: each `.frame()` wraps the previous (same as SwiftUI).
|
|
2034
|
+
*/
|
|
2035
|
+
frame(spec: FrameSpec): this;
|
|
2036
|
+
/**
|
|
2037
|
+
* SwiftUI `.offset(x:y:)` — visual translate; layout size stays.
|
|
2038
|
+
* `.offset(8)` ≡ `{ x: 8, y: 8 }`; `.offset({ x: 4 })` only horizontal.
|
|
2039
|
+
*/
|
|
2040
|
+
offset(value: number | OffsetSpec): this;
|
|
2041
|
+
/** SwiftUI `.clipped()` — overflow hidden to bounds. */
|
|
2042
|
+
clipped(): this;
|
|
2043
|
+
/**
|
|
2044
|
+
* SwiftUI `.clipShape` — `'circle' | 'rounded' | 'square'` or any CSS radius
|
|
2045
|
+
* (`'8px'`, `'50%'`). Clips drawing; hit-testing still follows layout unless
|
|
2046
|
+
* you also set {@link contentShape}.
|
|
2047
|
+
*/
|
|
2048
|
+
clipShape(shape: ClipShapeName | string): this;
|
|
2049
|
+
/**
|
|
2050
|
+
* SwiftUI `.contentShape` — region used for hit-testing (tap / long-press).
|
|
2051
|
+
* Default `'rectangle'` = full frame box, even over transparent pixels.
|
|
2052
|
+
*
|
|
2053
|
+
* ```ts
|
|
2054
|
+
* ZStack()…frame({ width: 300, height: 400 })
|
|
2055
|
+
* .clipShape('8px')
|
|
2056
|
+
* .contentShape('rectangle')
|
|
2057
|
+
* .onTapGesture(open)
|
|
2058
|
+
* ```
|
|
2059
|
+
*/
|
|
2060
|
+
contentShape(shape?: ContentShapeName | string): this;
|
|
2061
|
+
/**
|
|
2062
|
+
* SwiftUI `.fixedSize(horizontal:vertical:)` — hug content on those axes.
|
|
2063
|
+
* Defaults both axes when called with no args.
|
|
2064
|
+
*/
|
|
2065
|
+
fixedSize(spec?: FixedSizeSpec | boolean): this;
|
|
2066
|
+
/**
|
|
2067
|
+
* SwiftUI `.layoutPriority` — higher resists compression and claims free space.
|
|
2068
|
+
* Web: flex-grow / flex-shrink (not a full multi-axis proposal solver).
|
|
2069
|
+
*/
|
|
2070
|
+
layoutPriority(value: number): this;
|
|
2071
|
+
/** SwiftUI `.compositingGroup()`. */
|
|
2072
|
+
compositingGroup(): this;
|
|
2073
|
+
/** SwiftUI `.mask` — shape name or CSS mask-image value. */
|
|
2074
|
+
mask(shapeOrCss: ClipShapeName | "rectangle" | string): this;
|
|
2075
|
+
/** SwiftUI `containerRelativeFrame`. */
|
|
2076
|
+
containerRelativeFrame(axis?: ContainerRelativeFrameSpec["axis"] | ContainerRelativeFrameSpec, count?: number, span?: number): this;
|
|
2077
|
+
/**
|
|
2078
|
+
* SwiftUI `alignmentGuide` — named guide + absolute value or compute from size.
|
|
2079
|
+
* ```ts
|
|
2080
|
+
* Text('Hi').alignmentGuide('leading', (d) => d.width / 2)
|
|
2081
|
+
* ```
|
|
2082
|
+
*/
|
|
2083
|
+
alignmentGuide(guide: AlignmentGuideName, compute: number | ((dims: {
|
|
2084
|
+
width: number;
|
|
2085
|
+
height: number;
|
|
2086
|
+
}) => number)): this;
|
|
2087
|
+
/**
|
|
2088
|
+
* SwiftUI `matchedGeometryEffect` — shared view-transition id + measured rect.
|
|
2089
|
+
* ```ts
|
|
2090
|
+
* Image(url).matchedGeometryEffect('hero', { namespace: 'gallery', isSource: true })
|
|
2091
|
+
* ```
|
|
2092
|
+
*/
|
|
2093
|
+
matchedGeometryEffect(id: string, namespaceOrOpts?: string | {
|
|
2094
|
+
namespace?: string;
|
|
2095
|
+
isSource?: boolean;
|
|
2096
|
+
}): this;
|
|
2097
|
+
/** SwiftUI `.preference(key:value:)` — contribute upward to `.onPreferenceChange`. */
|
|
2098
|
+
preference<T>(key: PreferenceKeyDef<T>, value: T): this;
|
|
2099
|
+
/** SwiftUI `.onPreferenceChange` — reduce descendant preferences. */
|
|
2100
|
+
onPreferenceChange<T>(key: PreferenceKeyDef<T>, onChange: (value: T) => void): this;
|
|
2101
|
+
/**
|
|
2102
|
+
* SwiftUI `.safeAreaInset(edge:)` — reserve a bar on one edge; content fills the rest.
|
|
2103
|
+
* Distinct from `SafeArea` (notch padding) and `proxy.safeAreaInsets` (read-only).
|
|
2104
|
+
*/
|
|
2105
|
+
safeAreaInset(edge: SafeAreaInsetEdge, content: SafeAreaInsetSpec["content"], spacing?: number): this;
|
|
2106
|
+
/**
|
|
2107
|
+
* SwiftUI `.navigationTitle` — stores title for Scaffold (see `Scaffold.navigationTitle`).
|
|
2108
|
+
* On non-Scaffold builders, sets `aria-label` / data attribute only (no extra chrome bar).
|
|
2109
|
+
*/
|
|
2110
|
+
navigationTitle(title: string): this;
|
|
2111
|
+
/**
|
|
2112
|
+
* SwiftUI `.overlay(alignment:) { }` — layer above this view.
|
|
2113
|
+
* ```ts
|
|
2114
|
+
* Image(url).overlay(Text('NEW'), StackAlign.topTrailing)
|
|
2115
|
+
* ```
|
|
2116
|
+
*/
|
|
2117
|
+
overlay(child: FiboChild | (() => FiboChild), alignment?: StackAlign | keyof typeof StackAlign): this;
|
|
2118
|
+
/**
|
|
2119
|
+
* SwiftUI `.background(alignment:) { }` — layer behind this view.
|
|
2120
|
+
*/
|
|
2121
|
+
background(child: FiboChild | (() => FiboChild), alignment?: StackAlign | keyof typeof StackAlign): this;
|
|
2122
|
+
/** SwiftUI `onGeometryChange` — fires on mount + resize. */
|
|
2123
|
+
onGeometryChange(handler: (rect: GeometryRect) => void): this;
|
|
2124
|
+
id(value: string): this;
|
|
2125
|
+
/**
|
|
2126
|
+
* Scroll target. Same as `.id()`, plus `scroll-margin-top` so the section
|
|
2127
|
+
* is not hidden under a sticky header. Pair with `scrollTo('#name')`.
|
|
2128
|
+
*/
|
|
2129
|
+
anchor(value: string): this;
|
|
2130
|
+
/**
|
|
2131
|
+
* Explicit `scroll-margin-top` on this node (overrides the sticky CSS variable
|
|
2132
|
+
* that `.anchor()` applies).
|
|
2133
|
+
*/
|
|
2134
|
+
scrollMargin(value: number | string): this;
|
|
2135
|
+
/** Stamp a class onto the host. Used by PseudoStateBuilder (hashed `:hover` etc.). */
|
|
2136
|
+
addClassName(name: string): this;
|
|
2137
|
+
/**
|
|
2138
|
+
* React list key. After this is called, React reads the key as a string
|
|
2139
|
+
* on both the builder element and the inner host wrapper.
|
|
2140
|
+
* Builders are valid elements — you do not need `.build()`.
|
|
2141
|
+
*/
|
|
2142
|
+
key(value: string | number): this;
|
|
2143
|
+
private setBoxLonghand;
|
|
2144
|
+
private setBoxShorthand;
|
|
2145
|
+
paddingHorizontal(value: string | number): this;
|
|
2146
|
+
paddingVertical(value: string | number): this;
|
|
2147
|
+
/**
|
|
2148
|
+
* SwiftUI `.padding`:
|
|
2149
|
+
* - `.padding(8)` — all sides
|
|
2150
|
+
* - `.padding(EdgeSet.horizontal, 12)` — Edge.Set + value
|
|
2151
|
+
* - `.padding({ top: 8, leading: 12 })` — EdgeInsets
|
|
2152
|
+
*/
|
|
2153
|
+
padding(value: string | number): this;
|
|
2154
|
+
padding(edges: EdgeSet, value: string | number): this;
|
|
2155
|
+
padding(insets: EdgeInsetsValue): this;
|
|
2156
|
+
/** SwiftUI `.padding` with {@link EdgeSet} — alias clarity. */
|
|
2157
|
+
/** @deprecated Prefer `.padding(EdgeSet, n)` — same implementation. */
|
|
2158
|
+
paddingEdges(edges: EdgeSet, value: string | number): this;
|
|
2159
|
+
marginHorizontal(value: string | number): this;
|
|
2160
|
+
marginVertical(value: string | number): this;
|
|
2161
|
+
margin(value: string | number): this;
|
|
2162
|
+
/** Inline layout wins over a host that hardcodes flex on the element (Form, Scaffold). */
|
|
2163
|
+
protected layoutStyle(patch: React$1.CSSProperties): this;
|
|
2164
|
+
/** Last write of a key lives in one bag so getStyle() does not let earlier `.css()` beat later `.style()`. */
|
|
2165
|
+
private dropConflictingKeys;
|
|
2166
|
+
private trackBoxLonghandsFrom;
|
|
2167
|
+
flexDirection(direction: "row" | "column" | "row-reverse" | "column-reverse"): this;
|
|
2168
|
+
/** Flutter `textDirection`. */
|
|
2169
|
+
textDirection(direction: "ltr" | "rtl"): this;
|
|
2170
|
+
/** Flutter `textBaseline`. Both modes align on the flex baseline. */
|
|
2171
|
+
textBaseline(baseline: "alphabetic" | "ideographic"): this;
|
|
2172
|
+
/** Flutter `clipBehavior`. `none` shows overflow; the other two clip. */
|
|
2173
|
+
clip(behavior: "none" | "hardEdge" | "antiAlias"): this;
|
|
2174
|
+
/**
|
|
2175
|
+
* Flutter `mainAxisSize`. `min` hugs the current flex direction.
|
|
2176
|
+
* `max` stretches along that same axis.
|
|
2177
|
+
*/
|
|
2178
|
+
mainAxisSize(size: "min" | "max"): this;
|
|
2179
|
+
zIndex(value: number): this;
|
|
2180
|
+
alignItems(alignment: "start" | "center" | "end" | "stretch" | "baseline"): this;
|
|
2181
|
+
alignSelf(alignment: "start" | "center" | "end" | "stretch" | "baseline" | "auto"): this;
|
|
2182
|
+
flexWrap(wrap: "wrap" | "nowrap" | "wrap-reverse"): this;
|
|
2183
|
+
/**
|
|
2184
|
+
* Main-axis distribution. Accepts Tailwind shortcuts (`between`) and CSS/Flutter
|
|
2185
|
+
* names (`space-between` / `spaceBetween`).
|
|
2186
|
+
*/
|
|
2187
|
+
justifyContent(justify: "start" | "center" | "end" | "between" | "around" | "evenly" | "space-between" | "space-around" | "space-evenly" | "spaceBetween" | "spaceAround" | "spaceEvenly"): this;
|
|
2188
|
+
/** True when flexDirection is column / column-reverse (default is row). */
|
|
2189
|
+
protected isVerticalFlex(): boolean;
|
|
2190
|
+
/**
|
|
2191
|
+
* Both screen axes. `.align(Align.center)` and `.align('center')` do the same.
|
|
2192
|
+
* `between` packs the main axis and starts the cross axis.
|
|
2193
|
+
*/
|
|
2194
|
+
align(alignment: AlignAxis): this;
|
|
2195
|
+
/**
|
|
2196
|
+
* Horizontal (screen X) alignment. Same meaning on Row and Column:
|
|
2197
|
+
* left / center / right of the container — not “main axis”.
|
|
2198
|
+
*/
|
|
2199
|
+
alignX(alignment: AlignAxis): this;
|
|
2200
|
+
/**
|
|
2201
|
+
* Vertical (screen Y) alignment. Same meaning on Row and Column:
|
|
2202
|
+
* top / center / bottom of the container — not “cross axis”.
|
|
2203
|
+
*/
|
|
2204
|
+
alignY(alignment: AlignAxis): this;
|
|
2205
|
+
protected applyMainAlign(alignment: AlignAxis | string): this;
|
|
2206
|
+
protected applyCrossAlign(alignment: AlignAxis | string): this;
|
|
2207
|
+
flex(value?: number | string): this;
|
|
2208
|
+
grid(): this;
|
|
2209
|
+
inlineFlex(): this;
|
|
2210
|
+
inlineGrid(): this;
|
|
2211
|
+
block(): this;
|
|
2212
|
+
inlineBlock(): this;
|
|
2213
|
+
hidden(): this;
|
|
2214
|
+
center(): this;
|
|
2215
|
+
/** Center on the horizontal screen axis (uses `.alignX('center')`). */
|
|
2216
|
+
centerX(): this;
|
|
2217
|
+
/** Center on the vertical screen axis (uses `.alignY('center')`). */
|
|
2218
|
+
centerY(): this;
|
|
2219
|
+
spaceBetween(): this;
|
|
2220
|
+
spaceAround(): this;
|
|
2221
|
+
spaceEvenly(): this;
|
|
2222
|
+
fill(): this;
|
|
2223
|
+
fillWidth(): this;
|
|
2224
|
+
fillHeight(): this;
|
|
2225
|
+
square(size: number | string): this;
|
|
2226
|
+
circle(): this;
|
|
2227
|
+
opacity(value: number): this;
|
|
2228
|
+
p(value: number | string): this;
|
|
2229
|
+
px(value: number | string): this;
|
|
2230
|
+
py(value: number | string): this;
|
|
2231
|
+
paddingX(value: number | string): this;
|
|
2232
|
+
paddingY(value: number | string): this;
|
|
2233
|
+
m(value: number | string): this;
|
|
2234
|
+
mx(value: number | string): this;
|
|
2235
|
+
my(value: number | string): this;
|
|
2236
|
+
marginX(value: number | string): this;
|
|
2237
|
+
marginY(value: number | string): this;
|
|
2238
|
+
bg(color: string | Colors): this;
|
|
2239
|
+
text(color: string | Colors): this;
|
|
2240
|
+
color(value: string | Colors): this;
|
|
2241
|
+
private resolveSemanticColor;
|
|
2242
|
+
shadow(config?: ShadowConfig): this;
|
|
2243
|
+
/**
|
|
2244
|
+
* Breakpoint styles compiled to CSS `@media` (same engine as `.md()`).
|
|
2245
|
+
* Tiers stay mutually exclusive: mobile `<768`, tablet `768–1023`, desktop `≥1024`.
|
|
2246
|
+
* No `window.innerWidth` — hydrate-safe.
|
|
2247
|
+
*/
|
|
2248
|
+
responsive(styles: ResponsiveStyles): this;
|
|
2249
|
+
/**
|
|
2250
|
+
* CSS `@media` (min-width or a raw query). Compiles to a class — no resize JS.
|
|
2251
|
+
*
|
|
2252
|
+
* @example Box().padding(8).media('md', { padding: 16 }).media('(prefers-color-scheme: dark)', { backgroundColor: '#111' })
|
|
2253
|
+
*/
|
|
2254
|
+
media(query: BreakpointKey | string, styles: React$1.CSSProperties): this;
|
|
2255
|
+
private registerMediaStyles;
|
|
2256
|
+
sm(styles: React$1.CSSProperties): this;
|
|
2257
|
+
md(styles: React$1.CSSProperties): this;
|
|
2258
|
+
lg(styles: React$1.CSSProperties): this;
|
|
2259
|
+
xl(styles: React$1.CSSProperties): this;
|
|
2260
|
+
rounded(value: string | number): this;
|
|
2261
|
+
borderRadius(value: string | number): this;
|
|
2262
|
+
borderColor(value: string): this;
|
|
2263
|
+
/**
|
|
2264
|
+
* A passed size is a lock: `min-*` plus `flex-shrink: 0`, so a flex parent
|
|
2265
|
+
* (the Scaffold body) cannot divide the viewport across these children.
|
|
2266
|
+
* `400`, `'320px'`, `Size.full`, and `Space.md` all count. `flex(1)` afterwards
|
|
2267
|
+
* opts back into sharing space.
|
|
2268
|
+
*
|
|
2269
|
+
* Percentages / `auto` do not lock `min-*` — `minWidth: 100%` on a flex
|
|
2270
|
+
* child fights clamping and lets long text blow past the ZStack box.
|
|
2271
|
+
*/
|
|
2272
|
+
private lockAxis;
|
|
2273
|
+
width(value: string | number): this;
|
|
2274
|
+
paint(property: string, value: string): this;
|
|
2275
|
+
height(value: string | number): this;
|
|
2276
|
+
gap(value: string | number): this;
|
|
2277
|
+
clean(): this;
|
|
2278
|
+
borderInput(color?: string, focusColor?: string): this;
|
|
2279
|
+
weight(value: string | number): this;
|
|
2280
|
+
onClick(handler: (event: React$1.MouseEvent<any>) => void): this;
|
|
2281
|
+
state<T>(key: string, initialValue: T): this;
|
|
2282
|
+
getState<T>(key: string): T | undefined;
|
|
2283
|
+
setState<T>(key: string, value: T): this;
|
|
2284
|
+
provide<T>(key: string, value: T): this;
|
|
2285
|
+
consume<T>(key: string): T | undefined;
|
|
2286
|
+
observer(options?: string | number | {
|
|
2287
|
+
key?: string | number;
|
|
2288
|
+
}): this;
|
|
2289
|
+
observe<T>(observable: Observable<T>): this;
|
|
2290
|
+
bindSignal<T>(signal: BindableSignal<T>): this;
|
|
2291
|
+
/**
|
|
2292
|
+
* @internal Wire a direct `method(signal.value)` to this node.
|
|
2293
|
+
* Does not claim reads that happen later in a children function.
|
|
2294
|
+
*/
|
|
2295
|
+
adoptWire(signals: Subscribable<unknown>[], replay: () => void): void;
|
|
2296
|
+
/** @internal */
|
|
2297
|
+
runReplays(): void;
|
|
2298
|
+
translateX(value: Signal<number> | number): this;
|
|
2299
|
+
translateY(value: Signal<number> | number): this;
|
|
2300
|
+
scale(value: Signal<number> | number): this;
|
|
2301
|
+
/** SwiftUI `scaleEffect` — alias of {@link scale}. */
|
|
2302
|
+
scaleEffect(value: Signal<number> | number): this;
|
|
2303
|
+
rotate(degrees: Signal<number> | number): this;
|
|
2304
|
+
/** SwiftUI `rotationEffect` — alias of {@link rotate} (degrees). */
|
|
2305
|
+
rotationEffect(degrees: Signal<number> | number): this;
|
|
2306
|
+
/**
|
|
2307
|
+
* SwiftUI `.allowsHitTesting` — when `false`, this view and descendants
|
|
2308
|
+
* ignore pointer hits (`pointer-events: none`).
|
|
2309
|
+
*/
|
|
2310
|
+
allowsHitTesting(value?: boolean): this;
|
|
2311
|
+
/**
|
|
2312
|
+
* SwiftUI scroll target id — used by {@link ScrollViewReader} `.scrollTo(id)`.
|
|
2313
|
+
* Sets `data-scroll-id` on the host.
|
|
2314
|
+
*/
|
|
2315
|
+
scrollTarget(id: string): this;
|
|
2316
|
+
/**
|
|
2317
|
+
* SwiftUI: taps on *containers* (ZStack / Column / …) only hit drawn content
|
|
2318
|
+
* unless `.contentShape(Rectangle())` is set. We default that shape when the
|
|
2319
|
+
* first gesture is attached and the caller did not set one — same as the
|
|
2320
|
+
* usual SwiftUI fix, without forcing it on chrome-only views.
|
|
2321
|
+
*/
|
|
2322
|
+
protected ensureGestureContentShape(): void;
|
|
2323
|
+
/**
|
|
2324
|
+
* SwiftUI `.gesture` — attach Tap / LongPress / Drag / Magnify / Rotate / …
|
|
2325
|
+
* Chainable: each call wraps the previous (outermost = last).
|
|
2326
|
+
*/
|
|
2327
|
+
gesture(gesture: GestureBuilder): this;
|
|
2328
|
+
/** SwiftUI `.simultaneousGesture` — runs alongside other gestures (no steal). */
|
|
2329
|
+
simultaneousGesture(gesture: GestureBuilder): this;
|
|
2330
|
+
/** SwiftUI `.highPriorityGesture` — recognized before the view's own gestures. */
|
|
2331
|
+
highPriorityGesture(gesture: GestureBuilder): this;
|
|
2332
|
+
/**
|
|
2333
|
+
* Sugar for {@link TapGesture}`.onEnd(handler)`.
|
|
2334
|
+
* Note: `Button` / `List` / `ListTile` keep domain-specific `.onPress`.
|
|
2335
|
+
*/
|
|
2336
|
+
onPress(handler: () => void): this;
|
|
2337
|
+
/** Flutter-style alias of {@link onPress}. */
|
|
2338
|
+
onTap(handler: () => void): this;
|
|
2339
|
+
/**
|
|
2340
|
+
* SwiftUI `onTapGesture(count:perform:)` — default count 1.
|
|
2341
|
+
* Pass a location callback for SpatialTap behavior.
|
|
2342
|
+
*/
|
|
2343
|
+
onTapGesture(countOrHandler: number | ((location?: TapLocation) => void) | (() => void), handler?: ((location?: TapLocation) => void) | (() => void)): this;
|
|
2344
|
+
/**
|
|
2345
|
+
* SwiftUI `onLongPressGesture(minimumDuration:perform:onPressingChanged:)`.
|
|
2346
|
+
*/
|
|
2347
|
+
onLongPressGesture(handlerOrOpts: (() => void) | {
|
|
2348
|
+
minimumDuration?: number;
|
|
2349
|
+
maximumDistance?: number;
|
|
2350
|
+
perform: () => void;
|
|
2351
|
+
onPressingChanged?: (pressing: boolean) => void;
|
|
2352
|
+
}, onPressingChanged?: (pressing: boolean) => void): this;
|
|
2353
|
+
animation(config: Partial<AnimationOptions>): this;
|
|
2354
|
+
protected hasStateManagement(): boolean;
|
|
2355
|
+
className(className: string): this;
|
|
2356
|
+
classNames(classNames: string[]): this;
|
|
2357
|
+
css(styles: React$1.CSSProperties): this;
|
|
2358
|
+
style(style: React$1.CSSProperties): this;
|
|
2359
|
+
props(props: Record<string, any>): this;
|
|
2360
|
+
protected _transitionDuration: number;
|
|
2361
|
+
protected _transitionEasing: string;
|
|
2362
|
+
protected _transitionDelay: number;
|
|
2363
|
+
protected _transitionProperties: string[];
|
|
2364
|
+
/**
|
|
2365
|
+
* Apply CSS transition
|
|
2366
|
+
*
|
|
2367
|
+
* Overload 1: String syntax
|
|
2368
|
+
* Example: .transition('all 0.2s ease-in-out')
|
|
2369
|
+
*
|
|
2370
|
+
* Overload 2: Shorthand with parameters
|
|
2371
|
+
* Example: .transition('all', 200, 'ease-out')
|
|
2372
|
+
* Example: .transition('all', 200, 'ease-out', 50)
|
|
2373
|
+
*/
|
|
2374
|
+
transition(value: string): this;
|
|
2375
|
+
transition(properties: string | string[], duration: number, easing?: string, delay?: number): this;
|
|
2376
|
+
/**
|
|
2377
|
+
* Set transition duration in milliseconds
|
|
2378
|
+
* Example: .duration(200) → 200ms
|
|
2379
|
+
*/
|
|
2380
|
+
duration(ms: number): this;
|
|
2381
|
+
/**
|
|
2382
|
+
* Set transition easing function
|
|
2383
|
+
* Example: .easing('ease-in-out')
|
|
2384
|
+
*/
|
|
2385
|
+
easing(value: "linear" | "ease" | "ease-in" | "ease-out" | "ease-in-out" | "spring" | string): this;
|
|
2386
|
+
/** Alias of `.easing()`. `'spring'` becomes CSS `linear()`. */
|
|
2387
|
+
ease(value: string): this;
|
|
2388
|
+
/**
|
|
2389
|
+
* Set transition delay in milliseconds
|
|
2390
|
+
* Example: .delay(100) → 100ms delay
|
|
2391
|
+
*/
|
|
2392
|
+
delay(ms: number): this;
|
|
2393
|
+
/**
|
|
2394
|
+
* Set which properties to transition
|
|
2395
|
+
* Example: .properties(['color', 'transform'])
|
|
2396
|
+
*/
|
|
2397
|
+
properties(props: string[]): this;
|
|
2398
|
+
/**
|
|
2399
|
+
* Apply the built transition to the element
|
|
2400
|
+
*/
|
|
2401
|
+
protected _applyTransition(): void;
|
|
2402
|
+
private replaceTransitionClass;
|
|
2403
|
+
/**
|
|
2404
|
+
* CSS enter/exit preset. Compiles to `@keyframes` — no rAF.
|
|
2405
|
+
* @example Box().animate('fadeIn').duration(300).ease('spring')
|
|
2406
|
+
*/
|
|
2407
|
+
animate(preset: MotionPreset | string, options?: {
|
|
2408
|
+
duration?: number;
|
|
2409
|
+
ease?: string;
|
|
2410
|
+
delay?: number;
|
|
2411
|
+
from?: number | string;
|
|
2412
|
+
stiffness?: number;
|
|
2413
|
+
damping?: number;
|
|
2414
|
+
mass?: number;
|
|
2415
|
+
}): this;
|
|
2416
|
+
animate(custom: CustomMotion): this;
|
|
2417
|
+
/** CSS `linear()` spring. Works on `.animate()` and `.transition()` / `.hover()`. */
|
|
2418
|
+
spring(options?: SpringOptions): this;
|
|
2419
|
+
reducedMotion(mode?: "reduce" | "never"): this;
|
|
2420
|
+
press(callback?: (builder: PseudoStateBuilder) => void | PseudoStateBuilder): this;
|
|
2421
|
+
/**
|
|
2422
|
+
* Shortcut: `.hover(h => h.effect(name))`.
|
|
2423
|
+
* Named interaction effect on `:hover` (forward, float, grow, nudge, …).
|
|
2424
|
+
*/
|
|
2425
|
+
hoverEffect(name: string): this;
|
|
2426
|
+
/**
|
|
2427
|
+
* Shortcut: `.press(p => p.effect(name))` (maps to `:active`).
|
|
2428
|
+
*/
|
|
2429
|
+
pressEffect(name: string): this;
|
|
2430
|
+
/**
|
|
2431
|
+
* Shortcut: `.focus(f => f.effect(name))`.
|
|
2432
|
+
*/
|
|
2433
|
+
focusEffect(name: string): this;
|
|
2434
|
+
/**
|
|
2435
|
+
* Shortcut: `.active(a => a.effect(name))`.
|
|
2436
|
+
*/
|
|
2437
|
+
activeEffect(name: string): this;
|
|
2438
|
+
/**
|
|
2439
|
+
* Shortcut: `.groupHover(h => h.effect(name))`.
|
|
2440
|
+
*/
|
|
2441
|
+
groupHoverEffect(name: string): this;
|
|
2442
|
+
focusVisible(): PseudoStateBuilder;
|
|
2443
|
+
focusVisible(callback: PseudoStateFn): this;
|
|
2444
|
+
stagger(ms: number): this;
|
|
2445
|
+
/** Scroll-reveal: IntersectionObserver toggles `.fibo-inview`. */
|
|
2446
|
+
reveal(preset?: string | {
|
|
2447
|
+
preset?: string;
|
|
2448
|
+
once?: boolean;
|
|
2449
|
+
rootMargin?: string;
|
|
2450
|
+
threshold?: number;
|
|
2451
|
+
}, options?: {
|
|
2452
|
+
once?: boolean;
|
|
2453
|
+
rootMargin?: string;
|
|
2454
|
+
threshold?: number;
|
|
2455
|
+
}): this;
|
|
2456
|
+
/** Alias of `.reveal()` for scroll-triggered presets. */
|
|
2457
|
+
onScroll(preset?: string): this;
|
|
2458
|
+
/** CSS `animation-timeline: view()` / `scroll()`; IntersectionObserver reveal is the fallback. */
|
|
2459
|
+
scrollTimeline(kind?: "view" | "scroll"): this;
|
|
2460
|
+
scrollProgress(): this;
|
|
2461
|
+
smoothScroll(): this;
|
|
2462
|
+
scrollSnap(axis?: "x" | "y" | "both"): this;
|
|
2463
|
+
scrollSnapAlign(align?: "start" | "center" | "end"): this;
|
|
2464
|
+
sticky(top?: number | string | boolean): this;
|
|
2465
|
+
/**
|
|
2466
|
+
* Publish `--fibo-sticky-offset` on `:root` so `.anchor()` / `html` scroll-padding
|
|
2467
|
+
* clear this bar. Header uses the real bar height.
|
|
2468
|
+
*/
|
|
2469
|
+
protected publishStickyOffset(value: number | string): void;
|
|
2470
|
+
viewTransition(name: string): this;
|
|
2471
|
+
/** Default `:focus-visible` ring. Pass a callback to customize. */
|
|
2472
|
+
focusRing(color?: string): this;
|
|
2473
|
+
protected ensureInteractiveTransition(): void;
|
|
2474
|
+
/**
|
|
2475
|
+
* Prepare resting styles + transition so pseudo-state longhands (bg/border/transform)
|
|
2476
|
+
* interpolate instead of snapping. Safe to call repeatedly from PseudoStateBuilder.
|
|
2477
|
+
* @internal
|
|
2478
|
+
*/
|
|
2479
|
+
prepareSmoothInteraction(properties: string[]): void;
|
|
2480
|
+
/** @internal Convert inline background/border shorthands → longhands. */
|
|
2481
|
+
promoteSurfaceLonghands(): void;
|
|
2482
|
+
/** @internal Stamp translate3d(0,0,0) when no resting transform exists. */
|
|
2483
|
+
ensureRestTransform(): void;
|
|
2484
|
+
/**
|
|
2485
|
+
* Ensure the base element transitions the properties an interaction effect needs.
|
|
2486
|
+
* Expands an auto-managed transition; no-ops if the caller set `.transition(...)`
|
|
2487
|
+
* explicitly or a motion animation class is present.
|
|
2488
|
+
* @internal Used by PseudoStateBuilder.effect() and hover/press shortcuts.
|
|
2489
|
+
*/
|
|
2490
|
+
ensureEffectTransition(properties: string[]): void;
|
|
2491
|
+
/**
|
|
2492
|
+
* Apply a theme to this node and descendants (CSS vars inherit).
|
|
2493
|
+
* Fluent: `.theme("noir")` | `.theme(noirTheme)` | `.theme(extendTheme(webTheme, {…}))`.
|
|
2494
|
+
* SSR-safe: class + inline vars on first paint (no useEffect).
|
|
2495
|
+
*/
|
|
2496
|
+
theme(input: ThemeInput): this;
|
|
2497
|
+
/** Prefer dark/light system chrome for native controls under this subtree. */
|
|
2498
|
+
colorScheme(scheme: "light" | "dark" | "light dark"): this;
|
|
2499
|
+
hover(): PseudoStateBuilder;
|
|
2500
|
+
hover(callback: PseudoStateFn): this;
|
|
2501
|
+
/**
|
|
2502
|
+
* Paint for a `When` state. Hover / focus / active / visited / disabled
|
|
2503
|
+
* write a CSS pseudo on this node. `on` / `off` are for Checkbox and Switch.
|
|
2504
|
+
*
|
|
2505
|
+
* ```ts
|
|
2506
|
+
* Row().when(When.hover, (s) => s.bg('#c8ff00'))
|
|
2507
|
+
* ```
|
|
2508
|
+
*/
|
|
2509
|
+
when(state: When, style: WhenStyle): this;
|
|
2510
|
+
focus(): PseudoStateBuilder;
|
|
2511
|
+
focus(callback: PseudoStateFn): this;
|
|
2512
|
+
active(): PseudoStateBuilder;
|
|
2513
|
+
active(callback: PseudoStateFn): this;
|
|
2514
|
+
visited(): PseudoStateBuilder;
|
|
2515
|
+
visited(callback: PseudoStateFn): this;
|
|
2516
|
+
disabledState(): PseudoStateBuilder;
|
|
2517
|
+
disabledState(callback: PseudoStateFn): this;
|
|
2518
|
+
focusWithin(): PseudoStateBuilder;
|
|
2519
|
+
focusWithin(callback: PseudoStateFn): this;
|
|
2520
|
+
firstChild(): PseudoStateBuilder;
|
|
2521
|
+
firstChild(callback: PseudoStateFn): this;
|
|
2522
|
+
lastChild(): PseudoStateBuilder;
|
|
2523
|
+
lastChild(callback: PseudoStateFn): this;
|
|
2524
|
+
groupHover(): PseudoStateBuilder;
|
|
2525
|
+
groupHover(callback: PseudoStateFn): this;
|
|
2526
|
+
groupFocus(): PseudoStateBuilder;
|
|
2527
|
+
groupFocus(callback: PseudoStateFn): this;
|
|
2528
|
+
groupActive(): PseudoStateBuilder;
|
|
2529
|
+
groupActive(callback: PseudoStateFn): this;
|
|
2530
|
+
groupFocusWithin(): PseudoStateBuilder;
|
|
2531
|
+
groupFocusWithin(callback: PseudoStateFn): this;
|
|
2532
|
+
group(): this;
|
|
2533
|
+
protected _childFunction?: () => FiboChild | FiboChild[];
|
|
2534
|
+
children(children: FiboChildren): this;
|
|
2535
|
+
protected getClassName(): string;
|
|
2536
|
+
protected getStyle(): React$1.CSSProperties;
|
|
2537
|
+
protected processChildren(): React$1.ReactNode[];
|
|
2538
|
+
protected getChildFunction(): (() => FiboChild | FiboChild[]) | undefined;
|
|
2539
|
+
/**
|
|
2540
|
+
* @deprecated Builders are React elements. Returning or nesting the builder is enough.
|
|
2541
|
+
* `.build()` still assembles the host tree for older call sites.
|
|
2542
|
+
*/
|
|
2543
|
+
abstract build(): React$1.ReactElement;
|
|
2544
|
+
}
|
|
2545
|
+
type KnownKeys<T> = {
|
|
2546
|
+
[K in keyof T]: string extends K ? never : number extends K ? never : K;
|
|
2547
|
+
} extends {
|
|
2548
|
+
[_ in keyof T]: infer U;
|
|
2549
|
+
} ? U : never;
|
|
2550
|
+
type StyleBuilder<T> = T & LogicalAxes & {
|
|
2551
|
+
[K in KnownKeys<React$1.CSSProperties>]-?: (value: React$1.CSSProperties[K]) => StyleBuilder<T>;
|
|
2552
|
+
} & React$1.ReactElement;
|
|
2553
|
+
interface SignalLike<T> {
|
|
2554
|
+
value: T;
|
|
2555
|
+
subscribe: (listener: (val: T) => void) => () => void;
|
|
2556
|
+
}
|
|
2557
|
+
declare class FluentValueBuilder<T> {
|
|
2558
|
+
private _signal;
|
|
2559
|
+
private _loading?;
|
|
2560
|
+
private _error?;
|
|
2561
|
+
private _builder?;
|
|
2562
|
+
constructor(_signal: SignalLike<T>);
|
|
2563
|
+
loading(component: React$1.ReactNode | (() => React$1.ReactNode)): this;
|
|
2564
|
+
error(component: (error: Error | unknown) => React$1.ReactNode): this;
|
|
2565
|
+
builder(fn: (value: T) => React$1.ReactNode): this;
|
|
2566
|
+
children(fn: (value: T) => React$1.ReactNode): this;
|
|
2567
|
+
build(): React$1.ReactElement;
|
|
2568
|
+
}
|
|
2569
|
+
export declare function ValueBuilder<T>(signal: SignalLike<T>): FluentValueBuilder<T>;
|
|
2570
|
+
type PresenceShow = boolean | BindableSignal<boolean>;
|
|
2571
|
+
export interface PresenceProps {
|
|
2572
|
+
show: PresenceShow;
|
|
2573
|
+
enter?: MotionPreset | string;
|
|
2574
|
+
exit?: MotionPreset | string;
|
|
2575
|
+
duration?: number;
|
|
2576
|
+
reducedMotion?: "reduce" | "never";
|
|
2577
|
+
children?: React$1.ReactNode;
|
|
2578
|
+
}
|
|
2579
|
+
declare class PresenceBuilder extends FiboBuilder {
|
|
2580
|
+
private _show;
|
|
2581
|
+
private _enter;
|
|
2582
|
+
private _exit;
|
|
2583
|
+
constructor(show?: PresenceShow);
|
|
2584
|
+
show(value: PresenceShow): this;
|
|
2585
|
+
enter(preset: MotionPreset | string): this;
|
|
2586
|
+
exit(preset: MotionPreset | string): this;
|
|
2587
|
+
duration(ms: number): this;
|
|
2588
|
+
build(): React$1.ReactElement;
|
|
2589
|
+
}
|
|
2590
|
+
declare const presenceBuilder: (show?: PresenceShow | undefined) => StyleBuilder<PresenceBuilder>;
|
|
2591
|
+
export declare function Presence(show?: PresenceShow): ReturnType<typeof presenceBuilder>;
|
|
2592
|
+
export declare function Presence(props: PresenceProps): React$1.ReactElement;
|
|
2593
|
+
export declare namespace Presence {
|
|
2594
|
+
var displayName: string;
|
|
2595
|
+
}
|
|
2596
|
+
export interface RevealProps {
|
|
2597
|
+
preset?: string;
|
|
2598
|
+
once?: boolean;
|
|
2599
|
+
rootMargin?: string;
|
|
2600
|
+
threshold?: number;
|
|
2601
|
+
forceMotion?: boolean;
|
|
2602
|
+
/** @deprecated Ignored — view-timeline never skips IO (was forcing fibo-inview on load). */
|
|
2603
|
+
preferTimeline?: boolean;
|
|
2604
|
+
/** CSS vars (`--fibo-dur`, `--fibo-ease`, `--fibo-delay`) for the reveal wrapper. */
|
|
2605
|
+
style?: React$1.CSSProperties;
|
|
2606
|
+
children?: React$1.ReactNode;
|
|
2607
|
+
}
|
|
2608
|
+
/** IntersectionObserver toggles `.fibo-inview`. Motion is CSS — no rAF. */
|
|
2609
|
+
export declare function Reveal({ preset, once, rootMargin, threshold, forceMotion, style, children, }: RevealProps): React$1.DetailedReactHTMLElement<{
|
|
2610
|
+
ref: React$1.RefObject<HTMLDivElement>;
|
|
2611
|
+
className: string;
|
|
2612
|
+
style: React$1.CSSProperties | undefined;
|
|
2613
|
+
"data-fibo-reveal": string;
|
|
2614
|
+
}, HTMLDivElement>;
|
|
2615
|
+
interface ScrollProgressProps {
|
|
2616
|
+
children: React$1.ReactElement;
|
|
2617
|
+
}
|
|
2618
|
+
/** Binds `--fibo-progress` from scroll when `animation-timeline: scroll()` is missing. No rAF. */
|
|
2619
|
+
export declare function ScrollProgress({ children }: ScrollProgressProps): React$1.DetailedReactHTMLElement<{
|
|
2620
|
+
ref: React$1.RefObject<HTMLDivElement>;
|
|
2621
|
+
"data-fibo-scroll-progress": string;
|
|
2622
|
+
style: {
|
|
2623
|
+
display: "contents";
|
|
2624
|
+
};
|
|
2625
|
+
}, HTMLDivElement>;
|
|
2626
|
+
type ScrollToOptions$1 = {
|
|
2627
|
+
behavior?: ScrollBehavior;
|
|
2628
|
+
block?: ScrollLogicalPosition;
|
|
2629
|
+
/** Also set `location.hash` (in-page anchor navigation). */
|
|
2630
|
+
hash?: boolean;
|
|
2198
2631
|
};
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2632
|
+
/**
|
|
2633
|
+
* Smooth-scroll to an element id / selector / Element.
|
|
2634
|
+
* Pass `hash: true` to update the URL hash (replaces the old site-only `goHash`).
|
|
2635
|
+
*/
|
|
2636
|
+
declare function scrollTo$1(target: string | Element, options?: ScrollToOptions$1): void;
|
|
2637
|
+
export declare function startViewTransition(update: () => void): void;
|
|
2638
|
+
export declare function supportsViewTimeline(): boolean;
|
|
2639
|
+
export declare function supportsScrollTimeline(): boolean;
|
|
2640
|
+
/** Write text to the system clipboard. Returns false if unavailable. */
|
|
2641
|
+
export declare function writeClipboard(text: string): Promise<boolean>;
|
|
2642
|
+
/** Open a URL (default: new tab + noopener). Canonical name. */
|
|
2643
|
+
declare function open$1(url: string, options?: {
|
|
2644
|
+
target?: "_blank" | "_self";
|
|
2645
|
+
features?: string;
|
|
2646
|
+
}): void;
|
|
2647
|
+
/** Alias — name the fibogrid site already used. Do not remove (no break). */
|
|
2648
|
+
export declare const openExternal: typeof open$1;
|
|
2649
|
+
/**
|
|
2650
|
+
* In-page hash jump. Name the site already used.
|
|
2651
|
+
* Implementation = existing `scrollTo(id, { hash: true })` (no parallel logic).
|
|
2652
|
+
*/
|
|
2653
|
+
export declare function goHash(id: string, options?: {
|
|
2654
|
+
behavior?: ScrollBehavior;
|
|
2655
|
+
block?: ScrollLogicalPosition;
|
|
2656
|
+
}): void;
|
|
2657
|
+
export type HotkeyChord = {
|
|
2658
|
+
key: string;
|
|
2659
|
+
meta?: boolean;
|
|
2660
|
+
ctrl?: boolean;
|
|
2661
|
+
alt?: boolean;
|
|
2662
|
+
shift?: boolean;
|
|
2663
|
+
/** Require meta OR ctrl (⌘K / Ctrl+K). */
|
|
2664
|
+
metaOrCtrl?: boolean;
|
|
2665
|
+
preventDefault?: boolean;
|
|
2666
|
+
when?: () => boolean;
|
|
2667
|
+
run: () => void;
|
|
2204
2668
|
};
|
|
2205
|
-
|
|
2206
|
-
export declare
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2669
|
+
/** Bind global keydown chords. Returns unsubscribe. SSR-safe. */
|
|
2670
|
+
export declare function bindHotkeys(chords: HotkeyChord[]): () => void;
|
|
2671
|
+
/**
|
|
2672
|
+
* AUTO-GENERATED by scripts/gen-interaction-fx.mjs — do not edit by hand.
|
|
2673
|
+
* Fiboui-owned interaction effects (Hover.css–inspired names, not a vendor dump).
|
|
2674
|
+
*/
|
|
2675
|
+
export declare const FIBO_INTERACTION_FX_CSS: string;
|
|
2676
|
+
/**
|
|
2677
|
+
* Inject the full interaction-effect sheet once.
|
|
2678
|
+
* Idempotent via StyleManager cache — must NOT use a module flag, or
|
|
2679
|
+
* `endSsrRequest()` / `StyleManager.reset()` would skip re-injection on the
|
|
2680
|
+
* next SSR request and drop FX CSS from the snapshot.
|
|
2681
|
+
*/
|
|
2682
|
+
export declare function ensureInteractionFxCss(): void;
|
|
2683
|
+
export declare function ensureMotionCss(): void;
|
|
2684
|
+
export declare function getMotionCss(): string;
|
|
2685
|
+
export declare function getCss(): string;
|
|
2686
|
+
/** `<style id="fibo-dynamic-styles">` HTML. Call **after** `renderToString` so rules are collected. */
|
|
2687
|
+
export declare function getStyleTag(): string;
|
|
2688
|
+
/**
|
|
2689
|
+
* Reset the StyleManager singleton between SSR requests (Next.js / custom servers).
|
|
2690
|
+
* Call after the response CSS has been captured when using `<FiboStyles />` mid-tree.
|
|
2691
|
+
*/
|
|
2692
|
+
export declare function endSsrRequest(): void;
|
|
2693
|
+
/**
|
|
2694
|
+
* Inject collected CSS into a document. Place as a **later sibling** of the app
|
|
2695
|
+
* so registrations from children run first during SSR.
|
|
2696
|
+
*/
|
|
2697
|
+
export declare function FiboStyles(): React$1.ReactElement;
|
|
2698
|
+
export declare function MotionStyles(): React$1.ReactElement;
|
|
2699
|
+
export type FiboPageBuild = () => FiboChild | React$1.ReactNode;
|
|
2700
|
+
type FiboPageMeta = {
|
|
2701
|
+
title?: string;
|
|
2702
|
+
description?: string;
|
|
2210
2703
|
};
|
|
2211
|
-
export type
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2704
|
+
export type FiboPageOptions = {
|
|
2705
|
+
/** Append `<FiboStyles />` after the tree (SSR dynamic CSS). Default true. */
|
|
2706
|
+
styles?: boolean;
|
|
2707
|
+
/** SSR `<title>` / `<meta name="description">` (React 19 hoists into `<head>`). */
|
|
2708
|
+
meta?: FiboPageMeta;
|
|
2216
2709
|
};
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
readonly small: "small";
|
|
2220
|
-
readonly medium: "medium";
|
|
2221
|
-
readonly large: "large";
|
|
2710
|
+
type FiboPageComponent = React$1.ComponentType & {
|
|
2711
|
+
meta?: FiboPageMeta;
|
|
2222
2712
|
};
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2713
|
+
/**
|
|
2714
|
+
* Next/Vite page helper — **zero JSX** in app code, SSR-safe.
|
|
2715
|
+
*
|
|
2716
|
+
* Next App Router still SSRs Client Components: HTML is rendered on the server,
|
|
2717
|
+
* then hydrated. Import `fiboui/style.css` once from `app/layout.tsx` (or the
|
|
2718
|
+
* Vite entry) so the base sheet is in the document on first paint.
|
|
2719
|
+
*
|
|
2720
|
+
* ```ts
|
|
2721
|
+
* // app/page.tsx — Server Component (no 'use client')
|
|
2722
|
+
* import { page, Column, Text } from 'fiboui'
|
|
2723
|
+
*
|
|
2724
|
+
* export default page(() =>
|
|
2725
|
+
* Column().gap(12).children([Text('Hello')])
|
|
2726
|
+
* )
|
|
2727
|
+
* ```
|
|
2728
|
+
*
|
|
2729
|
+
* App Router resolves `fiboui` via the `react-server` export (static builders).
|
|
2730
|
+
* `build()` runs during RSC render so StyleManager rules exist before `<FiboStyles />`.
|
|
2731
|
+
*/
|
|
2732
|
+
export declare function page(build: FiboPageBuild, options?: FiboPageOptions): FiboPageComponent;
|
|
2733
|
+
/**
|
|
2734
|
+
* Alias of `page()`. Prefer `export default page(() => …)` from a Server Component.
|
|
2735
|
+
*/
|
|
2736
|
+
export declare const createPage: typeof page;
|
|
2737
|
+
/**
|
|
2738
|
+
* Wrap any builder / node with `FiboStyles` without JSX.
|
|
2739
|
+
*
|
|
2740
|
+
* ```ts
|
|
2741
|
+
* export default function Home() {
|
|
2742
|
+
* return withFiboStyles(Column().children([Text('Hi')]))
|
|
2743
|
+
* }
|
|
2744
|
+
* ```
|
|
2745
|
+
*/
|
|
2746
|
+
export declare function withFiboStyles(child: FiboChild | React$1.ReactNode): React$1.ReactElement;
|
|
2747
|
+
/**
|
|
2748
|
+
* Current viewport width. Hydration uses 1024 (desktop) so the first client
|
|
2749
|
+
* render matches SSR; the real width arrives after mount.
|
|
2750
|
+
* Prefer `.md()` / `.responsive()` (CSS `@media`) over this hook.
|
|
2751
|
+
*/
|
|
2752
|
+
export declare function useViewportWidth(): number;
|
|
2753
|
+
type Constructor<T = any> = new (...args: any[]) => T;
|
|
2754
|
+
type Factory<T = any> = () => T;
|
|
2755
|
+
type Provider<T = any> = Constructor<T> | Factory<T> | T;
|
|
2756
|
+
type Token<T = any> = string | symbol | Constructor<T>;
|
|
2757
|
+
export interface RouteDefinition {
|
|
2758
|
+
path: string;
|
|
2759
|
+
component: () => FiboBuilder;
|
|
2760
|
+
meta?: Record<string, any>;
|
|
2761
|
+
}
|
|
2762
|
+
export interface SidebarConfig {
|
|
2763
|
+
label: string;
|
|
2764
|
+
icon?: any;
|
|
2765
|
+
path: string;
|
|
2766
|
+
order?: number;
|
|
2767
|
+
}
|
|
2768
|
+
export interface FiboContext {
|
|
2769
|
+
registerService<T>(token: Token<T>, implementation: Provider<T>): void;
|
|
2770
|
+
registerStore(store: unknown, name?: string): void;
|
|
2771
|
+
getStore?<T = unknown>(name: string): T | undefined;
|
|
2772
|
+
registerRoute(route: RouteDefinition): void;
|
|
2773
|
+
registerSidebarItem(item: SidebarConfig): void;
|
|
2774
|
+
registerTopbarAction(component: () => FiboBuilder): void;
|
|
2775
|
+
registerOverlay(component: () => FiboBuilder): void;
|
|
2776
|
+
}
|
|
2777
|
+
type PluginSetup = (context: FiboContext) => void;
|
|
2778
|
+
export interface FiboPlugin {
|
|
2779
|
+
name: string;
|
|
2780
|
+
version?: string;
|
|
2781
|
+
setup: PluginSetup;
|
|
2782
|
+
teardown?: PluginSetup;
|
|
2783
|
+
}
|
|
2784
|
+
export declare class FiboAppBuilder {
|
|
2785
|
+
private _rootComponent;
|
|
2786
|
+
private _rootElement;
|
|
2787
|
+
private _plugins;
|
|
2788
|
+
private _reactRoot;
|
|
2789
|
+
private _installed;
|
|
2790
|
+
use(plugin: FiboPlugin): this;
|
|
2791
|
+
plugins(pluginsList: FiboPlugin[]): this;
|
|
2792
|
+
root(component: React$1.ComponentType): this;
|
|
2793
|
+
mount(elementId: string, options?: {
|
|
2794
|
+
strict?: boolean;
|
|
2795
|
+
}): () => void;
|
|
2796
|
+
unmount(): void;
|
|
2797
|
+
private build;
|
|
2798
|
+
}
|
|
2799
|
+
export declare const FiboApp: () => FiboAppBuilder;
|
|
2800
|
+
/** Turn a builder (or already-built node) into a React node. */
|
|
2801
|
+
export declare function toElement(node: FiboChild): React$1.ReactNode;
|
|
2802
|
+
/**
|
|
2803
|
+
* Optional wrapper. Builders are already React elements:
|
|
2804
|
+
*
|
|
2805
|
+
* ```tsx
|
|
2806
|
+
* function App() {
|
|
2807
|
+
* return Button('Save').onPress(save);
|
|
2808
|
+
* }
|
|
2809
|
+
* ```
|
|
2810
|
+
*/
|
|
2811
|
+
export declare function Fibo({ children }: {
|
|
2812
|
+
children: FiboChild;
|
|
2813
|
+
}): React$1.ReactElement;
|
|
2814
|
+
/**
|
|
2815
|
+
* Mount a page that returns a builder — no `.build()` on the root.
|
|
2816
|
+
*
|
|
2817
|
+
* ```ts
|
|
2818
|
+
* function App() {
|
|
2819
|
+
* return Column().children([Text('Hi')]);
|
|
2820
|
+
* }
|
|
2821
|
+
* mount('#root', App);
|
|
2822
|
+
* ```
|
|
2823
|
+
*/
|
|
2824
|
+
export declare function mount(target: string | Element, app: (() => FiboChild) | FiboChild, options?: {
|
|
2825
|
+
strict?: boolean;
|
|
2826
|
+
}): Root;
|
|
2827
|
+
/**
|
|
2828
|
+
* Client: process singleton via `getInstance()`.
|
|
2829
|
+
* SSR: wrap a request in `run()` for an isolated instance, or call `reset()`
|
|
2830
|
+
* between requests. `endSsrRequest()` also resets this manager when `window`
|
|
2831
|
+
* is missing (Node). FiboApp is `'use client'` and uninstalls on unmount.
|
|
2832
|
+
*/
|
|
2833
|
+
export declare class PluginManager implements FiboContext {
|
|
2834
|
+
private static instance;
|
|
2835
|
+
private static scopeStack;
|
|
2836
|
+
/** Shared across `run()` scopes — the DI container is process-wide. */
|
|
2837
|
+
private static serviceRefs;
|
|
2838
|
+
private plugins;
|
|
2839
|
+
/** `setup()` in flight — not yet in `plugins`, so Map order stays completion/LIFO. */
|
|
2840
|
+
private installing;
|
|
2841
|
+
private routes;
|
|
2842
|
+
private sidebarItems;
|
|
2843
|
+
private topbarActions;
|
|
2844
|
+
private overlays;
|
|
2845
|
+
private stores;
|
|
2846
|
+
private storeSeq;
|
|
2847
|
+
private constructor();
|
|
2848
|
+
static getInstance(): PluginManager;
|
|
2849
|
+
/** Isolated manager for one SSR request (or test). Client `getInstance()` is unchanged. */
|
|
2850
|
+
static run<T>(fn: () => T): T;
|
|
2851
|
+
/** Drop every plugin (runs teardown) and replace the process singleton. */
|
|
2852
|
+
static reset(): void;
|
|
2853
|
+
/** @see reset */
|
|
2854
|
+
static resetForTests(): void;
|
|
2855
|
+
has(name: string): boolean;
|
|
2856
|
+
use(plugin: FiboPlugin): this;
|
|
2857
|
+
uninstall(name: string): boolean;
|
|
2858
|
+
private uninstallAllSafe;
|
|
2859
|
+
private createOwned;
|
|
2860
|
+
private dropOwned;
|
|
2861
|
+
registerService<T>(token: Token<T>, implementation: Provider<T>): void;
|
|
2862
|
+
registerStore(store: unknown, name?: string): void;
|
|
2863
|
+
private registerStoreKeyed;
|
|
2864
|
+
getStore<T = unknown>(name: string): T | undefined;
|
|
2865
|
+
getStores(): Map<string, unknown>;
|
|
2866
|
+
registerRoute(route: RouteDefinition): void;
|
|
2867
|
+
registerSidebarItem(item: SidebarConfig): void;
|
|
2868
|
+
registerTopbarAction(component: () => FiboBuilder): void;
|
|
2869
|
+
registerOverlay(component: () => FiboBuilder): void;
|
|
2870
|
+
getRoutes(): RouteDefinition[];
|
|
2871
|
+
getSidebarItems(): SidebarConfig[];
|
|
2872
|
+
getTopbarActions(): (() => FiboBuilder)[];
|
|
2873
|
+
getOverlays(): (() => FiboBuilder)[];
|
|
2874
|
+
}
|
|
2875
|
+
/**
|
|
2876
|
+
* SwiftUI-ish `Transaction` — scoped animation flag for `withAnimation`.
|
|
2877
|
+
* Not a full animation graph; pairs with view transitions + existing `.animate`.
|
|
2878
|
+
*/
|
|
2879
|
+
export type Transaction = {
|
|
2880
|
+
/** `false` = disable; `true` = default VT; object = hint for callers. */
|
|
2881
|
+
animation: boolean | Partial<AnimationOptions>;
|
|
2228
2882
|
};
|
|
2229
|
-
|
|
2230
|
-
export declare function
|
|
2231
|
-
|
|
2232
|
-
|
|
2883
|
+
/** Active transaction inside `withAnimation` / `withTransaction`, else `null`. */
|
|
2884
|
+
export declare function transaction(): Transaction | null;
|
|
2885
|
+
export declare function withTransaction<T>(tx: Transaction, body: () => T): T;
|
|
2886
|
+
/**
|
|
2887
|
+
* SwiftUI `withAnimation` — run `body` inside a view transition when available.
|
|
2888
|
+
*
|
|
2889
|
+
* ```ts
|
|
2890
|
+
* withAnimation(() => count.value++)
|
|
2891
|
+
* withAnimation({ duration: 0.3 }, () => open.value = true)
|
|
2892
|
+
* withAnimation(false, () => open.value = true) // no VT
|
|
2893
|
+
* ```
|
|
2894
|
+
*
|
|
2895
|
+
* Does **not** replace `.animate()` (CSS presets) or `Presence` (enter/exit).
|
|
2896
|
+
*/
|
|
2897
|
+
export declare function withAnimation<T>(body: () => T): T;
|
|
2898
|
+
export declare function withAnimation<T>(animation: boolean | Partial<AnimationOptions>, body: () => T): T;
|
|
2233
2899
|
interface FiboThemeContextValue {
|
|
2234
2900
|
theme: FiboTheme;
|
|
2235
2901
|
themeName: string;
|
|
@@ -2397,6 +3063,8 @@ declare class ContainerBuilder extends FiboBuilder {
|
|
|
2397
3063
|
children(children: FiboChildren): this;
|
|
2398
3064
|
props(value: Record<string, any>): this;
|
|
2399
3065
|
padding(value: string | number): this;
|
|
3066
|
+
padding(edges: EdgeSet, value: string | number): this;
|
|
3067
|
+
padding(insets: EdgeInsetsValue): this;
|
|
2400
3068
|
paddingHorizontal(value: string | number): this;
|
|
2401
3069
|
paddingVertical(value: string | number): this;
|
|
2402
3070
|
paddingLeft(value: string | number): this;
|
|
@@ -2509,6 +3177,12 @@ declare class ScaffoldBuilder extends FiboBuilder {
|
|
|
2509
3177
|
headerBar(config: FiboChild | LayoutBarConfig): this;
|
|
2510
3178
|
/** Flutter `Scaffold.appBar`. Same slot as `.headerBar()`. */
|
|
2511
3179
|
appBar(config: FiboChild | LayoutBarConfig): this;
|
|
3180
|
+
/**
|
|
3181
|
+
* SwiftUI `.navigationTitle` — fills the header bar via existing `Header` chrome.
|
|
3182
|
+
* Does **not** add a sixth title component; if `.headerBar()` / `.appBar()` is already
|
|
3183
|
+
* set, this is a no-op (explicit chrome wins).
|
|
3184
|
+
*/
|
|
3185
|
+
navigationTitle(title: string | FiboChild): this;
|
|
2512
3186
|
footerBar(config: FiboChild | LayoutBarConfig): this;
|
|
2513
3187
|
sideBarLeft(config: FiboChild | LayoutBarConfig): this;
|
|
2514
3188
|
sideBarRight(config: FiboChild | LayoutBarConfig): this;
|
|
@@ -2620,14 +3294,70 @@ declare class DashboardLayoutBuilder extends FiboBuilder {
|
|
|
2620
3294
|
build(): React$1.ReactElement;
|
|
2621
3295
|
}
|
|
2622
3296
|
export declare const DashboardLayout: () => StyleBuilder<DashboardLayoutBuilder>;
|
|
3297
|
+
/**
|
|
3298
|
+
* ## ZStack — mental model (SwiftUI / Flutter)
|
|
3299
|
+
*
|
|
3300
|
+
* | FiboUI | SwiftUI | Flutter |
|
|
3301
|
+
* |---|---|---|
|
|
3302
|
+
* | `ZStack` | `ZStack` + `.overlay` | `Stack` |
|
|
3303
|
+
* | child 0 (base) | primary / `.background` host | non-positioned child |
|
|
3304
|
+
* | child 1…n | `.overlay(alignment:)` | `Positioned.fill` + `Align` |
|
|
3305
|
+
* | `.fit('content')` | ideal-size (default) | `StackFit.loose` |
|
|
3306
|
+
* | `.fit('expand')` | frame max / expand | `StackFit.expand` |
|
|
3307
|
+
* | `.alignment(...)` | `Alignment` | `Alignment` |
|
|
3308
|
+
*
|
|
3309
|
+
* **Size (SwiftUI):** the stack’s layout size comes from its children — FiboUI
|
|
3310
|
+
* uses the **base** (index 0) as the size driver (overlays are absolute and
|
|
3311
|
+
* cannot grow the stack). If the base has a fixed `.frame({ width, height })`,
|
|
3312
|
+
* that size is copied onto the ZStack host so chrome/gestures outside the
|
|
3313
|
+
* stack always wrap a real box (no “sometimes empty” hit target).
|
|
3314
|
+
*
|
|
3315
|
+
* You do **not** have to repeat `.frame` on the ZStack when the base is already
|
|
3316
|
+
* framed; an extra `.frame` on the stack still wins (wraps / clamps).
|
|
3317
|
+
*
|
|
3318
|
+
* **Hit-testing (SwiftUI):** taps on containers only hit drawn content unless
|
|
3319
|
+
* `.contentShape(Rectangle())` is set (or a gesture auto-defaults it).
|
|
3320
|
+
*
|
|
3321
|
+
* ```ts
|
|
3322
|
+
* ZStack()
|
|
3323
|
+
* .alignment(StackAlign.bottom)
|
|
3324
|
+
* .children([
|
|
3325
|
+
* Image(url).scaledToFill().frame({ width: 300, height: 400 }),
|
|
3326
|
+
* Text(title).width('100%').padding(12),
|
|
3327
|
+
* ])
|
|
3328
|
+
* .clipShape('8px')
|
|
3329
|
+
* .contentShape('rectangle') // or rely on gesture default
|
|
3330
|
+
* .onTapGesture(open)
|
|
3331
|
+
* ```
|
|
3332
|
+
*/
|
|
3333
|
+
/** @deprecated Prefer {@link StackAlign} / `StackAlign.topTrailing` — same values. */
|
|
3334
|
+
export type ZStackAlignment = StackAlign | keyof typeof StackAlign;
|
|
3335
|
+
/** `content` = size to base (SwiftUI default / StackFit.loose).
|
|
3336
|
+
* `expand` = fill parent (StackFit.expand). */
|
|
3337
|
+
export type ZStackFit = "content" | "expand";
|
|
2623
3338
|
declare class ZStackBuilder extends FiboBuilder {
|
|
2624
3339
|
private _alignment;
|
|
3340
|
+
private _fit;
|
|
3341
|
+
/** Copied from base child’s fixed frame, if any. */
|
|
3342
|
+
private _baseFixedFrame?;
|
|
2625
3343
|
children(children: FiboChildren): this;
|
|
2626
3344
|
props(value: Record<string, any>): this;
|
|
2627
|
-
alignment(align:
|
|
3345
|
+
alignment(align: ZStackAlignment): this;
|
|
3346
|
+
/**
|
|
3347
|
+
* How the stack sizes itself.
|
|
3348
|
+
* - `content` (default): hug the base child — SwiftUI ideal size / `StackFit.loose`
|
|
3349
|
+
* - `expand`: fill the parent — `StackFit.expand`
|
|
3350
|
+
*
|
|
3351
|
+
* `.hug()` still forces content; explicit `.width('100%')` still fills.
|
|
3352
|
+
*/
|
|
3353
|
+
fit(value: ZStackFit): this;
|
|
2628
3354
|
build(): React$1.ReactElement;
|
|
2629
3355
|
}
|
|
2630
3356
|
export declare const ZStack: () => StyleBuilder<ZStackBuilder>;
|
|
3357
|
+
export interface ZStackProps extends ChildrenProps {
|
|
3358
|
+
alignment?: ZStackAlignment;
|
|
3359
|
+
fit?: ZStackFit;
|
|
3360
|
+
}
|
|
2631
3361
|
declare class LineBuilder extends FiboBuilder {
|
|
2632
3362
|
private _sizeHeight?;
|
|
2633
3363
|
children(children: FiboChildren): this;
|
|
@@ -2658,15 +3388,44 @@ export declare class ScrollController {
|
|
|
2658
3388
|
scrollByChild(dir?: -1 | 1, gap?: number): void;
|
|
2659
3389
|
scrollToChild(index: number, gap?: number): void;
|
|
2660
3390
|
}
|
|
3391
|
+
/** Proxy passed to `ScrollViewReader` builder — SwiftUI `ScrollViewProxy`. */
|
|
3392
|
+
export type ScrollViewProxy = {
|
|
3393
|
+
/** Scroll the nearest ancestor scroller so `[data-scroll-id=id]` is visible. */
|
|
3394
|
+
scrollTo: (id: string, options?: ScrollIntoViewOptions) => void;
|
|
3395
|
+
};
|
|
3396
|
+
declare class ScrollViewReaderBuilder extends FiboBuilder {
|
|
3397
|
+
private _builder?;
|
|
3398
|
+
builder(fn: (proxy: ScrollViewProxy) => unknown): this;
|
|
3399
|
+
build(): React$1.ReactElement;
|
|
3400
|
+
}
|
|
3401
|
+
/**
|
|
3402
|
+
* SwiftUI `ScrollViewReader` — wrap a ScrollView; call `proxy.scrollTo(id)`
|
|
3403
|
+
* for children marked with `.scrollTarget(id)`.
|
|
3404
|
+
*
|
|
3405
|
+
* ```ts
|
|
3406
|
+
* ScrollViewReader().builder((proxy) =>
|
|
3407
|
+
* Column().children(
|
|
3408
|
+
* Button('Go').onPress(() => proxy.scrollTo('row-3')),
|
|
3409
|
+
* ScrollView().children(
|
|
3410
|
+
* Text('A').scrollTarget('row-1'),
|
|
3411
|
+
* Text('C').scrollTarget('row-3'),
|
|
3412
|
+
* )
|
|
3413
|
+
* )
|
|
3414
|
+
* )
|
|
3415
|
+
* ```
|
|
3416
|
+
*/
|
|
3417
|
+
export declare const ScrollViewReader: () => StyleBuilder<ScrollViewReaderBuilder>;
|
|
2661
3418
|
type ScrollDirection = "vertical" | "horizontal" | "both";
|
|
2662
3419
|
type ScrollbarVisibility = "hidden" | "visible" | "auto";
|
|
2663
|
-
type ScrollAnchor = "start" | "center" | "end";
|
|
3420
|
+
type ScrollAnchor$1 = "start" | "center" | "end";
|
|
2664
3421
|
declare class ScrollViewBuilder extends FiboBuilder {
|
|
2665
3422
|
private _direction;
|
|
2666
3423
|
private _scrollbar;
|
|
2667
3424
|
private _controller?;
|
|
2668
3425
|
private _anchor?;
|
|
2669
3426
|
private _refresh?;
|
|
3427
|
+
private _scrollTargetLayout;
|
|
3428
|
+
private _scrollPosition?;
|
|
2670
3429
|
children(children: FiboChildren): this;
|
|
2671
3430
|
props(value: Record<string, any>): this;
|
|
2672
3431
|
direction(direction: ScrollDirection): this;
|
|
@@ -2675,8 +3434,18 @@ declare class ScrollViewBuilder extends FiboBuilder {
|
|
|
2675
3434
|
scrollbar(visibility: ScrollbarVisibility): this;
|
|
2676
3435
|
/** Attach a ScrollController for programmatic scroll (carousel prev/next). */
|
|
2677
3436
|
controller(controller: ScrollController): this;
|
|
2678
|
-
scrollAnchor(anchor: ScrollAnchor): this;
|
|
3437
|
+
scrollAnchor(anchor: ScrollAnchor$1): this;
|
|
2679
3438
|
refreshable(handler: () => void): this;
|
|
3439
|
+
/**
|
|
3440
|
+
* SwiftUI `scrollTargetLayout` — children participate as scroll targets
|
|
3441
|
+
* (snap + `data-scroll-target-layout`).
|
|
3442
|
+
*/
|
|
3443
|
+
scrollTargetLayout(enabled?: boolean): this;
|
|
3444
|
+
/**
|
|
3445
|
+
* SwiftUI `scrollPosition(id:)` — initial / programmatic target id
|
|
3446
|
+
* (`data-scroll-position`). Pair with `.scrollTarget(id)` on children.
|
|
3447
|
+
*/
|
|
3448
|
+
scrollPosition(id: string): this;
|
|
2680
3449
|
/**
|
|
2681
3450
|
* Native scroll listener on the overflow host.
|
|
2682
3451
|
* String presets still alias `.reveal()` from FiboBuilder.
|
|
@@ -2700,6 +3469,20 @@ declare class VirtualColumnBuilder extends FiboBuilder {
|
|
|
2700
3469
|
build(): React$1.ReactElement;
|
|
2701
3470
|
}
|
|
2702
3471
|
export declare const VirtualColumn: () => StyleBuilder<VirtualColumnBuilder>;
|
|
3472
|
+
declare class VirtualRowBuilder extends FiboBuilder {
|
|
3473
|
+
private _itemWidth?;
|
|
3474
|
+
private _estimatedItemWidth?;
|
|
3475
|
+
private _measureItems;
|
|
3476
|
+
private _overscan;
|
|
3477
|
+
private _containerWidth;
|
|
3478
|
+
itemWidth(width: number): this;
|
|
3479
|
+
estimatedItemWidth(width: number): this;
|
|
3480
|
+
measureItems(measure?: boolean): this;
|
|
3481
|
+
overscan(count: number): this;
|
|
3482
|
+
containerWidth(width: number): this;
|
|
3483
|
+
build(): React$1.ReactElement;
|
|
3484
|
+
}
|
|
3485
|
+
export declare const VirtualRow: () => StyleBuilder<VirtualRowBuilder>;
|
|
2703
3486
|
type SafeEdge = "top" | "bottom" | "left" | "right";
|
|
2704
3487
|
type SafeEdges = SafeEdge | "all" | Array<SafeEdge | "all">;
|
|
2705
3488
|
declare class SafeAreaBuilder extends FiboBuilder {
|
|
@@ -2766,16 +3549,42 @@ declare class OrientationBuilderBuilder extends FiboBuilder {
|
|
|
2766
3549
|
build(): React$1.ReactElement;
|
|
2767
3550
|
}
|
|
2768
3551
|
export declare const OrientationBuilder: () => StyleBuilder<OrientationBuilderBuilder>;
|
|
2769
|
-
type LayoutSize = {
|
|
3552
|
+
export type LayoutSize = {
|
|
2770
3553
|
width: number;
|
|
2771
3554
|
height: number;
|
|
2772
3555
|
};
|
|
3556
|
+
/** SwiftUI-ish safe-area insets (CSS env when available). */
|
|
3557
|
+
export type EdgeInsets = {
|
|
3558
|
+
top: number;
|
|
3559
|
+
bottom: number;
|
|
3560
|
+
leading: number;
|
|
3561
|
+
trailing: number;
|
|
3562
|
+
};
|
|
3563
|
+
/**
|
|
3564
|
+
* SwiftUI `GeometryProxy` — size + safe-area + local / global / named frames.
|
|
3565
|
+
*/
|
|
3566
|
+
export type GeometryProxy = LayoutSize & {
|
|
3567
|
+
size: LayoutSize;
|
|
3568
|
+
safeAreaInsets: EdgeInsets;
|
|
3569
|
+
/** Frame in `local` | `global` | `CoordinateSpace.named('foo')`. */
|
|
3570
|
+
frame: (inSpace?: "local" | "global" | string) => {
|
|
3571
|
+
x: number;
|
|
3572
|
+
y: number;
|
|
3573
|
+
width: number;
|
|
3574
|
+
height: number;
|
|
3575
|
+
};
|
|
3576
|
+
};
|
|
2773
3577
|
declare class LayoutBuilderBuilder extends FiboBuilder {
|
|
2774
3578
|
private _builder?;
|
|
2775
|
-
|
|
3579
|
+
private _coordinateSpace?;
|
|
3580
|
+
builder(fn: (proxy: GeometryProxy) => unknown): this;
|
|
3581
|
+
/** Publish this reader as `CoordinateSpace.named(name)`. */
|
|
3582
|
+
coordinateSpace(name: string): this;
|
|
2776
3583
|
build(): React$1.ReactElement;
|
|
2777
3584
|
}
|
|
2778
3585
|
export declare const LayoutBuilder: () => StyleBuilder<LayoutBuilderBuilder>;
|
|
3586
|
+
/** SwiftUI `GeometryReader` — same as {@link LayoutBuilder}, receives {@link GeometryProxy}. */
|
|
3587
|
+
export declare const GeometryReader: () => StyleBuilder<LayoutBuilderBuilder>;
|
|
2779
3588
|
declare class KeyboardInsetBuilder extends FiboBuilder {
|
|
2780
3589
|
private _child?;
|
|
2781
3590
|
child(node: FiboChild): this;
|
|
@@ -2945,13 +3754,15 @@ declare class LabelBuilder extends FiboBuilder {
|
|
|
2945
3754
|
build(): React$1.ReactElement;
|
|
2946
3755
|
}
|
|
2947
3756
|
export declare const Label: (text?: string | undefined) => StyleBuilder<LabelBuilder>;
|
|
2948
|
-
type ClipShape = "circle" | "rounded" | "square";
|
|
3757
|
+
type ClipShape$1 = "circle" | "rounded" | "square";
|
|
2949
3758
|
declare class ImageBuilder extends FiboBuilder {
|
|
2950
3759
|
private _src;
|
|
2951
3760
|
private _alt;
|
|
2952
3761
|
private _fit;
|
|
2953
3762
|
private _resizable;
|
|
2954
|
-
|
|
3763
|
+
/** Image-native clip (Tailwind / borderRadius on `<img>`). Distinct from
|
|
3764
|
+
* {@link FiboBuilder.clipShape} chrome wrapper. */
|
|
3765
|
+
private _imageClipShape?;
|
|
2955
3766
|
private _frameWidth?;
|
|
2956
3767
|
private _frameHeight?;
|
|
2957
3768
|
private _foregroundStyle?;
|
|
@@ -2961,11 +3772,14 @@ declare class ImageBuilder extends FiboBuilder {
|
|
|
2961
3772
|
resizable(): this;
|
|
2962
3773
|
scaledToFit(): this;
|
|
2963
3774
|
scaledToFill(): this;
|
|
2964
|
-
|
|
2965
|
-
|
|
2966
|
-
|
|
2967
|
-
|
|
2968
|
-
|
|
3775
|
+
/**
|
|
3776
|
+
* Fixed numeric `{ width, height }` still paints on the `<img>` (tests +
|
|
3777
|
+
* object-fit). Any flexible SwiftUI frame (`maxWidth: Size.infinity`, …)
|
|
3778
|
+
* goes through {@link FiboBuilder.frame} (wrapper).
|
|
3779
|
+
*/
|
|
3780
|
+
frame(dimensions: FrameSpec): this;
|
|
3781
|
+
/** Named shapes paint on `<img>`; other radii use base chrome wrapper. */
|
|
3782
|
+
clipShape(shape: ClipShape$1 | string): this;
|
|
2969
3783
|
foregroundStyle(style: string): this;
|
|
2970
3784
|
build(): React$1.ReactElement;
|
|
2971
3785
|
}
|
|
@@ -5171,6 +5985,7 @@ export declare function clearPersistedState(key: string, storage?: StorageAdapte
|
|
|
5171
5985
|
export declare function getPersistedState<T>(key: string, storage?: StorageAdapter): T | null;
|
|
5172
5986
|
|
|
5173
5987
|
export {
|
|
5988
|
+
DragAxis$1 as DragAxisEnum,
|
|
5174
5989
|
Effect$1 as Effect,
|
|
5175
5990
|
Image$1 as Image,
|
|
5176
5991
|
ScrollToOptions$1 as ScrollToOptions,
|