fiboui 2.0.0 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +23 -22
- package/dist/{FineGrain-kBxv0WeR.js → FineGrain-6w615KQw.js} +4 -4
- package/dist/builder-KLTu7nAI.js +2476 -0
- package/dist/content.js +3 -3
- package/dist/core.js +49 -29
- package/dist/{index-B1av7e36.js → index-BN2z9MuJ.js} +317 -308
- package/dist/{index-DKFr-sai.js → index-CYnY7jAX.js} +3 -3
- package/dist/{index-Dm4j2mMM.js → index-CbTvwN9K.js} +4 -4
- package/dist/{index-BQGRpkzR.js → index-CdJvNseK.js} +3 -3
- package/dist/{index-yeYkDTAx.js → index-DU2MC5u3.js} +143 -126
- package/dist/index-DhPBYTPt.js +104 -0
- package/dist/{index-RbfIZuAo.js → index-ijbJR6lD.js} +1 -1
- package/dist/index.d.ts +43188 -42071
- package/dist/index.js +462 -420
- package/dist/interactive.js +1 -1
- package/dist/layout.js +2 -2
- package/dist/mount-D5gt_GWO.js +331 -0
- package/dist/structure.js +2 -2
- package/dist/style.css +1 -1
- package/package.json +5 -1
- package/dist/builder-DjLYXkXu.js +0 -1842
- package/dist/index-CTRZRn9S.js +0 -90
- package/dist/mount-sAVX_FBU.js +0 -95
package/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
# FiboUI v2.
|
|
1
|
+
# FiboUI v2.2.0
|
|
2
2
|
|
|
3
3
|
**A Flutter & SwiftUI-inspired React UI framework featuring a fluent builder API and fine-grained reactivity.**
|
|
4
4
|
|
|
5
|
-
FiboUI brings chainable builders to React. Compose screens with `Column()`, `Row()`, `Button()`, and `signal()
|
|
5
|
+
FiboUI brings chainable builders to React. Compose screens with `Column()`, `Row()`, `Button()`, and `signal()`. Builders **are** React elements — return them from functions and skip `.build()`. Prefer the fluent API (no JSX tags).
|
|
6
6
|
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -13,6 +13,8 @@ FiboUI brings chainable builders to React. Compose screens with `Column()`, `Row
|
|
|
13
13
|
- **Fine-grained reactivity** — `signal()`, `computed()`, `createStore()`, `.bindSignal()`, `.observer()`.
|
|
14
14
|
- **Multi-theme** — Material, Cupertino, and Web tokens with CSS variables.
|
|
15
15
|
- **Type-safe** — TypeScript builders; `FiboChild` / `FiboChildren` describe child slots.
|
|
16
|
+
- **Media queries** — `Box().padding(8).md({ padding: 16 }).lg({ padding: 24 })` compiles to CSS `@media`. `.responsive({ mobile, tablet, desktop })` still works (JS).
|
|
17
|
+
- **CSS motion & scroll** — `Box().animate('fadeIn').ease('spring')`, `.onScroll('fadeIn')`, `.stagger(80)`, `.scrollProgress()`, `Presence(open).enter('fadeIn').exit('fadeOut')`. Default path is CSS (no rAF). See `docs/guide/animation.md`.
|
|
16
18
|
|
|
17
19
|
---
|
|
18
20
|
|
|
@@ -49,26 +51,29 @@ Do not run `npm publish` locally. The `Publish` workflow runs on GitHub Release
|
|
|
49
51
|
```tsx
|
|
50
52
|
import { Card, Text } from 'fiboui';
|
|
51
53
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
54
|
+
function Hello() {
|
|
55
|
+
return Card()
|
|
56
|
+
.className('p-8')
|
|
57
|
+
.style({ backgroundColor: '#111' })
|
|
58
|
+
.children([Text('Hello')]);
|
|
59
|
+
}
|
|
57
60
|
```
|
|
58
61
|
|
|
59
|
-
###
|
|
62
|
+
### No `.build()`
|
|
63
|
+
|
|
64
|
+
Builders are valid React elements (`isValidElement(Button('Go'))`). Return them from functions, nest them in `.children()`, or pass them as `React.createElement` arguments. `.build()` still exists and is deprecated.
|
|
60
65
|
|
|
61
|
-
|
|
66
|
+
The event API on `Button` is **`.onPress`** (not `onClick`). `FiboBuilder.onClick` still exists for raw DOM handlers on any builder.
|
|
62
67
|
|
|
63
68
|
```tsx
|
|
64
69
|
import { Button, Column, Text } from 'fiboui';
|
|
65
70
|
|
|
66
|
-
|
|
67
|
-
.children([
|
|
71
|
+
function App() {
|
|
72
|
+
return Column().children([
|
|
68
73
|
Text('Title').variant('h1'),
|
|
69
74
|
Button('Action').onPress(() => undefined),
|
|
70
|
-
])
|
|
71
|
-
|
|
75
|
+
]);
|
|
76
|
+
}
|
|
72
77
|
```
|
|
73
78
|
|
|
74
79
|
---
|
|
@@ -77,7 +82,7 @@ Column()
|
|
|
77
82
|
|
|
78
83
|
### Signals
|
|
79
84
|
|
|
80
|
-
`.bindSignal(sig)` subscribes the builder and **re-
|
|
85
|
+
`.bindSignal(sig)` subscribes the builder and **re-assembles** when the signal changes. Read the signal inside a **function child** (or `Text(() => ...)`) so the new value is picked up. Interpolating `sig.value` into a string at construction time is a one-shot snapshot.
|
|
81
86
|
|
|
82
87
|
```tsx
|
|
83
88
|
import { Box, Button, Text, signal } from 'fiboui';
|
|
@@ -91,8 +96,7 @@ Box()
|
|
|
91
96
|
Button('+').onPress(() => {
|
|
92
97
|
count.value += 1;
|
|
93
98
|
}),
|
|
94
|
-
])
|
|
95
|
-
.build();
|
|
99
|
+
]);
|
|
96
100
|
```
|
|
97
101
|
|
|
98
102
|
`useSignal(count)` and `.observer()` with a function child also work. Signal subscriptions unsubscribe on unmount and are Safe for React 18/19 StrictMode (`useSyncExternalStore`). Signals are in-memory and client-only — do not rely on them during SSR.
|
|
@@ -110,8 +114,7 @@ const store = createStore({ theme: 'dark', user: 'John' });
|
|
|
110
114
|
|
|
111
115
|
Box()
|
|
112
116
|
.observer()
|
|
113
|
-
.children(() => Text(store.getState().user))
|
|
114
|
-
.build();
|
|
117
|
+
.children(() => Text(store.getState().user));
|
|
115
118
|
```
|
|
116
119
|
|
|
117
120
|
---
|
|
@@ -149,8 +152,7 @@ Scaffold()
|
|
|
149
152
|
.sideBarLeft(
|
|
150
153
|
Sidebar().width(240).children([Text('Home'), Text('Settings')])
|
|
151
154
|
)
|
|
152
|
-
.children([Text('Welcome to the main content area.')])
|
|
153
|
-
.build();
|
|
155
|
+
.children([Text('Welcome to the main content area.')]);
|
|
154
156
|
```
|
|
155
157
|
|
|
156
158
|
---
|
|
@@ -206,8 +208,7 @@ export function ShopHeader() {
|
|
|
206
208
|
])
|
|
207
209
|
)
|
|
208
210
|
),
|
|
209
|
-
])
|
|
210
|
-
.build();
|
|
211
|
+
]);
|
|
211
212
|
}
|
|
212
213
|
```
|
|
213
214
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import s, { useRef as l, useEffect as p } from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { w as x, r as m, E } from "./builder-KLTu7nAI.js";
|
|
4
4
|
function R({
|
|
5
5
|
compute: e,
|
|
6
6
|
as: n = "span",
|
|
7
|
-
className:
|
|
8
|
-
style:
|
|
7
|
+
className: o,
|
|
8
|
+
style: i,
|
|
9
9
|
...u
|
|
10
10
|
}) {
|
|
11
11
|
const r = x(), t = l(null), a = e();
|
|
@@ -15,7 +15,7 @@ function R({
|
|
|
15
15
|
t.current && t.current.textContent !== c && (t.current.textContent = c);
|
|
16
16
|
});
|
|
17
17
|
return () => f.dispose();
|
|
18
|
-
}), [e, r]), s.createElement(n, { ref: t, className:
|
|
18
|
+
}), [e, r]), s.createElement(n, { ref: t, className: o, style: i, ...u }, a);
|
|
19
19
|
}
|
|
20
20
|
function d(e, n) {
|
|
21
21
|
return s.createElement(R, {
|