orynn 0.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/LICENSE +21 -0
- package/README.md +71 -0
- package/dist/index.cjs +823 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +400 -0
- package/dist/index.d.ts +400 -0
- package/dist/index.js +809 -0
- package/dist/index.js.map +1 -0
- package/dist/styles.css +201 -0
- package/package.json +82 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 rajveer
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# orynn
|
|
2
|
+
|
|
3
|
+
> A small, strongly-typed, JSON-driven form library for React.
|
|
4
|
+
|
|
5
|
+
`orynn` gives you a `<Fieldset>` that renders a form from a config object, plus `<Input>` and
|
|
6
|
+
`<Dropdown>` controls you can use entirely on their own. V1 is intentionally small — a clean
|
|
7
|
+
foundation designed so validation, theming, and new field types can grow later without breaking
|
|
8
|
+
the public API.
|
|
9
|
+
|
|
10
|
+
- **JSON-driven** — describe fields in a strongly-typed config, get an accessible responsive form.
|
|
11
|
+
- **Standalone controls** — `<Input>` and `<Dropdown>` work without `<Fieldset>`.
|
|
12
|
+
- **Extensible by design** — field registry, pluggable validation resolver, CSS-variable tokens.
|
|
13
|
+
- **Zero runtime dependencies** — `react` is the only peer. ESM + CJS. Tree-shakeable.
|
|
14
|
+
|
|
15
|
+
> Status: `0.x`. The core API (`Fieldset`, `Input`, `Dropdown`, `useFieldsetState`) is stable in
|
|
16
|
+
> intent; APIs marked `@experimental` (the field registry, `registerRule`) may change before `1.0`.
|
|
17
|
+
|
|
18
|
+
## Install
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
npm install orynn
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
```tsx
|
|
25
|
+
import { Fieldset } from "orynn";
|
|
26
|
+
import "orynn/styles.css";
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Quick start
|
|
30
|
+
|
|
31
|
+
```tsx
|
|
32
|
+
import { Fieldset, type FieldsetConfig } from "orynn";
|
|
33
|
+
import "orynn/styles.css";
|
|
34
|
+
|
|
35
|
+
const config: FieldsetConfig = {
|
|
36
|
+
legend: "Personal details",
|
|
37
|
+
fields: [
|
|
38
|
+
{ name: "firstName", type: "input", label: "First name", validation: { required: true, minLength: 2 } },
|
|
39
|
+
{ name: "country", type: "dropdown", label: "Country", validation: { required: true },
|
|
40
|
+
options: [{ label: "India", value: "IN" }, { label: "Indonesia", value: "ID" }] },
|
|
41
|
+
],
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export function Form() {
|
|
45
|
+
return <Fieldset config={config} onChange={(values) => console.log(values)} />;
|
|
46
|
+
}
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Standalone:
|
|
50
|
+
|
|
51
|
+
```tsx
|
|
52
|
+
import { Input, Dropdown } from "orynn";
|
|
53
|
+
|
|
54
|
+
<Input label="Name" value={name} onChange={setName} required />
|
|
55
|
+
<Dropdown label="Country" value={country} onChange={setCountry} options={options} />
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Docs
|
|
59
|
+
|
|
60
|
+
- [Getting started](docs/getting-started.md)
|
|
61
|
+
- [`Fieldset`](docs/fieldset.md) · [`Input`](docs/input.md) · [`Dropdown`](docs/dropdown.md)
|
|
62
|
+
- [JSON configuration](docs/json-config.md)
|
|
63
|
+
- [Validation](docs/validation.md)
|
|
64
|
+
- [Layout](docs/layout.md)
|
|
65
|
+
- [Extensibility](docs/extensibility.md)
|
|
66
|
+
- [Accessibility](docs/accessibility.md)
|
|
67
|
+
- [Architecture](ARCHITECTURE.md) · [Roadmap / postponed](FUTURE.md)
|
|
68
|
+
|
|
69
|
+
## License
|
|
70
|
+
|
|
71
|
+
MIT
|