@raydenui/ui 0.1.0 → 0.3.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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Rayden UI
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,239 @@
1
+ # Rayden UI
2
+
3
+ A modern, accessible React component library built with Tailwind CSS v4. Rayden UI brings the [Rayna UI](https://www.figma.com/community/file/1229854793310881425) Figma design system to life with pixel-perfect React components.
4
+
5
+ [![npm version](https://img.shields.io/npm/v/@raydenui/ui.svg)](https://www.npmjs.com/package/@raydenui/ui)
6
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
7
+
8
+ ## Features
9
+
10
+ - **15+ Production-Ready Components** — Buttons, Inputs, Tabs, Alerts, and more
11
+ - **Tailwind CSS v4** — Modern styling with custom design tokens
12
+ - **Fully Typed** — Complete TypeScript support with exported types
13
+ - **Accessible** — Built with ARIA attributes and keyboard navigation
14
+ - **Tree-Shakeable** — Import only what you need
15
+ - **Dual Format** — ESM and CommonJS builds included
16
+
17
+ ## Installation
18
+
19
+ ```bash
20
+ # npm
21
+ npm install @raydenui/ui
22
+
23
+ # pnpm
24
+ pnpm add @raydenui/ui
25
+
26
+ # yarn
27
+ yarn add @raydenui/ui
28
+ ```
29
+
30
+ ### Peer Dependencies
31
+
32
+ Rayden UI requires React 18 or higher:
33
+
34
+ ```bash
35
+ npm install react react-dom
36
+ ```
37
+
38
+ ## Quick Start
39
+
40
+ ### 1. Import the Styles
41
+
42
+ Add the Rayden UI stylesheet to your app's entry point:
43
+
44
+ ```tsx
45
+ // App.tsx or main.tsx
46
+ import "@raydenui/ui/styles.css";
47
+ ```
48
+
49
+ Or in CSS:
50
+
51
+ ```css
52
+ /* globals.css */
53
+ @import "@raydenui/ui/styles.css";
54
+ ```
55
+
56
+ ### 2. Use Components
57
+
58
+ ```tsx
59
+ import { Button, Input, Badge } from "@raydenui/ui";
60
+
61
+ function App() {
62
+ return (
63
+ <div className="flex flex-col gap-4 p-8">
64
+ <Input
65
+ label="Email"
66
+ placeholder="you@example.com"
67
+ helperText="We'll never share your email"
68
+ />
69
+ <Button variant="primary" size="lg">
70
+ Subscribe
71
+ </Button>
72
+ <Badge color="success">Active</Badge>
73
+ </div>
74
+ );
75
+ }
76
+ ```
77
+
78
+ ## Components
79
+
80
+ ### Forms & Inputs
81
+
82
+ | Component | Description |
83
+ |-----------|-------------|
84
+ | [Button](./docs/components/Button.md) | Primary action buttons with variants and icon support |
85
+ | [ButtonGroup](./docs/components/ButtonGroup.md) | Horizontal grouping of related buttons |
86
+ | [Input](./docs/components/Input.md) | Text input with label, helper text, and validation states |
87
+ | [Checkbox](./docs/components/FormControl.md#checkbox) | Checkbox input with label and description |
88
+ | [Radio](./docs/components/FormControl.md#radio) | Radio button input with label and description |
89
+ | [Toggle](./docs/components/FormControl.md#toggle) | Switch/toggle input for boolean values |
90
+ | [Chip](./docs/components/Chip.md) | Compact input tags with close/filter actions |
91
+
92
+ ### Navigation
93
+
94
+ | Component | Description |
95
+ |-----------|-------------|
96
+ | [Tabs](./docs/components/Tabs.md) | Tabbed navigation with line and pill variants |
97
+ | [Breadcrumb](./docs/components/Breadcrumb.md) | Hierarchical page navigation |
98
+ | [Pagination](./docs/components/Pagination.md) | Page navigation with prev/next controls |
99
+
100
+ ### Feedback
101
+
102
+ | Component | Description |
103
+ |-----------|-------------|
104
+ | [Alert](./docs/components/Alert.md) | Toast and banner notifications with actions |
105
+ | [Badge](./docs/components/Badge.md) | Status indicators and labels |
106
+ | [ProgressBar](./docs/components/ProgressBar.md) | Linear progress indicator |
107
+ | [ProgressCircle](./docs/components/ProgressCircle.md) | Circular progress indicator |
108
+ | [Tooltip](./docs/components/Tooltip.md) | Contextual information popover |
109
+
110
+ ### Layout
111
+
112
+ | Component | Description |
113
+ |-----------|-------------|
114
+ | [Divider](./docs/components/Divider.md) | Content separator with optional label/button |
115
+
116
+ ## Design Tokens
117
+
118
+ Rayden UI includes a complete design token system extracted from the Rayna UI Figma design system.
119
+
120
+ ### Using Tokens with Tailwind
121
+
122
+ All tokens are available as Tailwind CSS v4 theme variables:
123
+
124
+ ```tsx
125
+ // Use token colors directly in Tailwind classes
126
+ <div className="bg-primary-400 text-grey-900">
127
+ Primary background with grey text
128
+ </div>
129
+
130
+ // Custom shadows
131
+ <div className="shadow-soft-lg">
132
+ Soft shadow effect
133
+ </div>
134
+ ```
135
+
136
+ ### Importing Tokens Programmatically
137
+
138
+ ```tsx
139
+ import { colors, shadows, spacing, typography } from "@raydenui/ui/preset";
140
+
141
+ // Access tokens in JavaScript
142
+ console.log(colors.primary[400]); // "#F56630"
143
+ console.log(shadows.soft.lg); // "0px 4px 6px..."
144
+ ```
145
+
146
+ ### Color Palette
147
+
148
+ | Scale | Primary | Secondary | Grey | Success | Error | Warning |
149
+ |-------|---------|-----------|------|---------|-------|---------|
150
+ | 50 | ![#FFECE5](https://via.placeholder.com/12/FFECE5/FFECE5.png) `#FFECE5` | ![#E3EFFC](https://via.placeholder.com/12/E3EFFC/E3EFFC.png) `#E3EFFC` | ![#F9FAFB](https://via.placeholder.com/12/F9FAFB/F9FAFB.png) `#F9FAFB` | ![#E7F6EC](https://via.placeholder.com/12/E7F6EC/E7F6EC.png) `#E7F6EC` | ![#FBEAE9](https://via.placeholder.com/12/FBEAE9/FBEAE9.png) `#FBEAE9` | ![#FEF6E7](https://via.placeholder.com/12/FEF6E7/FEF6E7.png) `#FEF6E7` |
151
+ | 400 | ![#F56630](https://via.placeholder.com/12/F56630/F56630.png) `#F56630` | ![#1671D9](https://via.placeholder.com/12/1671D9/1671D9.png) `#1671D9` | ![#98A2B3](https://via.placeholder.com/12/98A2B3/98A2B3.png) `#98A2B3` | ![#0F973D](https://via.placeholder.com/12/0F973D/0F973D.png) `#0F973D` | ![#D42620](https://via.placeholder.com/12/D42620/D42620.png) `#D42620` | ![#F3A218](https://via.placeholder.com/12/F3A218/F3A218.png) `#F3A218` |
152
+ | 700 | ![#AD3307](https://via.placeholder.com/12/AD3307/AD3307.png) `#AD3307` | ![#04326B](https://via.placeholder.com/12/04326B/04326B.png) `#04326B` | ![#344054](https://via.placeholder.com/12/344054/344054.png) `#344054` | ![#036B26](https://via.placeholder.com/12/036B26/036B26.png) `#036B26` | ![#9E0A05](https://via.placeholder.com/12/9E0A05/9E0A05.png) `#9E0A05` | ![#865503](https://via.placeholder.com/12/865503/865503.png) `#865503` |
153
+
154
+ See [Design Tokens Documentation](./docs/design-tokens.md) for the complete reference.
155
+
156
+ ## Development
157
+
158
+ ### Prerequisites
159
+
160
+ - Node.js 18+
161
+ - pnpm 8+
162
+
163
+ ### Setup
164
+
165
+ ```bash
166
+ # Clone the repository
167
+ git clone https://github.com/your-org/rayden.git
168
+ cd rayden
169
+
170
+ # Install dependencies
171
+ pnpm install
172
+
173
+ # Start Storybook
174
+ pnpm storybook
175
+ ```
176
+
177
+ ### Commands
178
+
179
+ ```bash
180
+ pnpm build # Build the library
181
+ pnpm dev # Watch mode for development
182
+ pnpm typecheck # Run TypeScript type checking
183
+ pnpm storybook # Start Storybook on port 6006
184
+ pnpm build-storybook # Build static Storybook
185
+ ```
186
+
187
+ ### Testing
188
+
189
+ Tests run via Storybook's Vitest addon with Playwright browser testing:
190
+
191
+ ```bash
192
+ pnpm exec vitest # Run all tests
193
+ pnpm exec vitest Button # Run tests matching "Button"
194
+ pnpm exec vitest --watch # Watch mode
195
+ ```
196
+
197
+ ### Project Structure
198
+
199
+ ```
200
+ src/
201
+ ├── components/ # React components
202
+ │ ├── Button/
203
+ │ │ ├── Button.tsx
204
+ │ │ ├── Button.stories.tsx
205
+ │ │ └── index.ts
206
+ │ └── ...
207
+ ├── styles/
208
+ │ └── globals.css # Tailwind v4 theme tokens
209
+ ├── utils/
210
+ │ └── cn.ts # Class merging utility
211
+ ├── index.ts # Component exports
212
+ └── preset.ts # Design token exports
213
+ ```
214
+
215
+ ## Contributing
216
+
217
+ We welcome contributions! Please see our [Contributing Guide](./CONTRIBUTING.md) for details.
218
+
219
+ ### Development Workflow
220
+
221
+ 1. Fork and clone the repository
222
+ 2. Create a feature branch: `git checkout -b feature/my-feature`
223
+ 3. Make your changes and add tests
224
+ 4. Run `pnpm typecheck` and `pnpm exec vitest`
225
+ 5. Commit your changes following [Conventional Commits](https://www.conventionalcommits.org/)
226
+ 6. Submit a pull request
227
+
228
+ ## License
229
+
230
+ MIT License - see [LICENSE](./LICENSE) for details.
231
+
232
+ ## Acknowledgments
233
+
234
+ - Design system based on [Rayna UI](https://www.figma.com/community/file/1229854793310881425) by Rayna UI Team
235
+ - Built with [React](https://react.dev/), [Tailwind CSS](https://tailwindcss.com/), and [Storybook](https://storybook.js.org/)
236
+
237
+ ---
238
+
239
+ Made with care for the React community.