@chellaa/react 0.2.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 +180 -0
- package/dist/index.cjs +523 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.css +674 -0
- package/dist/index.css.map +1 -0
- package/dist/index.d.cts +203 -0
- package/dist/index.d.ts +203 -0
- package/dist/index.mjs +495 -0
- package/dist/index.mjs.map +1 -0
- package/dist/index.node.mjs +494 -0
- package/dist/styles.css +1 -0
- package/dist/styles.css.d.cts +2 -0
- package/dist/styles.css.d.ts +2 -0
- package/package.json +111 -0
- package/styles.css +1 -0
- package/styles.css.d.ts +2 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Ezhil Selvan P
|
|
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,180 @@
|
|
|
1
|
+
# @chellaa/react
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@chellaa/react)
|
|
4
|
+
[](https://github.com/chellaa/chellaa-react/blob/main/LICENSE)
|
|
5
|
+
[](https://bundlephobia.com/package/@chellaa/react)
|
|
6
|
+
[](https://www.w3.org/WAI/standards-guidelines/wcag/)
|
|
7
|
+
[](https://www.typescriptlang.org/)
|
|
8
|
+
|
|
9
|
+
> **Production-grade, accessible, high-performance React component library and design system engine built with zero-runtime CSS custom properties.**
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Highlights
|
|
14
|
+
|
|
15
|
+
- **Zero-Configuration Styling**: Uses standard CSS cascade layers (`@layer cl-components`) injected automatically for browser bundlers—no Tailwind config, PostCSS plugins, or runtime CSS-in-JS overhead required.
|
|
16
|
+
- **Strict WCAG 2.2 AA Accessibility**: Rigorously validated with `@testing-library`, `vitest-axe`, explicit keyboard keymaps (`Space`, `Enter`, `Tab`), high-contrast focus rings, and proper ARIA semantics.
|
|
17
|
+
- **3-Tier Design Token Architecture**: Primitive Ramps $\rightarrow$ Semantic Intent $\rightarrow$ Component Scope. Every visual variable can be overridden at the root or component level without breaking library upgrades.
|
|
18
|
+
- **Zero-FOUC Theme Engine**: Complete light/dark/system theme orchestration with `ThemeProvider`, `useTheme`, and SSR-safe `ThemeScript`.
|
|
19
|
+
- **Polymorphic Slot Delegation (`asChild`)**: Render custom router links (Next.js `<Link>`, Remix/React Router `<Link>`) with full button behaviors and styles without invalid nested `<button>` tags.
|
|
20
|
+
- **Universal Runtime Architecture**: Dual ESM (`.mjs`) and CommonJS (`.cjs`) distributions, clean Node.js SSR support (`index.node.mjs`), and comprehensive TypeScript typings (`.d.ts` & `.d.cts`).
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## Installation
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
# Using pnpm (recommended)
|
|
28
|
+
pnpm add @chellaa/react
|
|
29
|
+
|
|
30
|
+
# Using npm
|
|
31
|
+
npm install @chellaa/react
|
|
32
|
+
|
|
33
|
+
# Using yarn
|
|
34
|
+
yarn add @chellaa/react
|
|
35
|
+
|
|
36
|
+
# Using bun
|
|
37
|
+
bun add @chellaa/react
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Peer Dependencies
|
|
41
|
+
`@chellaa/react` requires React 18.2.0 or later:
|
|
42
|
+
```json
|
|
43
|
+
{
|
|
44
|
+
"peerDependencies": {
|
|
45
|
+
"react": ">=18.2.0",
|
|
46
|
+
"react-dom": ">=18.2.0"
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## Quick Start
|
|
54
|
+
|
|
55
|
+
Wrap your application root with `ThemeProvider` and start using components:
|
|
56
|
+
|
|
57
|
+
```tsx
|
|
58
|
+
import * as React from "react";
|
|
59
|
+
import { Button, ButtonGroup, ThemeProvider } from "@chellaa/react";
|
|
60
|
+
|
|
61
|
+
export function App() {
|
|
62
|
+
return (
|
|
63
|
+
<ThemeProvider defaultTheme="system">
|
|
64
|
+
<main style={{ padding: "40px", display: "flex", flexDirection: "column", gap: "24px" }}>
|
|
65
|
+
<h1>Welcome to Chellaa React</h1>
|
|
66
|
+
|
|
67
|
+
{/* Individual Button */}
|
|
68
|
+
<Button variant="solid" colorScheme="primary" onClick={() => alert("Action triggered!")}>
|
|
69
|
+
Primary Action
|
|
70
|
+
</Button>
|
|
71
|
+
|
|
72
|
+
{/* Attached Segmented Button Group */}
|
|
73
|
+
<ButtonGroup isAttached variant="outline" colorScheme="neutral">
|
|
74
|
+
<Button>Day</Button>
|
|
75
|
+
<Button>Week</Button>
|
|
76
|
+
<Button>Month</Button>
|
|
77
|
+
<Button>Year</Button>
|
|
78
|
+
</ButtonGroup>
|
|
79
|
+
</main>
|
|
80
|
+
</ThemeProvider>
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
## Core Components
|
|
88
|
+
|
|
89
|
+
### `Button`
|
|
90
|
+
Versatile, interactive action trigger supporting 5 variants, 5 sizes, 7 color schemes, loading states, directional icon slots, and slot delegation:
|
|
91
|
+
|
|
92
|
+
```tsx
|
|
93
|
+
import { Button } from "@chellaa/react";
|
|
94
|
+
import { FiSend } from "react-icons/fi";
|
|
95
|
+
|
|
96
|
+
<Button
|
|
97
|
+
variant="solid" // "solid" | "outline" | "ghost" | "subtle" | "link"
|
|
98
|
+
size="md" // "xs" | "sm" | "md" | "lg" | "xl"
|
|
99
|
+
colorScheme="primary" // "primary" | "secondary" | "neutral" | "success" | "warning" | "danger" | "info"
|
|
100
|
+
isLoading={false}
|
|
101
|
+
loadingPosition="start" // "start" | "end" | "center"
|
|
102
|
+
startIcon={<FiSend />}
|
|
103
|
+
>
|
|
104
|
+
Send Message
|
|
105
|
+
</Button>
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
#### Framework Link Delegation (`asChild`)
|
|
109
|
+
Avoid invalid nested interactive elements when integrating with Next.js or React Router:
|
|
110
|
+
|
|
111
|
+
```tsx
|
|
112
|
+
import Link from "next/link";
|
|
113
|
+
import { Button } from "@chellaa/react";
|
|
114
|
+
|
|
115
|
+
<Button asChild variant="outline" colorScheme="primary">
|
|
116
|
+
<Link href="/dashboard">
|
|
117
|
+
Go to Dashboard
|
|
118
|
+
</Link>
|
|
119
|
+
</Button>
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
### `ButtonGroup`
|
|
125
|
+
Container coordinating spacing, attached segment styling, orientation, and context propagation:
|
|
126
|
+
|
|
127
|
+
```tsx
|
|
128
|
+
import { ButtonGroup, Button } from "@chellaa/react";
|
|
129
|
+
|
|
130
|
+
<ButtonGroup isAttached orientation="horizontal" variant="outline" colorScheme="primary">
|
|
131
|
+
<Button>Cut</Button>
|
|
132
|
+
<Button>Copy</Button>
|
|
133
|
+
<Button>Paste</Button>
|
|
134
|
+
</ButtonGroup>
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
---
|
|
138
|
+
|
|
139
|
+
## Theming & Dark Mode
|
|
140
|
+
|
|
141
|
+
Chellaa React handles theming through standard CSS custom properties without style injection flicker:
|
|
142
|
+
|
|
143
|
+
```tsx
|
|
144
|
+
import { useTheme } from "@chellaa/react";
|
|
145
|
+
|
|
146
|
+
export function ThemeToggle() {
|
|
147
|
+
const { theme, setTheme, systemTheme } = useTheme();
|
|
148
|
+
|
|
149
|
+
return (
|
|
150
|
+
<button onClick={() => setTheme(theme === "dark" ? "light" : "dark")}>
|
|
151
|
+
Current: {theme} (System: {systemTheme})
|
|
152
|
+
</button>
|
|
153
|
+
);
|
|
154
|
+
}
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
---
|
|
158
|
+
|
|
159
|
+
## Distribution & Export Verification
|
|
160
|
+
|
|
161
|
+
Package integrity is continuously verified with a multi-stage validation matrix:
|
|
162
|
+
- **Node ESM Resolution**: PASSED
|
|
163
|
+
- **Node CommonJS `require()`**: PASSED
|
|
164
|
+
- **Server-Side Rendering (SSR)**: PASSED
|
|
165
|
+
- **CSS Stylesheet Integrity**: PASSED
|
|
166
|
+
- **NPM Package Archive Payload**: PASSED (<45kB gzip)
|
|
167
|
+
|
|
168
|
+
---
|
|
169
|
+
|
|
170
|
+
## Documentation & Community
|
|
171
|
+
|
|
172
|
+
- **Official Documentation**: [https://chellaa.dev](https://chellaa.dev)
|
|
173
|
+
- **GitHub Repository**: [https://github.com/chellaa/chellaa-react](https://github.com/chellaa/chellaa-react)
|
|
174
|
+
- **Issue Tracker**: [https://github.com/chellaa/chellaa-react/issues](https://github.com/chellaa/chellaa-react/issues)
|
|
175
|
+
|
|
176
|
+
---
|
|
177
|
+
|
|
178
|
+
## License
|
|
179
|
+
|
|
180
|
+
MIT © [Ezhil Selvan P](https://github.com/chellaa)
|