@flipova/foundation 1.8.0 → 1.9.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.
Files changed (71) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/README.md +125 -185
  3. package/dist/chunk-2VLBOYBU.js +4 -0
  4. package/dist/chunk-2VLBOYBU.js.map +1 -0
  5. package/dist/chunk-3PYMFFVP.mjs +5974 -0
  6. package/dist/chunk-3PYMFFVP.mjs.map +1 -0
  7. package/dist/chunk-45NSZH5Z.js +404 -0
  8. package/dist/chunk-45NSZH5Z.js.map +1 -0
  9. package/dist/chunk-4QTEZKXE.mjs +2287 -0
  10. package/dist/chunk-4QTEZKXE.mjs.map +1 -0
  11. package/dist/chunk-5ZDSYOFL.js +6112 -0
  12. package/dist/chunk-5ZDSYOFL.js.map +1 -0
  13. package/dist/chunk-BJTO5JO5.mjs +10 -0
  14. package/dist/chunk-BJTO5JO5.mjs.map +1 -0
  15. package/dist/chunk-DGUM43GV.js +12 -0
  16. package/dist/chunk-DGUM43GV.js.map +1 -0
  17. package/dist/chunk-ECBM426M.mjs +2647 -0
  18. package/dist/chunk-ECBM426M.mjs.map +1 -0
  19. package/dist/chunk-EIWDEXBO.js +2690 -0
  20. package/dist/chunk-EIWDEXBO.js.map +1 -0
  21. package/dist/chunk-FLEEJX7L.js +2301 -0
  22. package/dist/chunk-FLEEJX7L.js.map +1 -0
  23. package/dist/chunk-GZPFYWMA.mjs +390 -0
  24. package/dist/chunk-GZPFYWMA.mjs.map +1 -0
  25. package/dist/chunk-HS2UOQU4.mjs +3 -0
  26. package/dist/chunk-HS2UOQU4.mjs.map +1 -0
  27. package/dist/chunk-MWRMHYW2.js +101 -0
  28. package/dist/chunk-MWRMHYW2.js.map +1 -0
  29. package/dist/chunk-RRZSROIT.mjs +655 -0
  30. package/dist/chunk-RRZSROIT.mjs.map +1 -0
  31. package/dist/chunk-SYHGZT2M.mjs +95 -0
  32. package/dist/chunk-SYHGZT2M.mjs.map +1 -0
  33. package/dist/chunk-T7V6TILB.js +669 -0
  34. package/dist/chunk-T7V6TILB.js.map +1 -0
  35. package/dist/config/index.js +16 -1092
  36. package/dist/config/index.js.map +1 -1
  37. package/dist/config/index.mjs +1 -1096
  38. package/dist/config/index.mjs.map +1 -1
  39. package/dist/index.js +623 -9546
  40. package/dist/index.js.map +1 -1
  41. package/dist/index.mjs +5 -9379
  42. package/dist/index.mjs.map +1 -1
  43. package/dist/layout/index.js +463 -9225
  44. package/dist/layout/index.js.map +1 -1
  45. package/dist/layout/index.mjs +2 -9122
  46. package/dist/layout/index.mjs.map +1 -1
  47. package/dist/studio/cli/index.js +15 -4796
  48. package/dist/studio/cli/index.js.map +1 -1
  49. package/dist/studio/cli/index.mjs +11 -4774
  50. package/dist/studio/cli/index.mjs.map +1 -1
  51. package/dist/studio/index.js +73 -4908
  52. package/dist/studio/index.js.map +1 -1
  53. package/dist/studio/index.mjs +1 -4874
  54. package/dist/studio/index.mjs.map +1 -1
  55. package/dist/theme/index.js +43 -823
  56. package/dist/theme/index.js.map +1 -1
  57. package/dist/theme/index.mjs +1 -824
  58. package/dist/theme/index.mjs.map +1 -1
  59. package/dist/tokens/index.js +56 -400
  60. package/dist/tokens/index.js.map +1 -1
  61. package/dist/tokens/index.mjs +1 -388
  62. package/dist/tokens/index.mjs.map +1 -1
  63. package/dist/web/index.js +327 -3600
  64. package/dist/web/index.js.map +1 -1
  65. package/dist/web/index.mjs +24 -3426
  66. package/dist/web/index.mjs.map +1 -1
  67. package/package.json +2 -2
  68. package/studio/app/dist/_expo/static/js/web/{entry-39d36897d2758a1d36b9ce16995ecc83.js → entry-77f601f6b9353e7b6e3b18cdbe63ac99.js} +16325 -2506
  69. package/studio/app/dist/_expo/static/js/web/{index-f0c66517963047bf2c0bdd371afb8d31.js → index-9587ee2e3c02826ac2da47e86fefe882.js} +4 -4
  70. package/studio/app/dist/_expo/static/js/web/{index-fb59148d0b266219e66b19aeca8e2086.js → index-ac88f7a39991e452f0b4323da9aa4367.js} +3 -3
  71. package/studio/app/dist/index.html +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.9.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 6e5e021: Refactor Flipova Studio UI to use unified Foundation primitives for elegant, centralized design.
