fiboui 2.9.4 → 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-lzMYg4vy.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>;
@@ -3268,8 +3316,14 @@ export declare const ToolbarItem: () => StyleBuilder<ToolbarItemBuilder>;
3268
3316
  export declare const AppBar: () => StyleBuilder<AppBarBuilder>;
3269
3317
  declare class BottomAppBarBuilder extends FiboBuilder {
3270
3318
  private _items;
3319
+ private _floating;
3271
3320
  /** Same contract as `AppBar().items` — zone via `ToolbarItem` place. */
3272
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;
3273
3327
  build(): React$1.ReactElement;
3274
3328
  }
3275
3329
  export declare const BottomAppBar: () => StyleBuilder<BottomAppBarBuilder>;
@@ -5158,6 +5212,29 @@ declare class ListBuilder<T = any> extends FiboBuilder {
5158
5212
  build(): React$1.ReactElement;
5159
5213
  }
5160
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>;
5161
5238
  declare class SectionBuilder extends FiboBuilder {
5162
5239
  private _header?;
5163
5240
  private _footer?;
@@ -6071,6 +6148,8 @@ export {
6071
6148
  Store as ReactiveStore,
6072
6149
  Store$1 as Store,
6073
6150
  Text$1 as Text,
6151
+ VirtualColumn as LazyVStack,
6152
+ VirtualRow as LazyHStack,
6074
6153
  open$1 as open,
6075
6154
  scrollTo$1 as scrollTo,
6076
6155
  };