autoui-react 0.1.0 → 0.1.1-alpha

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 CHANGED
@@ -1,4 +1,4 @@
1
- # @autoui/react
1
+ # autoui-react
2
2
 
3
3
  A React + TypeScript runtime that **generates goal-oriented UIs in real-time** using an LLM + your data schema.
4
4
 
@@ -27,13 +27,13 @@ This library implements this approach, using LLMs to interpret a goal and schema
27
27
  ## Installation
28
28
 
29
29
  ```bash
30
- npm install @autoui/react
30
+ npm install autoui-react
31
31
  ```
32
32
 
33
33
  ## Quick Start
34
34
 
35
35
  ```jsx
36
- import { AutoUI } from '@autoui/react';
36
+ import { AutoUI } from 'autoui-react';
37
37
  import { emailsTable, usersTable } from './schema';
38
38
 
39
39
  function App() {
@@ -124,7 +124,7 @@ AutoUI supports different ways to provide your data schema:
124
124
  #### 2. Using Drizzle Adapter
125
125
 
126
126
  ```jsx
127
- import { AutoUI } from '@autoui/react';
127
+ import { AutoUI } from 'autoui-react';
128
128
  import { db } from './db'; // Your Drizzle instance
129
129
  import { users, posts } from './schema'; // Drizzle schema
130
130
 
