@julseb-lib/react 0.1.12 → 0.1.15
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 +195 -8
- package/dist/index.d.ts +1 -1
- package/package.json +4 -9
package/README.md
CHANGED
|
@@ -1,19 +1,206 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @julseb-lib/react
|
|
2
2
|
|
|
3
|
-
A
|
|
3
|
+
A comprehensive React component library built with TypeScript and Tailwind CSS, providing a complete set of UI components for modern web applications.
|
|
4
4
|
|
|
5
|
-
##
|
|
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
|
|
6
24
|
|
|
7
25
|
```shell
|
|
8
|
-
npm
|
|
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
|
+
}
|
|
9
164
|
```
|
|
10
165
|
|
|
11
|
-
|
|
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
|
|
12
181
|
|
|
13
182
|
```shell
|
|
14
|
-
|
|
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
|
|
15
194
|
```
|
|
16
195
|
|
|
17
|
-
|
|
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)
|
|
18
205
|
|
|
19
|
-
|
|
206
|
+
[NPM Package](https://www.npmjs.com/package/@julseb-lib/react)
|
package/dist/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export * from "./lib/index.ts"
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@julseb-lib/react",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.15",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"scripts": {
|
|
@@ -11,19 +11,14 @@
|
|
|
11
11
|
"copy": "cp ./src/lib/index.css ./dist",
|
|
12
12
|
"copy-lib": "cp -a ./src/lib ./dist && rm -rf ./dist/lib/components/*/__preview__",
|
|
13
13
|
"clean": "rm -rf ./dist/icons ./dist/images ./dist/vite.svg ./dist/favicon.svg ./dist/icons-alt",
|
|
14
|
-
"
|
|
14
|
+
"add-index": "rm -rf ./dist/index.d.ts && touch ./dist/index.d.ts && echo 'export * from \"./lib/index.ts\"' > ./dist/index.d.ts",
|
|
15
|
+
"build": "vite build && yarn copy && yarn copy-lib && yarn clean && yarn add-index",
|
|
15
16
|
"plop": "cross-env NODE_OPTIONS='--import tsx' plop --plopfile=./plop/plopfile.ts",
|
|
16
17
|
"plop:c": "yarn plop component",
|
|
17
18
|
"plop:p": "yarn plop preview",
|
|
18
19
|
"plop:st": "yarn plop subtype",
|
|
19
20
|
"plop:g": "yarn plop generator",
|
|
20
21
|
"plop:d": "yarn plop demo",
|
|
21
|
-
"cy": "cypress",
|
|
22
|
-
"cy:open": "cypress open",
|
|
23
|
-
"cy:ct:run": "cypress run --component --browser electron",
|
|
24
|
-
"cy:ct:open": "cypress open --component --browser electron",
|
|
25
|
-
"docgen": "react-docgen -o ./src/data/docgen.json ./src/lib/components/**/*.tsx",
|
|
26
|
-
"cssgen": "cssjson src/lib/index.css --output src/data/styles.json",
|
|
27
22
|
"check-errors": "tsc --noEmit"
|
|
28
23
|
},
|
|
29
24
|
"dependencies": {
|
|
@@ -89,7 +84,7 @@
|
|
|
89
84
|
"exports": {
|
|
90
85
|
".": {
|
|
91
86
|
"import": "./dist/julseb-lib-react.es.js",
|
|
92
|
-
"types": "./dist/
|
|
87
|
+
"types": "./dist/index.d.ts",
|
|
93
88
|
"require": "./dist/julseb-lib-react.umd.js",
|
|
94
89
|
"default": "./dist/julseb-lib-react.cjs.js"
|
|
95
90
|
},
|