@quereus/shared-ui 0.2.1
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 -0
- package/dist/index.cjs +2 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -0
- package/package.json +60 -0
package/README.md
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
# @quereus/shared-ui
|
|
2
|
+
|
|
3
|
+
Shared React UI components for Quereus applications. Provides common components used across quoomb-web and other Quereus-based UIs.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @quereus/shared-ui
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import { ResultsTable, QueryEditor, SchemaViewer } from '@quereus/shared-ui';
|
|
15
|
+
import '@quereus/shared-ui/styles';
|
|
16
|
+
|
|
17
|
+
function App() {
|
|
18
|
+
const [results, setResults] = useState(null);
|
|
19
|
+
|
|
20
|
+
return (
|
|
21
|
+
<div>
|
|
22
|
+
<QueryEditor
|
|
23
|
+
onExecute={async (sql) => {
|
|
24
|
+
const rows = await db.all(sql);
|
|
25
|
+
setResults(rows);
|
|
26
|
+
}}
|
|
27
|
+
/>
|
|
28
|
+
{results && <ResultsTable data={results} />}
|
|
29
|
+
</div>
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Components
|
|
35
|
+
|
|
36
|
+
### ResultsTable
|
|
37
|
+
|
|
38
|
+
Displays query results in a tabular format:
|
|
39
|
+
|
|
40
|
+
```typescript
|
|
41
|
+
<ResultsTable
|
|
42
|
+
data={rows}
|
|
43
|
+
columns={['id', 'name', 'email']}
|
|
44
|
+
sortable={true}
|
|
45
|
+
onRowClick={(row) => console.log('Selected:', row)}
|
|
46
|
+
/>
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### QueryEditor
|
|
50
|
+
|
|
51
|
+
SQL query input with syntax highlighting:
|
|
52
|
+
|
|
53
|
+
```typescript
|
|
54
|
+
<QueryEditor
|
|
55
|
+
initialValue="SELECT * FROM users"
|
|
56
|
+
onExecute={handleExecute}
|
|
57
|
+
placeholder="Enter SQL..."
|
|
58
|
+
/>
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### SchemaViewer
|
|
62
|
+
|
|
63
|
+
Display database schema with tables and columns:
|
|
64
|
+
|
|
65
|
+
```typescript
|
|
66
|
+
<SchemaViewer
|
|
67
|
+
tables={[
|
|
68
|
+
{ name: 'users', columns: ['id', 'name', 'email'] },
|
|
69
|
+
{ name: 'orders', columns: ['id', 'user_id', 'total'] }
|
|
70
|
+
]}
|
|
71
|
+
onTableSelect={(name) => console.log('Selected table:', name)}
|
|
72
|
+
/>
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## Styles
|
|
76
|
+
|
|
77
|
+
Import the stylesheet for proper styling:
|
|
78
|
+
|
|
79
|
+
```typescript
|
|
80
|
+
import '@quereus/shared-ui/styles';
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
Or in CSS:
|
|
84
|
+
|
|
85
|
+
```css
|
|
86
|
+
@import '@quereus/shared-ui/dist/styles.css';
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## Development
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
npm run build # Build components
|
|
93
|
+
npm run dev # Watch mode
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
## Related Packages
|
|
97
|
+
|
|
98
|
+
- [`quoomb-web`](../quoomb-web/) - Web-based SQL IDE using these components
|
|
99
|
+
|
|
100
|
+
## License
|
|
101
|
+
|
|
102
|
+
MIT
|
|
103
|
+
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../src/index.ts"],"sourcesContent":["// Shared UI components for Quoomb applications\r\n// This package will contain reusable UI components like buttons, modals, etc.\r\n\r\n// TODO: Implement and export UI components\r\n// export { Button } from './Button.js';\r\n// export { Modal } from './Modal.js';\r\n// export { Toast } from './Toast.js';\r\n\r\n// For now, export a placeholder\r\nexport const placeholder = 'Shared UI components coming soon';\r\n"],"names":["placeholder"],"mappings":"gFASO,MAAMA,EAAc"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":["// Shared UI components for Quoomb applications\r\n// This package will contain reusable UI components like buttons, modals, etc.\r\n\r\n// TODO: Implement and export UI components\r\n// export { Button } from './Button.js';\r\n// export { Modal } from './Modal.js';\r\n// export { Toast } from './Toast.js';\r\n\r\n// For now, export a placeholder\r\nexport const placeholder = 'Shared UI components coming soon';\r\n"],"names":["placeholder"],"mappings":"AASO,MAAMA,IAAc;"}
|
package/package.json
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@quereus/shared-ui",
|
|
3
|
+
"version": "0.2.1",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "Quoomb UI Kit - Shared UI components for Quoomb applications",
|
|
6
|
+
"publisher": "Got Choices Foundation",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/gotchoices/quereus.git",
|
|
10
|
+
"directory": "packages/shared-ui"
|
|
11
|
+
},
|
|
12
|
+
"license": "MIT",
|
|
13
|
+
"main": "dist/index.js",
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
15
|
+
"files": [
|
|
16
|
+
"dist",
|
|
17
|
+
"!**/*.tsbuildinfo"
|
|
18
|
+
],
|
|
19
|
+
"exports": {
|
|
20
|
+
".": {
|
|
21
|
+
"types": "./dist/index.d.ts",
|
|
22
|
+
"import": "./dist/index.js"
|
|
23
|
+
},
|
|
24
|
+
"./styles": "./dist/styles.css"
|
|
25
|
+
},
|
|
26
|
+
"scripts": {
|
|
27
|
+
"clean": "rimraf dist",
|
|
28
|
+
"build": "tsc && vite build --mode lib",
|
|
29
|
+
"dev": "vite build --mode lib --watch",
|
|
30
|
+
"lint": "eslint src/**/*.{ts,tsx}",
|
|
31
|
+
"test": "vitest",
|
|
32
|
+
"typecheck": "tsc --noEmit",
|
|
33
|
+
"storybook": "storybook dev -p 6006",
|
|
34
|
+
"build-storybook": "storybook build"
|
|
35
|
+
},
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"@storybook/react": "^9.0.2",
|
|
38
|
+
"@storybook/react-vite": "^9.0.2",
|
|
39
|
+
"@types/react": "^19.1.6",
|
|
40
|
+
"@types/react-dom": "^19.1.5",
|
|
41
|
+
"@typescript-eslint/eslint-plugin": "^8.33.0",
|
|
42
|
+
"@typescript-eslint/parser": "^8.33.0",
|
|
43
|
+
"@vitejs/plugin-react": "^4.5.0",
|
|
44
|
+
"eslint": "^9.28.0",
|
|
45
|
+
"rimraf": "^6.1.2",
|
|
46
|
+
"typescript": "^5.8.3",
|
|
47
|
+
"vite": "^6.3.5",
|
|
48
|
+
"vitest": "^3.1.4"
|
|
49
|
+
},
|
|
50
|
+
"dependencies": {
|
|
51
|
+
"clsx": "^2.1.1",
|
|
52
|
+
"lucide-react": "^0.511.0",
|
|
53
|
+
"react": "^19.1.0",
|
|
54
|
+
"react-dom": "^19.1.0"
|
|
55
|
+
},
|
|
56
|
+
"peerDependencies": {
|
|
57
|
+
"react": "^19.1.0",
|
|
58
|
+
"react-dom": "^19.1.0"
|
|
59
|
+
}
|
|
60
|
+
}
|