@@ -177,7 +177,7 @@ function MyApp() {
177
177
  AutoUI provides hooks into its internal planning and rendering process through system events. You can subscribe to these events to monitor or extend the functionality.
178
178
 
179
179
  ```jsx
180
- import { AutoUI, SystemEventType } from '@autoui/react';
180
+ import { AutoUI, SystemEventType } from 'autoui-react';
181
181
 
182
182
  function MyApp() {
183
183
  return (
@@ -241,4 +241,50 @@ MIT
241
241
 
242
242
  ## Contributing
243
243
 
244
- Contributions are welcome! Please feel free to submit a Pull Request.
244
+ Contributions are welcome! Please feel free to submit a Pull Request.
245
+ ## Component Adapters
246
+
247
+ ### shadcn/ui (Default)
248
+
249
+ This library uses [shadcn/ui](https://ui.shadcn.com/) components by default. To set up these components in your project:
250
+
251
+ ```bash
252
+ # Run the setup script to install required shadcn components
253
+ npm run setup-shadcn
254
+ ```
255
+
256
+ This will:
257
+ 1. Install Tailwind CSS if not already installed
258
+ 2. Set up the necessary shadcn/ui components
259
+ 3. Configure your project to use them
260
+
261
+ After setup, make sure to import the CSS in your application:
262
+
263
+ ```jsx
264
+ // In your main entry file (e.g., main.tsx, index.tsx)
265
+ import "./src/tailwind.css";
266
+ ```
267
+
268
+ ### Custom Component Adapters
269
+
270
+ You can create custom adapters for other component libraries by implementing an adapter module:
271
+
272
+ ```jsx
273
+ // Create a custom adapter (e.g., for Material UI)
274
+ import { Button, Table, Card } from '@mui/material';
275
+
276
+ const materialAdapter = {
277
+ Button: (props) => <Button {...props} />,
278
+ Table: (props) => <Table {...props} />,
279
+ // ...
280
+ };
281
+
282
+ // Use your custom adapter
283
+ <AutoUI
284
+ schema={mySchema}
285
+ goal="Create a user dashboard"
286
+ componentAdapter="material" // Not yet supported in v0.1
287
+ />
288
+ ```
289
+
290
+ Support for custom component adapters is planned for future releases.
package/dist/index.css CHANGED
@@ -53,4 +53,14 @@
53
53
  .autoui-error-message {
54
54
  font-size: 0.875rem;
55
55
  }
56
+ .autoui-mock-container {
57
+ color: inherit;
58
+ width: 100%;
59
+ color: #1f2937;
60
+ }
61
+ @media (prefers-color-scheme: dark) {
62
+ .autoui-mock-container {
63
+ color: #f3f4f6;
64
+ }
65
+ }
56
66
  /*# sourceMappingURL=index.css.map */
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/styles/autoui.css"],"sourcesContent":["/* AutoUI Component Styles */\n\n.autoui-root {\n display: flex;\n flex-direction: column;\n height: 100%;\n width: 100%;\n}\n\n/* Loading states */\n.autoui-loading {\n width: 100%;\n height: 100%;\n}\n\n.autoui-shimmer-container {\n display: flex;\n flex-direction: column;\n gap: 1rem;\n padding: 1rem;\n}\n\n.autoui-shimmer-header {\n height: 2.5rem;\n background-color: #e5e7eb;\n border-radius: 0.25rem;\n animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;\n}\n\n.autoui-shimmer-content {\n height: 16rem;\n background-color: #e5e7eb;\n border-radius: 0.25rem;\n animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;\n}\n\n@keyframes pulse {\n 0%, 100% {\n opacity: 1;\n }\n 50% {\n opacity: 0.5;\n }\n}\n\n/* Content */\n.autoui-content {\n flex: 1;\n width: 100%;\n}\n\n/* Error states */\n.autoui-error {\n padding: 1rem;\n border: 1px solid #fca5a5;\n background-color: #fee2e2;\n color: #b91c1c;\n border-radius: 0.25rem;\n margin-top: 1rem;\n}\n\n.autoui-error-title {\n font-weight: 600;\n}\n\n.autoui-error-message {\n font-size: 0.875rem;\n} "],"mappings":";AAEA,CAAC;AACC,WAAS;AACT,kBAAgB;AAChB,UAAQ;AACR,SAAO;AACT;AAGA,CAAC;AACC,SAAO;AACP,UAAQ;AACV;AAEA,CAAC;AACC,WAAS;AACT,kBAAgB;AAChB,OAAK;AACL,WAAS;AACX;AAEA,CAAC;AACC,UAAQ;AACR,oBAAkB;AAClB,iBAAe;AACf,aAAW,MAAM,GAAG,aAAa,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG;AACnD;AAEA,CAAC;AACC,UAAQ;AACR,oBAAkB;AAClB,iBAAe;AACf,aAAW,MAAM,GAAG,aAAa,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG;AACnD;AAEA,WAVa;AAWX;AACE,aAAS;AACX;AACA;AACE,aAAS;AACX;AACF;AAGA,CAAC;AACC,QAAM;AACN,SAAO;AACT;AAGA,CAAC;AACC,WAAS;AACT,UAAQ,IAAI,MAAM;AAClB,oBAAkB;AAClB,SAAO;AACP,iBAAe;AACf,cAAY;AACd;AAEA,CAAC;AACC,eAAa;AACf;AAEA,CAAC;AACC,aAAW;AACb;","names":[]}
1
+ {"version":3,"sources":["../src/styles/autoui.css"],"sourcesContent":["/* AutoUI Component Styles */\n\n.autoui-root {\n display: flex;\n flex-direction: column;\n height: 100%;\n width: 100%;\n}\n\n/* Loading states */\n.autoui-loading {\n width: 100%;\n height: 100%;\n}\n\n.autoui-shimmer-container {\n display: flex;\n flex-direction: column;\n gap: 1rem;\n padding: 1rem;\n}\n\n.autoui-shimmer-header {\n height: 2.5rem;\n background-color: #e5e7eb;\n border-radius: 0.25rem;\n animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;\n}\n\n.autoui-shimmer-content {\n height: 16rem;\n background-color: #e5e7eb;\n border-radius: 0.25rem;\n animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;\n}\n\n@keyframes pulse {\n 0%, 100% {\n opacity: 1;\n }\n 50% {\n opacity: 0.5;\n }\n}\n\n/* Content */\n.autoui-content {\n flex: 1;\n width: 100%;\n}\n\n/* Error states */\n.autoui-error {\n padding: 1rem;\n border: 1px solid #fca5a5;\n background-color: #fee2e2;\n color: #b91c1c;\n border-radius: 0.25rem;\n margin-top: 1rem;\n}\n\n.autoui-error-title {\n font-weight: 600;\n}\n\n.autoui-error-message {\n font-size: 0.875rem;\n}\n\n/* Style for the mock Container component in shadcn.tsx */\n.autoui-mock-container {\n color: inherit;\n width: 100%;\n /* text-gray-800 */\n color: #1f2937; \n}\n\n/* Dark mode styling for the mock Container */\n@media (prefers-color-scheme: dark) {\n .autoui-mock-container {\n /* dark:text-gray-100 */\n color: #f3f4f6;\n }\n} "],"mappings":";AAEA,CAAC;AACC,WAAS;AACT,kBAAgB;AAChB,UAAQ;AACR,SAAO;AACT;AAGA,CAAC;AACC,SAAO;AACP,UAAQ;AACV;AAEA,CAAC;AACC,WAAS;AACT,kBAAgB;AAChB,OAAK;AACL,WAAS;AACX;AAEA,CAAC;AACC,UAAQ;AACR,oBAAkB;AAClB,iBAAe;AACf,aAAW,MAAM,GAAG,aAAa,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG;AACnD;AAEA,CAAC;AACC,UAAQ;AACR,oBAAkB;AAClB,iBAAe;AACf,aAAW,MAAM,GAAG,aAAa,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG;AACnD;AAEA,WAVa;AAWX;AACE,aAAS;AACX;AACA;AACE,aAAS;AACX;AACF;AAGA,CAAC;AACC,QAAM;AACN,SAAO;AACT;AAGA,CAAC;AACC,WAAS;AACT,UAAQ,IAAI,MAAM;AAClB,oBAAkB;AAClB,SAAO;AACP,iBAAe;AACf,cAAY;AACd;AAEA,CAAC;AACC,eAAa;AACf;AAEA,CAAC;AACC,aAAW;AACb;AAGA,CAAC;AACC,SAAO;AACP,SAAO;AAEP,SAAO;AACT;AAGA,OAAO,CAAC,oBAAoB,EAAE;AAC5B,GATD;AAWG,WAAO;AACT;AACF;","names":[]}