fiboui 2.8.4 → 2.8.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +89 -0
- package/dist/{client-DOrZXJAN.js → client-BzMPiV64.js} +4966 -4864
- package/dist/content.d.ts +1178 -1
- package/dist/content.js +8 -8
- package/dist/core.d.ts +1545 -2
- package/dist/core.js +52 -46
- package/dist/{icons-DujcjAOD.js → icons-aP7ZHyqh.js} +7 -7
- package/dist/{index-uks8jtfK.js → index-B9YuBkEv.js} +568 -499
- package/dist/{index-CYMoWJMX.js → index-Bgt9DiVJ.js} +26 -26
- package/dist/{index-C0qI47Zw.js → index-DU4n9axe.js} +5 -5
- package/dist/{index-19mPjg_D.js → index-DWBoYvko.js} +5 -5
- package/dist/{index-rNMzRy8Y.js → index-Dd48Ov9N.js} +16 -16
- package/dist/index.d.ts +250 -116830
- package/dist/index.js +157 -151
- package/dist/interactive.d.ts +1350 -2
- package/dist/interactive.js +8 -8
- package/dist/layout.d.ts +1218 -1
- package/dist/layout.js +7 -7
- package/dist/{metadata-9Bpw89m2.js → metadata-B5v6sx60.js} +18 -18
- package/dist/navigation.d.ts +88 -1
- package/dist/navigation.js +2 -2
- package/dist/page-CHjFSSAF.js +263 -0
- package/dist/server.d.ts +1369 -2
- package/dist/server.js +2 -1
- package/dist/structure.d.ts +1345 -1
- package/dist/structure.js +9 -9
- package/dist/theme.d.ts +149 -2
- package/dist/theme.js +1 -1
- package/package.json +5 -3
- package/dist/page-BOQJIKa5.js +0 -184
package/dist/core.d.ts
CHANGED
|
@@ -1,2 +1,1545 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
// Generated by dts-bundle-generator v9.5.1
|
|
2
|
+
|
|
3
|
+
import React$1 from 'react';
|
|
4
|
+
import { CSSProperties, ComponentType, ReactElement, ReactNode } from 'react';
|
|
5
|
+
import { Root } from 'react-dom/client';
|
|
6
|
+
|
|
7
|
+
/** Any fluent builder that can produce a React element. */
|
|
8
|
+
export type Buildable = {
|
|
9
|
+
/** @deprecated Builders are React elements; `.build()` is optional. */
|
|
10
|
+
build(): React$1.ReactNode;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* A single child accepted by `.children()` / layout slots / JSX / component returns.
|
|
14
|
+
* Builders are React elements — they do not need `.build()`.
|
|
15
|
+
*/
|
|
16
|
+
export type FiboChild = React$1.ReactNode | Buildable;
|
|
17
|
+
/** Value accepted by `.children()`: one child, a list, or a lazy factory. */
|
|
18
|
+
export type FiboChildren = FiboChild | readonly FiboChild[] | (() => FiboChild | readonly FiboChild[]);
|
|
19
|
+
type FiboThemeName = "material" | "cupertino" | "web" | "noir";
|
|
20
|
+
export interface ResponsiveStyles {
|
|
21
|
+
mobile?: React$1.CSSProperties;
|
|
22
|
+
tablet?: React$1.CSSProperties;
|
|
23
|
+
desktop?: React$1.CSSProperties;
|
|
24
|
+
}
|
|
25
|
+
type AlignAxis = "start" | "center" | "end" | "stretch" | "baseline" | "between" | "around" | "evenly" | "space-between" | "space-around" | "space-evenly" | "spaceBetween" | "spaceAround" | "spaceEvenly";
|
|
26
|
+
interface TextStyle {
|
|
27
|
+
fontSize?: string | number;
|
|
28
|
+
fontWeight?: string | number;
|
|
29
|
+
fontFamily?: string;
|
|
30
|
+
color?: string;
|
|
31
|
+
lineHeight?: string | number;
|
|
32
|
+
letterSpacing?: string | number;
|
|
33
|
+
}
|
|
34
|
+
type Listener<T> = (value: T) => void;
|
|
35
|
+
type Unsubscribe = () => void;
|
|
36
|
+
/** Isolated reactive graph for one React root / test / island. */
|
|
37
|
+
export declare class ReactivityScope {
|
|
38
|
+
activeEffect: Effect | Tracker | null;
|
|
39
|
+
}
|
|
40
|
+
export declare function createReactivityRoot(): ReactivityScope;
|
|
41
|
+
export declare function getCurrentScope(): ReactivityScope;
|
|
42
|
+
export declare function runInScope<T>(scope: ReactivityScope, fn: () => T): T;
|
|
43
|
+
interface Subscribable<T> {
|
|
44
|
+
subscribe(listener: Listener<T>): Unsubscribe;
|
|
45
|
+
subscribeEffect(effect: Effect): void;
|
|
46
|
+
unsubscribeEffect(effect: Effect): void;
|
|
47
|
+
}
|
|
48
|
+
/** Anything `.bindSignal()` can subscribe to (`Signal` or `ComputedSignal`). */
|
|
49
|
+
export interface BindableSignal<T = unknown> {
|
|
50
|
+
readonly value: T;
|
|
51
|
+
subscribe(listener: Listener<T>): Unsubscribe;
|
|
52
|
+
}
|
|
53
|
+
declare class Effect {
|
|
54
|
+
private fn;
|
|
55
|
+
private dependencies;
|
|
56
|
+
private _onDispose?;
|
|
57
|
+
constructor(fn: () => void);
|
|
58
|
+
run(): void;
|
|
59
|
+
track(dep: Subscribable<any>): void;
|
|
60
|
+
trigger(): void;
|
|
61
|
+
cleanup(): void;
|
|
62
|
+
dispose(): void;
|
|
63
|
+
}
|
|
64
|
+
declare class Tracker {
|
|
65
|
+
private _onInvalidate;
|
|
66
|
+
private dependencies;
|
|
67
|
+
constructor(_onInvalidate: () => void);
|
|
68
|
+
execute<T>(fn: () => T): T;
|
|
69
|
+
track(dep: Subscribable<any>): void;
|
|
70
|
+
trigger(): void;
|
|
71
|
+
cleanup(): void;
|
|
72
|
+
dispose(): void;
|
|
73
|
+
}
|
|
74
|
+
export declare class Signal<T> implements Subscribable<T> {
|
|
75
|
+
private _value;
|
|
76
|
+
private listeners;
|
|
77
|
+
private effects;
|
|
78
|
+
private readonly _initial;
|
|
79
|
+
constructor(_value: T);
|
|
80
|
+
get value(): T;
|
|
81
|
+
/** Current value without tracking. Replays use this so a node does not subscribe twice. */
|
|
82
|
+
peek(): T;
|
|
83
|
+
set value(newValue: T);
|
|
84
|
+
/** Replace the value. Same notify path as `.value = next`. */
|
|
85
|
+
set(next: T): this;
|
|
86
|
+
/**
|
|
87
|
+
* Write a value, or an updater `(prev) => next`.
|
|
88
|
+
* Function-valued signals should use `.set()` / `.value =` so the function is stored, not called.
|
|
89
|
+
* Not named `update`: `listSignal.update(id, patch)` is the item patch.
|
|
90
|
+
*/
|
|
91
|
+
change(next: T | ((prev: T) => T)): this;
|
|
92
|
+
/** Restore the value passed to `signal(initial)`. */
|
|
93
|
+
reset(): this;
|
|
94
|
+
subscribe(listener: Listener<T>): Unsubscribe;
|
|
95
|
+
subscribeEffect(effect: Effect): void;
|
|
96
|
+
unsubscribeEffect(effect: Effect): void;
|
|
97
|
+
private _notifyDepth;
|
|
98
|
+
private notify;
|
|
99
|
+
}
|
|
100
|
+
export declare function signal<T>(initialValue: T): Signal<T>;
|
|
101
|
+
export declare class ComputedSignal<T> implements Subscribable<T> {
|
|
102
|
+
private fn;
|
|
103
|
+
private listeners;
|
|
104
|
+
private effects;
|
|
105
|
+
private _value;
|
|
106
|
+
private _dirty;
|
|
107
|
+
private _disposed;
|
|
108
|
+
private _ready;
|
|
109
|
+
private _hasValue;
|
|
110
|
+
private _computing;
|
|
111
|
+
private internalEffect;
|
|
112
|
+
constructor(fn: () => T);
|
|
113
|
+
/** Current value without tracking and without joining the page frame. */
|
|
114
|
+
peek(): T;
|
|
115
|
+
get value(): T;
|
|
116
|
+
subscribe(listener: Listener<T>): Unsubscribe;
|
|
117
|
+
subscribeEffect(effect: Effect): void;
|
|
118
|
+
unsubscribeEffect(effect: Effect): void;
|
|
119
|
+
/** Drop the internal effect and freeze the last evaluated value. */
|
|
120
|
+
dispose(): void;
|
|
121
|
+
private _notifyDepth;
|
|
122
|
+
private notify;
|
|
123
|
+
}
|
|
124
|
+
export declare function computed<T>(fn: () => T): ComputedSignal<T>;
|
|
125
|
+
export declare class Observable<T> implements Subscribable<T> {
|
|
126
|
+
private _value;
|
|
127
|
+
private listeners;
|
|
128
|
+
private effects;
|
|
129
|
+
constructor(_value: T);
|
|
130
|
+
get(): T;
|
|
131
|
+
set(newValue: T): void;
|
|
132
|
+
subscribe(listener: Listener<T>): Unsubscribe;
|
|
133
|
+
subscribeEffect(effect: Effect): void;
|
|
134
|
+
unsubscribeEffect(effect: Effect): void;
|
|
135
|
+
private notify;
|
|
136
|
+
}
|
|
137
|
+
export declare function observable<T>(initialValue: T): Observable<T>;
|
|
138
|
+
interface Store<T> extends Subscribable<T> {
|
|
139
|
+
getState(): T;
|
|
140
|
+
setState(fn: Partial<T> | ((state: T) => Partial<T>)): void;
|
|
141
|
+
}
|
|
142
|
+
export declare function createStore<T>(initialState: T): Store<T>;
|
|
143
|
+
export type ListItemId = string | number;
|
|
144
|
+
/** Every object in a `listSignal` gets a stable internal key. */
|
|
145
|
+
export type ListEntity<T extends object = object> = T & {
|
|
146
|
+
_id: string;
|
|
147
|
+
};
|
|
148
|
+
export type ListMatcher<T> = ListItemId | ((item: T, index: number) => boolean);
|
|
149
|
+
/** Stamp `_id` if missing. Keeps an existing `_id`. */
|
|
150
|
+
export declare function ensureListId<T extends object>(item: T): ListEntity<T>;
|
|
151
|
+
/**
|
|
152
|
+
* Reactive list — auto-stamps a UUID `_id` on every object.
|
|
153
|
+
* Use `_id` for update/remove/find; your domain fields stay free of ids.
|
|
154
|
+
*
|
|
155
|
+
* `view('ship')` / `search('ship')` show a subset. The full list stays in memory, so
|
|
156
|
+
* `view('')` / `search('')` show every item again. `filter(fn)` is a one-shot snapshot
|
|
157
|
+
* of the full list. `viewWhere(fn)` is the live predicate (AND with the query);
|
|
158
|
+
* `viewWhere()` clears it. `add` always writes to the full list.
|
|
159
|
+
*
|
|
160
|
+
* ```ts
|
|
161
|
+
* const todos = listSignal<{ title: string }>([])
|
|
162
|
+
* todos.add({ title: 'Ship' }) // → { title: 'Ship', _id: '…' }
|
|
163
|
+
* todos.update(todo._id, { title: 'Done' })
|
|
164
|
+
* todos.view('done')
|
|
165
|
+
* todos.view('')
|
|
166
|
+
* todos.remove(todo._id)
|
|
167
|
+
* ```
|
|
168
|
+
*/
|
|
169
|
+
export declare class ListSignal<T extends object> extends Signal<ListEntity<T>[]> {
|
|
170
|
+
private _$length?;
|
|
171
|
+
/** Full list. `.value` is this array, or a filtered slice while a view/filter is set. */
|
|
172
|
+
private _source;
|
|
173
|
+
private _query;
|
|
174
|
+
private _keys?;
|
|
175
|
+
private _predicate?;
|
|
176
|
+
/** Membership and order. Item patches do not move this. */
|
|
177
|
+
private _structureVersion;
|
|
178
|
+
private _itemVersions;
|
|
179
|
+
private _structureListeners;
|
|
180
|
+
private _itemListeners;
|
|
181
|
+
constructor(initial?: Array<T | ListEntity<T>>);
|
|
182
|
+
get value(): ListEntity<T>[];
|
|
183
|
+
/**
|
|
184
|
+
* Replaces the full list, then reapplies the current view.
|
|
185
|
+
* In-place mutation of this array (`push` / `splice`) does not notify
|
|
186
|
+
* and does not write the stored list — assign a new array or use
|
|
187
|
+
* `add` / `update` / `remove`.
|
|
188
|
+
*/
|
|
189
|
+
set value(next: ListEntity<T>[]);
|
|
190
|
+
/** Who is in the list, and in what order. `add` / `remove` / `set` / `view` move this. */
|
|
191
|
+
structureVersion(): number;
|
|
192
|
+
/** Content of one `_id`. `update` / `replace` move only that id. */
|
|
193
|
+
itemVersion(id: string): number;
|
|
194
|
+
subscribeStructure(listener: () => void): () => void;
|
|
195
|
+
subscribeItem(id: string, listener: () => void): () => void;
|
|
196
|
+
private emitStructure;
|
|
197
|
+
private emitItem;
|
|
198
|
+
/**
|
|
199
|
+
* Push the visible rows. Always a copy so `.value.splice` cannot write `_source`.
|
|
200
|
+
* `silent` still notifies `.subscribe` (the whole array changed in memory).
|
|
201
|
+
* `structure` is membership. `items` is one row's fields.
|
|
202
|
+
*/
|
|
203
|
+
private publish;
|
|
204
|
+
get length(): number;
|
|
205
|
+
/**
|
|
206
|
+
* Reactive length for plain templates:
|
|
207
|
+
* `Text(\`Total todos: ${todos.$length}\`)`
|
|
208
|
+
*
|
|
209
|
+
* Embeds a marker via `interp()`; `Text` resolves it on each update.
|
|
210
|
+
* (`todos.length` is a plain number and still freezes — use `$length`.)
|
|
211
|
+
*/
|
|
212
|
+
get $length(): string;
|
|
213
|
+
/** Replace the whole array (missing `_id`s are generated). */
|
|
214
|
+
set(items: Array<T | ListEntity<T>>): this;
|
|
215
|
+
clear(): this;
|
|
216
|
+
/** Append items — each gets `_id` if not already set. Writes the full list. */
|
|
217
|
+
add(...items: Array<T | ListEntity<T>>): this;
|
|
218
|
+
/** Insert at index (clamped) in the full list. */
|
|
219
|
+
insert(index: number, item: T | ListEntity<T>): this;
|
|
220
|
+
/**
|
|
221
|
+
* Patch by `_id` / `id` / predicate.
|
|
222
|
+
* `patch` can be a partial object or a mapper.
|
|
223
|
+
*/
|
|
224
|
+
update(matcher: ListMatcher<ListEntity<T>>, patch: Partial<T> | ((item: ListEntity<T>) => T | ListEntity<T>)): this;
|
|
225
|
+
/** Replace the first match (keeps original `_id` unless `item` already has one). */
|
|
226
|
+
replace(matcher: ListMatcher<ListEntity<T>>, item: T | ListEntity<T>): this;
|
|
227
|
+
/** Remove by `_id` / `id` / predicate. Alias: `delete`. */
|
|
228
|
+
remove(matcher: ListMatcher<ListEntity<T>>): this;
|
|
229
|
+
delete(matcher: ListMatcher<ListEntity<T>>): this;
|
|
230
|
+
find(matcher: ListMatcher<ListEntity<T>>): ListEntity<T> | undefined;
|
|
231
|
+
/**
|
|
232
|
+
* Show only rows that match `query`. The full list stays stored.
|
|
233
|
+
* `view('')` or `view()` shows every item again (does not clear `viewWhere`).
|
|
234
|
+
* `keys` limits the match to those fields (`['text']`).
|
|
235
|
+
*/
|
|
236
|
+
view(query?: string, keys?: (keyof T)[]): this;
|
|
237
|
+
/**
|
|
238
|
+
* Live predicate on `publish()` (AND with `view`/`search` query).
|
|
239
|
+
* `viewWhere()` with no fn (or `null`) clears it.
|
|
240
|
+
*/
|
|
241
|
+
viewWhere(predicate?: ((item: ListEntity<T>, index: number) => boolean) | null): this;
|
|
242
|
+
/**
|
|
243
|
+
* Same live view as `view()`, plus a copy of the visible rows.
|
|
244
|
+
* Bound List/Table update; `const hits = todos.search('x')` still works.
|
|
245
|
+
*/
|
|
246
|
+
search(query: string, keys?: (keyof T)[]): ListEntity<T>[];
|
|
247
|
+
/**
|
|
248
|
+
* One-shot snapshot of `_source` (Array.filter). Does not change `.value`.
|
|
249
|
+
* Safe inside `computed(() => todos.filter(fn))`.
|
|
250
|
+
* `todos.set(todos.filter(fn))` replaces the full list (clearDone).
|
|
251
|
+
*/
|
|
252
|
+
filter(predicate: (item: ListEntity<T>, index: number) => boolean): ListEntity<T>[];
|
|
253
|
+
map<U>(fn: (item: ListEntity<T>, index: number) => U): U[];
|
|
254
|
+
move(from: number, to: number): this;
|
|
255
|
+
}
|
|
256
|
+
export declare function listSignal<T extends object>(initial?: Array<T | ListEntity<T>>): ListSignal<T>;
|
|
257
|
+
/** Alias — same as `listSignal`. */
|
|
258
|
+
export declare const collection: typeof listSignal;
|
|
259
|
+
/**
|
|
260
|
+
* Wrap a signal so `` `…${interp(sig)}` `` embeds a reactive marker
|
|
261
|
+
* instead of freezing `String(sig.value)` immediately.
|
|
262
|
+
*
|
|
263
|
+
* Returns a primitive string (the marker). Callers that check
|
|
264
|
+
* `typeof x === 'string'` then `hasInterpMarks(x)` must see it.
|
|
265
|
+
*/
|
|
266
|
+
export declare function interp<T>(signal: BindableSignal<T>): string;
|
|
267
|
+
export type FiboDevStats = {
|
|
268
|
+
/** runBuildFrame / page produce counts */
|
|
269
|
+
produces: number;
|
|
270
|
+
/** node wire replays */
|
|
271
|
+
replays: number;
|
|
272
|
+
/** times a signal was promoted to page root (warn path) */
|
|
273
|
+
pageRoots: number;
|
|
274
|
+
/** warnDev calls that actually printed */
|
|
275
|
+
warns: number;
|
|
276
|
+
};
|
|
277
|
+
export declare function fiboDevStats(): FiboDevStats;
|
|
278
|
+
export declare function resetFiboDevStats(): void;
|
|
279
|
+
type NumericInput = number | BindableSignal<number>;
|
|
280
|
+
/**
|
|
281
|
+
* Number / money printers for live `Text` / `Button` templates.
|
|
282
|
+
*
|
|
283
|
+
* ```ts
|
|
284
|
+
* Text(`€ ${Format.fixed(price)}`)
|
|
285
|
+
* Text(Format.euro(price))
|
|
286
|
+
* Text(Format.currency(price, 'USD'))
|
|
287
|
+
* ```
|
|
288
|
+
*/
|
|
289
|
+
export declare const Format: {
|
|
290
|
+
/** Decimals — default 2: `Format.fixed(price)` → `"12.50"`. */
|
|
291
|
+
readonly fixed: (value: NumericInput, digits?: number) => string;
|
|
292
|
+
/** Whole number, no decimals: `Format.integer(n)` → `"12"`. */
|
|
293
|
+
readonly integer: (value: NumericInput) => string;
|
|
294
|
+
/** `Format.euro(price)` → `"€ 12.50"`. */
|
|
295
|
+
readonly euro: (value: NumericInput, digits?: number) => string;
|
|
296
|
+
/**
|
|
297
|
+
* Locale currency. Default `EUR` / `es-ES`.
|
|
298
|
+
* `Format.currency(price, 'USD', 'en-US')` → `"$12.50"`.
|
|
299
|
+
*/
|
|
300
|
+
readonly currency: (value: NumericInput, currency?: string, locale?: string) => string;
|
|
301
|
+
/** `Format.percent(rate)` with rate `0–1` → `"12%"` (default 0 decimals). */
|
|
302
|
+
readonly percent: (value: NumericInput, digits?: number) => string;
|
|
303
|
+
/** Compact: `1200` → `"1.2K"` (en). */
|
|
304
|
+
readonly compact: (value: NumericInput, locale?: string) => string;
|
|
305
|
+
};
|
|
306
|
+
/** Alias of `Format`. */
|
|
307
|
+
export declare const Transform: {
|
|
308
|
+
/** Decimals — default 2: `Format.fixed(price)` → `"12.50"`. */
|
|
309
|
+
readonly fixed: (value: NumericInput, digits?: number) => string;
|
|
310
|
+
/** Whole number, no decimals: `Format.integer(n)` → `"12"`. */
|
|
311
|
+
readonly integer: (value: NumericInput) => string;
|
|
312
|
+
/** `Format.euro(price)` → `"€ 12.50"`. */
|
|
313
|
+
readonly euro: (value: NumericInput, digits?: number) => string;
|
|
314
|
+
/**
|
|
315
|
+
* Locale currency. Default `EUR` / `es-ES`.
|
|
316
|
+
* `Format.currency(price, 'USD', 'en-US')` → `"$12.50"`.
|
|
317
|
+
*/
|
|
318
|
+
readonly currency: (value: NumericInput, currency?: string, locale?: string) => string;
|
|
319
|
+
/** `Format.percent(rate)` with rate `0–1` → `"12%"` (default 0 decimals). */
|
|
320
|
+
readonly percent: (value: NumericInput, digits?: number) => string;
|
|
321
|
+
/** Compact: `1200` → `"1.2K"` (en). */
|
|
322
|
+
readonly compact: (value: NumericInput, locale?: string) => string;
|
|
323
|
+
};
|
|
324
|
+
/**
|
|
325
|
+
* CSS length printers for live styles / text.
|
|
326
|
+
*
|
|
327
|
+
* ```ts
|
|
328
|
+
* Box().width(Unit.px(width))
|
|
329
|
+
* Box().height(Unit.percent(height))
|
|
330
|
+
* Text(Unit.rem(size))
|
|
331
|
+
* ```
|
|
332
|
+
*/
|
|
333
|
+
export declare const Unit: {
|
|
334
|
+
readonly px: (value: NumericInput) => string;
|
|
335
|
+
readonly rem: (value: NumericInput) => string;
|
|
336
|
+
readonly em: (value: NumericInput) => string;
|
|
337
|
+
/** `Unit.percent(50)` → `"50%"`. */
|
|
338
|
+
readonly percent: (value: NumericInput) => string;
|
|
339
|
+
readonly vh: (value: NumericInput) => string;
|
|
340
|
+
readonly vw: (value: NumericInput) => string;
|
|
341
|
+
};
|
|
342
|
+
/**
|
|
343
|
+
* Count + word for live labels.
|
|
344
|
+
*
|
|
345
|
+
* ```ts
|
|
346
|
+
* Text(Plural.of(count, 'task', 'tasks')) // "1 task" / "3 tasks"
|
|
347
|
+
* Text(Plural.of(left, 'left', 'left')) // "2 left"
|
|
348
|
+
* ```
|
|
349
|
+
*/
|
|
350
|
+
export declare const Plural: {
|
|
351
|
+
/**
|
|
352
|
+
* `"N word"` — uses `one` when the absolute count is 1, otherwise `many`.
|
|
353
|
+
*/
|
|
354
|
+
readonly of: (count: NumericInput, one: string, many: string) => string;
|
|
355
|
+
/** Only the word: `Plural.word(count, 'item', 'items')` → `"items"`. */
|
|
356
|
+
readonly word: (count: NumericInput, one: string, many: string) => string;
|
|
357
|
+
};
|
|
358
|
+
export declare function useSignal<T>(signal: Signal<T> | ComputedSignal<T>): T;
|
|
359
|
+
/** Subscribe to a `createStore()` instance. Distinct from the class-decorator `useStore`. */
|
|
360
|
+
export declare function useReactiveStore<T>(store: Store<T>): T;
|
|
361
|
+
export declare function useObservable<T>(obs: Observable<T>): T;
|
|
362
|
+
export declare function Observer({ children }: {
|
|
363
|
+
children: () => React$1.ReactNode;
|
|
364
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
365
|
+
export declare function useBuilderState<T = unknown>(key: string): [
|
|
366
|
+
T | undefined,
|
|
367
|
+
(value: T) => void
|
|
368
|
+
];
|
|
369
|
+
interface ProviderWrapperProps {
|
|
370
|
+
providers?: Map<string, unknown>;
|
|
371
|
+
children: React$1.ReactNode;
|
|
372
|
+
}
|
|
373
|
+
export declare function useProvider<T>(key: string): T | undefined;
|
|
374
|
+
export declare function ProviderWrapper({ providers, children }: ProviderWrapperProps): import("react/jsx-runtime").JSX.Element;
|
|
375
|
+
interface ReactivityRootProps {
|
|
376
|
+
children: React$1.ReactNode;
|
|
377
|
+
scope?: ReactivityScope;
|
|
378
|
+
}
|
|
379
|
+
/** Isolates `activeEffect` for one React tree / island. */
|
|
380
|
+
export declare function ReactivityRoot({ children, scope }: ReactivityRootProps): import("react/jsx-runtime").JSX.Element;
|
|
381
|
+
interface FineGrainTextProps {
|
|
382
|
+
compute: () => string;
|
|
383
|
+
as?: keyof HTMLElementTagNameMap;
|
|
384
|
+
className?: string;
|
|
385
|
+
style?: React$1.CSSProperties;
|
|
386
|
+
}
|
|
387
|
+
/** Updates `textContent` in place — the host element is not remounted. */
|
|
388
|
+
export declare function FineGrainText({ compute, as, className, style, ...rest }: FineGrainTextProps & Record<string, unknown>): React$1.DetailedReactHTMLElement<{
|
|
389
|
+
ref: (node: HTMLElement | null) => void;
|
|
390
|
+
className: string | undefined;
|
|
391
|
+
style: React$1.CSSProperties | undefined;
|
|
392
|
+
}, HTMLElement>;
|
|
393
|
+
/** Bind a signal to a live text node without a React state subscription. */
|
|
394
|
+
export declare function bindText(signal: BindableSignal<unknown>, as?: keyof HTMLElementTagNameMap): React$1.FunctionComponentElement<FineGrainTextProps & Record<string, unknown>>;
|
|
395
|
+
export declare function applyResponsiveStyles(baseStyle: React$1.CSSProperties, responsive?: ResponsiveStyles, width?: number): React$1.CSSProperties;
|
|
396
|
+
export interface TransitionConfig {
|
|
397
|
+
duration?: number;
|
|
398
|
+
delay?: number;
|
|
399
|
+
easing?: (t: number) => number;
|
|
400
|
+
}
|
|
401
|
+
export interface SpringConfig {
|
|
402
|
+
stiffness?: number;
|
|
403
|
+
damping?: number;
|
|
404
|
+
mass?: number;
|
|
405
|
+
}
|
|
406
|
+
export declare const Easing: {
|
|
407
|
+
linear: (t: number) => number;
|
|
408
|
+
easeIn: (t: number) => number;
|
|
409
|
+
easeOut: (t: number) => number;
|
|
410
|
+
easeInOut: (t: number) => number;
|
|
411
|
+
easeInCubic: (t: number) => number;
|
|
412
|
+
easeOutCubic: (t: number) => number;
|
|
413
|
+
elastic: (t: number) => number;
|
|
414
|
+
bounce: (t: number) => number;
|
|
415
|
+
};
|
|
416
|
+
export declare function useTransition(targetValue: number, config?: TransitionConfig): number;
|
|
417
|
+
export declare function useSpring(targetValue: number, config?: SpringConfig): number;
|
|
418
|
+
export declare function useMountTransition(isVisible: boolean, duration?: number): {
|
|
419
|
+
shouldRender: boolean;
|
|
420
|
+
stage: "entering" | "entered" | "exiting" | "exited";
|
|
421
|
+
};
|
|
422
|
+
export declare function useStagger(count: number, delayBetween?: number): number[];
|
|
423
|
+
export declare function usePrefersReducedMotion(): boolean;
|
|
424
|
+
/** Scroll position 0–1. Uses `scroll` / `resize` listeners — not rAF. */
|
|
425
|
+
export declare function useScrollProgress(): number;
|
|
426
|
+
export interface AnimationOptions {
|
|
427
|
+
duration?: number;
|
|
428
|
+
curve?: "linear" | "easeIn" | "easeOut" | "easeInOut" | "spring" | string;
|
|
429
|
+
damping?: number;
|
|
430
|
+
stiffness?: number;
|
|
431
|
+
velocity?: number;
|
|
432
|
+
mass?: number;
|
|
433
|
+
onComplete?: () => void;
|
|
434
|
+
}
|
|
435
|
+
export interface Signal<T> {
|
|
436
|
+
spring(target: T, options?: Partial<AnimationOptions>): void;
|
|
437
|
+
animate(target: T, options?: Partial<AnimationOptions>): void;
|
|
438
|
+
snapTo(target: T, options?: Partial<AnimationOptions>): void;
|
|
439
|
+
}
|
|
440
|
+
export declare function cssCurve(options?: Partial<AnimationOptions>): string;
|
|
441
|
+
export declare const MOTION_PRESETS: readonly [
|
|
442
|
+
"fadeIn",
|
|
443
|
+
"fadeOut",
|
|
444
|
+
"fade",
|
|
445
|
+
"slideUp",
|
|
446
|
+
"slideDown",
|
|
447
|
+
"slideLeft",
|
|
448
|
+
"slideRight",
|
|
449
|
+
"scaleIn",
|
|
450
|
+
"scaleOut",
|
|
451
|
+
"scale",
|
|
452
|
+
"blurIn",
|
|
453
|
+
"blurOut",
|
|
454
|
+
"blur",
|
|
455
|
+
"pop",
|
|
456
|
+
"bounce"
|
|
457
|
+
];
|
|
458
|
+
export type MotionPreset = (typeof MOTION_PRESETS)[number];
|
|
459
|
+
export interface CustomMotion {
|
|
460
|
+
from: Record<string, string | number>;
|
|
461
|
+
to: Record<string, string | number>;
|
|
462
|
+
duration?: number;
|
|
463
|
+
ease?: string;
|
|
464
|
+
delay?: number;
|
|
465
|
+
stiffness?: number;
|
|
466
|
+
damping?: number;
|
|
467
|
+
mass?: number;
|
|
468
|
+
}
|
|
469
|
+
declare const FIBO_BREAKPOINTS: {
|
|
470
|
+
readonly sm: 640;
|
|
471
|
+
readonly md: 768;
|
|
472
|
+
readonly lg: 1024;
|
|
473
|
+
readonly xl: 1280;
|
|
474
|
+
};
|
|
475
|
+
type BreakpointKey = keyof typeof FIBO_BREAKPOINTS;
|
|
476
|
+
declare abstract class GestureBuilder {
|
|
477
|
+
abstract wrap(children: React$1.ReactNode): React$1.ReactNode;
|
|
478
|
+
}
|
|
479
|
+
/**
|
|
480
|
+
* Full interaction-effect catalog (Hover.css–inspired names, fiboui-owned CSS).
|
|
481
|
+
* NOT a vendor of Hover.css — reimplemented for commercial use inside fiboui.
|
|
482
|
+
*
|
|
483
|
+
* Apply on any trigger:
|
|
484
|
+
* .hover(h => h.effect("sweepToRight"))
|
|
485
|
+
* .pressEffect("shrink")
|
|
486
|
+
* .focusEffect("glow")
|
|
487
|
+
*/
|
|
488
|
+
export declare const INTERACTION_EFFECTS: readonly [
|
|
489
|
+
"grow",
|
|
490
|
+
"shrink",
|
|
491
|
+
"pulse",
|
|
492
|
+
"pulseGrow",
|
|
493
|
+
"pulseShrink",
|
|
494
|
+
"push",
|
|
495
|
+
"pop",
|
|
496
|
+
"bounceIn",
|
|
497
|
+
"bounceOut",
|
|
498
|
+
"rotate",
|
|
499
|
+
"growRotate",
|
|
500
|
+
"float",
|
|
501
|
+
"sink",
|
|
502
|
+
"bob",
|
|
503
|
+
"hang",
|
|
504
|
+
"skew",
|
|
505
|
+
"skewForward",
|
|
506
|
+
"skewBackward",
|
|
507
|
+
"wobbleHorizontal",
|
|
508
|
+
"wobbleVertical",
|
|
509
|
+
"wobbleToBottomRight",
|
|
510
|
+
"wobbleToTopRight",
|
|
511
|
+
"wobbleTop",
|
|
512
|
+
"wobbleBottom",
|
|
513
|
+
"wobbleSkew",
|
|
514
|
+
"buzz",
|
|
515
|
+
"buzzOut",
|
|
516
|
+
"forward",
|
|
517
|
+
"backward",
|
|
518
|
+
"nudge",
|
|
519
|
+
"fade",
|
|
520
|
+
"backPulse",
|
|
521
|
+
"sweepToRight",
|
|
522
|
+
"sweepToLeft",
|
|
523
|
+
"sweepToBottom",
|
|
524
|
+
"sweepToTop",
|
|
525
|
+
"bounceToRight",
|
|
526
|
+
"bounceToLeft",
|
|
527
|
+
"bounceToBottom",
|
|
528
|
+
"bounceToTop",
|
|
529
|
+
"radialOut",
|
|
530
|
+
"radialIn",
|
|
531
|
+
"rectangleIn",
|
|
532
|
+
"rectangleOut",
|
|
533
|
+
"shutterInHorizontal",
|
|
534
|
+
"shutterOutHorizontal",
|
|
535
|
+
"shutterInVertical",
|
|
536
|
+
"shutterOutVertical",
|
|
537
|
+
"iconBack",
|
|
538
|
+
"iconForward",
|
|
539
|
+
"iconDown",
|
|
540
|
+
"iconUp",
|
|
541
|
+
"iconSpin",
|
|
542
|
+
"iconDrop",
|
|
543
|
+
"iconFade",
|
|
544
|
+
"iconFloatAway",
|
|
545
|
+
"iconSinkAway",
|
|
546
|
+
"iconGrow",
|
|
547
|
+
"iconShrink",
|
|
548
|
+
"iconPulse",
|
|
549
|
+
"iconPulseGrow",
|
|
550
|
+
"iconPulseShrink",
|
|
551
|
+
"iconPush",
|
|
552
|
+
"iconPop",
|
|
553
|
+
"iconBounce",
|
|
554
|
+
"iconRotate",
|
|
555
|
+
"iconGrowRotate",
|
|
556
|
+
"iconFloat",
|
|
557
|
+
"iconSink",
|
|
558
|
+
"iconBob",
|
|
559
|
+
"iconHang",
|
|
560
|
+
"iconWobbleHorizontal",
|
|
561
|
+
"iconWobbleVertical",
|
|
562
|
+
"iconBuzz",
|
|
563
|
+
"iconBuzzOut",
|
|
564
|
+
"borderFade",
|
|
565
|
+
"hollow",
|
|
566
|
+
"trim",
|
|
567
|
+
"rippleOut",
|
|
568
|
+
"rippleIn",
|
|
569
|
+
"outlineOut",
|
|
570
|
+
"outlineIn",
|
|
571
|
+
"roundCorners",
|
|
572
|
+
"underlineFromLeft",
|
|
573
|
+
"underlineFromCenter",
|
|
574
|
+
"underlineFromRight",
|
|
575
|
+
"reveal",
|
|
576
|
+
"underlineReveal",
|
|
577
|
+
"overlineFromLeft",
|
|
578
|
+
"overlineFromCenter",
|
|
579
|
+
"overlineFromRight",
|
|
580
|
+
"overlineReveal",
|
|
581
|
+
"shadowGrow",
|
|
582
|
+
"shadowFloat",
|
|
583
|
+
"shadowGlow",
|
|
584
|
+
"shadowRadial",
|
|
585
|
+
"boxShadowOutset",
|
|
586
|
+
"boxShadowInset",
|
|
587
|
+
"lift",
|
|
588
|
+
"glow",
|
|
589
|
+
"bubbleTop",
|
|
590
|
+
"bubbleRight",
|
|
591
|
+
"bubbleBottom",
|
|
592
|
+
"bubbleLeft",
|
|
593
|
+
"bubbleFloatTop",
|
|
594
|
+
"bubbleFloatRight",
|
|
595
|
+
"bubbleFloatBottom",
|
|
596
|
+
"bubbleFloatLeft",
|
|
597
|
+
"curlTopLeft",
|
|
598
|
+
"curlTopRight",
|
|
599
|
+
"curlBottomRight",
|
|
600
|
+
"curlBottomLeft"
|
|
601
|
+
];
|
|
602
|
+
export type InteractionEffectName = (typeof INTERACTION_EFFECTS)[number];
|
|
603
|
+
export declare function interactionEffectKebab(name: InteractionEffectName): string;
|
|
604
|
+
export declare function normalizeInteractionEffect(name: string): InteractionEffectName;
|
|
605
|
+
export declare function interactionEffectClass(name: InteractionEffectName): string;
|
|
606
|
+
interface LogicalAxes {
|
|
607
|
+
paddingHorizontal(value: string | number): this;
|
|
608
|
+
paddingVertical(value: string | number): this;
|
|
609
|
+
paddingX(value: string | number): this;
|
|
610
|
+
paddingY(value: string | number): this;
|
|
611
|
+
px(value: string | number): this;
|
|
612
|
+
py(value: string | number): this;
|
|
613
|
+
marginHorizontal(value: string | number): this;
|
|
614
|
+
marginVertical(value: string | number): this;
|
|
615
|
+
marginX(value: string | number): this;
|
|
616
|
+
marginY(value: string | number): this;
|
|
617
|
+
mx(value: string | number): this;
|
|
618
|
+
my(value: string | number): this;
|
|
619
|
+
borderHorizontal(value: string | number): this;
|
|
620
|
+
borderVertical(value: string | number): this;
|
|
621
|
+
borderX(value: string | number): this;
|
|
622
|
+
borderY(value: string | number): this;
|
|
623
|
+
borderWidthHorizontal(value: string | number): this;
|
|
624
|
+
borderWidthVertical(value: string | number): this;
|
|
625
|
+
borderColorHorizontal(value: string | number): this;
|
|
626
|
+
borderColorVertical(value: string | number): this;
|
|
627
|
+
roundedTop(value: string | number): this;
|
|
628
|
+
roundedBottom(value: string | number): this;
|
|
629
|
+
roundedLeft(value: string | number): this;
|
|
630
|
+
roundedRight(value: string | number): this;
|
|
631
|
+
insetHorizontal(value: string | number): this;
|
|
632
|
+
insetVertical(value: string | number): this;
|
|
633
|
+
insetX(value: string | number): this;
|
|
634
|
+
insetY(value: string | number): this;
|
|
635
|
+
gapX(value: string | number): this;
|
|
636
|
+
gapY(value: string | number): this;
|
|
637
|
+
}
|
|
638
|
+
/**
|
|
639
|
+
* The constructor returns a proxy that accepts any CSS method.
|
|
640
|
+
* Declare the axes plus `boxShadow` (the class method is `.shadow()`).
|
|
641
|
+
*/
|
|
642
|
+
export interface PseudoStateBuilder extends LogicalAxes {
|
|
643
|
+
boxShadow(value: string | number): this;
|
|
644
|
+
}
|
|
645
|
+
export declare class PseudoStateBuilder {
|
|
646
|
+
private pseudoState;
|
|
647
|
+
private parentBuilder;
|
|
648
|
+
private isGroup;
|
|
649
|
+
private transitionDuration;
|
|
650
|
+
private transitionEasing;
|
|
651
|
+
private transitionDelay;
|
|
652
|
+
private transitionProperties;
|
|
653
|
+
private transforms;
|
|
654
|
+
private _boxLonghands;
|
|
655
|
+
constructor(pseudoState: string, parentBuilder: FiboBuilder, isGroup?: boolean);
|
|
656
|
+
/**
|
|
657
|
+
* Apply a named interaction effect (full Hover.css–inspired catalog).
|
|
658
|
+
* Works on any pseudo trigger — hover, press/active, focus, groupHover, etc.
|
|
659
|
+
* Stamps CSS classes; sheet is fiboui-owned (not a Hover.css vendor).
|
|
660
|
+
*/
|
|
661
|
+
effect(name: InteractionEffectName | string): this;
|
|
662
|
+
bg(color: string): this;
|
|
663
|
+
/** Same longhand as `.bg()` — interpolates against the resting surface. */
|
|
664
|
+
backgroundColor(value: string): this;
|
|
665
|
+
color(value: string): this;
|
|
666
|
+
text(color: string): this;
|
|
667
|
+
opacity(value: number): this;
|
|
668
|
+
borderColor(value: string): this;
|
|
669
|
+
transform(value: string): this;
|
|
670
|
+
scale(value: number): this;
|
|
671
|
+
translateX(value: number | string): this;
|
|
672
|
+
translateY(value: number | string): this;
|
|
673
|
+
rotate(degrees: number): this;
|
|
674
|
+
shadow(value: string | number): this;
|
|
675
|
+
css(property: string, value: string | number): this;
|
|
676
|
+
padding(value: string | number): this;
|
|
677
|
+
p(value: string | number): this;
|
|
678
|
+
margin(value: string | number): this;
|
|
679
|
+
transition(value: string): this;
|
|
680
|
+
transition(properties: string | string[], duration: number, easing?: string, delay?: number): this;
|
|
681
|
+
duration(ms: number): this;
|
|
682
|
+
easing(value: "linear" | "ease" | "ease-in" | "ease-out" | "ease-in-out" | "spring" | string): this;
|
|
683
|
+
ease(value: string): this;
|
|
684
|
+
delay(ms: number): this;
|
|
685
|
+
properties(props: string[]): this;
|
|
686
|
+
private applyTransition;
|
|
687
|
+
private flushTransform;
|
|
688
|
+
private set;
|
|
689
|
+
private commit;
|
|
690
|
+
end(): FiboBuilder;
|
|
691
|
+
}
|
|
692
|
+
declare const When: {
|
|
693
|
+
readonly hover: "hover";
|
|
694
|
+
readonly focus: "focus";
|
|
695
|
+
readonly active: "active";
|
|
696
|
+
readonly visited: "visited";
|
|
697
|
+
readonly disabled: "disabled";
|
|
698
|
+
readonly on: "on";
|
|
699
|
+
readonly off: "off";
|
|
700
|
+
readonly checked: "checked";
|
|
701
|
+
readonly unchecked: "unchecked";
|
|
702
|
+
readonly indeterminate: "indeterminate";
|
|
703
|
+
readonly mixed: "mixed";
|
|
704
|
+
};
|
|
705
|
+
type When = (typeof When)[keyof typeof When];
|
|
706
|
+
type WhenStyle = React$1.CSSProperties | string | ((builder: any) => void);
|
|
707
|
+
export interface SpringOptions {
|
|
708
|
+
stiffness?: number;
|
|
709
|
+
damping?: number;
|
|
710
|
+
mass?: number;
|
|
711
|
+
}
|
|
712
|
+
/**
|
|
713
|
+
* CSS `linear()` spring sampled once. stiffness/damping/mass change the curve.
|
|
714
|
+
* The browser interpolates — no rAF on the CSS path.
|
|
715
|
+
*/
|
|
716
|
+
export declare function springEase(options?: SpringOptions): string;
|
|
717
|
+
export declare function resolveCssEase(value: string, spring?: SpringOptions): string;
|
|
718
|
+
interface ThemeColors {
|
|
719
|
+
primary: string;
|
|
720
|
+
primaryVariant?: string;
|
|
721
|
+
primaryContainer?: string;
|
|
722
|
+
onPrimaryContainer?: string;
|
|
723
|
+
secondary: string;
|
|
724
|
+
secondaryVariant?: string;
|
|
725
|
+
secondaryContainer?: string;
|
|
726
|
+
onSecondaryContainer?: string;
|
|
727
|
+
tertiary?: string;
|
|
728
|
+
onTertiary?: string;
|
|
729
|
+
tertiaryContainer?: string;
|
|
730
|
+
onTertiaryContainer?: string;
|
|
731
|
+
background: string;
|
|
732
|
+
surface: string;
|
|
733
|
+
surfaceVariant?: string;
|
|
734
|
+
onSurfaceVariant?: string;
|
|
735
|
+
error: string;
|
|
736
|
+
errorContainer?: string;
|
|
737
|
+
onErrorContainer?: string;
|
|
738
|
+
success?: string;
|
|
739
|
+
warning?: string;
|
|
740
|
+
info?: string;
|
|
741
|
+
onPrimary: string;
|
|
742
|
+
onSecondary: string;
|
|
743
|
+
onBackground: string;
|
|
744
|
+
onSurface: string;
|
|
745
|
+
onError: string;
|
|
746
|
+
/** Borders / hairlines — maps to `--fibo-outline`. */
|
|
747
|
+
outline?: string;
|
|
748
|
+
outlineVariant?: string;
|
|
749
|
+
/** Maps to `--fibo-surface-container-low` (M3 card surfaces). */
|
|
750
|
+
surfaceContainerLow?: string;
|
|
751
|
+
}
|
|
752
|
+
interface ThemeTypography {
|
|
753
|
+
h1: TextStyle;
|
|
754
|
+
h2: TextStyle;
|
|
755
|
+
h3: TextStyle;
|
|
756
|
+
h4: TextStyle;
|
|
757
|
+
h5: TextStyle;
|
|
758
|
+
h6: TextStyle;
|
|
759
|
+
body: TextStyle;
|
|
760
|
+
caption: TextStyle;
|
|
761
|
+
label: TextStyle;
|
|
762
|
+
}
|
|
763
|
+
interface ThemeSpacing {
|
|
764
|
+
xs: string;
|
|
765
|
+
sm: string;
|
|
766
|
+
md: string;
|
|
767
|
+
lg: string;
|
|
768
|
+
xl: string;
|
|
769
|
+
}
|
|
770
|
+
interface ThemeBorderRadius {
|
|
771
|
+
/** Maps to `--fibo-radius-xs` when set (CSS sheets already define it). */
|
|
772
|
+
xs?: string;
|
|
773
|
+
sm: string;
|
|
774
|
+
md: string;
|
|
775
|
+
lg: string;
|
|
776
|
+
/** Maps to `--fibo-radius-xl` when set (CSS sheets already define it). */
|
|
777
|
+
xl?: string;
|
|
778
|
+
full: string;
|
|
779
|
+
}
|
|
780
|
+
interface ThemeShadows {
|
|
781
|
+
sm: string;
|
|
782
|
+
md: string;
|
|
783
|
+
lg: string;
|
|
784
|
+
}
|
|
785
|
+
interface FiboTheme {
|
|
786
|
+
name: FiboThemeName;
|
|
787
|
+
colors: ThemeColors;
|
|
788
|
+
typography: ThemeTypography;
|
|
789
|
+
spacing: ThemeSpacing;
|
|
790
|
+
borderRadius: ThemeBorderRadius;
|
|
791
|
+
shadows: ThemeShadows;
|
|
792
|
+
fontFamily: string;
|
|
793
|
+
}
|
|
794
|
+
declare const FIBO_THEMES: {
|
|
795
|
+
readonly material: FiboTheme;
|
|
796
|
+
readonly cupertino: FiboTheme;
|
|
797
|
+
readonly web: FiboTheme;
|
|
798
|
+
readonly noir: FiboTheme;
|
|
799
|
+
};
|
|
800
|
+
type FiboThemePreset = keyof typeof FIBO_THEMES;
|
|
801
|
+
type ThemeInput = FiboTheme | FiboThemePreset;
|
|
802
|
+
declare enum Colors {
|
|
803
|
+
Primary = "primary",
|
|
804
|
+
OnPrimary = "on-primary",
|
|
805
|
+
PrimaryContainer = "primary-container",
|
|
806
|
+
OnPrimaryContainer = "on-primary-container",
|
|
807
|
+
Secondary = "secondary",
|
|
808
|
+
OnSecondary = "on-secondary",
|
|
809
|
+
SecondaryContainer = "secondary-container",
|
|
810
|
+
OnSecondaryContainer = "on-secondary-container",
|
|
811
|
+
Tertiary = "tertiary",
|
|
812
|
+
OnTertiary = "on-tertiary",
|
|
813
|
+
TertiaryContainer = "tertiary-container",
|
|
814
|
+
OnTertiaryContainer = "on-tertiary-container",
|
|
815
|
+
Error = "error",
|
|
816
|
+
OnError = "on-error",
|
|
817
|
+
Success = "success",
|
|
818
|
+
Warning = "warning",
|
|
819
|
+
Info = "info",
|
|
820
|
+
Background = "background",
|
|
821
|
+
OnBackground = "on-background",
|
|
822
|
+
Surface = "surface",
|
|
823
|
+
OnSurface = "on-surface",
|
|
824
|
+
SurfaceVariant = "surface-variant",
|
|
825
|
+
OnSurfaceVariant = "on-surface-variant",
|
|
826
|
+
Outline = "outline",
|
|
827
|
+
Transparent = "transparent",
|
|
828
|
+
Black = "black",
|
|
829
|
+
White = "white"
|
|
830
|
+
}
|
|
831
|
+
declare enum ShadowSize {
|
|
832
|
+
Sm = "sm",
|
|
833
|
+
Md = "md",
|
|
834
|
+
Lg = "lg",
|
|
835
|
+
Xl = "xl",
|
|
836
|
+
Xl2 = "2xl"
|
|
837
|
+
}
|
|
838
|
+
declare enum ShadowPreset {
|
|
839
|
+
Card = "card",
|
|
840
|
+
Button = "button",
|
|
841
|
+
Modal = "modal",
|
|
842
|
+
Float = "float",
|
|
843
|
+
Inner = "inner"
|
|
844
|
+
}
|
|
845
|
+
declare enum ShadowDirection {
|
|
846
|
+
Top = "top",
|
|
847
|
+
Bottom = "bottom",
|
|
848
|
+
Left = "left",
|
|
849
|
+
Right = "right",
|
|
850
|
+
TopBottom = "top-bottom",
|
|
851
|
+
LeftRight = "left-right",
|
|
852
|
+
Vertical = "vertical",
|
|
853
|
+
Horizontal = "horizontal",
|
|
854
|
+
All = "all"
|
|
855
|
+
}
|
|
856
|
+
type ShadowConfig = ShadowSize | ShadowPreset | string | 0 | null | [
|
|
857
|
+
string,
|
|
858
|
+
number?
|
|
859
|
+
] | [
|
|
860
|
+
ShadowDirection | string,
|
|
861
|
+
ShadowSize | string
|
|
862
|
+
] | [
|
|
863
|
+
ShadowDirection | string,
|
|
864
|
+
string
|
|
865
|
+
] | [
|
|
866
|
+
ShadowDirection | string,
|
|
867
|
+
string,
|
|
868
|
+
number?
|
|
869
|
+
] | [
|
|
870
|
+
ShadowDirection | string,
|
|
871
|
+
ShadowSize | string,
|
|
872
|
+
string,
|
|
873
|
+
number?
|
|
874
|
+
];
|
|
875
|
+
/**
|
|
876
|
+
* Callback form of `.hover()` / `.focus()` / … Contextual typing uses the *last*
|
|
877
|
+
* overload, so this signature must stay last or `h` becomes implicit `any` inside `.map()`.
|
|
878
|
+
*/
|
|
879
|
+
export type PseudoStateFn = (builder: PseudoStateBuilder) => void | PseudoStateBuilder;
|
|
880
|
+
declare abstract class FiboBuilder {
|
|
881
|
+
/** @internal Extra DOM props forwarded to the host element. */
|
|
882
|
+
protected _props: Record<string, any>;
|
|
883
|
+
protected _style: React$1.CSSProperties;
|
|
884
|
+
protected _cssStyles: React$1.CSSProperties;
|
|
885
|
+
protected _classNames: string[];
|
|
886
|
+
protected _children: React$1.ReactNode[];
|
|
887
|
+
/** Resolved theme for this subtree (SwiftUI Environment / Flutter Theme). */
|
|
888
|
+
protected _theme?: FiboTheme;
|
|
889
|
+
protected _state: Map<string, any>;
|
|
890
|
+
protected _providers: Map<string, any>;
|
|
891
|
+
protected _observers: Set<Observable<any>>;
|
|
892
|
+
protected _signals: Set<BindableSignal<any>>;
|
|
893
|
+
/** Explicit `.bindSignal()` / `.observer()` owns nested reads. A direct wire does not. */
|
|
894
|
+
protected _ownsReads: boolean;
|
|
895
|
+
/** @internal Direct `method(signal.value)` calls replayed when that signal changes. */
|
|
896
|
+
protected _replays: Array<() => void>;
|
|
897
|
+
protected _isObserver: boolean;
|
|
898
|
+
protected _gesture?: GestureBuilder;
|
|
899
|
+
protected _animationConfig?: Partial<AnimationOptions>;
|
|
900
|
+
protected _animatedProps: Map<string, Signal<any>>;
|
|
901
|
+
protected _transforms: string[];
|
|
902
|
+
protected _transitionClass?: string;
|
|
903
|
+
/** True while transition class was auto-managed for hover/effect presets (expandable). */
|
|
904
|
+
protected _autoEffectTransition: boolean;
|
|
905
|
+
protected _effectTransitionProps: string[];
|
|
906
|
+
/**
|
|
907
|
+
* When true, getStyle() promotes background/border shorthands to longhands and
|
|
908
|
+
* (optionally) stamps a resting translate3d so pseudo transforms ease cleanly.
|
|
909
|
+
*/
|
|
910
|
+
protected _smoothSurface: boolean;
|
|
911
|
+
protected _smoothNeedsRestTransform: boolean;
|
|
912
|
+
protected _motionClass?: string;
|
|
913
|
+
protected _staggerMs?: number;
|
|
914
|
+
protected _reveal?: {
|
|
915
|
+
preset: string;
|
|
916
|
+
once?: boolean;
|
|
917
|
+
rootMargin?: string;
|
|
918
|
+
threshold?: number;
|
|
919
|
+
};
|
|
920
|
+
protected _scrollProgress: boolean;
|
|
921
|
+
protected _viewTransition?: string;
|
|
922
|
+
protected _reducedMotion: "reduce" | "never";
|
|
923
|
+
protected _usesCssMotion: boolean;
|
|
924
|
+
protected _explicitScrollMargin: boolean;
|
|
925
|
+
/** Shrink-wrap: skip the default `w-full` / `self-stretch` on Row and Column. */
|
|
926
|
+
protected _hug: boolean;
|
|
927
|
+
/**
|
|
928
|
+
* Unset every CSS property on this component and what it renders inside.
|
|
929
|
+
* Chain `.style()`, `.px()`, `.flex()` and the rest after this to put back only what you want.
|
|
930
|
+
*/
|
|
931
|
+
protected _resetStyle: boolean;
|
|
932
|
+
/** Kebab box longhands already stamped (`padding-left`, …) so later shorthand cannot clobber them. */
|
|
933
|
+
protected _boxLonghands: Set<string>;
|
|
934
|
+
resetStyle(): this;
|
|
935
|
+
protected isReset(): boolean;
|
|
936
|
+
hug(): this;
|
|
937
|
+
protected isHug(): boolean;
|
|
938
|
+
id(value: string): this;
|
|
939
|
+
/**
|
|
940
|
+
* Scroll target. Same as `.id()`, plus `scroll-margin-top` so the section
|
|
941
|
+
* is not hidden under a sticky header. Pair with `scrollTo('#name')`.
|
|
942
|
+
*/
|
|
943
|
+
anchor(value: string): this;
|
|
944
|
+
/**
|
|
945
|
+
* Explicit `scroll-margin-top` on this node (overrides the sticky CSS variable
|
|
946
|
+
* that `.anchor()` applies).
|
|
947
|
+
*/
|
|
948
|
+
scrollMargin(value: number | string): this;
|
|
949
|
+
/** Stamp a class onto the host. Used by PseudoStateBuilder (hashed `:hover` etc.). */
|
|
950
|
+
addClassName(name: string): this;
|
|
951
|
+
/**
|
|
952
|
+
* React list key. After this is called, React reads the key as a string
|
|
953
|
+
* on both the builder element and the inner host wrapper.
|
|
954
|
+
* Builders are valid elements — you do not need `.build()`.
|
|
955
|
+
*/
|
|
956
|
+
key(value: string | number): this;
|
|
957
|
+
private setBoxLonghand;
|
|
958
|
+
private setBoxShorthand;
|
|
959
|
+
paddingHorizontal(value: string | number): this;
|
|
960
|
+
paddingVertical(value: string | number): this;
|
|
961
|
+
padding(value: string | number): this;
|
|
962
|
+
marginHorizontal(value: string | number): this;
|
|
963
|
+
marginVertical(value: string | number): this;
|
|
964
|
+
margin(value: string | number): this;
|
|
965
|
+
/** Inline layout wins over a host that hardcodes flex on the element (Form, Scaffold). */
|
|
966
|
+
protected layoutStyle(patch: React$1.CSSProperties): this;
|
|
967
|
+
/** Last write of a key lives in one bag so getStyle() does not let earlier `.css()` beat later `.style()`. */
|
|
968
|
+
private dropConflictingKeys;
|
|
969
|
+
private trackBoxLonghandsFrom;
|
|
970
|
+
flexDirection(direction: "row" | "column" | "row-reverse" | "column-reverse"): this;
|
|
971
|
+
/** Flutter `textDirection`. */
|
|
972
|
+
textDirection(direction: "ltr" | "rtl"): this;
|
|
973
|
+
/** Flutter `textBaseline`. Both modes align on the flex baseline. */
|
|
974
|
+
textBaseline(baseline: "alphabetic" | "ideographic"): this;
|
|
975
|
+
/** Flutter `clipBehavior`. `none` shows overflow; the other two clip. */
|
|
976
|
+
clip(behavior: "none" | "hardEdge" | "antiAlias"): this;
|
|
977
|
+
/**
|
|
978
|
+
* Flutter `mainAxisSize`. `min` hugs the current flex direction.
|
|
979
|
+
* `max` stretches along that same axis.
|
|
980
|
+
*/
|
|
981
|
+
mainAxisSize(size: "min" | "max"): this;
|
|
982
|
+
zIndex(value: number): this;
|
|
983
|
+
alignItems(alignment: "start" | "center" | "end" | "stretch" | "baseline"): this;
|
|
984
|
+
alignSelf(alignment: "start" | "center" | "end" | "stretch" | "baseline" | "auto"): this;
|
|
985
|
+
flexWrap(wrap: "wrap" | "nowrap" | "wrap-reverse"): this;
|
|
986
|
+
/**
|
|
987
|
+
* Main-axis distribution. Accepts Tailwind shortcuts (`between`) and CSS/Flutter
|
|
988
|
+
* names (`space-between` / `spaceBetween`).
|
|
989
|
+
*/
|
|
990
|
+
justifyContent(justify: "start" | "center" | "end" | "between" | "around" | "evenly" | "space-between" | "space-around" | "space-evenly" | "spaceBetween" | "spaceAround" | "spaceEvenly"): this;
|
|
991
|
+
/** True when flexDirection is column / column-reverse (default is row). */
|
|
992
|
+
protected isVerticalFlex(): boolean;
|
|
993
|
+
/**
|
|
994
|
+
* Both screen axes. `.align(Align.center)` and `.align('center')` do the same.
|
|
995
|
+
* `between` packs the main axis and starts the cross axis.
|
|
996
|
+
*/
|
|
997
|
+
align(alignment: AlignAxis): this;
|
|
998
|
+
/**
|
|
999
|
+
* Horizontal (screen X) alignment. Same meaning on Row and Column:
|
|
1000
|
+
* left / center / right of the container — not “main axis”.
|
|
1001
|
+
*/
|
|
1002
|
+
alignX(alignment: AlignAxis): this;
|
|
1003
|
+
/**
|
|
1004
|
+
* Vertical (screen Y) alignment. Same meaning on Row and Column:
|
|
1005
|
+
* top / center / bottom of the container — not “cross axis”.
|
|
1006
|
+
*/
|
|
1007
|
+
alignY(alignment: AlignAxis): this;
|
|
1008
|
+
protected applyMainAlign(alignment: AlignAxis | string): this;
|
|
1009
|
+
protected applyCrossAlign(alignment: AlignAxis | string): this;
|
|
1010
|
+
flex(value?: number | string): this;
|
|
1011
|
+
grid(): this;
|
|
1012
|
+
inlineFlex(): this;
|
|
1013
|
+
inlineGrid(): this;
|
|
1014
|
+
block(): this;
|
|
1015
|
+
inlineBlock(): this;
|
|
1016
|
+
hidden(): this;
|
|
1017
|
+
center(): this;
|
|
1018
|
+
/** Center on the horizontal screen axis (uses `.alignX('center')`). */
|
|
1019
|
+
centerX(): this;
|
|
1020
|
+
/** Center on the vertical screen axis (uses `.alignY('center')`). */
|
|
1021
|
+
centerY(): this;
|
|
1022
|
+
spaceBetween(): this;
|
|
1023
|
+
spaceAround(): this;
|
|
1024
|
+
spaceEvenly(): this;
|
|
1025
|
+
fill(): this;
|
|
1026
|
+
fillWidth(): this;
|
|
1027
|
+
fillHeight(): this;
|
|
1028
|
+
square(size: number | string): this;
|
|
1029
|
+
circle(): this;
|
|
1030
|
+
opacity(value: number): this;
|
|
1031
|
+
p(value: number | string): this;
|
|
1032
|
+
px(value: number | string): this;
|
|
1033
|
+
py(value: number | string): this;
|
|
1034
|
+
paddingX(value: number | string): this;
|
|
1035
|
+
paddingY(value: number | string): this;
|
|
1036
|
+
m(value: number | string): this;
|
|
1037
|
+
mx(value: number | string): this;
|
|
1038
|
+
my(value: number | string): this;
|
|
1039
|
+
marginX(value: number | string): this;
|
|
1040
|
+
marginY(value: number | string): this;
|
|
1041
|
+
bg(color: string | Colors): this;
|
|
1042
|
+
text(color: string | Colors): this;
|
|
1043
|
+
color(value: string | Colors): this;
|
|
1044
|
+
private resolveSemanticColor;
|
|
1045
|
+
shadow(config?: ShadowConfig): this;
|
|
1046
|
+
/**
|
|
1047
|
+
* Breakpoint styles compiled to CSS `@media` (same engine as `.md()`).
|
|
1048
|
+
* Tiers stay mutually exclusive: mobile `<768`, tablet `768–1023`, desktop `≥1024`.
|
|
1049
|
+
* No `window.innerWidth` — hydrate-safe.
|
|
1050
|
+
*/
|
|
1051
|
+
responsive(styles: ResponsiveStyles): this;
|
|
1052
|
+
/**
|
|
1053
|
+
* CSS `@media` (min-width or a raw query). Compiles to a class — no resize JS.
|
|
1054
|
+
*
|
|
1055
|
+
* @example Box().padding(8).media('md', { padding: 16 }).media('(prefers-color-scheme: dark)', { backgroundColor: '#111' })
|
|
1056
|
+
*/
|
|
1057
|
+
media(query: BreakpointKey | string, styles: React$1.CSSProperties): this;
|
|
1058
|
+
private registerMediaStyles;
|
|
1059
|
+
sm(styles: React$1.CSSProperties): this;
|
|
1060
|
+
md(styles: React$1.CSSProperties): this;
|
|
1061
|
+
lg(styles: React$1.CSSProperties): this;
|
|
1062
|
+
xl(styles: React$1.CSSProperties): this;
|
|
1063
|
+
rounded(value: string | number): this;
|
|
1064
|
+
borderRadius(value: string | number): this;
|
|
1065
|
+
borderColor(value: string): this;
|
|
1066
|
+
/**
|
|
1067
|
+
* A passed size is a lock: `min-*` plus `flex-shrink: 0`, so a flex parent
|
|
1068
|
+
* (the Scaffold body) cannot divide the viewport across these children.
|
|
1069
|
+
* `400`, `'320px'`, `Size.full`, and `Space.md` all count. `flex(1)` afterwards
|
|
1070
|
+
* opts back into sharing space.
|
|
1071
|
+
*/
|
|
1072
|
+
private lockAxis;
|
|
1073
|
+
width(value: string | number): this;
|
|
1074
|
+
paint(property: string, value: string): this;
|
|
1075
|
+
height(value: string | number): this;
|
|
1076
|
+
gap(value: string | number): this;
|
|
1077
|
+
clean(): this;
|
|
1078
|
+
borderInput(color?: string, focusColor?: string): this;
|
|
1079
|
+
weight(value: string | number): this;
|
|
1080
|
+
onClick(handler: (event: React$1.MouseEvent<any>) => void): this;
|
|
1081
|
+
state<T>(key: string, initialValue: T): this;
|
|
1082
|
+
getState<T>(key: string): T | undefined;
|
|
1083
|
+
setState<T>(key: string, value: T): this;
|
|
1084
|
+
provide<T>(key: string, value: T): this;
|
|
1085
|
+
consume<T>(key: string): T | undefined;
|
|
1086
|
+
observer(options?: string | number | {
|
|
1087
|
+
key?: string | number;
|
|
1088
|
+
}): this;
|
|
1089
|
+
observe<T>(observable: Observable<T>): this;
|
|
1090
|
+
bindSignal<T>(signal: BindableSignal<T>): this;
|
|
1091
|
+
/**
|
|
1092
|
+
* @internal Wire a direct `method(signal.value)` to this node.
|
|
1093
|
+
* Does not claim reads that happen later in a children function.
|
|
1094
|
+
*/
|
|
1095
|
+
adoptWire(signals: Subscribable<unknown>[], replay: () => void): void;
|
|
1096
|
+
/** @internal */
|
|
1097
|
+
runReplays(): void;
|
|
1098
|
+
translateX(value: Signal<number> | number): this;
|
|
1099
|
+
translateY(value: Signal<number> | number): this;
|
|
1100
|
+
scale(value: Signal<number> | number): this;
|
|
1101
|
+
rotate(degrees: Signal<number> | number): this;
|
|
1102
|
+
gesture(gesture: GestureBuilder): this;
|
|
1103
|
+
animation(config: Partial<AnimationOptions>): this;
|
|
1104
|
+
protected hasStateManagement(): boolean;
|
|
1105
|
+
className(className: string): this;
|
|
1106
|
+
classNames(classNames: string[]): this;
|
|
1107
|
+
css(styles: React$1.CSSProperties): this;
|
|
1108
|
+
style(style: React$1.CSSProperties): this;
|
|
1109
|
+
props(props: Record<string, any>): this;
|
|
1110
|
+
protected _transitionDuration: number;
|
|
1111
|
+
protected _transitionEasing: string;
|
|
1112
|
+
protected _transitionDelay: number;
|
|
1113
|
+
protected _transitionProperties: string[];
|
|
1114
|
+
/**
|
|
1115
|
+
* Apply CSS transition
|
|
1116
|
+
*
|
|
1117
|
+
* Overload 1: String syntax
|
|
1118
|
+
* Example: .transition('all 0.2s ease-in-out')
|
|
1119
|
+
*
|
|
1120
|
+
* Overload 2: Shorthand with parameters
|
|
1121
|
+
* Example: .transition('all', 200, 'ease-out')
|
|
1122
|
+
* Example: .transition('all', 200, 'ease-out', 50)
|
|
1123
|
+
*/
|
|
1124
|
+
transition(value: string): this;
|
|
1125
|
+
transition(properties: string | string[], duration: number, easing?: string, delay?: number): this;
|
|
1126
|
+
/**
|
|
1127
|
+
* Set transition duration in milliseconds
|
|
1128
|
+
* Example: .duration(200) → 200ms
|
|
1129
|
+
*/
|
|
1130
|
+
duration(ms: number): this;
|
|
1131
|
+
/**
|
|
1132
|
+
* Set transition easing function
|
|
1133
|
+
* Example: .easing('ease-in-out')
|
|
1134
|
+
*/
|
|
1135
|
+
easing(value: "linear" | "ease" | "ease-in" | "ease-out" | "ease-in-out" | "spring" | string): this;
|
|
1136
|
+
/** Alias of `.easing()`. `'spring'` becomes CSS `linear()`. */
|
|
1137
|
+
ease(value: string): this;
|
|
1138
|
+
/**
|
|
1139
|
+
* Set transition delay in milliseconds
|
|
1140
|
+
* Example: .delay(100) → 100ms delay
|
|
1141
|
+
*/
|
|
1142
|
+
delay(ms: number): this;
|
|
1143
|
+
/**
|
|
1144
|
+
* Set which properties to transition
|
|
1145
|
+
* Example: .properties(['color', 'transform'])
|
|
1146
|
+
*/
|
|
1147
|
+
properties(props: string[]): this;
|
|
1148
|
+
/**
|
|
1149
|
+
* Apply the built transition to the element
|
|
1150
|
+
*/
|
|
1151
|
+
protected _applyTransition(): void;
|
|
1152
|
+
private replaceTransitionClass;
|
|
1153
|
+
/**
|
|
1154
|
+
* CSS enter/exit preset. Compiles to `@keyframes` — no rAF.
|
|
1155
|
+
* @example Box().animate('fadeIn').duration(300).ease('spring')
|
|
1156
|
+
*/
|
|
1157
|
+
animate(preset: MotionPreset | string, options?: {
|
|
1158
|
+
duration?: number;
|
|
1159
|
+
ease?: string;
|
|
1160
|
+
delay?: number;
|
|
1161
|
+
from?: number | string;
|
|
1162
|
+
stiffness?: number;
|
|
1163
|
+
damping?: number;
|
|
1164
|
+
mass?: number;
|
|
1165
|
+
}): this;
|
|
1166
|
+
animate(custom: CustomMotion): this;
|
|
1167
|
+
/** CSS `linear()` spring. Works on `.animate()` and `.transition()` / `.hover()`. */
|
|
1168
|
+
spring(options?: SpringOptions): this;
|
|
1169
|
+
reducedMotion(mode?: "reduce" | "never"): this;
|
|
1170
|
+
press(callback?: (builder: PseudoStateBuilder) => void | PseudoStateBuilder): this;
|
|
1171
|
+
/**
|
|
1172
|
+
* Shortcut: `.hover(h => h.effect(name))`.
|
|
1173
|
+
* Named interaction effect on `:hover` (forward, float, grow, nudge, …).
|
|
1174
|
+
*/
|
|
1175
|
+
hoverEffect(name: string): this;
|
|
1176
|
+
/**
|
|
1177
|
+
* Shortcut: `.press(p => p.effect(name))` (maps to `:active`).
|
|
1178
|
+
*/
|
|
1179
|
+
pressEffect(name: string): this;
|
|
1180
|
+
/**
|
|
1181
|
+
* Shortcut: `.focus(f => f.effect(name))`.
|
|
1182
|
+
*/
|
|
1183
|
+
focusEffect(name: string): this;
|
|
1184
|
+
/**
|
|
1185
|
+
* Shortcut: `.active(a => a.effect(name))`.
|
|
1186
|
+
*/
|
|
1187
|
+
activeEffect(name: string): this;
|
|
1188
|
+
/**
|
|
1189
|
+
* Shortcut: `.groupHover(h => h.effect(name))`.
|
|
1190
|
+
*/
|
|
1191
|
+
groupHoverEffect(name: string): this;
|
|
1192
|
+
focusVisible(): PseudoStateBuilder;
|
|
1193
|
+
focusVisible(callback: PseudoStateFn): this;
|
|
1194
|
+
stagger(ms: number): this;
|
|
1195
|
+
/** Scroll-reveal: IntersectionObserver toggles `.fibo-inview`. */
|
|
1196
|
+
reveal(preset?: string | {
|
|
1197
|
+
preset?: string;
|
|
1198
|
+
once?: boolean;
|
|
1199
|
+
rootMargin?: string;
|
|
1200
|
+
threshold?: number;
|
|
1201
|
+
}, options?: {
|
|
1202
|
+
once?: boolean;
|
|
1203
|
+
rootMargin?: string;
|
|
1204
|
+
threshold?: number;
|
|
1205
|
+
}): this;
|
|
1206
|
+
/** Alias of `.reveal()` for scroll-triggered presets. */
|
|
1207
|
+
onScroll(preset?: string): this;
|
|
1208
|
+
/** CSS `animation-timeline: view()` / `scroll()`; IntersectionObserver reveal is the fallback. */
|
|
1209
|
+
scrollTimeline(kind?: "view" | "scroll"): this;
|
|
1210
|
+
scrollProgress(): this;
|
|
1211
|
+
smoothScroll(): this;
|
|
1212
|
+
scrollSnap(axis?: "x" | "y" | "both"): this;
|
|
1213
|
+
scrollSnapAlign(align?: "start" | "center" | "end"): this;
|
|
1214
|
+
sticky(top?: number | string | boolean): this;
|
|
1215
|
+
/**
|
|
1216
|
+
* Publish `--fibo-sticky-offset` on `:root` so `.anchor()` / `html` scroll-padding
|
|
1217
|
+
* clear this bar. Header uses the real bar height.
|
|
1218
|
+
*/
|
|
1219
|
+
protected publishStickyOffset(value: number | string): void;
|
|
1220
|
+
viewTransition(name: string): this;
|
|
1221
|
+
/** Default `:focus-visible` ring. Pass a callback to customize. */
|
|
1222
|
+
focusRing(color?: string): this;
|
|
1223
|
+
protected ensureInteractiveTransition(): void;
|
|
1224
|
+
/**
|
|
1225
|
+
* Prepare resting styles + transition so pseudo-state longhands (bg/border/transform)
|
|
1226
|
+
* interpolate instead of snapping. Safe to call repeatedly from PseudoStateBuilder.
|
|
1227
|
+
* @internal
|
|
1228
|
+
*/
|
|
1229
|
+
prepareSmoothInteraction(properties: string[]): void;
|
|
1230
|
+
/** @internal Convert inline background/border shorthands → longhands. */
|
|
1231
|
+
promoteSurfaceLonghands(): void;
|
|
1232
|
+
/** @internal Stamp translate3d(0,0,0) when no resting transform exists. */
|
|
1233
|
+
ensureRestTransform(): void;
|
|
1234
|
+
/**
|
|
1235
|
+
* Ensure the base element transitions the properties an interaction effect needs.
|
|
1236
|
+
* Expands an auto-managed transition; no-ops if the caller set `.transition(...)`
|
|
1237
|
+
* explicitly or a motion animation class is present.
|
|
1238
|
+
* @internal Used by PseudoStateBuilder.effect() and hover/press shortcuts.
|
|
1239
|
+
*/
|
|
1240
|
+
ensureEffectTransition(properties: string[]): void;
|
|
1241
|
+
/**
|
|
1242
|
+
* Apply a theme to this node and descendants (CSS vars inherit).
|
|
1243
|
+
* Fluent: `.theme("noir")` | `.theme(noirTheme)` | `.theme(extendTheme(webTheme, {…}))`.
|
|
1244
|
+
* SSR-safe: class + inline vars on first paint (no useEffect).
|
|
1245
|
+
*/
|
|
1246
|
+
theme(input: ThemeInput): this;
|
|
1247
|
+
/** Prefer dark/light system chrome for native controls under this subtree. */
|
|
1248
|
+
colorScheme(scheme: "light" | "dark" | "light dark"): this;
|
|
1249
|
+
hover(): PseudoStateBuilder;
|
|
1250
|
+
hover(callback: PseudoStateFn): this;
|
|
1251
|
+
/**
|
|
1252
|
+
* Paint for a `When` state. Hover / focus / active / visited / disabled
|
|
1253
|
+
* write a CSS pseudo on this node. `on` / `off` are for Checkbox and Switch.
|
|
1254
|
+
*
|
|
1255
|
+
* ```ts
|
|
1256
|
+
* Row().when(When.hover, (s) => s.bg('#c8ff00'))
|
|
1257
|
+
* ```
|
|
1258
|
+
*/
|
|
1259
|
+
when(state: When, style: WhenStyle): this;
|
|
1260
|
+
focus(): PseudoStateBuilder;
|
|
1261
|
+
focus(callback: PseudoStateFn): this;
|
|
1262
|
+
active(): PseudoStateBuilder;
|
|
1263
|
+
active(callback: PseudoStateFn): this;
|
|
1264
|
+
visited(): PseudoStateBuilder;
|
|
1265
|
+
visited(callback: PseudoStateFn): this;
|
|
1266
|
+
disabledState(): PseudoStateBuilder;
|
|
1267
|
+
disabledState(callback: PseudoStateFn): this;
|
|
1268
|
+
focusWithin(): PseudoStateBuilder;
|
|
1269
|
+
focusWithin(callback: PseudoStateFn): this;
|
|
1270
|
+
firstChild(): PseudoStateBuilder;
|
|
1271
|
+
firstChild(callback: PseudoStateFn): this;
|
|
1272
|
+
lastChild(): PseudoStateBuilder;
|
|
1273
|
+
lastChild(callback: PseudoStateFn): this;
|
|
1274
|
+
groupHover(): PseudoStateBuilder;
|
|
1275
|
+
groupHover(callback: PseudoStateFn): this;
|
|
1276
|
+
groupFocus(): PseudoStateBuilder;
|
|
1277
|
+
groupFocus(callback: PseudoStateFn): this;
|
|
1278
|
+
groupActive(): PseudoStateBuilder;
|
|
1279
|
+
groupActive(callback: PseudoStateFn): this;
|
|
1280
|
+
groupFocusWithin(): PseudoStateBuilder;
|
|
1281
|
+
groupFocusWithin(callback: PseudoStateFn): this;
|
|
1282
|
+
group(): this;
|
|
1283
|
+
protected _childFunction?: () => FiboChild | FiboChild[];
|
|
1284
|
+
children(children: FiboChildren): this;
|
|
1285
|
+
protected getClassName(): string;
|
|
1286
|
+
protected getStyle(): React$1.CSSProperties;
|
|
1287
|
+
protected processChildren(): React$1.ReactNode[];
|
|
1288
|
+
protected getChildFunction(): (() => FiboChild | FiboChild[]) | undefined;
|
|
1289
|
+
/**
|
|
1290
|
+
* @deprecated Builders are React elements. Returning or nesting the builder is enough.
|
|
1291
|
+
* `.build()` still assembles the host tree for older call sites.
|
|
1292
|
+
*/
|
|
1293
|
+
abstract build(): React$1.ReactElement;
|
|
1294
|
+
}
|
|
1295
|
+
type KnownKeys<T> = {
|
|
1296
|
+
[K in keyof T]: string extends K ? never : number extends K ? never : K;
|
|
1297
|
+
} extends {
|
|
1298
|
+
[_ in keyof T]: infer U;
|
|
1299
|
+
} ? U : never;
|
|
1300
|
+
type StyleBuilder<T> = T & LogicalAxes & {
|
|
1301
|
+
[K in KnownKeys<React$1.CSSProperties>]-?: (value: React$1.CSSProperties[K]) => StyleBuilder<T>;
|
|
1302
|
+
} & React$1.ReactElement;
|
|
1303
|
+
interface SignalLike<T> {
|
|
1304
|
+
value: T;
|
|
1305
|
+
subscribe: (listener: (val: T) => void) => () => void;
|
|
1306
|
+
}
|
|
1307
|
+
declare class FluentValueBuilder<T> {
|
|
1308
|
+
private _signal;
|
|
1309
|
+
private _loading?;
|
|
1310
|
+
private _error?;
|
|
1311
|
+
private _builder?;
|
|
1312
|
+
constructor(_signal: SignalLike<T>);
|
|
1313
|
+
loading(component: React$1.ReactNode | (() => React$1.ReactNode)): this;
|
|
1314
|
+
error(component: (error: Error | unknown) => React$1.ReactNode): this;
|
|
1315
|
+
builder(fn: (value: T) => React$1.ReactNode): this;
|
|
1316
|
+
children(fn: (value: T) => React$1.ReactNode): this;
|
|
1317
|
+
build(): React$1.ReactElement;
|
|
1318
|
+
}
|
|
1319
|
+
export declare function ValueBuilder<T>(signal: SignalLike<T>): FluentValueBuilder<T>;
|
|
1320
|
+
type PresenceShow = boolean | BindableSignal<boolean>;
|
|
1321
|
+
interface PresenceProps {
|
|
1322
|
+
show: PresenceShow;
|
|
1323
|
+
enter?: MotionPreset | string;
|
|
1324
|
+
exit?: MotionPreset | string;
|
|
1325
|
+
duration?: number;
|
|
1326
|
+
reducedMotion?: "reduce" | "never";
|
|
1327
|
+
children?: React$1.ReactNode;
|
|
1328
|
+
}
|
|
1329
|
+
declare class PresenceBuilder extends FiboBuilder {
|
|
1330
|
+
private _show;
|
|
1331
|
+
private _enter;
|
|
1332
|
+
private _exit;
|
|
1333
|
+
constructor(show?: PresenceShow);
|
|
1334
|
+
show(value: PresenceShow): this;
|
|
1335
|
+
enter(preset: MotionPreset | string): this;
|
|
1336
|
+
exit(preset: MotionPreset | string): this;
|
|
1337
|
+
duration(ms: number): this;
|
|
1338
|
+
build(): React$1.ReactElement;
|
|
1339
|
+
}
|
|
1340
|
+
declare const presenceBuilder: (show?: PresenceShow | undefined) => StyleBuilder<PresenceBuilder>;
|
|
1341
|
+
export declare function Presence(show?: PresenceShow): ReturnType<typeof presenceBuilder>;
|
|
1342
|
+
export declare function Presence(props: PresenceProps): React$1.ReactElement;
|
|
1343
|
+
export declare namespace Presence {
|
|
1344
|
+
var displayName: string;
|
|
1345
|
+
}
|
|
1346
|
+
interface RevealProps {
|
|
1347
|
+
preset?: string;
|
|
1348
|
+
once?: boolean;
|
|
1349
|
+
rootMargin?: string;
|
|
1350
|
+
threshold?: number;
|
|
1351
|
+
forceMotion?: boolean;
|
|
1352
|
+
/** @deprecated Ignored — view-timeline never skips IO (was forcing fibo-inview on load). */
|
|
1353
|
+
preferTimeline?: boolean;
|
|
1354
|
+
/** CSS vars (`--fibo-dur`, `--fibo-ease`, `--fibo-delay`) for the reveal wrapper. */
|
|
1355
|
+
style?: React$1.CSSProperties;
|
|
1356
|
+
children?: React$1.ReactNode;
|
|
1357
|
+
}
|
|
1358
|
+
/** IntersectionObserver toggles `.fibo-inview`. Motion is CSS — no rAF. */
|
|
1359
|
+
export declare function Reveal({ preset, once, rootMargin, threshold, forceMotion, style, children, }: RevealProps): React$1.DetailedReactHTMLElement<{
|
|
1360
|
+
ref: React$1.RefObject<HTMLDivElement>;
|
|
1361
|
+
className: string;
|
|
1362
|
+
style: React$1.CSSProperties | undefined;
|
|
1363
|
+
"data-fibo-reveal": string;
|
|
1364
|
+
}, HTMLDivElement>;
|
|
1365
|
+
interface ScrollProgressProps {
|
|
1366
|
+
children: React$1.ReactElement;
|
|
1367
|
+
}
|
|
1368
|
+
/** Binds `--fibo-progress` from scroll when `animation-timeline: scroll()` is missing. No rAF. */
|
|
1369
|
+
export declare function ScrollProgress({ children }: ScrollProgressProps): React$1.DetailedReactHTMLElement<{
|
|
1370
|
+
ref: React$1.RefObject<HTMLDivElement>;
|
|
1371
|
+
"data-fibo-scroll-progress": string;
|
|
1372
|
+
style: {
|
|
1373
|
+
display: "contents";
|
|
1374
|
+
};
|
|
1375
|
+
}, HTMLDivElement>;
|
|
1376
|
+
type ScrollToOptions$1 = {
|
|
1377
|
+
behavior?: ScrollBehavior;
|
|
1378
|
+
block?: ScrollLogicalPosition;
|
|
1379
|
+
/** Also set `location.hash` (in-page anchor navigation). */
|
|
1380
|
+
hash?: boolean;
|
|
1381
|
+
};
|
|
1382
|
+
/**
|
|
1383
|
+
* Smooth-scroll to an element id / selector / Element.
|
|
1384
|
+
* Pass `hash: true` to update the URL hash (replaces the old site-only `goHash`).
|
|
1385
|
+
*/
|
|
1386
|
+
declare function scrollTo$1(target: string | Element, options?: ScrollToOptions$1): void;
|
|
1387
|
+
export declare function startViewTransition(update: () => void): void;
|
|
1388
|
+
export declare function supportsViewTimeline(): boolean;
|
|
1389
|
+
export declare function supportsScrollTimeline(): boolean;
|
|
1390
|
+
/**
|
|
1391
|
+
* AUTO-GENERATED by scripts/gen-interaction-fx.mjs — do not edit by hand.
|
|
1392
|
+
* Fiboui-owned interaction effects (Hover.css–inspired names, not a vendor dump).
|
|
1393
|
+
*/
|
|
1394
|
+
export declare const FIBO_INTERACTION_FX_CSS: string;
|
|
1395
|
+
/**
|
|
1396
|
+
* Inject the full interaction-effect sheet once.
|
|
1397
|
+
* Idempotent via StyleManager cache — must NOT use a module flag, or
|
|
1398
|
+
* `endSsrRequest()` / `StyleManager.reset()` would skip re-injection on the
|
|
1399
|
+
* next SSR request and drop FX CSS from the snapshot.
|
|
1400
|
+
*/
|
|
1401
|
+
export declare function ensureInteractionFxCss(): void;
|
|
1402
|
+
export declare function getMotionCss(): string;
|
|
1403
|
+
export declare function getCss(): string;
|
|
1404
|
+
/** `<style id="fibo-dynamic-styles">` HTML. Call **after** `renderToString` so rules are collected. */
|
|
1405
|
+
export declare function getStyleTag(): string;
|
|
1406
|
+
/**
|
|
1407
|
+
* Reset the StyleManager singleton between SSR requests (Next.js / custom servers).
|
|
1408
|
+
* Call after the response CSS has been captured when using `<FiboStyles />` mid-tree.
|
|
1409
|
+
*/
|
|
1410
|
+
export declare function endSsrRequest(): void;
|
|
1411
|
+
/**
|
|
1412
|
+
* Inject collected CSS into a document. Place as a **later sibling** of the app
|
|
1413
|
+
* so registrations from children run first during SSR.
|
|
1414
|
+
*/
|
|
1415
|
+
export declare function FiboStyles(): React$1.ReactElement;
|
|
1416
|
+
export declare function MotionStyles(): React$1.ReactElement;
|
|
1417
|
+
export type FiboPageBuild = () => FiboChild | React$1.ReactNode;
|
|
1418
|
+
type FiboPageMeta = {
|
|
1419
|
+
title?: string;
|
|
1420
|
+
description?: string;
|
|
1421
|
+
};
|
|
1422
|
+
export type FiboPageOptions = {
|
|
1423
|
+
/** Append `<FiboStyles />` after the tree (SSR dynamic CSS). Default true. */
|
|
1424
|
+
styles?: boolean;
|
|
1425
|
+
/** SSR `<title>` / `<meta name="description">` (React 19 hoists into `<head>`). */
|
|
1426
|
+
meta?: FiboPageMeta;
|
|
1427
|
+
};
|
|
1428
|
+
type FiboPageComponent = React$1.ComponentType & {
|
|
1429
|
+
meta?: FiboPageMeta;
|
|
1430
|
+
};
|
|
1431
|
+
/**
|
|
1432
|
+
* Next/Vite page helper — **zero JSX** in app code, SSR-safe.
|
|
1433
|
+
*
|
|
1434
|
+
* Next App Router still SSRs Client Components: HTML is rendered on the server,
|
|
1435
|
+
* then hydrated. Import `fiboui/style.css` once from `app/layout.tsx` (or the
|
|
1436
|
+
* Vite entry) so the base sheet is in the document on first paint.
|
|
1437
|
+
*
|
|
1438
|
+
* ```ts
|
|
1439
|
+
* // app/page.tsx — Server Component (no 'use client')
|
|
1440
|
+
* import { page, Column, Text } from 'fiboui'
|
|
1441
|
+
*
|
|
1442
|
+
* export default page(() =>
|
|
1443
|
+
* Column().gap(12).children([Text('Hello')])
|
|
1444
|
+
* )
|
|
1445
|
+
* ```
|
|
1446
|
+
*
|
|
1447
|
+
* App Router resolves `fiboui` via the `react-server` export (static builders).
|
|
1448
|
+
* `build()` runs during RSC render so StyleManager rules exist before `<FiboStyles />`.
|
|
1449
|
+
*/
|
|
1450
|
+
export declare function page(build: FiboPageBuild, options?: FiboPageOptions): FiboPageComponent;
|
|
1451
|
+
/**
|
|
1452
|
+
* Alias of `page()`. Prefer `export default page(() => …)` from a Server Component.
|
|
1453
|
+
*/
|
|
1454
|
+
export declare const createPage: typeof page;
|
|
1455
|
+
/**
|
|
1456
|
+
* Wrap any builder / node with `FiboStyles` without JSX.
|
|
1457
|
+
*
|
|
1458
|
+
* ```ts
|
|
1459
|
+
* export default function Home() {
|
|
1460
|
+
* return withFiboStyles(Column().children([Text('Hi')]))
|
|
1461
|
+
* }
|
|
1462
|
+
* ```
|
|
1463
|
+
*/
|
|
1464
|
+
export declare function withFiboStyles(child: FiboChild | React$1.ReactNode): React$1.ReactElement;
|
|
1465
|
+
type Constructor<T = any> = new (...args: any[]) => T;
|
|
1466
|
+
type Factory<T = any> = () => T;
|
|
1467
|
+
type Provider<T = any> = Constructor<T> | Factory<T> | T;
|
|
1468
|
+
type Token<T = any> = string | symbol | Constructor<T>;
|
|
1469
|
+
interface RouteDefinition {
|
|
1470
|
+
path: string;
|
|
1471
|
+
component: () => FiboBuilder;
|
|
1472
|
+
meta?: Record<string, any>;
|
|
1473
|
+
}
|
|
1474
|
+
interface SidebarConfig {
|
|
1475
|
+
label: string;
|
|
1476
|
+
icon?: any;
|
|
1477
|
+
path: string;
|
|
1478
|
+
order?: number;
|
|
1479
|
+
}
|
|
1480
|
+
interface FiboContext {
|
|
1481
|
+
registerService<T>(token: Token<T>, implementation: Provider<T>): void;
|
|
1482
|
+
registerStore(store: unknown, name?: string): void;
|
|
1483
|
+
getStore?<T = unknown>(name: string): T | undefined;
|
|
1484
|
+
registerRoute(route: RouteDefinition): void;
|
|
1485
|
+
registerSidebarItem(item: SidebarConfig): void;
|
|
1486
|
+
registerTopbarAction(component: () => FiboBuilder): void;
|
|
1487
|
+
registerOverlay(component: () => FiboBuilder): void;
|
|
1488
|
+
}
|
|
1489
|
+
type PluginSetup = (context: FiboContext) => void;
|
|
1490
|
+
interface FiboPlugin {
|
|
1491
|
+
name: string;
|
|
1492
|
+
version?: string;
|
|
1493
|
+
setup: PluginSetup;
|
|
1494
|
+
teardown?: PluginSetup;
|
|
1495
|
+
}
|
|
1496
|
+
export declare class FiboAppBuilder {
|
|
1497
|
+
private _rootComponent;
|
|
1498
|
+
private _rootElement;
|
|
1499
|
+
private _plugins;
|
|
1500
|
+
private _reactRoot;
|
|
1501
|
+
private _installed;
|
|
1502
|
+
use(plugin: FiboPlugin): this;
|
|
1503
|
+
plugins(pluginsList: FiboPlugin[]): this;
|
|
1504
|
+
root(component: React$1.ComponentType): this;
|
|
1505
|
+
mount(elementId: string, options?: {
|
|
1506
|
+
strict?: boolean;
|
|
1507
|
+
}): () => void;
|
|
1508
|
+
unmount(): void;
|
|
1509
|
+
private build;
|
|
1510
|
+
}
|
|
1511
|
+
export declare const FiboApp: () => FiboAppBuilder;
|
|
1512
|
+
/** Turn a builder (or already-built node) into a React node. */
|
|
1513
|
+
export declare function toElement(node: FiboChild): React$1.ReactNode;
|
|
1514
|
+
/**
|
|
1515
|
+
* Optional wrapper. Builders are already React elements:
|
|
1516
|
+
*
|
|
1517
|
+
* ```tsx
|
|
1518
|
+
* function App() {
|
|
1519
|
+
* return Button('Save').onPress(save);
|
|
1520
|
+
* }
|
|
1521
|
+
* ```
|
|
1522
|
+
*/
|
|
1523
|
+
export declare function Fibo({ children }: {
|
|
1524
|
+
children: FiboChild;
|
|
1525
|
+
}): React$1.ReactElement;
|
|
1526
|
+
/**
|
|
1527
|
+
* Mount a page that returns a builder — no `.build()` on the root.
|
|
1528
|
+
*
|
|
1529
|
+
* ```ts
|
|
1530
|
+
* function App() {
|
|
1531
|
+
* return Column().children([Text('Hi')]);
|
|
1532
|
+
* }
|
|
1533
|
+
* mount('#root', App);
|
|
1534
|
+
* ```
|
|
1535
|
+
*/
|
|
1536
|
+
export declare function mount(target: string | Element, app: (() => FiboChild) | FiboChild, options?: {
|
|
1537
|
+
strict?: boolean;
|
|
1538
|
+
}): Root;
|
|
1539
|
+
|
|
1540
|
+
export {
|
|
1541
|
+
Store as ReactiveStore,
|
|
1542
|
+
scrollTo$1 as scrollTo,
|
|
1543
|
+
};
|
|
1544
|
+
|
|
1545
|
+
export {};
|