@phsa.tec/design-system-react 0.1.0 โ†’ 0.1.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.
Files changed (2) hide show
  1. package/README.md +265 -19
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,36 +1,282 @@
1
- This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/cli/create-next-app).
1
+ # ๐ŸŽจ PHSA Design System
2
2
 
3
- ## Getting Started
3
+ A comprehensive React design system built with modern tools and best practices, featuring reusable components, consistent styling, and powerful layout solutions.
4
4
 
5
- First, run the development server:
5
+ ## โœจ Features
6
+
7
+ - ๐Ÿงฉ **Modular Components** - Reusable React components built with TypeScript
8
+ - ๐ŸŽญ **Storybook Integration** - Interactive component documentation and testing
9
+ - ๐ŸŽจ **Tailwind CSS** - Utility-first CSS framework for rapid styling
10
+ - ๐Ÿ”ง **Form Management** - Integrated with React Hook Form for robust form handling
11
+ - ๐Ÿ“Š **Data Tables** - Advanced table components with TanStack Table
12
+ - ๐ŸŒ™ **Theme Support** - Dark/light mode with next-themes
13
+ - ๐Ÿ” **Type Safety** - Full TypeScript support
14
+ - ๐Ÿงช **Testing Ready** - Jest and Testing Library setup
15
+ - ๐Ÿ“ฑ **Responsive Design** - Mobile-first approach
16
+
17
+ ## ๐Ÿ› ๏ธ Tech Stack
18
+
19
+ - **Framework**: Next.js 15
20
+ - **UI Library**: Radix UI primitives
21
+ - **Styling**: Tailwind CSS
22
+ - **State Management**: Zustand
23
+ - **Forms**: React Hook Form + Zod validation
24
+ - **Data Fetching**: TanStack Query
25
+ - **Icons**: Lucide React
26
+ - **Documentation**: Storybook
27
+ - **Testing**: Jest + Testing Library
28
+ - **Language**: TypeScript
29
+
30
+ ## ๐Ÿš€ Getting Started
31
+
32
+ ### Prerequisites
33
+
34
+ Make sure you have Node.js installed on your machine (version 18 or higher recommended).
35
+
36
+ ### Installation
37
+
38
+ #### Option 1: Install from npm (Recommended)
39
+
40
+ Install the published package directly from npm:
6
41
 
7
42
  ```bash
8
- npm run dev
9
- # or
10
- yarn dev
43
+ npm install @phsa.tec/design-system-react
11
44
  # or
12
- pnpm dev
45
+ yarn add @phsa.tec/design-system-react
13
46
  # or
14
- bun dev
47
+ pnpm add @phsa.tec/design-system-react
15
48
  ```
16
49
 
