@julseb-lib/react 0.1.22 → 0.1.24
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 +206 -0
- package/dist/index.cjs +5 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/dist/types/components-props.d.cts +1 -1
- package/dist/types/components-props.d.ts +1 -1
- package/package.json +3 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Julien Sebag
|
|
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,206 @@
|
|
|
1
|
+
# @julseb-lib/react
|
|
2
|
+
|
|
3
|
+
A comprehensive React component library built with TypeScript and Tailwind CSS, providing a complete set of UI components for modern web applications.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
🎨 Modern Design System - Built with Tailwind CSS v4 and custom design tokens
|
|
8
|
+
|
|
9
|
+
📱 Responsive Components - Mobile-first approach with flexible layouts
|
|
10
|
+
|
|
11
|
+
♿ Accessibility First - WCAG compliant components with proper ARIA support
|
|
12
|
+
|
|
13
|
+
🎯 TypeScript Native - Full type safety with comprehensive TypeScript definitions
|
|
14
|
+
|
|
15
|
+
🔧 Highly Customizable - Extensive prop interfaces for maximum flexibility
|
|
16
|
+
|
|
17
|
+
📦 Tree Shakeable - Import only what you need
|
|
18
|
+
|
|
19
|
+
🎭 Icon Integration - Built-in support for React Icons
|
|
20
|
+
|
|
21
|
+
🌗 Theme Support - Custom CSS variables and design tokens
|
|
22
|
+
|
|
23
|
+
## Installation
|
|
24
|
+
|
|
25
|
+
```shell
|
|
26
|
+
# npm
|
|
27
|
+
npm install @julseb-lib/react
|
|
28
|
+
|
|
29
|
+
# yarn
|
|
30
|
+
yarn add @julseb-lib/react
|
|
31
|
+
|
|
32
|
+
# pnpm
|
|
33
|
+
pnpm add @julseb-lib/react
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### Setup
|
|
37
|
+
|
|
38
|
+
Import the CSS file in your main application file:
|
|
39
|
+
|
|
40
|
+
```typescript
|
|
41
|
+
// main.tsx or App.tsx
|
|
42
|
+
import '@julseb-lib/react/index.css'
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Type Exports
|
|
46
|
+
|
|
47
|
+
Access comprehensive TypeScript definitions:
|
|
48
|
+
|
|
49
|
+
```typescript
|
|
50
|
+
import type {
|
|
51
|
+
ILibButton,
|
|
52
|
+
ILibText,
|
|
53
|
+
LibAllColors,
|
|
54
|
+
LibSpacers
|
|
55
|
+
} from '@julseb-lib/react/types'
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Component-specific prop types:
|
|
59
|
+
|
|
60
|
+
```typescript
|
|
61
|
+
import type {
|
|
62
|
+
ILibButton,
|
|
63
|
+
ILibInput,
|
|
64
|
+
ILibModal
|
|
65
|
+
} from '@julseb-lib/react/component-props'
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Styling & Customization
|
|
69
|
+
|
|
70
|
+
### CSS Variables
|
|
71
|
+
|
|
72
|
+
The library uses CSS custom properties for theming:
|
|
73
|
+
|
|
74
|
+
```css
|
|
75
|
+
:root {
|
|
76
|
+
--color-primary-500: #3b82f6;
|
|
77
|
+
--color-secondary-500: #06b6d4;
|
|
78
|
+
--spacer-xs: 8px;
|
|
79
|
+
--spacer-sm: 16px;
|
|
80
|
+
--radius-sm: 4px;
|
|
81
|
+
--radius-md: 8px;
|
|
82
|
+
}
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### Design Tokens
|
|
86
|
+
|
|
87
|
+
Access design tokens programmatically:
|
|
88
|
+
|
|
89
|
+
```typescript
|
|
90
|
+
import { COLORS, SPACERS, RADIUS } from '@julseb-lib/react'
|
|
91
|
+
|
|
92
|
+
// Use in components
|
|
93
|
+
<div style={{ color: COLORS.PRIMARY_500 }}>
|
|
94
|
+
Custom styled content
|
|
95
|
+
</div>
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
### Tailwind Classes
|
|
99
|
+
|
|
100
|
+
All components use Tailwind CSS classes that can be extended:
|
|
101
|
+
|
|
102
|
+
```typescript
|
|
103
|
+
<Button className="hover:scale-105 transition-transform">
|
|
104
|
+
Custom Button
|
|
105
|
+
</Button>
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
## Advanced Usage
|
|
109
|
+
|
|
110
|
+
Form Handling
|
|
111
|
+
|
|
112
|
+
```typescript
|
|
113
|
+
import { Input, Button, Flexbox } from '@julseb-lib/react'
|
|
114
|
+
|
|
115
|
+
function ContactForm() {
|
|
116
|
+
return (
|
|
117
|
+
<form>
|
|
118
|
+
<Flexbox direction="column" gap="md">
|
|
119
|
+
<Input
|
|
120
|
+
label="Email"
|
|
121
|
+
type="email"
|
|
122
|
+
required
|
|
123
|
+
validation="Please enter a valid email"
|
|
124
|
+
/>
|
|
125
|
+
<Input
|
|
126
|
+
label="Message"
|
|
127
|
+
element="textarea"
|
|
128
|
+
rows={4}
|
|
129
|
+
/>
|
|
130
|
+
<Button type="submit" variant="primary">
|
|
131
|
+
Send Message
|
|
132
|
+
</Button>
|
|
133
|
+
</Flexbox>
|
|
134
|
+
</form>
|
|
135
|
+
)
|
|
136
|
+
}
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
Modal with Form
|
|
140
|
+
|
|
141
|
+
```typescript
|
|
142
|
+
import { Modal, Button, Text } from '@julseb-lib/react'
|
|
143
|
+
import { useState } from 'react'
|
|
144
|
+
|
|
145
|
+
function App() {
|
|
146
|
+
const [isOpen, setIsOpen] = useState(false)
|
|
147
|
+
|
|
148
|
+
return (
|
|
149
|
+
<>
|
|
150
|
+
<Button onClick={() => setIsOpen(true)}>
|
|
151
|
+
Open Modal
|
|
152
|
+
</Button>
|
|
153
|
+
|
|
154
|
+
<Modal
|
|
155
|
+
isOpen={isOpen}
|
|
156
|
+
onClose={() => setIsOpen(false)}
|
|
157
|
+
title="Contact Form"
|
|
158
|
+
>
|
|
159
|
+
<Text>Modal content goes here</Text>
|
|
160
|
+
</Modal>
|
|
161
|
+
</>
|
|
162
|
+
)
|
|
163
|
+
}
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
## Browser Support
|
|
167
|
+
|
|
168
|
+
Chrome (latest)
|
|
169
|
+
|
|
170
|
+
Firefox (latest)
|
|
171
|
+
|
|
172
|
+
Safari (latest)
|
|
173
|
+
|
|
174
|
+
Edge (latest)
|
|
175
|
+
|
|
176
|
+
## Contributing
|
|
177
|
+
|
|
178
|
+
Contributions are welcome! Please read our contributing guidelines before submitting PRs.
|
|
179
|
+
|
|
180
|
+
## Development
|
|
181
|
+
|
|
182
|
+
```shell
|
|
183
|
+
# Install dependencies
|
|
184
|
+
yarn install
|
|
185
|
+
|
|
186
|
+
# Start development server
|
|
187
|
+
yarn dev
|
|
188
|
+
|
|
189
|
+
# Run type checking
|
|
190
|
+
yarn check-errors
|
|
191
|
+
|
|
192
|
+
# Build library
|
|
193
|
+
yarn build
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
### License
|
|
197
|
+
|
|
198
|
+
MIT © [Julien Sebag](https://julien-sebag.com)
|
|
199
|
+
|
|
200
|
+
### Links
|
|
201
|
+
|
|
202
|
+
[Documentation](https://doc-julseb-lib-react.vercel.app/)
|
|
203
|
+
|
|
204
|
+
[GitHub Repository](https://github.com/JulSeb42/julseb-lib-react)
|
|
205
|
+
|
|
206
|
+
[NPM Package](https://www.npmjs.com/package/@julseb-lib/react)
|