@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.
Files changed (2) hide show
  1. package/README.md +169 -66
  2. package/package.json +3 -3
package/README.md CHANGED
@@ -1,69 +1,172 @@
1
- # React + TypeScript + Vite
2
-
3
- This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
4
-
5
- Currently, two official plugins are available:
6
-
7
- - [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Babel](https://babeljs.io/) for Fast Refresh
8
- - [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
9
-
10
- ## Expanding the ESLint configuration
11
-
12
- If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:
13
-
14
- ```js
15
- export default tseslint.config([
16
- globalIgnores(['dist']),
17
- {
18
- files: ['**/*.{ts,tsx}'],
19
- extends: [
20
- // Other configs...
21
-
22
- // Remove tseslint.configs.recommended and replace with this
23
- ...tseslint.configs.recommendedTypeChecked,
24
- // Alternatively, use this for stricter rules
25
- ...tseslint.configs.strictTypeChecked,
26
- // Optionally, add this for stylistic rules
27
- ...tseslint.configs.stylisticTypeChecked,
28
-
29
- // Other configs...
30
- ],
31
- languageOptions: {
32
- parserOptions: {
33
- project: ['./tsconfig.node.json', './tsconfig.app.json'],
34
- tsconfigRootDir: import.meta.dirname,
35
- },
36
- // other options...
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
- You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules:
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.1",
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
  },