fiboui 2.4.2 → 2.4.4
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 +103 -146
- package/dist/{FineGrain-D7wH1QxC.js → FineGrain-CvcJ5OxF.js} +1 -1
- package/dist/{builder-CCVmfPD1.js → builder-B5cebEWZ.js} +356 -320
- package/dist/content.js +3 -3
- package/dist/core.js +40 -39
- package/dist/{index-BK1AwJ9O.js → index-BMIo5j9Y.js} +1 -1
- package/dist/{index-CVPzf0A9.js → index-BxH8dhoT.js} +3 -2
- package/dist/{index-R-gUALvW.js → index-DGQVwcWx.js} +27 -27
- package/dist/{index-Cb05sNOU.js → index-DRVdVimz.js} +4 -4
- package/dist/{index-BVpNTDKn.js → index-DbaNIwWW.js} +2 -2
- package/dist/{index-CHXOPJU-.js → index-MeDbhMEg.js} +189 -185
- package/dist/{index-Bdphg-MS.js → index-orKQGpHl.js} +3 -3
- package/dist/index.d.ts +12 -1
- package/dist/index.js +133 -132
- package/dist/interactive.js +1 -1
- package/dist/layout.js +2 -2
- package/dist/{mount-Dx2s-imU.js → mount-DbMVakA4.js} +35 -35
- package/dist/{provider-Muljv62_.js → provider-BTNE3N5g.js} +1 -1
- package/dist/structure.js +2 -2
- package/dist/style.css +1 -1
- package/dist/theme.js +2 -2
- package/dist/{themeData-CmTJt3dU.js → themeData-Dtm0M_mF.js} +80 -80
- package/package.json +3 -10
package/README.md
CHANGED
|
@@ -1,220 +1,177 @@
|
|
|
1
|
-
|
|
1
|
+
<div align="center">
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
```
|
|
4
|
+
███████╗██╗██████╗ ██████╗ ██╗ ██╗██╗
|
|
5
|
+
██╔════╝██║██╔══██╗██╔═══██╗██║ ██║██║
|
|
6
|
+
█████╗ ██║██████╔╝██║ ██║██║ ██║██║
|
|
7
|
+
██╔══╝ ██║██╔══██╗██║ ██║██║ ██║██║
|
|
8
|
+
██║ ██║██████╔╝╚██████╔╝╚██████╔╝██║
|
|
9
|
+
╚═╝ ╚═╝╚═════╝ ╚═════╝ ╚═════╝ ╚═╝
|
|
10
|
+
```
|
|
4
11
|
|
|
5
|
-
FiboUI
|
|
12
|
+
# FiboUI
|
|
6
13
|
|
|
7
|
-
|
|
14
|
+
**Fluent React UI.** Flutter & SwiftUI energy — chainable builders, signals, themes.
|
|
8
15
|
|
|
9
|
-
|
|
16
|
+
Builders **are** React elements. Return them from functions. Skip `.build()`. Prefer the fluent API — no JSX tags.
|
|
10
17
|
|
|
11
|
-
|
|
12
|
-
- **Zero-build children** — pass builders to `.children()`; they build implicitly. Typed methods (`.onPress`, `.id`, `.spacing`, `.children`) stay assignable as children.
|
|
13
|
-
- **Fine-grained reactivity** — `signal()`, `computed()`, `createStore()`, `.bindSignal()`, `.observer()`.
|
|
14
|
-
- **Fluent themes** — `.theme("noir" \| "web" \| …)` / `extendTheme` / `FiboThemeProvider` — CSS vars SSR-safe (Flutter / SwiftUI model). Presets: Material, Cupertino, Web, **Noir**.
|
|
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`.
|
|
18
|
-
- **Interaction effects** — full Hover.css–inspired catalog (2D, background sweeps, borders, shadows, bubbles, curls) as fiboui-owned CSS. Any trigger: `.hover(h => h.effect("sweepToRight"))`, `.pressEffect("shrink")`, `.hoverEffect("float")`.
|
|
18
|
+
<br />
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
[](https://www.npmjs.com/package/fiboui)
|
|
21
|
+
[](./LICENSE)
|
|
22
|
+
[](https://fiboui.vercel.app)
|
|
23
|
+
[](https://fiboui-store.vercel.app)
|
|
21
24
|
|
|
22
|
-
|
|
25
|
+
**Live**
|
|
26
|
+
[`fiboui.vercel.app`](https://fiboui.vercel.app)
|
|
27
|
+
·
|
|
28
|
+
**Store demo**
|
|
29
|
+
[`fiboui-store.vercel.app`](https://fiboui-store.vercel.app)
|
|
30
|
+
·
|
|
31
|
+
**npm**
|
|
32
|
+
[`fiboui`](https://www.npmjs.com/package/fiboui)
|
|
23
33
|
|
|
24
34
|
```bash
|
|
25
35
|
npm install fiboui
|
|
26
36
|
```
|
|
27
37
|
|
|
28
|
-
|
|
38
|
+
</div>
|
|
29
39
|
|
|
30
|
-
|
|
31
|
-
import 'fiboui/style.css';
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
**Required.** The JS entry does not load CSS. ESM-only (`import`, no `require`). See [MIGRATION.md](./MIGRATION.md) if you used 1.x snapshots.
|
|
35
|
-
|
|
36
|
-
Peer dependencies: React 18 or 19.
|
|
37
|
-
|
|
38
|
-
Next.js App Router: files that **call** builders (`Button()`, `Column()`, …) must be Client Components (`'use client'`). FiboUI uses hooks and context; it is not an RSC factory API. Import `'fiboui/style.css'` from a layout or the client entry.
|
|
39
|
-
|
|
40
|
-
## Releasing
|
|
40
|
+
---
|
|
41
41
|
|
|
42
|
-
|
|
42
|
+
## Why FiboUI
|
|
43
43
|
|
|
44
|
-
|
|
44
|
+
| | |
|
|
45
|
+
| :--- | :--- |
|
|
46
|
+
| **Assembly pattern** | Factories return builders for endless chaining |
|
|
47
|
+
| **Zero-build children** | Pass builders to `.children()` — they finalize implicitly |
|
|
48
|
+
| **Signals** | `signal()`, `computed()`, `.bindSignal()`, `.observer()` |
|
|
49
|
+
| **Themes** | `.theme("noir")` · `extendTheme` · Material / Cupertino / Web / Noir |
|
|
50
|
+
| **Motion** | `.animate('fadeIn')` · `.onScroll` · `.hoverEffect` · CSS-first |
|
|
51
|
+
| **Type-safe** | TypeScript builders · `FiboChild` / `FiboChildren` |
|
|
45
52
|
|
|
46
53
|
---
|
|
47
54
|
|
|
48
|
-
##
|
|
49
|
-
|
|
50
|
-
### Components as builders
|
|
55
|
+
## Quick start
|
|
51
56
|
|
|
52
57
|
```tsx
|
|
53
|
-
import
|
|
58
|
+
import 'fiboui/style.css'
|
|
59
|
+
import { Button, Column, Text, mount } from 'fiboui'
|
|
54
60
|
|
|
55
|
-
function
|
|
56
|
-
return
|
|
57
|
-
.
|
|
58
|
-
.
|
|
59
|
-
.children([
|
|
61
|
+
function App() {
|
|
62
|
+
return Column()
|
|
63
|
+
.gap(12)
|
|
64
|
+
.padding(24)
|
|
65
|
+
.children([
|
|
66
|
+
Text('Hello FiboUI').variant('h1'),
|
|
67
|
+
Button('Ship it').onPress(() => undefined),
|
|
68
|
+
])
|
|
60
69
|
}
|
|
70
|
+
|
|
71
|
+
mount('#root', App)
|
|
61
72
|
```
|
|
62
73
|
|
|
63
|
-
|
|
74
|
+
**Required:** import `'fiboui/style.css'` once — the JS entry does not load CSS.
|
|
75
|
+
ESM-only (`import`, no `require`). Peer deps: **React 18 or 19**.
|
|
64
76
|
|
|
65
|
-
|
|
77
|
+
Next.js App Router: files that **call** builders must be Client Components (`'use client'`).
|
|
66
78
|
|
|
67
|
-
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## Taste of the API
|
|
82
|
+
|
|
83
|
+
### Builders (no `.build()`)
|
|
68
84
|
|
|
69
85
|
```tsx
|
|
70
|
-
import {
|
|
86
|
+
import { Card, Text } from 'fiboui'
|
|
71
87
|
|
|
72
|
-
function
|
|
73
|
-
return
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
88
|
+
function Hello() {
|
|
89
|
+
return Card()
|
|
90
|
+
.padding(32)
|
|
91
|
+
.bg('#111')
|
|
92
|
+
.children([Text('Hello').variant('h2')])
|
|
77
93
|
}
|
|
78
94
|
```
|
|
79
95
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
## Reactivity & state
|
|
96
|
+
`Button` uses **`.onPress`** (not `onClick`).
|
|
83
97
|
|
|
84
98
|
### Signals
|
|
85
99
|
|
|
86
|
-
`.bindSignal(sig)`
|
|
100
|
+
`.bindSignal(sig)` re-assembles when the signal changes. Read values inside a **function child**:
|
|
87
101
|
|
|
88
102
|
```tsx
|
|
89
|
-
import { Box, Button, Text, signal } from 'fiboui'
|
|
103
|
+
import { Box, Button, Text, signal } from 'fiboui'
|
|
90
104
|
|
|
91
|
-
const count = signal(0)
|
|
105
|
+
const count = signal(0)
|
|
92
106
|
|
|
93
107
|
Box()
|
|
94
108
|
.bindSignal(count)
|
|
95
109
|
.children(() => [
|
|
96
110
|
Text(`Count: ${count.value}`),
|
|
97
111
|
Button('+').onPress(() => {
|
|
98
|
-
count.value += 1
|
|
112
|
+
count.value += 1
|
|
99
113
|
}),
|
|
100
|
-
])
|
|
114
|
+
])
|
|
101
115
|
```
|
|
102
116
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
`computed(() => ...)` is lazy: the first `.value` read attaches the internal effect. Read it (or `.bindSignal`) so updates notify.
|
|
106
|
-
|
|
107
|
-
Two store APIs exist: `createStore()` + `useReactiveStore(store)`, and the `@Store()` decorator + `useStore(StoreClass)` (the package-root `useStore`). Builder `.state(key, initial)` is runtime-updatable via `useBuilderState(key)`.
|
|
108
|
-
|
|
109
|
-
### Global store
|
|
117
|
+
### Themes & motion
|
|
110
118
|
|
|
111
119
|
```tsx
|
|
112
|
-
|
|
120
|
+
Box()
|
|
121
|
+
.theme('noir')
|
|
122
|
+
.animate('fadeIn')
|
|
123
|
+
.ease('spring')
|
|
124
|
+
.hover((h) => h.effect('sweepToRight'))
|
|
125
|
+
```
|
|
113
126
|
|
|
114
|
-
|
|
127
|
+
Responsive:
|
|
115
128
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
.children(() => Text(store.getState().user));
|
|
129
|
+
```tsx
|
|
130
|
+
Box().padding(8).md({ padding: 16 }).lg({ padding: 24 })
|
|
119
131
|
```
|
|
120
132
|
|
|
121
133
|
---
|
|
122
134
|
|
|
123
135
|
## Layout notes
|
|
124
136
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
Flutter `Column` defaults to `CrossAxisAlignment.center`. SwiftUI `VStack` defaults to `.center`. FiboUI **2.0 matches that: `crossAxisAlignment('center')`.**
|
|
128
|
-
|
|
129
|
-
**Row uses `align-self: stretch`** so `spaceBetween` still fills the Column width under a centered cross axis.
|
|
130
|
-
|
|
131
|
-
To stretch every child (Flutter `CrossAxisAlignment.stretch`):
|
|
137
|
+
FiboUI **2.x** matches Flutter / SwiftUI: `Column` defaults to `crossAxisAlignment('center')`.
|
|
138
|
+
`Row` uses `align-self: stretch` so `spaceBetween` still fills width.
|
|
132
139
|
|
|
133
140
|
```tsx
|
|
134
|
-
Column().crossAxisAlignment('stretch')
|
|
141
|
+
Column().crossAxisAlignment('stretch')
|
|
135
142
|
```
|
|
136
143
|
|
|
144
|
+
`Scaffold` uses `headerBar`, `footerBar`, `sideBarLeft`, `sideBarRight`.
|
|
145
|
+
|
|
137
146
|
---
|
|
138
147
|
|
|
139
|
-
##
|
|
148
|
+
## Live demos
|
|
140
149
|
|
|
141
|
-
|
|
150
|
+
| | |
|
|
151
|
+
| :--- | :--- |
|
|
152
|
+
| **[fiboui.vercel.app](https://fiboui.vercel.app)** | Marketing site — builders, signals, theme, motion, media |
|
|
153
|
+
| **[fiboui-store.vercel.app](https://fiboui-store.vercel.app)** | Full retail demo — catalog → bag → checkout |
|
|
142
154
|
|
|
143
|
-
|
|
144
|
-
import { Header, Scaffold, Sidebar, Text } from 'fiboui';
|
|
145
|
-
|
|
146
|
-
Scaffold()
|
|
147
|
-
.headerBar(
|
|
148
|
-
Header()
|
|
149
|
-
.height(80)
|
|
150
|
-
.className('px-6 bg-white shadow-sm')
|
|
151
|
-
.children([Text('App Title').variant('h2')])
|
|
152
|
-
)
|
|
153
|
-
.sideBarLeft(
|
|
154
|
-
Sidebar().width(240).children([Text('Home'), Text('Settings')])
|
|
155
|
-
)
|
|
156
|
-
.children([Text('Welcome to the main content area.')]);
|
|
157
|
-
```
|
|
155
|
+
Both are built **only** with FiboUI fluent builders.
|
|
158
156
|
|
|
159
157
|
---
|
|
160
158
|
|
|
161
|
-
##
|
|
159
|
+
## Docs & contributing
|
|
162
160
|
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
Card,
|
|
169
|
-
Grid,
|
|
170
|
-
Row,
|
|
171
|
-
Text,
|
|
172
|
-
computed,
|
|
173
|
-
createStore,
|
|
174
|
-
} from 'fiboui';
|
|
175
|
-
|
|
176
|
-
const appStore = createStore({
|
|
177
|
-
cart: [] as { id: string; name: string; price: number; quantity: number }[],
|
|
178
|
-
products: [
|
|
179
|
-
{ id: '1', name: 'MacBook Pro', price: 2499 },
|
|
180
|
-
{ id: '2', name: 'iPhone 15', price: 999 },
|
|
181
|
-
],
|
|
182
|
-
});
|
|
183
|
-
|
|
184
|
-
const cartTotal = computed(() => {
|
|
185
|
-
const cart = appStore.getState().cart;
|
|
186
|
-
return cart.reduce((sum, item) => sum + item.price * item.quantity, 0);
|
|
187
|
-
});
|
|
188
|
-
|
|
189
|
-
export function ShopHeader() {
|
|
190
|
-
return Box()
|
|
191
|
-
.observer()
|
|
192
|
-
.children(() => [
|
|
193
|
-
Row().children([
|
|
194
|
-
Text(`Total: $${cartTotal.value.toFixed(2)}`).bindSignal(cartTotal),
|
|
195
|
-
Badge().text(String(appStore.getState().cart.length)),
|
|
196
|
-
]),
|
|
197
|
-
Grid()
|
|
198
|
-
.columns(2)
|
|
199
|
-
.gap('md')
|
|
200
|
-
.children(
|
|
201
|
-
appStore.getState().products.map((product) =>
|
|
202
|
-
Card().children([
|
|
203
|
-
Text(product.name).weight('bold'),
|
|
204
|
-
Button(`Add $${product.price}`).onPress(() => {
|
|
205
|
-
appStore.setState((s) => ({
|
|
206
|
-
cart: [...s.cart, { ...product, quantity: 1 }],
|
|
207
|
-
}));
|
|
208
|
-
}),
|
|
209
|
-
])
|
|
210
|
-
)
|
|
211
|
-
),
|
|
212
|
-
]);
|
|
213
|
-
}
|
|
214
|
-
```
|
|
161
|
+
- Migration from 1.x → [MIGRATION.md](./MIGRATION.md)
|
|
162
|
+
- Contributing & release → [CONTRIBUTING.md](./CONTRIBUTING.md)
|
|
163
|
+
- Animation guide → `docs/guide/animation.md`
|
|
164
|
+
|
|
165
|
+
Publishing is automated on **`main`** (GitHub Actions + `NPM_TOKEN`). Prefer not to `npm publish` locally.
|
|
215
166
|
|
|
216
167
|
---
|
|
217
168
|
|
|
218
|
-
|
|
169
|
+
<div align="center">
|
|
170
|
+
|
|
171
|
+
**Wear the return.**
|
|
219
172
|
|
|
220
173
|
MIT © 2025–2026 FiboUI
|
|
174
|
+
|
|
175
|
+
[Site](https://fiboui.vercel.app) · [Store](https://fiboui-store.vercel.app) · [npm](https://www.npmjs.com/package/fiboui) · [GitHub](https://github.com/felipeoliveiradev/fiboui)
|
|
176
|
+
|
|
177
|
+
</div>
|