luna-components-library 1.0.0 → 1.0.1
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 +174 -15
- package/dist/index.d.ts +2 -0
- package/dist/src/components/Button.d.ts +11 -0
- package/dist/src/components/Card.d.ts +10 -0
- package/dist/src/components/index.d.ts +2 -0
- package/dist/src/index.d.ts +1 -0
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -1,38 +1,75 @@
|
|
|
1
|
-
# Luna Components Library
|
|
1
|
+
# 🌙 Luna Components Library
|
|
2
2
|
|
|
3
|
-
A modern React component library built with TypeScript and designed for reusability.
|
|
3
|
+
A modern React component library built with TypeScript and Vite, designed for reusability and optimal performance.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## ✨ Features
|
|
6
|
+
|
|
7
|
+
- 🚀 **Built with Vite** - Fast development and optimized builds
|
|
8
|
+
- 📝 **TypeScript Support** - Full type safety and IntelliSense
|
|
9
|
+
- 🎨 **Modern Components** - Clean, accessible, and customizable UI components
|
|
10
|
+
- 📦 **Tree-shakable** - Only bundle what you use
|
|
11
|
+
- 🔧 **Multiple Formats** - ES modules and UMD bundles
|
|
12
|
+
- 📚 **Type Declarations** - Complete TypeScript definitions included
|
|
13
|
+
|
|
14
|
+
## 📦 Installation
|
|
6
15
|
|
|
7
16
|
```bash
|
|
8
17
|
npm install luna-components-library
|
|
18
|
+
# or
|
|
19
|
+
yarn add luna-components-library
|
|
20
|
+
# or
|
|
21
|
+
pnpm add luna-components-library
|
|
9
22
|
```
|
|
10
23
|
|
|
11
|
-
##
|
|
24
|
+
## 🚀 Quick Start
|
|
12
25
|
|
|
13
26
|
```jsx
|
|
14
27
|
import { Button, Card } from 'luna-components-library';
|
|
15
28
|
|
|
16
29
|
function App() {
|
|
17
30
|
return (
|
|
18
|
-
<div>
|
|
19
|
-
<Button
|
|
31
|
+
<div className="p-4 space-y-4">
|
|
32
|
+
<Button
|
|
33
|
+
variant="primary"
|
|
34
|
+
size="lg"
|
|
35
|
+
onClick={() => console.log('Clicked!')}
|
|
36
|
+
>
|
|
20
37
|
Click me
|
|
21
38
|
</Button>
|
|
22
39
|
|
|
23
|
-
<Card
|
|
40
|
+
<Card
|
|
41
|
+
title="Example Card"
|
|
42
|
+
padding="md"
|
|
43
|
+
shadow="lg"
|
|
44
|
+
className="max-w-md"
|
|
45
|
+
>
|
|
24
46
|
<p>This is a card component from Luna Components Library.</p>
|
|
47
|
+
<Button variant="outline" size="sm">
|
|
48
|
+
Learn More
|
|
49
|
+
</Button>
|
|
25
50
|
</Card>
|
|
26
51
|
</div>
|
|
27
52
|
);
|
|
28
53
|
}
|
|
29
54
|
```
|
|
30
55
|
|
|
31
|
-
## Components
|
|
56
|
+
## 🧩 Components
|
|
32
57
|
|
|
33
58
|
### Button
|
|
34
59
|
A versatile button component with multiple variants and sizes.
|
|
35
60
|
|
|
61
|
+
```jsx
|
|
62
|
+
<Button
|
|
63
|
+
variant="primary"
|
|
64
|
+
size="md"
|
|
65
|
+
onClick={handleClick}
|
|
66
|
+
disabled={false}
|
|
67
|
+
className="custom-class"
|
|
68
|
+
>
|
|
69
|
+
Button Text
|
|
70
|
+
</Button>
|
|
71
|
+
```
|
|
72
|
+
|
|
36
73
|
**Props:**
|
|
37
74
|
- `children`: React.ReactNode - Button content
|
|
38
75
|
- `variant?: 'primary' | 'secondary' | 'outline'` - Button style (default: 'primary')
|
|
@@ -41,29 +78,151 @@ A versatile button component with multiple variants and sizes.
|
|
|
41
78
|
- `disabled?: boolean` - Disable button (default: false)
|
|
42
79
|
- `className?: string` - Additional CSS classes
|
|
43
80
|
|
|
81
|
+
**Variants:**
|
|
82
|
+
- `primary` - Blue background button
|
|
83
|
+
- `secondary` - Gray background button
|
|
84
|
+
- `outline` - Transparent with border
|
|
85
|
+
|
|
44
86
|
### Card
|
|
45
|
-
A flexible card component for displaying content.
|
|
87
|
+
A flexible card component for displaying content with various padding and shadow options.
|
|
88
|
+
|
|
89
|
+
```jsx
|
|
90
|
+
<Card
|
|
91
|
+
title="Card Title"
|
|
92
|
+
padding="md"
|
|
93
|
+
shadow="lg"
|
|
94
|
+
className="custom-card"
|
|
95
|
+
>
|
|
96
|
+
<p>Card content goes here</p>
|
|
97
|
+
</Card>
|
|
98
|
+
```
|
|
46
99
|
|
|
47
100
|
**Props:**
|
|
48
101
|
- `children`: React.ReactNode - Card content
|
|
49
|
-
- `title?: string` - Card title
|
|
102
|
+
- `title?: string` - Card title (optional)
|
|
50
103
|
- `className?: string` - Additional CSS classes
|
|
51
104
|
- `padding?: 'none' | 'sm' | 'md' | 'lg'` - Internal padding (default: 'md')
|
|
52
105
|
- `shadow?: 'none' | 'sm' | 'md' | 'lg'` - Shadow depth (default: 'md')
|
|
53
106
|
|
|
54
|
-
## Development
|
|
107
|
+
## 🛠️ Development
|
|
108
|
+
|
|
109
|
+
### Prerequisites
|
|
110
|
+
- Node.js 16+
|
|
111
|
+
- npm, yarn, or pnpm
|
|
112
|
+
|
|
113
|
+
### Setup
|
|
55
114
|
|
|
56
115
|
```bash
|
|
116
|
+
# Clone the repository
|
|
117
|
+
git clone <repository-url>
|
|
118
|
+
cd luna-library
|
|
119
|
+
|
|
57
120
|
# Install dependencies
|
|
58
121
|
npm install
|
|
59
122
|
|
|
123
|
+
# Start development with watch mode
|
|
124
|
+
npm run dev
|
|
125
|
+
|
|
60
126
|
# Build the library
|
|
61
127
|
npm run build
|
|
62
128
|
|
|
63
|
-
#
|
|
64
|
-
npm run
|
|
129
|
+
# Clean build directory
|
|
130
|
+
npm run clean
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
### Project Structure
|
|
134
|
+
|
|
65
135
|
```
|
|
136
|
+
luna-library/
|
|
137
|
+
├── src/
|
|
138
|
+
│ ├── components/
|
|
139
|
+
│ │ ├── Button.tsx
|
|
140
|
+
│ │ ├── Card.tsx
|
|
141
|
+
│ │ └── index.ts
|
|
142
|
+
│ └── index.ts
|
|
143
|
+
├── dist/ # Build output
|
|
144
|
+
├── package.json
|
|
145
|
+
├── tsconfig.json
|
|
146
|
+
├── vite.config.ts
|
|
147
|
+
└── README.md
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
## 📦 Build & Publishing
|
|
151
|
+
|
|
152
|
+
### Build Process
|
|
153
|
+
|
|
154
|
+
The library uses Vite for building with the following outputs:
|
|
155
|
+
|
|
156
|
+
```bash
|
|
157
|
+
npm run build
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
**Generated Files:**
|
|
161
|
+
- `dist/luna-components-library.es.js` - ES Module bundle
|
|
162
|
+
- `dist/luna-components-library.umd.js` - UMD bundle
|
|
163
|
+
- `dist/index.d.ts` - TypeScript declarations
|
|
164
|
+
- Source maps for debugging
|
|
165
|
+
|
|
166
|
+
### Publishing to NPM
|
|
167
|
+
|
|
168
|
+
```bash
|
|
169
|
+
# Login to NPM
|
|
170
|
+
npm login
|
|
171
|
+
|
|
172
|
+
# Build and publish
|
|
173
|
+
npm publish
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
The `prepublishOnly` script automatically builds the library before publishing.
|
|
177
|
+
|
|
178
|
+
## 🔧 Configuration
|
|
179
|
+
|
|
180
|
+
### TypeScript Configuration
|
|
181
|
+
|
|
182
|
+
The library is configured with:
|
|
183
|
+
- Strict type checking enabled
|
|
184
|
+
- React JSX support
|
|
185
|
+
- Declaration file generation
|
|
186
|
+
- Modern ES2020 target
|
|
187
|
+
|
|
188
|
+
### Vite Configuration
|
|
189
|
+
|
|
190
|
+
- Library mode with ES and UMD outputs
|
|
191
|
+
- External React dependencies (peer dependencies)
|
|
192
|
+
- TypeScript declaration generation with `vite-plugin-dts`
|
|
193
|
+
- Source maps for debugging
|
|
194
|
+
|
|
195
|
+
## 📋 Dependencies
|
|
196
|
+
|
|
197
|
+
### Peer Dependencies
|
|
198
|
+
- `react: >=16.8.0`
|
|
199
|
+
- `react-dom: >=16.8.0`
|
|
200
|
+
|
|
201
|
+
### Dev Dependencies
|
|
202
|
+
- `vite` - Build tool and dev server
|
|
203
|
+
- `@vitejs/plugin-react` - React plugin for Vite
|
|
204
|
+
- `typescript` - TypeScript compiler
|
|
205
|
+
- `vite-plugin-dts` - TypeScript declaration generation
|
|
206
|
+
- `rimraf` - Cross-platform file removal
|
|
207
|
+
|
|
208
|
+
## 🤝 Contributing
|
|
209
|
+
|
|
210
|
+
1. Fork the repository
|
|
211
|
+
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
|
|
212
|
+
3. Commit your changes (`git commit -m 'Add some amazing feature'`)
|
|
213
|
+
4. Push to the branch (`git push origin feature/amazing-feature`)
|
|
214
|
+
5. Open a Pull Request
|
|
215
|
+
|
|
216
|
+
## 📄 License
|
|
217
|
+
|
|
218
|
+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
|
219
|
+
|
|
220
|
+
## 🙏 Author
|
|
221
|
+
|
|
222
|
+
Created and maintained by [Pablo Andre Chacon](https://andreychaconresumereact.netlify.app)
|
|
66
223
|
|
|
67
|
-
##
|
|
224
|
+
## 🔗 Links
|
|
68
225
|
|
|
69
|
-
|
|
226
|
+
- [NPM Package](https://www.npmjs.com/package/luna-components-library)
|
|
227
|
+
- [GitHub Repository](https://github.com/your-username/luna-components-library)
|
|
228
|
+
- [Author's Portfolio](https://andreychaconresumereact.netlify.app)
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface ButtonProps {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
variant?: 'primary' | 'secondary' | 'outline';
|
|
5
|
+
size?: 'sm' | 'md' | 'lg';
|
|
6
|
+
onClick?: () => void;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
className?: string;
|
|
9
|
+
}
|
|
10
|
+
declare const Button: React.FC<ButtonProps>;
|
|
11
|
+
export default Button;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface CardProps {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
title?: string;
|
|
5
|
+
className?: string;
|
|
6
|
+
padding?: 'none' | 'sm' | 'md' | 'lg';
|
|
7
|
+
shadow?: 'none' | 'sm' | 'md' | 'lg';
|
|
8
|
+
}
|
|
9
|
+
declare const Card: React.FC<CardProps>;
|
|
10
|
+
export default Card;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './components';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "luna-components-library",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "A React component library with TypeScript support",
|
|
5
5
|
"main": "dist/luna-components-library.umd.js",
|
|
6
6
|
"module": "dist/luna-components-library.es.js",
|
|
@@ -37,6 +37,7 @@
|
|
|
37
37
|
"rimraf": "^6.1.3",
|
|
38
38
|
"tslib": "^2.8.1",
|
|
39
39
|
"typescript": "^6.0.3",
|
|
40
|
-
"vite": "^8.0.11"
|
|
40
|
+
"vite": "^8.0.11",
|
|
41
|
+
"vite-plugin-dts": "^5.0.0"
|
|
41
42
|
}
|
|
42
43
|
}
|