fiboui 2.9.1 → 2.9.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.
@@ -2,10 +2,10 @@ var nt = Object.defineProperty;
2
2
  var et = (n, i, t) => i in n ? nt(n, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[i] = t;
3
3
  var d = (n, i, t) => et(n, typeof i != "symbol" ? i + "" : i, t);
4
4
  import h from "react";
5
- import { b2 as T, b3 as B, b7 as $, b6 as m, b9 as z, bu as _, bv as E, bw as b, bx as rt, bd as ot, by as st, bz as lt } from "./client-3NdKI2xE.js";
5
+ import { b2 as T, b3 as B, b7 as $, b6 as m, b9 as A, bv as _, bw as E, bx as b, by as rt, be as ot, bz as st, bA as lt } from "./client-Cc87LXic.js";
6
6
  function at(n, i) {
7
7
  if (!(typeof i != "string" || !m(i)))
8
- for (const t of z(i))
8
+ for (const t of A(i))
9
9
  n.bindSignal(t);
10
10
  }
11
11
  function L(n, i) {
@@ -68,7 +68,7 @@ class ut extends B {
68
68
  const qt = T(ut);
69
69
  function pt(n, i) {
70
70
  if (!(typeof i != "string" || !m(i)))
71
- for (const t of z(i))
71
+ for (const t of A(i))
72
72
  n.bindSignal(t);
73
73
  }
74
74
  function N(n, i) {
@@ -127,7 +127,7 @@ function _t(n) {
127
127
  const i = n.trim().toLowerCase();
128
128
  return !bt.test(i) || yt.has(i) ? "div" : i;
129
129
  }
130
- function A(n, i) {
130
+ function z(n, i) {
131
131
  const t = `fibo-${i}-`;
132
132
  return n.some((e) => e.startsWith(t));
133
133
  }
@@ -163,18 +163,18 @@ function wt(n, i) {
163
163
  t.paddingLeft = v(t.paddingLeft, "left"), t.paddingRight = v(t.paddingRight, "right"), e && (t.paddingTop = v(t.paddingTop, "top")), r && (t.paddingBottom = v(t.paddingBottom, "bottom"));
164
164
  }
165
165
  function vt(n, i, t, e) {
166
- const r = n, o = r.width != null || e.has("width") || A(t, "width");
166
+ const r = n, o = r.width != null || e.has("width") || z(t, "width");
167
167
  if (i) {
168
168
  o || (r.width = "auto");
169
169
  return;
170
170
  }
171
171
  o || (r.width = "100%");
172
- const s = r.margin != null && r.margin !== "", l = s || r.marginLeft != null || r.marginInlineStart != null || e.has("margin-left") || A(t, "margin-left"), a = s || r.marginRight != null || r.marginInlineEnd != null || e.has("margin-right") || A(t, "margin-right");
172
+ const s = r.margin != null && r.margin !== "", l = s || r.marginLeft != null || r.marginInlineStart != null || e.has("margin-left") || z(t, "margin-left"), a = s || r.marginRight != null || r.marginInlineEnd != null || e.has("margin-right") || z(t, "margin-right");
173
173
  l || (r.marginLeft = "auto"), a || (r.marginRight = "auto");
174
174
  }
175
175
  function Ct(n, i, t, e, r, o, s) {
176
176
  const l = i ? rt({ ...n, ...i }) : { ...n }, a = St(l, o);
177
- return !(a.maxWidth != null || A(r, "max-width") || o.has("max-width")) && t != null && t !== "" && (a.maxWidth = _("maxWidth", t)), vt(a, e, r, o), wt(a, s), a;
177
+ return !(a.maxWidth != null || z(r, "max-width") || o.has("max-width")) && t != null && t !== "" && (a.maxWidth = _("maxWidth", t)), vt(a, e, r, o), wt(a, s), a;
178
178
  }
179
179
  class Tt extends B {
180
180
  constructor() {
@@ -278,7 +278,7 @@ function M(n) {
278
278
  }
279
279
  function Bt(n, i) {
280
280
  if (!(typeof i != "string" || !m(i)))
281
- for (const t of z(i))
281
+ for (const t of A(i))
282
282
  n.bindSignal(t);
283
283
  }
284
284
  function I(n, i) {
@@ -299,11 +299,11 @@ function I(n, i) {
299
299
  function $t(n) {
300
300
  return typeof n == "string" && m(n) ? $(n) : n;
301
301
  }
302
- function zt(n, i) {
302
+ function At(n, i) {
303
303
  const { children: t, ...e } = i, r = t !== void 0 ? t : n;
304
304
  return { nodes: r == null ? [] : Array.isArray(r) ? r : [r], rest: e };
305
305
  }
306
- function At(n, i, t) {
306
+ function zt(n, i, t) {
307
307
  if (n == null || typeof n == "boolean") return null;
308
308
  const e = i === 0, r = st(t);
309
309
  return e ? h.createElement(
@@ -403,7 +403,7 @@ class Lt extends B {
403
403
  ...this._classNames
404
404
  ], r = this.getStyle();
405
405
  r.overflow == null && (r.overflow = "hidden"), this._baseFixedFrame ? (r.width == null && (r.width = `${this._baseFixedFrame.width}px`), r.height == null && (r.height = `${this._baseFixedFrame.height}px`)) : t && r.height == null && r.minHeight == null && (r.height = "fit-content");
406
- const { nodes: o, rest: s } = zt(this.processChildren(), this._props), { className: l, ...a } = s, f = [...e, l].filter(Boolean).join(" "), g = o.map($t).map((p, c) => At(p, c, this._alignment));
406
+ const { nodes: o, rest: s } = At(this.processChildren(), this._props), { className: l, ...a } = s, f = [...e, l].filter(Boolean).join(" "), g = o.map($t).map((p, c) => zt(p, c, this._alignment));
407
407
  return h.createElement(
408
408
  "div",
409
409
  {
@@ -418,7 +418,7 @@ class Lt extends B {
418
418
  const Jt = T(Lt);
419
419
  function Nt(n, i) {
420
420
  if (!(typeof i != "string" || !m(i)))
421
- for (const t of z(i))
421
+ for (const t of A(i))
422
422
  n.bindSignal(t);
423
423
  }
424
424
  function H(n, i) {
@@ -594,7 +594,7 @@ function X(n) {
594
594
  }
595
595
  function jt(n, i) {
596
596
  if (!(typeof i != "string" || !m(i)))
597
- for (const t of z(i))
597
+ for (const t of A(i))
598
598
  n.bindSignal(t);
599
599
  }
600
600
  function R(n, i) {
package/dist/index.d.ts CHANGED
@@ -1726,6 +1726,34 @@ export declare function applyEdgeSet(set: EdgeSet, value: number | string): {
1726
1726
  bottom?: number | string;
1727
1727
  left?: number | string;
1728
1728
  };
1729
+ /**
1730
+ * SwiftUI `Material` — glass fills for `.material(Material.ultraThin)`.
1731
+ * Light translucent defaults; pair with `.theme('noir')` / dark bg as needed.
1732
+ */
1733
+ export declare const Material: {
1734
+ readonly ultraThin: {
1735
+ readonly blur: 20;
1736
+ readonly background: "rgba(255, 255, 255, 0.35)";
1737
+ };
1738
+ readonly thin: {
1739
+ readonly blur: 28;
1740
+ readonly background: "rgba(255, 255, 255, 0.48)";
1741
+ };
1742
+ readonly regular: {
1743
+ readonly blur: 36;
1744
+ readonly background: "rgba(255, 255, 255, 0.62)";
1745
+ };
1746
+ readonly thick: {
1747
+ readonly blur: 48;
1748
+ readonly background: "rgba(255, 255, 255, 0.78)";
1749
+ };
1750
+ readonly ultraThick: {
1751
+ readonly blur: 60;
1752
+ readonly background: "rgba(255, 255, 255, 0.88)";
1753
+ };
1754
+ };
1755
+ export type MaterialKind = keyof typeof Material;
1756
+ export type MaterialSpec = (typeof Material)[MaterialKind];
1729
1757
  export type SafeAreaInsetEdge = Edge | "top" | "bottom" | "leading" | "trailing" | "left" | "right";
1730
1758
  export type SafeAreaInsetSpec = {
1731
1759
  edge: SafeAreaInsetEdge;
@@ -2239,6 +2267,16 @@ declare abstract class FiboBuilder {
2239
2267
  text(color: string | Colors): this;
2240
2268
  color(value: string | Colors): this;
2241
2269
  private resolveSemanticColor;
2270
+ /**
2271
+ * Backdrop blur (glass). Prefer over raw `.backdropFilter('blur(…)')`.
2272
+ * `20` → `blur(20px)`; also accepts `'20px'` or a full `blur(…)` string.
2273
+ */
2274
+ backdropBlur(radius?: number | string): this;
2275
+ /**
2276
+ * SwiftUI `Material` glass fill — blur + translucent background.
2277
+ * `Box().material(Material.ultraThin)` or `.material('regular')`.
2278
+ */
2279
+ material(kind: MaterialKind | MaterialSpec): this;
2242
2280
  shadow(config?: ShadowConfig): this;
2243
2281
  /**
2244
2282
  * Breakpoint styles compiled to CSS `@media` (same engine as `.md()`).
@@ -3055,6 +3093,11 @@ declare class ColumnBuilder extends FiboBuilder {
3055
3093
  alignY(alignment: AlignAxis): this;
3056
3094
  spacing(value: string | number): this;
3057
3095
  size(size: "small" | "medium" | "large"): this;
3096
+ /**
3097
+ * Sugar for `.children(ForEach(data).renderItem(fn))`.
3098
+ * Prefer `ForEach` when you need `.keyBy()`.
3099
+ */
3100
+ forEach<T>(items: T[] | readonly T[], renderItem: (item: T, index: number) => unknown): this;
3058
3101
  build(): React$1.ReactElement;
3059
3102
  }
3060
3103
  export declare const Column: () => StyleBuilder<ColumnBuilder>;
@@ -3087,6 +3130,11 @@ declare class RowBuilder extends FiboBuilder {
3087
3130
  alignY(alignment: AlignAxis): this;
3088
3131
  spacing(value: string | number): this;
3089
3132
  items(children: React$1.ReactElement[]): this;
3133
+ /**
3134
+ * Sugar for `.children(ForEach(data).renderItem(fn))`.
3135
+ * Prefer `ForEach` when you need `.keyBy()`.
3136
+ */
3137
+ forEach<T>(items: T[] | readonly T[], renderItem: (item: T, index: number) => unknown): this;
3090
3138
  build(): React$1.ReactElement;
3091
3139
  }
3092
3140
  export declare const Row: () => StyleBuilder<RowBuilder>;
@@ -3129,6 +3177,13 @@ interface ScaffoldStructure {
3129
3177
  height?: string | number;
3130
3178
  visible?: boolean;
3131
3179
  };
3180
+ /** Flutter `Scaffold.bottomNavigationBar` chrome metrics. */
3181
+ bottomAppBar?: {
3182
+ position?: "static" | "sticky" | "fixed";
3183
+ height?: string | number;
3184
+ visible?: boolean;
3185
+ };
3186
+ /** @deprecated Use `bottomAppBar`. */
3132
3187
  footer?: {
3133
3188
  position?: "static" | "sticky" | "fixed";
3134
3189
  height?: string | number;
@@ -3154,7 +3209,7 @@ declare class ScaffoldBuilder extends FiboBuilder {
3154
3209
  private _customProviders;
3155
3210
  private _structure;
3156
3211
  private _headerBar?;
3157
- private _footerBar?;
3212
+ private _bottomAppBar?;
3158
3213
  private _sideBarLeft?;
3159
3214
  private _sideBarRight?;
3160
3215
  private _drawer?;
@@ -3183,7 +3238,13 @@ declare class ScaffoldBuilder extends FiboBuilder {
3183
3238
  * set, this is a no-op (explicit chrome wins).
3184
3239
  */
3185
3240
  navigationTitle(title: string | FiboChild): this;
3186
- footerBar(config: FiboChild | LayoutBarConfig): this;
3241
+ /**
3242
+ * Flutter `Scaffold.bottomNavigationBar` — typically a {@link BottomAppBar}
3243
+ * (same three zones as `AppBar`) or a `TabView` / `BottomBar` strip.
3244
+ */
3245
+ bottomAppBar(config: FiboChild | LayoutBarConfig): this;
3246
+ /** Flutter alias of `.bottomAppBar()`. */
3247
+ bottomNavigationBar(config: FiboChild | LayoutBarConfig): this;
3187
3248
  sideBarLeft(config: FiboChild | LayoutBarConfig): this;
3188
3249
  sideBarRight(config: FiboChild | LayoutBarConfig): this;
3189
3250
  /** Flutter drawer. Starts closed. Open it with `useScaffold().openDrawer()`. */
@@ -3212,7 +3273,7 @@ declare class ScaffoldBuilder extends FiboBuilder {
3212
3273
  build(): React$1.ReactElement;
3213
3274
  }
3214
3275
  export declare const Scaffold: () => StyleBuilder<ScaffoldBuilder>;
3215
- /** Where a toolbar item sits. Same three slots as Flutter's NavigationToolbar and SwiftUI's top bar. */
3276
+ /** Where a toolbar item sits. Flutter NavigationToolbar / SwiftUI top·bottom bar. */
3216
3277
  export type ToolbarPlace = "leading" | "principal" | "trailing";
3217
3278
  declare class ToolbarItemBuilder extends FiboBuilder {
3218
3279
  private _place;
@@ -3220,11 +3281,11 @@ declare class ToolbarItemBuilder extends FiboBuilder {
3220
3281
  private _onPress?;
3221
3282
  private _drawer?;
3222
3283
  private _disabled;
3223
- /** SwiftUI `.topBarLeading`. Flutter `AppBar.leading`. */
3284
+ /** SwiftUI `.topBarLeading` / `.bottomBar` leading. Flutter `AppBar.leading`. */
3224
3285
  leading(): this;
3225
- /** SwiftUI `.principal`. Flutter `AppBar.title`. */
3286
+ /** SwiftUI `.principal`. Flutter `AppBar.title` / center slot. */
3226
3287
  principal(): this;
3227
- /** SwiftUI `.topBarTrailing`. Flutter `AppBar.actions`. */
3288
+ /** SwiftUI `.topBarTrailing` / bottom trailing. Flutter `AppBar.actions`. */
3228
3289
  trailing(): this;
3229
3290
  at(place: ToolbarPlace): this;
3230
3291
  /** Hover label and accessible name. Flutter `tooltip`. */
@@ -3253,6 +3314,19 @@ declare class AppBarBuilder extends FiboBuilder {
3253
3314
  }
3254
3315
  export declare const ToolbarItem: () => StyleBuilder<ToolbarItemBuilder>;
3255
3316
  export declare const AppBar: () => StyleBuilder<AppBarBuilder>;
3317
+ declare class BottomAppBarBuilder extends FiboBuilder {
3318
+ private _items;
3319
+ private _floating;
3320
+ /** Same contract as `AppBar().items` — zone via `ToolbarItem` place. */
3321
+ items(children: FiboChildren): this;
3322
+ /**
3323
+ * iOS-style floating capsule — inset from edges, rounded, shadow.
3324
+ * Pair with `.resetStyle().material(Material.ultraThin)` for glass.
3325
+ */
3326
+ floating(value?: boolean): this;
3327
+ build(): React$1.ReactElement;
3328
+ }
3329
+ export declare const BottomAppBar: () => StyleBuilder<BottomAppBarBuilder>;
3256
3330
  declare class HeaderBuilder extends FiboBuilder {
3257
3331
  private _height;
3258
3332
  private _sticky;
@@ -3368,6 +3442,27 @@ declare class LineBuilder extends FiboBuilder {
3368
3442
  build(): React$1.ReactElement;
3369
3443
  }
3370
3444
  export declare const Line: () => StyleBuilder<LineBuilder>;
3445
+ declare class DividerBuilder extends FiboBuilder {
3446
+ private _thickness;
3447
+ private _indent;
3448
+ private _endIndent;
3449
+ private _color;
3450
+ private _height?;
3451
+ /** Flutter `Divider.thickness` — painted line width in px. */
3452
+ thickness(value: number): this;
3453
+ /** Flutter `Divider.height` — outer box height (line is centered when taller). */
3454
+ height(value: number | string): this;
3455
+ /** Flutter `Divider.indent` — leading inset. */
3456
+ indent(value: number): this;
3457
+ /** Flutter `Divider.endIndent` — trailing inset. */
3458
+ endIndent(value: number): this;
3459
+ /** Flutter `Divider.color`. */
3460
+ color(value: string): this;
3461
+ build(): React$1.ReactElement;
3462
+ }
3463
+ export declare const Divider: () => StyleBuilder<DividerBuilder>;
3464
+ /** SwiftUI / common alias — same builder as {@link Divider}. */
3465
+ export declare const Separator: () => StyleBuilder<DividerBuilder>;
3371
3466
  /** Flutter-style handle for a mounted ScrollView — no document.querySelector. */
3372
3467
  export declare class ScrollController {
3373
3468
  private _node;
@@ -4994,6 +5089,7 @@ declare class ListItemStyleBuilder extends CssStyleStore {
4994
5089
  style(extra: React$1.CSSProperties): this;
4995
5090
  }
4996
5091
  type ListVariant$1 = "default" | "card" | "floating";
5092
+ type ListSeparator = boolean | FiboChild | ((index: number) => FiboChild);
4997
5093
  declare class ListBuilder<T = any> extends FiboBuilder {
4998
5094
  private _items;
4999
5095
  /** Plain `signal(array)`. Read on each rebuild. */
@@ -5003,6 +5099,7 @@ declare class ListBuilder<T = any> extends FiboBuilder {
5003
5099
  private _renderItem?;
5004
5100
  private _onItemPress?;
5005
5101
  private _variant;
5102
+ /** Flutter `ListView.separated` — see {@link ListBuilder.separator}. */
5006
5103
  private _separator;
5007
5104
  private _onEndReached?;
5008
5105
  private _loading;
@@ -5063,7 +5160,26 @@ declare class ListBuilder<T = any> extends FiboBuilder {
5063
5160
  */
5064
5161
  empty(content: FiboChild | (() => FiboChild)): this;
5065
5162
  variant(variant: ListVariant$1): this;
5066
- separator(show?: boolean): this;
5163
+ /**
5164
+ * Flutter `ListView.separated` — paint a widget **between** rows only
5165
+ * (never before the first or after the last). The value itself is the build:
5166
+ *
5167
+ * ```ts
5168
+ * // default Material hairline (Divider)
5169
+ * List().items(rows).separator().renderItem(…)
5170
+ *
5171
+ * // fixed custom separator (any builder / node)
5172
+ * List().items(rows).separator(Divider().indent(16).color('#ccc'))
5173
+ * List().items(rows).separator(Text('·').alignX('center'))
5174
+ * List().items(rows).separator(Row().gap(8).children([Line(), Text('OR'), Line()]))
5175
+ *
5176
+ * // build each gap — index is 0 … itemCount-2
5177
+ * List().items(rows).separator((i) =>
5178
+ * i === 2 ? Text('Section') : Divider().indent(16)
5179
+ * )
5180
+ * ```
5181
+ */
5182
+ separator(value?: ListSeparator): this;
5067
5183
  onEndReached(handler: () => void): this;
5068
5184
  loading(isLoading: boolean): this;
5069
5185
  threshold(value: number): this;
@@ -5096,6 +5212,29 @@ declare class ListBuilder<T = any> extends FiboBuilder {
5096
5212
  build(): React$1.ReactElement;
5097
5213
  }
5098
5214
  export declare const List: <T = any>() => StyleBuilder<ListBuilder<T>>;
5215
+ export type ForEachSource<T> = readonly T[] | T[] | (() => readonly T[] | T[]) | BindableSignal<readonly T[] | T[]>;
5216
+ declare class ForEachBuilder<T = unknown> extends FiboBuilder {
5217
+ private _source?;
5218
+ private _renderItem?;
5219
+ private _keyBy?;
5220
+ constructor(source?: ForEachSource<T>, renderItem?: (item: T, index: number) => unknown);
5221
+ /** Data: array, `() => array`, or bindable / `listSignal` (read `.value` at build). */
5222
+ items(source: ForEachSource<T>): this;
5223
+ /** Factory per item — same idea as `List.renderItem`. */
5224
+ renderItem(fn: (item: T, index: number) => unknown): this;
5225
+ /**
5226
+ * Stable React key per item.
5227
+ * Defaults to `id` / `_id` / `key` on objects, else index.
5228
+ * (Not `.id()` — that sets the host HTML id on `FiboBuilder`.)
5229
+ */
5230
+ keyBy(fn: (item: T, index: number) => string | number): this;
5231
+ build(): React$1.ReactElement;
5232
+ }
5233
+ export declare const ForEach: <T = unknown>(source?: ForEachSource<T> | undefined, renderItem?: ((item: T, index: number) => unknown) | undefined) => StyleBuilder<ForEachBuilder<T>>;
5234
+ declare class GroupBuilder extends FiboBuilder {
5235
+ build(): React$1.ReactElement;
5236
+ }
5237
+ export declare const Group: () => StyleBuilder<GroupBuilder>;
5099
5238
  declare class SectionBuilder extends FiboBuilder {
5100
5239
  private _header?;
5101
5240
  private _footer?;
@@ -5859,14 +5998,31 @@ interface TabViewTab {
5859
5998
  value: string;
5860
5999
  label: React$1.ReactNode;
5861
6000
  child?: React$1.ReactNode;
6001
+ icon?: React$1.ReactNode;
5862
6002
  }
6003
+ type TabBarPosition = "top" | "bottom" | "none";
5863
6004
  declare class TabViewBuilder extends FiboBuilder {
5864
6005
  private _tabs;
5865
6006
  private _value?;
5866
6007
  private _onChange?;
6008
+ private _barPosition;
6009
+ private _swipe;
6010
+ private _keepAlive;
5867
6011
  tabs(items: TabViewTab[]): this;
5868
6012
  value(value: string): this;
5869
6013
  onChange(handler: (value: string) => void): this;
6014
+ /**
6015
+ * Tablist placement. Default `bottom` (Material / pairs with `BottomAppBar`).
6016
+ * `none` — panels only; put your own bar in `BottomAppBar().items(…)`.
6017
+ */
6018
+ barPosition(position: TabBarPosition): this;
6019
+ /** Horizontal drag between pages. Default true. CSS transform + snap. */
6020
+ swipe(enabled?: boolean): this;
6021
+ /**
6022
+ * Keep neighboring / all panels mounted (React.memo + Activity).
6023
+ * Default true. `false` mounts only the active tab ±1.
6024
+ */
6025
+ keepAlive(enabled?: boolean): this;
5870
6026
  build(): React$1.ReactElement;
5871
6027
  }
5872
6028
  export declare const TabView: () => StyleBuilder<TabViewBuilder>;
@@ -5992,6 +6148,8 @@ export {
5992
6148
  Store as ReactiveStore,
5993
6149
  Store$1 as Store,
5994
6150
  Text$1 as Text,
6151
+ VirtualColumn as LazyVStack,
6152
+ VirtualRow as LazyHStack,
5995
6153
  open$1 as open,
5996
6154
  scrollTo$1 as scrollTo,
5997
6155
  };