8
+
3
9
  ## 1.8.0
4
10
 
5
11
  ### Minor Changes
package/README.md CHANGED
@@ -1,37 +1,74 @@
1
1
  # @flipova/foundation
2
2
 
3
- Design tokens, theming, layout primitives, and UI components for **React Native** (iOS, Android) and **React web** apps — from a single shared codebase.
3
+ [![npm version](https://img.shields.io/npm/v/@flipova/foundation.svg)](https://www.npmjs.com/package/@flipova/foundation)
4
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
4
5
 
5
- ## Install
6
+ A unified, platform-agnostic design system and UI foundation for building identical experiences across **React Native** (iOS, Android) and **React Web**.
7
+
8
+ Flipova Foundation provides design tokens, a declarative theming engine, layout primitives, and beautifully crafted UI components from a single shared codebase. By abstracting the platform dependencies, Flipova ensures that web and mobile projects can seamlessly share 100% of their UI layer.
9
+
10
+ ---
11
+
12
+ ## Features
13
+
14
+ - **Write Once, Run Anywhere**: Isomorphic components that map to native primitives on mobile (`View`, `Text`, `ScrollView`) and highly-optimized HTML semantics on the web.
15
+ - **Zero-Config Web Support**: The web entry point (`@flipova/foundation/web`) is completely free of heavy native dependencies, enabling rapid bundling for SSR and SSG environments like Next.js and Vite.
16
+ - **Declarative Layouts**: Build complex UI using intuitive layout primitives (`Box`, `Stack`, `Inline`, `Center`).
17
+ - **Dynamic Theming**: First-class support for dark/light modes, dynamic color schemes, and custom design tokens.
18
+ - **Built-in Studio Builder**: Comes with a powerful visual UI builder (`flipova-studio`) to drag, drop, and construct layouts visually, outputting production-ready React code.
19
+
20
+ ---
21
+
22
+ ## Installation
23
+
24
+ Flipova Foundation is published on both the **npm public registry** and **GitHub Packages**. It is designed to adapt its dependency graph depending on your target environment.
25
+
26
+ ### For React Web Projects
27
+
28
+ The web version is extremely lightweight. It installs only what is necessary for DOM-based environments, completely bypassing React Native abstractions.
6
29
 
7
30
  ```bash
8
31
  npm install @flipova/foundation
9
32
  ```
10
33
 
11
- One install — no extra deps needed. Works out of the box for **React web** projects.
34
+ ### For React Native / Expo Projects
12
35
 
13
- For **React Native / Expo** projects, install the optional native peer dependencies you use:
36
+ For native environments, Flipova leverages your existing Expo and React Native ecosystem. Install the package alongside its optional native peer dependencies:
14
37
 
15
38
  ```bash
16
- npx expo install expo-linear-gradient expo-haptics react-native-gesture-handler react-native-reanimated react-native-safe-area-context lucide-react-native
39
+ npm install @flipova/foundation
40
+
41
+ # Install required native peer dependencies
42
+ npx expo install react-native-screens react-native-safe-area-context react-native-gesture-handler react-native-reanimated expo-linear-gradient expo-haptics @expo/vector-icons lucide-react-native
17
43
  ```
18
44
 
19
- ### Other Installation Methods
45
+ ---
46
+
47
+ ## Architecture & Modules
48
+
49
+ The package is deeply modularized so you only import what you need. Importing from specific sub-modules guarantees that bundlers will tree-shake platform-incompatible code.
20
50
 
21
- FlipovaFoundation is available in multiple formats for different use cases:
51
+ | Module Entry Point | Description | Supported Platforms |
52
+ | :--- | :--- | :--- |
53
+ | **`@flipova/foundation`** | Core UI components, interactive controls, and layout blocks. | Native |
54
+ | **`@flipova/foundation/web`** | DOM-based implementations of primitives, components, and layouts. | Web |
55
+ | **`@flipova/foundation/layout`**| Layout hooks (`useBreakpoint`, `useSafeArea`), and declarative registries. | Native |
56
+ | **`@flipova/foundation/tokens`**| Core design tokens (spacing, radii, colors, typography). | Native & Web |
57
+ | **`@flipova/foundation/theme`** | Theme system, ThemeProvider context, and ColorScheme utilities. | Native & Web |
58
+ | **`@flipova/foundation/config`**| Configuration engine (`defineConfig`, `FoundationProvider`). | Native & Web |
22
59
 
23
- - **npm (public)**: `npm install @flipova/foundation` ← default
24
- - **GitHub Packages**: `npm install @flipova/foundation --registry https://npm.pkg.github.com`
25
- - **Docker Image**: `docker pull ghcr.io/flipova/foundation:latest` or `docker pull flipova/foundation:latest`
26
- - **Standalone CLI Binary**: Download from GitHub Releases for Linux, macOS, or Windows
27
- - **Archive**: Download tar.gz archive from GitHub Releases for offline installation
60
+ ---
28
61
 
29
- ## Quick start
62
+ ## Core Concepts & Usage
30
63
 
31
- ### React Native / Expo
64
+ ### 1. Initialization and Theming
32
65
 
66
+ Whether you are on the Web or Native, initializing the design system requires a Provider.
67
+
68
+ **React Native (App.tsx):**
33
69
  ```tsx
34
70
  import { FoundationProvider, defineConfig } from "@flipova/foundation/config";
71
+ import { Box, Button } from "@flipova/foundation";
35
72
 
36
73
  const config = defineConfig({
37
74
  defaultTheme: "light",
@@ -40,229 +77,132 @@ const config = defineConfig({
40
77
  export default function App() {
41
78
  return (
42
79
  <FoundationProvider config={config}>
43
- <MyApp />
80
+ <Box padding="xl" backgroundColor="background">
81
+ <Button label="Welcome to Flipova" variant="primary" />
82
+ </Box>
44
83
  </FoundationProvider>
45
84
  );
46
85
  }
47
86
  ```
48
87
 
49
- ### React Web
50
-
88
+ **React Web (App.tsx):**
51
89
  ```tsx
52
90
  import { ThemeProvider } from "@flipova/foundation/theme";
53
- import { DashboardLayout, Button, TextInput } from "@flipova/foundation/web";
91
+ import { Box } from "@flipova/foundation/web";
54
92
 
55
93
  export default function App() {
56
94
  return (
57
95
  <ThemeProvider defaultTheme="light">
58
- <DashboardLayout
59
- header={<nav>My App</nav>}
60
- sidebar={<aside>Navigation</aside>}
61
- >
62
- <Button label="Get started" variant="primary" />
63
- <TextInput label="Email" placeholder="you@example.com" />
64
- </DashboardLayout>
96
+ <Box padding="xl" backgroundColor="background">
97
+ <h1>Web Experience</h1>
98
+ </Box>
65
99
  </ThemeProvider>
66
100
  );
67
101
  }
68
102
  ```
69
103
 
70
- ## Architecture
104
+ ### 2. Layout Primitives
71
105
 
72
- ```
73
- foundation/
74
- ├── tokens/ Static design tokens (spacing, colors, radii, shadows, typography, motion)
75
- ├── theme/ Theme system (ColorScheme, ThemeProvider, 9 built-in themes)
76
- ├── config/ Configuration (defineConfig, FoundationProvider, token overrides)
77
- ├── web/ ← NEW: React web components (no React Native dependency)
78
- │ ├── primitives/ Box, Stack, Inline, Center, Scroll, Divider
79
- │ ├── components/ Button, TextInput, Badge, Avatar, Icon, Select, Tabs…
80
- │ └── layouts/ RootLayout, DashboardLayout, AuthLayout, SidebarLayout…
81
- └── layout/
82
- ├── types/ Shared types (LayoutMeta, ComponentMeta, BlockMeta)
83
- ├── registry/ Declarative registries (layouts, components, blocks) — platform-agnostic
84
- ├── hooks/ useBreakpoint, useAdaptiveValue, usePlatformInfo, useSafeArea
85
- ├── utils/ resolveLayoutPadding, resolveBackground, responsive
86
- └── ui/
87
- ├── primitives/ Box, Stack, Inline, Center, Scroll, Divider (React Native)
88
- ├── [layouts] 23 layout components (React Native)
89
- ├── components/ Button, TextInput… (React Native)
90
- └── blocks/ AuthFormBlock, HeaderBlock (React Native)
91
-
92
- studio/
93
- ├── cli/ CLI entry point (npx flipova-studio)
94
- ├── server/ Express + WebSocket server with REST API
95
- └── engine/
96
- ├── tree/ Document tree (types + immutable operations)
97
- └── codegen/ Code generation (page → .tsx, project → full app)
106
+ Flipova strongly discourages inline styling. Instead, all structural layouts should be composed using foundational primitives. This guarantees identical spacing and alignment across web and mobile.
107
+
108
+ - **`Box`**: The lowest-level building block. Supports padding, margins, borders, and background tokens.
109
+ - **`Stack`**: A vertical flex container with configurable `gap` spacing.
110
+ - **`Inline`**: A horizontal flex container with configurable `gap` spacing and wrapping capabilities.
111
+ - **`Center`**: Utility primitive to vertically and horizontally align its children.
112
+
113
+ **Example: Building a User Card**
114
+ ```tsx
115
+ import { Box, Inline, Stack } from "@flipova/foundation/web";
116
+ import { Avatar, Text, Button } from "@flipova/foundation/web";
117
+
118
+ export function UserCard() {
119
+ return (
120
+ <Box padding="lg" borderRadius="md" backgroundColor="surface">
121
+ <Inline gap="md" align="center">
122
+ <Avatar src="https://example.com/avatar.png" size="lg" />
123
+ <Stack gap="xs" flex={1}>
124
+ <Text variant="heading">John Doe</Text>
125
+ <Text variant="body" color="muted">Software Engineer</Text>
126
+ </Stack>
127
+ <Button label="Follow" variant="secondary" />
128
+ </Inline>
129
+ </Box>
130
+ );
131
+ }
98
132
  ```
99
133
 
100
- ## Modules
134
+ ---
101
135
 
102
- | Import path | Content | Platform |
103
- |---|---|---|
104
- | `@flipova/foundation` | Everything (RN) | React Native |
105
- | `@flipova/foundation/web` | Web primitives, components & layouts | React Web |
106
- | `@flipova/foundation/tokens` | Design tokens only | Both |
107
- | `@flipova/foundation/theme` | Theme system only | Both |
108
- | `@flipova/foundation/layout` | Layouts, components, blocks, hooks, registry | React Native |
109
- | `@flipova/foundation/config` | defineConfig, FoundationProvider | Both |
110
- | `@flipova/foundation/studio` | Studio engine (tree, codegen, server) | Node.js |
136
+ ## Flipova Studio (Visual Builder)
111
137
 
112
- ## Studio (visual builder)
138
+ The foundation library comes bundled with **Flipova Studio**, a local visual builder designed to accelerate UI development. It allows you to drag, drop, and configure Foundation components in a web interface, and instantly outputs clean React Native or React Web code.
139
+
140
+ To start the studio, run:
113
141
 
114
142
  ```bash
115
143
  npx flipova-studio
116
144
  ```
145
+ *This starts the builder locally at http://localhost:4200.*
117
146
 
118
- Starts the builder at http://localhost:4200. This single command auto-builds the web UI if needed, starts the server, and serves the React app.
147
+ ### Studio CLI Commands
119
148
 
120
149
  | Command | Description |
121
- |---------|-------------|
122
- | `npx flipova-studio` | Start the builder |
123
- | `npx flipova-studio --port 3000` | Custom port |
124
- | `npx flipova-studio --dev` | Dev mode with Vite HMR |
125
- | `npx flipova-studio generate` | Generate React Native code |
150
+ | :--- | :--- |
151
+ | `npx flipova-studio` | Start the studio server and visual interface. |
152
+ | `npx flipova-studio --port 3000` | Start the studio on a custom port. |
153
+ | `npx flipova-studio --dev` | Start the studio in development mode with Vite HMR enabled. |
154
+ | `npx flipova-studio generate` | Execute the code generator engine against your saved project tree without starting the UI. |
126
155
 
127
- See [studio/README.md](studio/README.md) for the full API documentation.
156
+ ---
128
157
 
129
- ## Docker
158
+ ## Docker Support
130
159
 
131
- You can run Flipova Studio using Docker for an isolated environment with automatic builds and persistence.
160
+ For continuous integration, isolated environments, or team collaboration, Flipova Studio can be run via Docker. It supports data persistence and exposes your generated code to your host machine via volume mapping.
132
161
 
133
162
  ### Using Docker Compose (Recommended)
134
163
 
135
- ```bash
136
- docker-compose up -d
137
- ```
138
-
139
- This will:
140
- - Build the Docker image with Foundation and Studio
141
- - Start the Studio server on port 4200
142
- - Persist project data in a Docker volume
143
- - Mount generated code to a volume for easy access
164
+ Create a `docker-compose.yml` file:
144
165
 
145
- Access the Studio at http://localhost:4200
146
-
147
- ### Using Docker directly
166
+ ```yaml
167
+ version: '3.8'
168
+ services:
169
+ flipova-studio:
170
+ image: ghcr.io/flipova/foundation:latest
171
+ ports:
172
+ - "4200:4200"
173
+ volumes:
174
+ - studio-data:/app/.flipova-studio
175
+ - ./generated:/app/generated
176
+ volumes:
177
+ studio-data:
178
+ ```
148
179
 
180
+ Then run:
149
181
  ```bash
150
- # Build the image
151
- docker build -t flipova-studio .
152
-
153
- # Run the container
154
- docker run -d \
155
- -p 4200:4200 \
156
- -v studio-data:/app/.flipova-studio \
157
- -v generated-code:/app/generated \
158
- --name flipova-studio \
159
- flipova-studio
182
+ docker-compose up -d
160
183
  ```
161
184
 
162
- ### Using Pre-built Docker Images
163
-
164
- Pre-built Docker images are available from GitHub Container Registry and Docker Hub:
185
+ ### Using Pre-built Images via Docker CLI
165
186
 
166
187
  ```bash
167
- # From GitHub Container Registry
188
+ # Pull from GitHub Container Registry
168
189
  docker pull ghcr.io/flipova/foundation:latest
169
190
 
170
- # From Docker Hub
171
- docker pull flipova/foundation:latest
172
-
173
- # Run with pre-built image
191
+ # Run the container with volume mapping
174
192
  docker run -d \
175
193
  -p 4200:4200 \
176
194
  -v studio-data:/app/.flipova-studio \
177
- -v generated-code:/app/generated \
195
+ -v ./generated:/app/generated \
178
196
  --name flipova-studio \
179
197
  ghcr.io/flipova/foundation:latest
180
198
  ```
181
199
 
182
- ### Docker Volumes
183
-
184
- - `studio-data`: Persists your Studio project data (layouts, pages, components)
185
- - `generated-code`: Contains the generated React Native code
186
-
187
- ### Accessing Generated Code
188
-
189
- The generated code is available in the `generated-code` volume. To access it:
190
-
191
- ```bash
192
- # Copy generated code to host
193
- docker cp flipova-studio:/app/generated ./generated
194
- ```
195
-
196
- Or mount the volume directly to a host directory by modifying docker-compose.yml:
197
-
198
- ```yaml
199
- volumes:
200
- - ./generated:/app/generated
201
- ```
202
-
203
- ## Release Formats
204
-
205
- Flipova Foundation is distributed in multiple formats for different use cases:
206
-
207
- ### npm Package
208
-
209
- For use in React Native projects via npm:
210
-
211
- ```bash
212
- npm install @flipova/foundation
213
- ```
200
+ ---
214
201
 
215
- Published to: https://npm.pkg.github.com/@flipova/foundation
202
+ ## Contributing
216
203
 
217
- ### Docker Image
218
-
219
- For containerized deployment of Flipova Studio:
220
-
221
- ```bash
222
- docker pull ghcr.io/flipova/foundation:latest
223
- # or
224
- docker pull flipova/foundation:latest
225
- ```
226
-
227
- Published to:
228
- - GitHub Container Registry: https://github.com/flipova/foundation/pkgs/container/foundation
229
- - Docker Hub: https://hub.docker.com/r/flipova/foundation
230
-
231
- ### Standalone CLI Binary
232
-
233
- For running Flipova Studio without npm:
234
-
235
- Download from GitHub Releases:
236
- - Linux: `flipova-studio-linux-x64`
237
- - macOS: `flipova-studio-macos-x64`
238
- - Windows: `flipova-studio-windows-x64.exe`
239
-
240
- ```bash
241
- # Make executable (Linux/macOS)
242
- chmod +x flipova-studio-linux-x64
243
-
244
- # Run
245
- ./flipova-studio-linux-x64
246
- ```
247
-
248
- ### Archive
249
-
250
- For offline installation or custom deployment:
251
-
252
- Download `flipova-foundation-VERSION.tar.gz` from GitHub Releases.
253
-
254
- ```bash
255
- # Extract
256
- tar -xzf flipova-foundation-VERSION.tar.gz
257
-
258
- # The archive contains:
259
- # - dist/ (built foundation library)
260
- # - studio/app/dist/ (built studio web UI)
261
- # - studio/server/ (Express server)
262
- # - studio/engine/ (tree operations and codegen)
263
- # - studio/cli/ (CLI entry point)
264
- ```
204
+ We welcome contributions to the Flipova Foundation! Please refer to the `CONTRIBUTING.md` file in the root of the repository for detailed instructions on the development workflow, branching strategies, and instructions for adding new components.
265
205
 
266
206
  ## License
267
207
 
268
- MIT
208
+ MIT © Flipova
@@ -0,0 +1,4 @@
1
+ 'use strict';
2
+
3
+ //# sourceMappingURL=chunk-2VLBOYBU.js.map
4
+ //# sourceMappingURL=chunk-2VLBOYBU.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"chunk-2VLBOYBU.js"}