@voidable/ui-react 0.8.1 → 0.10.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 +4 -0
- package/dist/index.d.ts +3 -3
- package/llms.txt +29 -0
- package/package.json +7 -5
package/README.md
CHANGED
|
@@ -86,6 +86,10 @@ The package starts with `"use client"`, so the components can be imported from A
|
|
|
86
86
|
|
|
87
87
|
`useTheme()` returns the colour scheme in force, `'dark'` or `'light'`: what the page shows, not just the attribute. With `<html data-theme>` unset or `"system"` it reports what the theme resolves, so a theme or skin that prefers a scheme (Loft prefers light) is counted, and otherwise the operating system's `prefers-color-scheme`. It updates when the attribute or the operating system preference changes. During server rendering, and on the first render of a hydrating tree, it is `'dark'` (the server cannot know the visitor's preference); React then re-renders with the real value, with no hydration warning. It is read-only: set `data-theme` on `<html>` to change the scheme.
|
|
88
88
|
|
|
89
|
+
## For AI agents
|
|
90
|
+
|
|
91
|
+
`@voidable/ui-react/llms.txt` (in the package root) summarises this adapter's API: the naming rule, props, events and `useTheme`. Every element's parts, attributes and events are in `@voidable/ui/reference.md` (`node_modules/@voidable/ui/dist/reference.md`).
|
|
92
|
+
|
|
89
93
|
## Documentation
|
|
90
94
|
|
|
91
95
|
- [Documentation](https://voidable.dev)
|
package/dist/index.d.ts
CHANGED
|
@@ -133,7 +133,7 @@ export declare const ActionInput: default_2.ForwardRefExoticComponent<{
|
|
|
133
133
|
spellcheck?: boolean;
|
|
134
134
|
icon?: string;
|
|
135
135
|
actionLabel?: string;
|
|
136
|
-
iconSide?: "
|
|
136
|
+
iconSide?: "start" | "end";
|
|
137
137
|
/** Form field name; the value is submitted under it. */
|
|
138
138
|
name?: string;
|
|
139
139
|
/** Form validation: the control must have a value. */
|
|
@@ -582,7 +582,7 @@ export { DonutChartData }
|
|
|
582
582
|
|
|
583
583
|
export declare const Drawer: default_2.ForwardRefExoticComponent<{
|
|
584
584
|
open?: boolean;
|
|
585
|
-
side?: "left" | "right" | "top" | "bottom";
|
|
585
|
+
side?: "left" | "right" | "start" | "end" | "top" | "bottom";
|
|
586
586
|
size?: "sm" | "md" | "lg";
|
|
587
587
|
/** No close button; Escape and the backdrop do not close it. */
|
|
588
588
|
hideClose?: boolean;
|
|
@@ -1273,7 +1273,7 @@ export declare const Select: default_2.ForwardRefExoticComponent<{
|
|
|
1273
1273
|
} & default_2.RefAttributes<VoidSelect>>;
|
|
1274
1274
|
|
|
1275
1275
|
export declare const Sidebar: default_2.ForwardRefExoticComponent<{
|
|
1276
|
-
side?: "
|
|
1276
|
+
side?: "start" | "end";
|
|
1277
1277
|
collapsed?: boolean;
|
|
1278
1278
|
width?: string;
|
|
1279
1279
|
collapsedWidth?: string;
|
package/llms.txt
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# @voidable/ui-react
|
|
2
|
+
|
|
3
|
+
> React wrappers for the Voidable UI web components. One React component per `<void-*>` element, with ref forwarding, typed props and typed `onVoid*` event props.
|
|
4
|
+
|
|
5
|
+
## Install and use
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
npm install @voidable/ui-react @voidable/ui @voidable/theme react
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
```tsx
|
|
12
|
+
import '@voidable/theme';
|
|
13
|
+
import { Button, Dialog, DialogTitle, Input, useTheme } from '@voidable/ui-react';
|
|
14
|
+
|
|
15
|
+
<Button variant="filled" color="error" onVoidClick={() => {}}>Delete</Button>
|
|
16
|
+
<Input aria-label="Name" onVoidChange={(e) => save(e.detail.value)} />
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## API
|
|
20
|
+
|
|
21
|
+
- Naming: `<void-foo-bar>` is `<FooBar>`; its parts are components too (`<void-dialog-title>` is `<DialogTitle>`). Importing the package registers every element.
|
|
22
|
+
- Props are the element's attributes; booleans, arrays and objects are set as properties (`disabled={false}` is really false). `className` maps to `class`; `aria-*` and `data-*` pass through.
|
|
23
|
+
- Events: `void-change` becomes `onVoidChange`, `void-click` `onVoidClick`, and so on; `event.detail` is typed per component. Overlays take a controlled `open` and fire `onVoidOpen` / `onVoidClose` with `{ reason }` (`OverlayOpenReason`, `OverlayCloseReason`); set state false in `onVoidClose`, or `preventDefault()` to keep it open.
|
|
24
|
+
- `useTheme()` returns `'dark' | 'light'`, the scheme the page is in.
|
|
25
|
+
- Types: `VoidEvents`, `OverlayOpenReason`, `OverlayCloseReason`, `BarChartData`, `LineChartData`, `DonutChartData`, `GaugeData`, `GaugeZone`. Charts take `data`.
|
|
26
|
+
|
|
27
|
+
## Full reference
|
|
28
|
+
|
|
29
|
+
Every `<void-*>` element (parts, attributes with allowed values, events with `detail`, examples) is in the core package: `@voidable/ui/reference.md` (`node_modules/@voidable/ui/dist/reference.md`), summarised in `@voidable/ui/llms.txt`. Online: https://voidable.dev/llms.txt. Offline per element: `voidable ref <tag>`.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@voidable/ui-react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"description": "React wrappers and hooks for Voidable UI web components",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -20,14 +20,16 @@
|
|
|
20
20
|
".": {
|
|
21
21
|
"types": "./dist/index.d.ts",
|
|
22
22
|
"default": "./dist/index.js"
|
|
23
|
-
}
|
|
23
|
+
},
|
|
24
|
+
"./llms.txt": "./llms.txt"
|
|
24
25
|
},
|
|
25
26
|
"files": [
|
|
26
|
-
"dist"
|
|
27
|
+
"dist",
|
|
28
|
+
"llms.txt"
|
|
27
29
|
],
|
|
28
30
|
"peerDependencies": {
|
|
29
31
|
"react": "^18.0.0 || ^19.0.0",
|
|
30
|
-
"@voidable/ui": "0.
|
|
32
|
+
"@voidable/ui": "0.10.0"
|
|
31
33
|
},
|
|
32
34
|
"devDependencies": {
|
|
33
35
|
"react": "^19.0.0",
|
|
@@ -40,7 +42,7 @@
|
|
|
40
42
|
"typescript": "^6.0.0",
|
|
41
43
|
"vite": "^8.0.0",
|
|
42
44
|
"vite-plugin-dts": "^4.5.0",
|
|
43
|
-
"@voidable/ui": "0.
|
|
45
|
+
"@voidable/ui": "0.10.0"
|
|
44
46
|
},
|
|
45
47
|
"repository": {
|
|
46
48
|
"type": "git",
|