@bysages/react 0.0.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 +75 -0
- package/dist/index.d.mts +14159 -0
- package/dist/index.mjs +11548 -0
- package/package.json +67 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 By Sages
|
|
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,75 @@
|
|
|
1
|
+
# @bysages/react
|
|
2
|
+
|
|
3
|
+

|
|
4
|
+

|
|
5
|
+

|
|
6
|
+
|
|
7
|
+
> By Sages Elements for React — 70+ accessible component families, headless by construction, dressed by the paper-and-ink style layer. Ported from the Vue reference implementation, API for API.
|
|
8
|
+
|
|
9
|
+
## Features
|
|
10
|
+
|
|
11
|
+
- 🧩 **70+ families** — actions, forms, overlays, navigation, data, layout, and an AI conversation family on ai-sdk formats
|
|
12
|
+
- 🏛️ **Headless inside** — interaction, state, ARIA, and positioning come from proven headless state machines; wrappers add API narrowing and style injection, no DOM of their own
|
|
13
|
+
- 🎨 **Token-styled** — every visual value is a CSS custom property from `@bysages/core`; light/dark, accent pigments, contrast and density tiers are data, never hardcoded styles
|
|
14
|
+
- 📦 **Container-driven** — components respond to `@container`, not the viewport; the same component composes in a sidebar, a card, or a page
|
|
15
|
+
- 💡 **Styles on import** — each family injects its stylesheet at module load, guarded against double-injection
|
|
16
|
+
- 📊 **DataTable included** — a TanStack Table v9 integration with drag reordering, pinning, tree data, and virtualization
|
|
17
|
+
|
|
18
|
+
## Installation
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
# pnpm
|
|
22
|
+
pnpm add @bysages/react @bysages/core
|
|
23
|
+
|
|
24
|
+
# npm
|
|
25
|
+
npm install @bysages/react @bysages/core
|
|
26
|
+
|
|
27
|
+
# yarn
|
|
28
|
+
yarn add @bysages/react @bysages/core
|
|
29
|
+
|
|
30
|
+
# bun
|
|
31
|
+
bun add @bysages/react @bysages/core
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Quick Start
|
|
35
|
+
|
|
36
|
+
Import the token stylesheet once, theme the document, then use the components:
|
|
37
|
+
|
|
38
|
+
```tsx
|
|
39
|
+
// main.tsx
|
|
40
|
+
import "@bysages/tokens/css";
|
|
41
|
+
import { applyTheme } from "@bysages/core";
|
|
42
|
+
|
|
43
|
+
applyTheme({ mode: "system", accent: "ink" });
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
```tsx
|
|
47
|
+
// App.tsx
|
|
48
|
+
import { Button, Dialog } from "@bysages/react";
|
|
49
|
+
|
|
50
|
+
export function App() {
|
|
51
|
+
return (
|
|
52
|
+
<Dialog.Root>
|
|
53
|
+
<Dialog.Trigger asChild>
|
|
54
|
+
<Button>Delete item</Button>
|
|
55
|
+
</Dialog.Trigger>
|
|
56
|
+
<Dialog.Backdrop />
|
|
57
|
+
<Dialog.Positioner>
|
|
58
|
+
<Dialog.Content>
|
|
59
|
+
<Dialog.Title>Delete item</Dialog.Title>
|
|
60
|
+
<Dialog.Description>This action cannot be undone.</Dialog.Description>
|
|
61
|
+
<Dialog.CloseTrigger>×</Dialog.CloseTrigger>
|
|
62
|
+
</Dialog.Content>
|
|
63
|
+
</Dialog.Positioner>
|
|
64
|
+
</Dialog.Root>
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Documentation
|
|
70
|
+
|
|
71
|
+
The [documentation site](https://elements.bysages.com) carries every family with live demos and props tables.
|
|
72
|
+
|
|
73
|
+
## License
|
|
74
|
+
|
|
75
|
+
- [MIT](../../LICENSE) © [By Sages](https://www.bysages.com/)
|