@geometra/ui 1.0.1 → 1.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 +26 -6
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -18,26 +18,46 @@ Semantics follow ARIA-like `role` / `ariaLabel` fields where applicable; full pl
|
|
|
18
18
|
npm install @geometra/ui
|
|
19
19
|
```
|
|
20
20
|
|
|
21
|
+
## Key exports
|
|
22
|
+
|
|
23
|
+
- `button`, `checkbox`, `radio`, `tabs`
|
|
24
|
+
- `input`, `selectControl`, `comboboxField`
|
|
25
|
+
- `dialog`, `toast`, `menu`, `commandPalette`
|
|
26
|
+
- `list`, `dataTable`, `treeView`
|
|
27
|
+
|
|
21
28
|
## Usage
|
|
22
29
|
|
|
23
30
|
```ts
|
|
24
|
-
import {
|
|
31
|
+
import { input, toast, dataTable } from '@geometra/ui'
|
|
25
32
|
import { box, signal } from '@geometra/core'
|
|
26
33
|
|
|
27
34
|
const msg = signal('')
|
|
35
|
+
const rows = [
|
|
36
|
+
{ name: 'Ada', role: 'Admin' },
|
|
37
|
+
{ name: 'Linus', role: 'Editor' },
|
|
38
|
+
]
|
|
39
|
+
|
|
28
40
|
function view() {
|
|
29
41
|
return box({ flexDirection: 'column', gap: 8, padding: 16 }, [
|
|
30
42
|
input(msg.value, 'Type…', {
|
|
31
|
-
|
|
43
|
+
focused: true,
|
|
44
|
+
onKeyDown: (e) => {
|
|
45
|
+
if (e.key.length === 1) msg.set(msg.peek() + e.key)
|
|
46
|
+
},
|
|
32
47
|
}),
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
[{ a: 'Ada' }],
|
|
36
|
-
),
|
|
48
|
+
toast(`Draft: ${msg.value || 'empty'}`, { variant: 'info' }),
|
|
49
|
+
dataTable([{ key: 'name', header: 'Name' }, { key: 'role', header: 'Role' }], rows),
|
|
37
50
|
])
|
|
38
51
|
}
|
|
39
52
|
```
|
|
40
53
|
|
|
54
|
+
## Notes
|
|
55
|
+
|
|
56
|
+
- Primitives are renderer-agnostic `UIElement` builders. State, focus, menu open/close, filtering, and async data loading stay in your app.
|
|
57
|
+
- `input()` is controlled. You provide the current value, focus state, caret/selection state, and keyboard/composition handlers.
|
|
58
|
+
- Semantics use `role` and `ariaLabel` hints when applicable, but full platform accessibility still depends on the renderer and host integration.
|
|
59
|
+
|
|
41
60
|
## Links
|
|
42
61
|
|
|
43
62
|
- [Main repo](https://github.com/razroo/geometra)
|
|
63
|
+
- [Integration cookbook](https://github.com/razroo/geometra/blob/main/INTEGRATION_COOKBOOK.md)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@geometra/ui",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "Starter UI primitives built on @geometra/core",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -27,6 +27,6 @@
|
|
|
27
27
|
"check": "tsc --noEmit"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@geometra/core": "^1.0
|
|
30
|
+
"@geometra/core": "^1.1.0"
|
|
31
31
|
}
|
|
32
32
|
}
|