17
- Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
50
+ View the package on npm: [https://www.npmjs.com/package/@phsa.tec/design-system-react](https://www.npmjs.com/package/@phsa.tec/design-system-react)
18
51
 
19
- You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.
52
+ #### Option 2: Development Setup
53
+
54
+ For contributing or local development:
55
+
56
+ 1. **Clone the repository**
57
+
58
+ ```bash
59
+ git clone <repository-url>
60
+ cd phsa-design-system
61
+ ```
62
+
63
+ 2. **Install dependencies**
64
+ ```bash
65
+ npm install
66
+ # or
67
+ yarn install
68
+ # or
69
+ pnpm install
70
+ ```
71
+
72
+ ### ๐Ÿƒ Running the Project
73
+
74
+ #### Development Server
75
+
76
+ Start the Next.js development server:
77
+
78
+ ```bash
79
+ npm run dev
80
+ ```
20
81
 
21
- This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel.
82
+ Open [http://localhost:3000](http://localhost:3000) to view the application.
22
83
 
23
- ## Learn More
84
+ #### Storybook
85
+
86
+ Launch Storybook for component development and documentation:
87
+
88
+ ```bash
89
+ npm run storybook
90
+ ```
91
+
92
+ Open [http://localhost:6006](http://localhost:6006) to view the component library.
93
+
94
+ #### Build for Production
95
+
96
+ ```bash
97
+ npm run build
98
+ npm run start
99
+ ```
100
+
101
+ #### Testing
102
+
103
+ ```bash
104
+ npm run test
105
+ ```
106
+
107
+ #### Linting
108
+
109
+ ```bash
110
+ npm run lint
111
+ ```
112
+
113
+ ## ๐Ÿ“ Project Structure
114
+
115
+ ```
116
+ src/
117
+ โ”œโ”€โ”€ components/ # Reusable components
118
+ โ”‚ โ”œโ”€โ”€ ui/ # Base UI components
119
+ โ”‚ โ”œโ”€โ”€ layout/ # Layout components (Crud, etc.)
120
+ โ”‚ โ””โ”€โ”€ dataInput/ # Form input components
121
+ โ”œโ”€โ”€ hooks/ # Custom React hooks
122
+ โ”œโ”€โ”€ lib/ # Utility functions
123
+ โ”œโ”€โ”€ styles/ # Global styles
124
+ โ””โ”€โ”€ types/ # TypeScript type definitions
125
+ ```
126
+
127
+ This README provides a comprehensive overview of your design system project, including:
128
+
129
+ 1. **Clear project description** with emoji icons for visual appeal
130
+ 2. **Feature highlights** showcasing the main capabilities
131
+ 3. **Complete tech stack** listing all major dependencies
132
+ 4. **Step-by-step setup instructions** for new developers
133
+ 5. **Project structure** to help navigate the codebase
134
+ 6. **Component documentation** explaining key features
135
+ 7. **Theming and configuration** guides
136
+ 8. **Contributing guidelines** for team collaboration
137
+ 9. **Scripts reference** for quick command lookup
138
+ 10. **Professional formatting** with proper sections and styling
139
+
140
+ The README is written in English as requested and provides everything a developer would need to understand, set up, and contribute to your design system project.
141
+
142
+ ## ๐Ÿงฉ Key Components
143
+
144
+ ### Layout Components
145
+
146
+ - **CrudLayout** - Complete CRUD operations layout with forms, tables, and modals
147
+ - **DataTable** - Advanced table component with sorting, filtering, and pagination
148
+
149
+ ### Form Components
150
+
151
+ - **Input** - Flexible input component with validation
152
+ - **Button** - Customizable button with variants
153
+ - **Select** - Dropdown selection component
154
+ - **Form controls** - Checkbox, Switch, and more
155
+
156
+ ### UI Components
157
+
158
+ - **Dialog/Modal** - Accessible modal components
159
+ - **Toast** - Notification system
160
+ - **Avatar** - User avatar component
161
+ - **Tooltip** - Contextual help tooltips
162
+
163
+ ## ๐Ÿ“š Documentation
164
+
165
+ Visit our Storybook documentation to explore all available components:
166
+
167
+ ```bash
168
+ npm run storybook
169
+ ```
170
+
171
+ Each component includes:
172
+
173
+ - ๐Ÿ“– **Usage examples**
174
+ - โš™๏ธ **Props documentation**
175
+ - ๐ŸŽฎ **Interactive controls**
176
+ - ๐Ÿ’ก **Best practices**
177
+
178
+ ## ๐ŸŽจ Theming
179
+
180
+ The design system supports customizable themes through Tailwind CSS and next-themes:
181
+
182
+ ```tsx
183
+ import { ThemeProvider } from "next-themes";
184
+
185
+ function App() {
186
+ return (
187
+ <ThemeProvider attribute="class" defaultTheme="system">
188
+ {/* Your app */}
189
+ </ThemeProvider>
190
+ );
191
+ }
192
+ ```
193
+
194
+ ## ๐Ÿ”ง Configuration
195
+
196
+ ### Tailwind CSS
197
+
198
+ Customize the design tokens in `tailwind.config.js`:
199
+
200
+ ```javascript
201
+ module.exports = {
202
+ theme: {
203
+ extend: {
204
+ colors: {
205
+ // Your custom colors
206
+ },
207
+ spacing: {
208
+ // Your custom spacing
209
+ },
210
+ },
211
+ },
212
+ };
213
+ ```
214
+
215
+ ### Component Variants
216
+
217
+ Components use `class-variance-authority` for consistent variant management:
218
+
219
+ ```tsx
220
+ const buttonVariants = cva(
221
+ "inline-flex items-center justify-center rounded-md",
222
+ {
223
+ variants: {
224
+ variant: {
225
+ default: "bg-primary text-primary-foreground",
226
+ secondary: "bg-secondary text-secondary-foreground",
227
+ },
228
+ },
229
+ }
230
+ );
231
+ ```
232
+
233
+ ## ๐Ÿค Contributing
234
+
235
+ 1. Fork the repository
236
+ 2. Create a feature branch (`git checkout -b feature/amazing-feature`)
237
+ 3. Commit your changes (`git commit -m 'Add some amazing feature'`)
238
+ 4. Push to the branch (`git push origin feature/amazing-feature`)
239
+ 5. Open a Pull Request
240
+
241
+ ### Development Guidelines
242
+
243
+ - Follow TypeScript best practices
244
+ - Add Storybook stories for new components
245
+ - Include tests for complex logic
246
+ - Follow the existing code style
247
+ - Update documentation as needed
248
+
249
+ ## ๐Ÿ“ Scripts Reference
250
+
251
+ | Command | Description |
252
+ | ------------------------- | ------------------------ |
253
+ | `npm run dev` | Start development server |
254
+ | `npm run build` | Build for production |
255
+ | `npm run start` | Start production server |
256
+ | `npm run lint` | Run ESLint |
257
+ | `npm run storybook` | Start Storybook |
258
+ | `npm run build-storybook` | Build Storybook |
259
+ | `npm run test` | Run tests |
260
+
261
+ ## ๐Ÿ“ฆ Publishing
262
+
263
+ This package is configured for publishing to npm:
264
+
265
+ ```bash
266
+ npm publish
267
+ ```
24
268
 
25
- To learn more about Next.js, take a look at the following resources:
269
+ ## ๐Ÿ“„ License
26
270
 
27
- - [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
28
- - [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
271
+ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
29
272
 
30
- You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome!
273
+ ## ๐Ÿ™ Acknowledgments
31
274
 
32
- ## Deploy on Vercel
275
+ - [Radix UI](https://radix-ui.com/) for accessible component primitives
276
+ - [Tailwind CSS](https://tailwindcss.com/) for the utility-first CSS framework
277
+ - [Shadcn/ui](https://ui.shadcn.com/) for component inspiration
278
+ - [Storybook](https://storybook.js.org/) for component documentation
33
279
 
34
- The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
280
+ ---
35
281
 
36
- Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details.
282
+ Built with โค๏ธ by the PHSA team
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@phsa.tec/design-system-react",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "private": false,
5
5
  "main": "./src/index.ts",
6
6
  "scripts": {