aural-ui 2.0.2 → 2.0.4
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 +252 -377
- package/dist/components/button/Button.stories.tsx +43 -0
- package/dist/components/button/index.tsx +10 -4
- package/dist/components/chip/index.tsx +3 -3
- package/dist/components/icon-button/IconButton.stories.tsx +48 -0
- package/dist/components/icon-button/index.tsx +6 -2
- package/dist/components/input/index.tsx +4 -0
- package/dist/components/overlay/index.tsx +22 -5
- package/dist/components/tag/index.tsx +2 -2
- package/dist/components/textarea/index.tsx +2 -0
- package/dist/components/tooltip/index.tsx +45 -0
- package/dist/hooks/index.ts +1 -0
- package/dist/hooks/use-change-state/UseChangeState.stories.tsx +744 -0
- package/dist/hooks/use-change-state/index.tsx +17 -0
- package/dist/hooks/use-change-state/meta.ts +6 -0
- package/dist/icons/circle-tick-icon/CircleTickIcon.stories.tsx +1204 -0
- package/dist/icons/circle-tick-icon/index.tsx +22 -0
- package/dist/icons/circle-tick-icon/meta.ts +8 -0
- package/dist/icons/copy-icon/CopyIcon.stories.tsx +1021 -0
- package/dist/icons/copy-icon/index.tsx +21 -0
- package/dist/icons/copy-icon/meta.ts +8 -0
- package/dist/icons/download-icon/DownloadIcon.stories.tsx +877 -0
- package/dist/icons/download-icon/index.tsx +22 -0
- package/dist/icons/download-icon/meta.ts +8 -0
- package/dist/icons/filter-bar-row-icon/FilterBarRowIcon.stories.tsx +1109 -0
- package/dist/icons/filter-bar-row-icon/index.tsx +24 -0
- package/dist/icons/filter-bar-row-icon/meta.ts +8 -0
- package/dist/icons/index.ts +8 -0
- package/dist/icons/notepad-icon/NotepadIcon.stories.tsx +1159 -0
- package/dist/icons/notepad-icon/index.tsx +21 -0
- package/dist/icons/notepad-icon/meta.ts +8 -0
- package/dist/icons/notes-icon/NotesIcon.stories.tsx +1159 -0
- package/dist/icons/notes-icon/index.tsx +24 -0
- package/dist/icons/notes-icon/meta.ts +8 -0
- package/dist/icons/paper-plane-icon/PaperPlaneIcon.stories.tsx +936 -0
- package/dist/icons/paper-plane-icon/index.tsx +33 -0
- package/dist/icons/paper-plane-icon/meta.ts +8 -0
- package/dist/icons/suggestion-icon/SuggestionIcon.stories.tsx +907 -0
- package/dist/icons/suggestion-icon/index.tsx +33 -0
- package/dist/icons/suggestion-icon/meta.ts +8 -0
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,456 +1,331 @@
|
|
|
1
|
-
# Aural UI
|
|
1
|
+
# 🎨 Aural UI
|
|
2
|
+
|
|
3
|
+
<div align="center">
|
|
2
4
|
|
|
3
5
|
[](https://www.npmjs.com/package/aural-ui)
|
|
4
|
-
[](https://opensource.org/licenses/MIT)
|
|
5
6
|
[](https://www.npmjs.com/package/aural-ui)
|
|
6
|
-
[](https://
|
|
7
|
-
[
|
|
16
|
-
- [Architecture](#architecture)
|
|
17
|
-
- [Technology Stack](#technology-stack)
|
|
18
|
-
- [Installation](#installation)
|
|
19
|
-
- [Getting Started](#getting-started)
|
|
20
|
-
- [Usage Examples](#usage-examples)
|
|
21
|
-
- [Configuration](#configuration)
|
|
22
|
-
- [Project Setup](#project-setup)
|
|
23
|
-
- [Component Development](#component-development)
|
|
24
|
-
- [Adding a New Component](#adding-a-new-component)
|
|
25
|
-
- [Adding a New Hook](#adding-a-new-hook)
|
|
26
|
-
- [Adding a New Icon](#adding-a-new-icon)
|
|
27
|
-
- [Adding a New Utility](#adding-a-new-utility)
|
|
28
|
-
- [Storybook](#storybook)
|
|
29
|
-
- [Running Storybook Locally](#running-storybook-locally)
|
|
30
|
-
- [Theme Support](#theme-support)
|
|
31
|
-
- [Deployment](#deployment)
|
|
32
|
-
- [Pros and Cons](#pros-and-cons)
|
|
33
|
-
- [Contributing](#contributing)
|
|
34
|
-
- [Publishing to npm](#publishing-to-npm)
|
|
35
|
-
- [License](#license)
|
|
36
|
-
|
|
37
|
-
## Features
|
|
38
|
-
|
|
39
|
-
- 🚀 **Quick Setup**: Initialize your project with a single command
|
|
40
|
-
- 🧩 **Component Library**: Ready-to-use React components styled with Tailwind
|
|
41
|
-
CSS
|
|
42
|
-
- 🔌 **Plug & Play**: Automatically adds components to your project structure
|
|
43
|
-
- ✨ **Modern UI**: Components built with modern design patterns
|
|
44
|
-
- 🎨 **Customizable**: Easy to customize and extend components
|
|
45
|
-
- 📦 **Zero Config**: Works out of the box with sensible defaults
|
|
46
|
-
- 🌙 **Theme Support**: Built-in theming capabilities
|
|
47
|
-
- 📚 **Storybook Integration**: Full documentation and visual testing
|
|
48
|
-
|
|
49
|
-
## Architecture
|
|
50
|
-
|
|
51
|
-
Aural UI follows a modular architecture designed for flexibility and easy
|
|
52
|
-
maintenance:
|
|
53
|
-
|
|
54
|
-
```
|
|
55
|
-
aural-ui/
|
|
56
|
-
├── src/
|
|
57
|
-
│ ├── cli/ # CLI commands and utilities
|
|
58
|
-
│ ├── core/ # Core library functionalities
|
|
59
|
-
│ │ ├── constants/ # Shared constants
|
|
60
|
-
│ │ ├── services/ # Core services
|
|
61
|
-
│ │ ├── templates/ # Component and project templates
|
|
62
|
-
│ │ ├── utils/ # Shared utility functions
|
|
63
|
-
│ │ └── validation/ # Validation utilities
|
|
64
|
-
│ └── ui/ # UI components and related files
|
|
65
|
-
│ ├── components/ # React component library
|
|
66
|
-
│ ├── hooks/ # React custom hooks
|
|
67
|
-
│ ├── icons/ # SVG icon components
|
|
68
|
-
│ ├── lib/ # UI library utilities
|
|
69
|
-
│ └── styles/ # Theme and styling utilities
|
|
70
|
-
├── dist/ # Built distribution files
|
|
71
|
-
└── storybook-static/ # Built Storybook documentation
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
### Key Architectural Concepts
|
|
75
|
-
|
|
76
|
-
- **CLI-First Approach**: Primary interaction through command-line interface
|
|
77
|
-
- **Component Isolation**: Components are self-contained with their own logic
|
|
78
|
-
and styling
|
|
79
|
-
- **Theme System**: Centralized theming with token-based design
|
|
80
|
-
- **Documentation as Code**: Integrated documentation with Storybook
|
|
81
|
-
|
|
82
|
-
## Technology Stack
|
|
7
|
+
[](https://bundlephobia.com/package/aural-ui)
|
|
8
|
+
[](https://opensource.org/licenses/MIT)
|
|
9
|
+
[](https://aural-ui.netlify.app)
|
|
83
10
|
|
|
84
|
-
-
|
|
11
|
+
A modern CLI toolkit for seamlessly integrating customizable UI components into React projects. Quickly scaffold, add, and manage production-ready components with minimal configuration.
|
|
85
12
|
|
|
86
|
-
|
|
87
|
-
- TypeScript
|
|
88
|
-
- Node.js (>=14.16)
|
|
13
|
+
[📚 Documentation](https://aural-ui.netlify.app) • [🎨 Storybook](https://aural-ui.netlify.app) • [📦 NPM](https://www.npmjs.com/package/aural-ui) • [🐛 Issues](https://github.com/Pocket-Fm/fm-ui/issues)
|
|
89
14
|
|
|
90
|
-
|
|
15
|
+
</div>
|
|
91
16
|
|
|
92
|
-
|
|
93
|
-
- CSS Variables for theming
|
|
17
|
+
## ✨ Features
|
|
94
18
|
|
|
95
|
-
- **
|
|
19
|
+
- 🚀 **CLI-First Approach** - Scaffold and manage components via intuitive CLI commands
|
|
20
|
+
- 🎯 **Production Ready** - Battle-tested components used in production applications
|
|
21
|
+
- 🎨 **Highly Customizable** - Full theming support with CSS variables and Tailwind CSS
|
|
22
|
+
- 📱 **Accessible** - Built on Radix UI primitives for maximum accessibility
|
|
23
|
+
- 🔧 **Type Safe** - Written in TypeScript with comprehensive type definitions
|
|
24
|
+
- 📖 **Storybook Integration** - Interactive component documentation and testing
|
|
25
|
+
- 🌙 **Dark Mode Support** - Built-in dark mode with easy theme switching
|
|
26
|
+
- ⚡ **Performance Optimized** - Tree-shakeable components with minimal bundle impact
|
|
27
|
+
- 🔄 **Hot Reloading** - Development experience with instant updates
|
|
28
|
+
- 📦 **Zero Config** - Works out of the box with sensible defaults
|
|
96
29
|
|
|
97
|
-
|
|
98
|
-
- ARIA-compliant patterns
|
|
30
|
+
## 🛠️ Tech Stack
|
|
99
31
|
|
|
100
|
-
|
|
32
|
+
### Core Technologies
|
|
33
|
+
- **React** - Component library foundation
|
|
34
|
+
- **TypeScript** - Type-safe development
|
|
35
|
+
- **Tailwind CSS** - Utility-first styling
|
|
36
|
+
- **Radix UI** - Accessible component primitives
|
|
37
|
+
- **Class Variance Authority** - Component variant management
|
|
101
38
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
39
|
+
### Build & Development
|
|
40
|
+
- **Vite** - Fast build tool and dev server
|
|
41
|
+
- **Tsup** - TypeScript bundler
|
|
42
|
+
- **Storybook** - Component documentation and testing
|
|
43
|
+
- **Vitest** - Unit testing framework
|
|
44
|
+
- **Playwright** - End-to-end testing
|
|
106
45
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
46
|
+
### CLI & Tooling
|
|
47
|
+
- **Commander.js** - CLI framework
|
|
48
|
+
- **Inquirer.js** - Interactive command line prompts
|
|
49
|
+
- **Chalk** - Terminal string styling
|
|
50
|
+
- **Handlebars** - Template engine for code generation
|
|
51
|
+
- **ESLint & Prettier** - Code quality and formatting
|
|
112
52
|
|
|
113
|
-
## Installation
|
|
53
|
+
## 📦 Installation
|
|
114
54
|
|
|
55
|
+
### npm
|
|
115
56
|
```bash
|
|
116
|
-
# Install globally (recommended)
|
|
117
57
|
npm install -g aural-ui
|
|
118
|
-
|
|
119
|
-
# Or install as a project dependency
|
|
120
|
-
npm install aural-ui --save-dev
|
|
121
|
-
|
|
122
|
-
# Or use directly with npx
|
|
123
|
-
npx aural-ui [command]
|
|
124
58
|
```
|
|
125
59
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
### Initialize Your Project
|
|
129
|
-
|
|
60
|
+
### yarn
|
|
130
61
|
```bash
|
|
131
|
-
|
|
62
|
+
yarn global add aural-ui
|
|
132
63
|
```
|
|
133
64
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
- Create configuration for your project
|
|
137
|
-
- Detect your project structure
|
|
138
|
-
- Set up the component directory
|
|
139
|
-
|
|
140
|
-
### Adding Components
|
|
141
|
-
|
|
65
|
+
### pnpm
|
|
142
66
|
```bash
|
|
143
|
-
|
|
144
|
-
```
|
|
145
|
-
|
|
146
|
-
## Configuration
|
|
147
|
-
|
|
148
|
-
Aural UI creates a configuration file (`aural-ui.json`) in your project root
|
|
149
|
-
with the following default settings:
|
|
150
|
-
|
|
151
|
-
```json
|
|
152
|
-
{
|
|
153
|
-
"framework": "react",
|
|
154
|
-
"styling": "tailwind",
|
|
155
|
-
"componentsDir": "src/components/aural-ui",
|
|
156
|
-
"libDir": "src/lib",
|
|
157
|
-
"tailwind": {
|
|
158
|
-
"css": "src/index.css",
|
|
159
|
-
"theme": "rose"
|
|
160
|
-
}
|
|
161
|
-
}
|
|
67
|
+
pnpm add -g aural-ui
|
|
162
68
|
```
|
|
163
69
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
## Project Setup
|
|
70
|
+
## 🚀 Quick Start
|
|
167
71
|
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
git clone https://github.com/YourOrganization/aural-ui.git
|
|
174
|
-
cd aural-ui
|
|
175
|
-
```
|
|
72
|
+
### 1. Initialize your project
|
|
73
|
+
```bash
|
|
74
|
+
# Create a new React project (if you don't have one)
|
|
75
|
+
npx create-react-app my-app --template typescript
|
|
76
|
+
cd my-app
|
|
176
77
|
|
|
177
|
-
|
|
78
|
+
# Initialize aural-ui
|
|
79
|
+
aural-ui init
|
|
80
|
+
```
|
|
178
81
|
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
82
|
+
### 2. Add components
|
|
83
|
+
```bash
|
|
84
|
+
# Add individual components
|
|
85
|
+
aural-ui add button
|
|
86
|
+
aural-ui add card
|
|
87
|
+
aural-ui add dialog
|
|
182
88
|
|
|
183
|
-
|
|
89
|
+
# Add multiple components
|
|
90
|
+
aural-ui add button card dialog avatar
|
|
91
|
+
```
|
|
184
92
|
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
93
|
+
### 3. Configure themes
|
|
94
|
+
```bash
|
|
95
|
+
# Set up custom theme
|
|
96
|
+
aural-ui theme
|
|
188
97
|
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
```
|
|
98
|
+
# Update existing components
|
|
99
|
+
aural-ui update
|
|
100
|
+
```
|
|
193
101
|
|
|
194
|
-
|
|
102
|
+
## 📋 Available Commands
|
|
103
|
+
|
|
104
|
+
| Command | Description | Example |
|
|
105
|
+
|---------|-------------|---------|
|
|
106
|
+
| `init` | Initialize aural-ui in your project | `aural-ui init` |
|
|
107
|
+
| `add <components>` | Add one or more components | `aural-ui add button card` |
|
|
108
|
+
| `remove <components>` | Remove components from project | `aural-ui remove button` |
|
|
109
|
+
| `update [components]` | Update components to latest version | `aural-ui update` |
|
|
110
|
+
| `theme` | Configure theme and design tokens | `aural-ui theme` |
|
|
111
|
+
|
|
112
|
+
## 🧩 Available Components
|
|
113
|
+
|
|
114
|
+
### Layout & Structure
|
|
115
|
+
- **AspectRatio** - Maintain consistent aspect ratios
|
|
116
|
+
- **Card** - Flexible content containers
|
|
117
|
+
- **Divider** - Visual content separation
|
|
118
|
+
- **Resizable** - Resizable panel layouts
|
|
119
|
+
- **ScrollArea** - Custom scrollable areas
|
|
120
|
+
|
|
121
|
+
### Form Controls
|
|
122
|
+
- **Button** - Interactive buttons with variants
|
|
123
|
+
- **Input** - Text input fields
|
|
124
|
+
- **Textarea** - Multi-line text input
|
|
125
|
+
- **Checkbox** - Binary choice inputs
|
|
126
|
+
- **Radio** - Single choice from multiple options
|
|
127
|
+
- **Select** - Dropdown selection menus
|
|
128
|
+
- **Slider** - Range value selection
|
|
129
|
+
- **Switch** - Toggle controls
|
|
130
|
+
|
|
131
|
+
### Navigation
|
|
132
|
+
- **Tabs** - Tabbed content organization
|
|
133
|
+
- **Pagination** - Page navigation controls
|
|
134
|
+
- **Command** - Command palette interface
|
|
135
|
+
|
|
136
|
+
### Feedback
|
|
137
|
+
- **Toast** - Notification messages
|
|
138
|
+
- **Dialog** - Modal dialogs
|
|
139
|
+
- **Banner** - Important announcements
|
|
140
|
+
- **Badge** - Status indicators
|
|
141
|
+
- **Tooltip** - Contextual information
|
|
142
|
+
|
|
143
|
+
### Data Display
|
|
144
|
+
- **Avatar** - User profile images
|
|
145
|
+
- **Table** - Data tables
|
|
146
|
+
- **Typography** - Text styling components
|
|
147
|
+
- **Chip** - Compact information display
|
|
148
|
+
- **Tag** - Categorization labels
|
|
149
|
+
|
|
150
|
+
### Utilities
|
|
151
|
+
- **If-Else** - Conditional rendering helper
|
|
152
|
+
- **Switch-Case** - Multi-condition rendering
|
|
153
|
+
- **Overlay** - Modal overlays
|
|
154
|
+
- **Skelton** - Loading placeholders
|
|
155
|
+
|
|
156
|
+
## 🎨 Theming
|
|
157
|
+
|
|
158
|
+
Aural UI provides a powerful theming system built on CSS variables and Tailwind CSS:
|
|
159
|
+
|
|
160
|
+
```css
|
|
161
|
+
:root {
|
|
162
|
+
--background: 0 0% 100%;
|
|
163
|
+
--foreground: 222.2 84% 4.9%;
|
|
164
|
+
--primary: 222.2 47.4% 11.2%;
|
|
165
|
+
--primary-foreground: 210 40% 98%;
|
|
166
|
+
/* ... more variables */
|
|
167
|
+
}
|
|
168
|
+
```
|
|
195
169
|
|
|
170
|
+
### Custom Theme Configuration
|
|
196
171
|
```bash
|
|
197
|
-
|
|
172
|
+
# Interactive theme setup
|
|
173
|
+
aural-ui theme
|
|
174
|
+
|
|
175
|
+
# This will:
|
|
176
|
+
# 1. Generate CSS variables
|
|
177
|
+
# 2. Create Tailwind config
|
|
178
|
+
# 3. Set up component styles
|
|
179
|
+
# 4. Configure Storybook themes
|
|
198
180
|
```
|
|
199
181
|
|
|
200
|
-
|
|
201
|
-
TSup.
|
|
202
|
-
|
|
203
|
-
## Component Development
|
|
204
|
-
|
|
205
|
-
### Adding a New Component
|
|
206
|
-
|
|
207
|
-
1. Create a new directory in `src/ui/components/[component-name]` with:
|
|
208
|
-
|
|
209
|
-
- `[component-name].tsx` - Component implementation
|
|
210
|
-
- `[component-name].stories.tsx` - Storybook documentation
|
|
211
|
-
- `[component-name].test.tsx` - Component tests
|
|
212
|
-
- `meta.ts` - Meta registration
|
|
213
|
-
|
|
214
|
-
2. Follow the component structure pattern:
|
|
215
|
-
|
|
216
|
-
```tsx
|
|
217
|
-
import { cn } from "src/lib/utils"
|
|
218
|
-
|
|
219
|
-
export interface ComponentNameProps {
|
|
220
|
-
className?: string
|
|
221
|
-
// Other props...
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
export function ComponentName({ className, ...props }: ComponentNameProps) {
|
|
225
|
-
return (
|
|
226
|
-
<div className={cn("aui-component-base", className)} {...props}>
|
|
227
|
-
{/* Component content */}
|
|
228
|
-
</div>
|
|
229
|
-
)
|
|
230
|
-
}
|
|
231
|
-
```
|
|
232
|
-
|
|
233
|
-
3. Export the component in the appropriate index file.
|
|
234
|
-
|
|
235
|
-
### Adding a New Hook
|
|
236
|
-
|
|
237
|
-
1. Create a new file in `src/ui/hooks/use-hook-name.ts`:
|
|
238
|
-
|
|
239
|
-
```tsx
|
|
240
|
-
export function useHookName(params) {
|
|
241
|
-
// Hook implementation
|
|
242
|
-
return {
|
|
243
|
-
// Hook return values
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
```
|
|
247
|
-
|
|
248
|
-
2. Create tests in `src/ui/hooks/use-hook-name.test.tsx`
|
|
249
|
-
|
|
250
|
-
3. Create a story in `src/ui/hooks/use-hook-name.stories.tsx` with usage
|
|
251
|
-
examples
|
|
252
|
-
|
|
253
|
-
4. Export the hook in `src/ui/hooks/index.ts`
|
|
254
|
-
|
|
255
|
-
5. Create meta registration in `src/ui/hooks/meta.ts`
|
|
182
|
+
## 📖 Storybook
|
|
256
183
|
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
1. Optimize the SVG using a tool like SVGO
|
|
260
|
-
|
|
261
|
-
2. Create a new file in `src/ui/icons/icon-name.tsx`:
|
|
262
|
-
|
|
263
|
-
```tsx
|
|
264
|
-
export function IconName(props: React.SVGProps<SVGSVGElement>) {
|
|
265
|
-
return (
|
|
266
|
-
<svg
|
|
267
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
268
|
-
viewBox="0 0 24 24"
|
|
269
|
-
fill="none"
|
|
270
|
-
stroke="currentColor"
|
|
271
|
-
{...props}
|
|
272
|
-
>
|
|
273
|
-
{/* SVG paths */}
|
|
274
|
-
</svg>
|
|
275
|
-
)
|
|
276
|
-
}
|
|
277
|
-
```
|
|
278
|
-
|
|
279
|
-
3. Export the icon in `src/ui/icons/index.ts`
|
|
280
|
-
|
|
281
|
-
4. Create tests in `src/ui/icons/icon-name.test.tsx`
|
|
282
|
-
|
|
283
|
-
5. Create story in `src/ui/icons/icon-name.stories.tsx`
|
|
284
|
-
|
|
285
|
-
6. Create meta registration in `src/ui/hooks/meta.ts`
|
|
286
|
-
|
|
287
|
-
### Adding a New Utility
|
|
288
|
-
|
|
289
|
-
1. Create a new file in `src/core/utils/utility-name.ts` with appropriate
|
|
290
|
-
functionality
|
|
291
|
-
|
|
292
|
-
2. Add tests in `src/core/utils/utility-name.test.ts`
|
|
293
|
-
|
|
294
|
-
3. Add story in `src/core/utils/utility-name.stories.ts`
|
|
295
|
-
|
|
296
|
-
4. Export the utility in `src/core/utils/index.ts`
|
|
297
|
-
|
|
298
|
-
5. Create meta registration in `src/ui/hooks/meta.ts`
|
|
299
|
-
|
|
300
|
-
## Storybook
|
|
301
|
-
|
|
302
|
-
Aural UI uses Storybook for component documentation and development.
|
|
303
|
-
|
|
304
|
-
### Running Storybook Locally
|
|
184
|
+
Interactive component documentation is available at: **[https://aural-ui.netlify.app](https://aural-ui.netlify.app)**
|
|
305
185
|
|
|
186
|
+
### Local Development
|
|
306
187
|
```bash
|
|
307
188
|
# Install dependencies
|
|
308
189
|
npm install
|
|
309
190
|
|
|
310
|
-
#
|
|
311
|
-
npm run theme
|
|
312
|
-
|
|
313
|
-
# Start Storybook development server
|
|
191
|
+
# Start Storybook
|
|
314
192
|
npm run storybook
|
|
315
193
|
```
|
|
316
194
|
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
Aural UI includes integrated theme support that is automatically initialized
|
|
322
|
-
when running Storybook:
|
|
195
|
+
### Building Storybook
|
|
196
|
+
```bash
|
|
197
|
+
# Build static Storybook
|
|
198
|
+
npm run build-storybook
|
|
323
199
|
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
200
|
+
# Deploy to Netlify
|
|
201
|
+
npm run deploy-storybook
|
|
202
|
+
```
|
|
327
203
|
|
|
328
|
-
|
|
204
|
+
## 📁 Project Structure
|
|
329
205
|
|
|
330
|
-
|
|
206
|
+
```
|
|
207
|
+
aural-ui/
|
|
208
|
+
├── 📁 src/
|
|
209
|
+
│ ├── 📁 cli/ # CLI commands and utilities
|
|
210
|
+
│ │ ├── 📁 commands/ # Individual command implementations
|
|
211
|
+
│ │ │ ├── add.ts # Add components command
|
|
212
|
+
│ │ │ ├── init.ts # Initialize project command
|
|
213
|
+
│ │ │ ├── remove.ts # Remove components command
|
|
214
|
+
│ │ │ ├── theme.ts # Theme configuration command
|
|
215
|
+
│ │ │ └── update.ts # Update components command
|
|
216
|
+
│ │ └── index.ts # CLI entry point
|
|
217
|
+
│ ├── 📁 core/ # Core utilities and services
|
|
218
|
+
│ │ ├── 📁 services/ # Business logic services
|
|
219
|
+
│ │ ├── 📁 templates/ # Code generation templates
|
|
220
|
+
│ │ ├── 📁 utils/ # Utility functions
|
|
221
|
+
│ │ ├── 📁 validation/ # Input validation
|
|
222
|
+
│ │ └── constants.ts # Global constants
|
|
223
|
+
│ ├── 📁 ui/ # UI components and assets
|
|
224
|
+
│ │ ├── 📁 components/ # React components
|
|
225
|
+
│ │ ├── 📁 hooks/ # Custom React hooks
|
|
226
|
+
│ │ ├── 📁 lib/ # Utility libraries
|
|
227
|
+
│ │ ├── 📁 styles/ # Global styles and themes
|
|
228
|
+
│ │ ├── 📁 icons/ # Icon components
|
|
229
|
+
│ │ └── 📁 fonts/ # Font assets
|
|
230
|
+
│ └── 📁 stories/ # Storybook stories
|
|
231
|
+
├── 📁 aural-ui-example/ # Example implementation
|
|
232
|
+
├── 📁 storybook-static/ # Built Storybook output
|
|
233
|
+
├── 📄 package.json # Package configuration
|
|
234
|
+
├── 📄 tsconfig.json # TypeScript configuration
|
|
235
|
+
├── 📄 vite.config.mts # Vite configuration
|
|
236
|
+
└── 📄 README.md # This file
|
|
237
|
+
```
|
|
331
238
|
|
|
332
|
-
## Deployment
|
|
239
|
+
## 🌍 Deployment
|
|
333
240
|
|
|
334
241
|
### Storybook Deployment
|
|
242
|
+
The component documentation is automatically deployed to Netlify:
|
|
335
243
|
|
|
336
|
-
|
|
337
|
-
|
|
244
|
+
1. **Build**: `npm run build-storybook`
|
|
245
|
+
2. **Deploy**: `npm run deploy-storybook`
|
|
246
|
+
3. **Live URL**: [https://aural-ui.netlify.app](https://aural-ui.netlify.app)
|
|
338
247
|
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
```
|
|
344
|
-
|
|
345
|
-
2. The built Storybook is available in the `storybook-static` directory
|
|
346
|
-
|
|
347
|
-
3. CI/CD automatically deploys this directory to Netlify
|
|
348
|
-
|
|
349
|
-
### Live Storybook
|
|
350
|
-
|
|
351
|
-
The Storybook documentation is available online:
|
|
352
|
-
|
|
353
|
-
[https://aural-ui.netlify.app/](https://aural-ui.netlify.app/)
|
|
354
|
-
|
|
355
|
-
## Pros and Cons
|
|
356
|
-
|
|
357
|
-
### Pros
|
|
358
|
-
|
|
359
|
-
- ✅ **Easy Integration**: Simple CLI commands to add components to any project
|
|
360
|
-
- ✅ **Modern Stack**: Built with modern React patterns and TypeScript
|
|
361
|
-
- ✅ **Theming**: Robust theme system for customization
|
|
362
|
-
- ✅ **Accessibility**: Components follow WAI-ARIA guidelines
|
|
363
|
-
- ✅ **Well-Documented**: Thorough documentation with Storybook
|
|
364
|
-
- ✅ **Minimum Dependencies**: Core library has minimal external dependencies
|
|
365
|
-
- ✅ **TypeScript Support**: Full type definitions for all components
|
|
248
|
+
### NPM Package
|
|
249
|
+
```bash
|
|
250
|
+
# Build for production
|
|
251
|
+
npm run build
|
|
366
252
|
|
|
367
|
-
|
|
253
|
+
# Publish to NPM
|
|
254
|
+
npm run release
|
|
255
|
+
```
|
|
368
256
|
|
|
369
|
-
|
|
257
|
+
## 💡 Benefits
|
|
370
258
|
|
|
371
|
-
###
|
|
259
|
+
### For Developers
|
|
260
|
+
- **Rapid Development** - Add production-ready components in seconds
|
|
261
|
+
- **Consistent Design** - Maintain design system consistency across projects
|
|
262
|
+
- **Type Safety** - Full TypeScript support with IntelliSense
|
|
263
|
+
- **Customization** - Easy theming and component customization
|
|
264
|
+
- **Documentation** - Interactive Storybook documentation
|
|
372
265
|
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
266
|
+
### For Teams
|
|
267
|
+
- **Standardization** - Consistent component library across projects
|
|
268
|
+
- **Productivity** - Reduce time spent building common UI components
|
|
269
|
+
- **Maintainability** - Centralized component updates and bug fixes
|
|
270
|
+
- **Accessibility** - Built-in accessibility best practices
|
|
271
|
+
- **Scalability** - Modular architecture for large applications
|
|
379
272
|
|
|
380
|
-
###
|
|
273
|
+
### For Projects
|
|
274
|
+
- **Performance** - Optimized bundle size with tree-shaking
|
|
275
|
+
- **Modern Stack** - Latest React, TypeScript, and tooling
|
|
276
|
+
- **Cross-Platform** - Works with any React framework (Next.js, Vite, CRA)
|
|
277
|
+
- **Future-Proof** - Regular updates and modern development practices
|
|
381
278
|
|
|
382
|
-
|
|
383
|
-
- Write tests for new functionality
|
|
384
|
-
- Update documentation for any new or changed features
|
|
385
|
-
- Add a changeset for version management (`npm run changeset`)
|
|
386
|
-
- Ensure all tests pass before submitting a pull request
|
|
279
|
+
## 🤝 Contributing
|
|
387
280
|
|
|
388
|
-
|
|
281
|
+
We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.
|
|
389
282
|
|
|
283
|
+
### Development Setup
|
|
390
284
|
```bash
|
|
391
|
-
# Clone
|
|
392
|
-
git clone https://github.com/
|
|
285
|
+
# Clone the repository
|
|
286
|
+
git clone https://github.com/Pocket-Fm/fm-ui.git
|
|
393
287
|
cd aural-ui
|
|
394
288
|
|
|
395
289
|
# Install dependencies
|
|
396
290
|
npm install
|
|
397
291
|
|
|
398
|
-
#
|
|
399
|
-
git checkout -b feature/your-feature-name
|
|
400
|
-
|
|
401
|
-
# Run development mode
|
|
292
|
+
# Start development
|
|
402
293
|
npm run dev
|
|
403
|
-
```
|
|
404
|
-
|
|
405
|
-
## Publishing to npm
|
|
406
|
-
|
|
407
|
-
### Manual Publishing
|
|
408
|
-
|
|
409
|
-
If you're a maintainer of this package, follow these steps to publish to npm
|
|
410
|
-
manually:
|
|
411
|
-
|
|
412
|
-
1. Update the version in `package.json` (follow [semver](https://semver.org/))
|
|
413
|
-
2. Make sure all tests pass with `npm test`
|
|
414
|
-
3. Build the package with `npm run build`
|
|
415
|
-
4. Log in to npm with `npm login`
|
|
416
|
-
5. Publish with `npm publish`
|
|
417
294
|
|
|
418
|
-
|
|
295
|
+
# Run tests
|
|
296
|
+
npm test
|
|
419
297
|
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
are pushed to the main branch. The workflow:
|
|
298
|
+
# Start Storybook
|
|
299
|
+
npm run storybook
|
|
300
|
+
```
|
|
424
301
|
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
302
|
+
### Development Scripts
|
|
303
|
+
| Script | Description |
|
|
304
|
+
|--------|-------------|
|
|
305
|
+
| `npm run dev` | Start development build with watch mode |
|
|
306
|
+
| `npm run build` | Build for production |
|
|
307
|
+
| `npm run test` | Run unit tests |
|
|
308
|
+
| `npm run lint` | Lint code with ESLint |
|
|
309
|
+
| `npm run format` | Format code with Prettier |
|
|
310
|
+
| `npm run storybook` | Start Storybook development server |
|
|
431
311
|
|
|
432
|
-
|
|
312
|
+
## 📄 License
|
|
433
313
|
|
|
434
|
-
|
|
435
|
-
secret:
|
|
314
|
+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
|
436
315
|
|
|
437
|
-
|
|
316
|
+
## 🙏 Acknowledgments
|
|
438
317
|
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
318
|
+
- [Radix UI](https://radix-ui.com/) - For accessible component primitives
|
|
319
|
+
- [Tailwind CSS](https://tailwindcss.com/) - For utility-first CSS framework
|
|
320
|
+
- [Shadcn/ui](https://ui.shadcn.com/) - For design inspiration
|
|
321
|
+
- [Storybook](https://storybook.js.org/) - For component documentation
|
|
443
322
|
|
|
444
|
-
|
|
445
|
-
- Go to your GitHub repository → Settings → Secrets and variables → Actions
|
|
446
|
-
- Click "New repository secret"
|
|
447
|
-
- Set the name as "NPM_TOKEN" and paste your npm token as the value
|
|
448
|
-
- Click "Add secret"
|
|
323
|
+
---
|
|
449
324
|
|
|
450
|
-
|
|
325
|
+
<div align="center">
|
|
451
326
|
|
|
452
|
-
|
|
327
|
+
**Built with ❤️ by the Pocket FM team**
|
|
453
328
|
|
|
454
|
-
|
|
329
|
+
[Website](https://pocketfm.com) • [GitHub](https://github.com/Pocket-Fm) • [NPM](https://www.npmjs.com/package/aural-ui)
|
|
455
330
|
|
|
456
|
-
|
|
331
|
+
</div>
|