fiboui 2.0.0 → 2.1.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 +21 -22
- package/dist/{FineGrain-kBxv0WeR.js → FineGrain-BTgNt7fN.js} +1 -1
- package/dist/{builder-DjLYXkXu.js → builder-6GkZlCaz.js} +370 -318
- package/dist/content.js +3 -3
- package/dist/core.js +3 -3
- package/dist/{index-DKFr-sai.js → index-BaX5zy8O.js} +1 -1
- package/dist/{index-BQGRpkzR.js → index-C4xZywsh.js} +3 -3
- package/dist/{index-RbfIZuAo.js → index-C8y7FIYH.js} +1 -1
- package/dist/{index-Dm4j2mMM.js → index-CREALegH.js} +4 -4
- package/dist/{index-yeYkDTAx.js → index-CWz0hYog.js} +3 -3
- package/dist/{index-B1av7e36.js → index-OLW4l8s8.js} +1 -1
- package/dist/{index-CTRZRn9S.js → index-zOfPHD00.js} +2 -2
- package/dist/index.d.ts +42057 -42046
- package/dist/index.js +315 -299
- package/dist/interactive.js +1 -1
- package/dist/layout.js +2 -2
- package/dist/{mount-sAVX_FBU.js → mount-rDUAHuDT.js} +1 -1
- package/dist/structure.js +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
# FiboUI v2.
|
|
1
|
+
# FiboUI v2.1.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 components, nest them in JSX, and skip `.build()`.
|
|
6
6
|
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -49,26 +49,29 @@ Do not run `npm publish` locally. The `Publish` workflow runs on GitHub Release
|
|
|
49
49
|
```tsx
|
|
50
50
|
import { Card, Text } from 'fiboui';
|
|
51
51
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
52
|
+
function Hello() {
|
|
53
|
+
return Card()
|
|
54
|
+
.className('p-8')
|
|
55
|
+
.style({ backgroundColor: '#111' })
|
|
56
|
+
.children([Text('Hello')]);
|
|
57
|
+
}
|
|
57
58
|
```
|
|
58
59
|
|
|
59
|
-
###
|
|
60
|
+
### No `.build()`
|
|
61
|
+
|
|
62
|
+
Builders are valid React elements (`isValidElement(Button('Go'))`). Use them as JSX children, return values, array items (`.key(id)`), props, or `React.createElement` arguments. `.build()` still exists and is deprecated.
|
|
60
63
|
|
|
61
|
-
|
|
64
|
+
The event API on `Button` is **`.onPress`** (not `onClick`). `FiboBuilder.onClick` still exists for raw DOM handlers on any builder.
|
|
62
65
|
|
|
63
66
|
```tsx
|
|
64
67
|
import { Button, Column, Text } from 'fiboui';
|
|
65
68
|
|
|
66
|
-
|
|
67
|
-
.children([
|
|
69
|
+
function App() {
|
|
70
|
+
return Column().children([
|
|
68
71
|
Text('Title').variant('h1'),
|
|
69
72
|
Button('Action').onPress(() => undefined),
|
|
70
|
-
])
|
|
71
|
-
|
|
73
|
+
]);
|
|
74
|
+
}
|
|
72
75
|
```
|
|
73
76
|
|
|
74
77
|
---
|
|
@@ -77,7 +80,7 @@ Column()
|
|
|
77
80
|
|
|
78
81
|
### Signals
|
|
79
82
|
|
|
80
|
-
`.bindSignal(sig)` subscribes the builder and **re-
|
|
83
|
+
`.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
84
|
|
|
82
85
|
```tsx
|
|
83
86
|
import { Box, Button, Text, signal } from 'fiboui';
|
|
@@ -91,8 +94,7 @@ Box()
|
|
|
91
94
|
Button('+').onPress(() => {
|
|
92
95
|
count.value += 1;
|
|
93
96
|
}),
|
|
94
|
-
])
|
|
95
|
-
.build();
|
|
97
|
+
]);
|
|
96
98
|
```
|
|
97
99
|
|
|
98
100
|
`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 +112,7 @@ const store = createStore({ theme: 'dark', user: 'John' });
|
|
|
110
112
|
|
|
111
113
|
Box()
|
|
112
114
|
.observer()
|
|
113
|
-
.children(() => Text(store.getState().user))
|
|
114
|
-
.build();
|
|
115
|
+
.children(() => Text(store.getState().user));
|
|
115
116
|
```
|
|
116
117
|
|
|
117
118
|
---
|
|
@@ -149,8 +150,7 @@ Scaffold()
|
|
|
149
150
|
.sideBarLeft(
|
|
150
151
|
Sidebar().width(240).children([Text('Home'), Text('Settings')])
|
|
151
152
|
)
|
|
152
|
-
.children([Text('Welcome to the main content area.')])
|
|
153
|
-
.build();
|
|
153
|
+
.children([Text('Welcome to the main content area.')]);
|
|
154
154
|
```
|
|
155
155
|
|
|
156
156
|
---
|
|
@@ -206,8 +206,7 @@ export function ShopHeader() {
|
|
|
206
206
|
])
|
|
207
207
|
)
|
|
208
208
|
),
|
|
209
|
-
])
|
|
210
|
-
.build();
|
|
209
|
+
]);
|
|
211
210
|
}
|
|
212
211
|
```
|
|
213
212
|
|