@antoniobenincasa/ui 0.0.1 โ 0.0.2
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 +169 -66
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,69 +1,172 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
This
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
-
|
|
8
|
-
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
1
|
+
# @antoniobenincasa/ui
|
|
2
|
+
|
|
3
|
+
A personal design system library built with React, TypeScript, and shadcn/ui components. This library provides a collection of reusable, accessible UI components styled with Tailwind CSS.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- ๐จ **shadcn/ui Components** - Built on top of shadcn/ui for beautiful, accessible components
|
|
8
|
+
- โก **TypeScript** - Fully typed for better developer experience
|
|
9
|
+
- ๐ฏ **Tailwind CSS v4** - Modern utility-first CSS framework
|
|
10
|
+
- ๐ฆ **Tree-shakeable** - Import only what you need
|
|
11
|
+
- ๐งฉ **Modular** - Components can be used independently
|
|
12
|
+
- ๐ **Storybook** - Interactive component documentation
|
|
13
|
+
- ๐งช **Vitest** - Comprehensive testing setup
|
|
14
|
+
- โฟ **Accessible** - Built with accessibility in mind
|
|
15
|
+
|
|
16
|
+
## Installation
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
npm install @antoniobenincasa/ui
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
### Peer Dependencies
|
|
23
|
+
|
|
24
|
+
This library requires the following peer dependencies:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
npm install react react-dom tailwindcss lucide-react
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Usage
|
|
31
|
+
|
|
32
|
+
### Import Components
|
|
33
|
+
|
|
34
|
+
```tsx
|
|
35
|
+
import { Button, Input } from "@antoniobenincasa/ui";
|
|
36
|
+
import "@antoniobenincasa/ui/ui.css";
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### Example
|
|
40
|
+
|
|
41
|
+
```tsx
|
|
42
|
+
import { Button, Input } from "@antoniobenincasa/ui";
|
|
43
|
+
import "@antoniobenincasa/ui/ui.css";
|
|
44
|
+
|
|
45
|
+
function App() {
|
|
46
|
+
return (
|
|
47
|
+
<div>
|
|
48
|
+
<Input placeholder="Enter your name" />
|
|
49
|
+
<Button variant="default">Click me</Button>
|
|
50
|
+
</div>
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Available Components
|
|
56
|
+
|
|
57
|
+
### Button
|
|
58
|
+
|
|
59
|
+
A versatile button component with multiple variants and sizes.
|
|
60
|
+
|
|
61
|
+
```tsx
|
|
62
|
+
import { Button } from "@antoniobenincasa/ui";
|
|
63
|
+
|
|
64
|
+
// Variants
|
|
65
|
+
<Button variant="default">Default</Button>
|
|
66
|
+
<Button variant="destructive">Destructive</Button>
|
|
67
|
+
<Button variant="outline">Outline</Button>
|
|
68
|
+
<Button variant="secondary">Secondary</Button>
|
|
69
|
+
<Button variant="ghost">Ghost</Button>
|
|
70
|
+
<Button variant="link">Link</Button>
|
|
71
|
+
|
|
72
|
+
// Sizes
|
|
73
|
+
<Button size="sm">Small</Button>
|
|
74
|
+
<Button size="default">Default</Button>
|
|
75
|
+
<Button size="lg">Large</Button>
|
|
76
|
+
<Button size="icon">Icon</Button>
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### Input
|
|
80
|
+
|
|
81
|
+
A styled input component with built-in focus states and validation support.
|
|
82
|
+
|
|
83
|
+
```tsx
|
|
84
|
+
import { Input } from "@antoniobenincasa/ui";
|
|
85
|
+
|
|
86
|
+
<Input type="text" placeholder="Enter text" />
|
|
87
|
+
<Input type="email" placeholder="Enter email" />
|
|
88
|
+
<Input type="password" placeholder="Enter password" />
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## Development
|
|
92
|
+
|
|
93
|
+
### Prerequisites
|
|
94
|
+
|
|
95
|
+
- Node.js (v18 or higher)
|
|
96
|
+
- npm or yarn
|
|
97
|
+
|
|
98
|
+
### Setup
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
# Install dependencies
|
|
102
|
+
npm install
|
|
103
|
+
|
|
104
|
+
# Start development server
|
|
105
|
+
npm run dev
|
|
106
|
+
|
|
107
|
+
# Start Storybook
|
|
108
|
+
npm run storybook
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
### Build
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
# Build the library
|
|
115
|
+
npm run build
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
The build output will be in the `dist` directory:
|
|
119
|
+
|
|
120
|
+
- `index.es.js` - ES module format
|
|
121
|
+
- `index.cjs.js` - CommonJS format
|
|
122
|
+
- `index.d.ts` - TypeScript definitions
|
|
123
|
+
- `ui.css` - Stylesheet
|
|
124
|
+
|
|
125
|
+
### Testing
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
# Run all tests
|
|
129
|
+
npm test
|
|
130
|
+
|
|
131
|
+
# Run unit tests with coverage
|
|
132
|
+
npm run test:unit
|
|
133
|
+
|
|
134
|
+
# Run Storybook tests
|
|
135
|
+
npm run test:unit:storybook
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
### Linting
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
npm run lint
|
|
40
142
|
```
|
|
41
143
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
```js
|
|
45
|
-
// eslint.config.js
|
|
46
|
-
import reactX from 'eslint-plugin-react-x'
|
|
47
|
-
import reactDom from 'eslint-plugin-react-dom'
|
|
48
|
-
|
|
49
|
-
export default tseslint.config([
|
|
50
|
-
globalIgnores(['dist']),
|
|
51
|
-
{
|
|
52
|
-
files: ['**/*.{ts,tsx}'],
|
|
53
|
-
extends: [
|
|
54
|
-
// Other configs...
|
|
55
|
-
// Enable lint rules for React
|
|
56
|
-
reactX.configs['recommended-typescript'],
|
|
57
|
-
// Enable lint rules for React DOM
|
|
58
|
-
reactDom.configs.recommended,
|
|
59
|
-
],
|
|
60
|
-
languageOptions: {
|
|
61
|
-
parserOptions: {
|
|
62
|
-
project: ['./tsconfig.node.json', './tsconfig.app.json'],
|
|
63
|
-
tsconfigRootDir: import.meta.dirname,
|
|
64
|
-
},
|
|
65
|
-
// other options...
|
|
66
|
-
},
|
|
67
|
-
},
|
|
68
|
-
])
|
|
144
|
+
## Project Structure
|
|
145
|
+
|
|
69
146
|
```
|
|
147
|
+
src/
|
|
148
|
+
โโโ index.ts # Main entry point
|
|
149
|
+
โโโ index.css # Global styles
|
|
150
|
+
โโโ lib/
|
|
151
|
+
โ โโโ utils.ts # Utility functions
|
|
152
|
+
โโโ ui/
|
|
153
|
+
โโโ Button/ # Button component
|
|
154
|
+
โโโ Input/ # Input component
|
|
155
|
+
โโโ index.ts # Component exports
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
## Tech Stack
|
|
159
|
+
|
|
160
|
+
- **React** - UI library
|
|
161
|
+
- **TypeScript** - Type safety
|
|
162
|
+
- **Vite** - Build tool
|
|
163
|
+
- **Tailwind CSS v4** - Styling
|
|
164
|
+
- **shadcn/ui** - Component foundation
|
|
165
|
+
- **Radix UI** - Accessible primitives
|
|
166
|
+
- **Storybook** - Component documentation
|
|
167
|
+
- **Vitest** - Testing framework
|
|
168
|
+
- **ESLint** - Code linting
|
|
169
|
+
|
|
170
|
+
## License
|
|
171
|
+
|
|
172
|
+
This is a personal project. All rights reserved.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antoniobenincasa/ui",
|
|
3
3
|
"author": "Antonio Benincasa",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.2",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs.js",
|
|
7
7
|
"module": "./dist/index.es.js",
|
|
@@ -11,9 +11,9 @@
|
|
|
11
11
|
],
|
|
12
12
|
"exports": {
|
|
13
13
|
".": {
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
14
15
|
"import": "./dist/index.es.js",
|
|
15
|
-
"require": "./dist/index.cjs.js"
|
|
16
|
-
"types": "./dist/index.d.ts"
|
|
16
|
+
"require": "./dist/index.cjs.js"
|
|
17
17
|
},
|
|
18
18
|
"./ui.css": "./dist/ui.css"
|
|
19
19
|
},
|