docthub-core-components 1.0.15 โ†’ 1.0.16

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 CHANGED
@@ -4,11 +4,28 @@ A modern, reusable React component library built with TypeScript and Vite. Inclu
4
4
 
5
5
  ## โœจ Features
6
6
 
7
- - Built with React 18, TypeScript, and Vite
8
- - Tree-shakable and lightweight
9
- - Includes buttons, inputs, dialogs, pickers, and more
10
- - Designed for easy theming and customization
11
- - Comprehensive test suite using Vitest and Testing Library
7
+ - **๐Ÿš€ Modern Stack**: Built with React 18, TypeScript, and Vite
8
+ - **๐Ÿ“ฆ Tree-shakable**: Lightweight and optimized bundle
9
+ - **๐ŸŽจ Comprehensive**: 30+ components including buttons, inputs, dialogs, pickers, and more
10
+ - **โ™ฟ Accessible**: WCAG compliant with proper ARIA attributes
11
+ - **๐ŸŽฏ Customizable**: Easy theming with CSS variables and Tailwind CSS
12
+ - **๐Ÿ“š Well-documented**: Comprehensive API documentation and Storybook examples
13
+ - **๐Ÿงช Tested**: Full test suite using Vitest and Testing Library
14
+ - **๐Ÿ“Š Optimized**: Bundle size analysis and performance monitoring
15
+
16
+ ## ๐Ÿ“– Documentation
17
+
18
+ For comprehensive API documentation, examples, and usage instructions, see:
19
+
20
+ **[๐Ÿ“š API Documentation](./API_DOCUMENTATION.md)**
21
+
22
+ The API documentation covers:
23
+ - All 30+ components with detailed props and examples
24
+ - TypeScript interfaces and type definitions
25
+ - Best practices and patterns
26
+ - Accessibility guidelines
27
+ - Theming and customization
28
+ - Migration guides
12
29
 
13
30
  ## ๐Ÿ“ฆ Installation
14
31
 
@@ -18,58 +35,199 @@ npm install docthub-core-components
18
35
  yarn add docthub-core-components
19
36
  ```
20
37
 
21
- ## ๐Ÿš€ Usage
38
+ ### Peer Dependencies
39
+
40
+ ```bash
41
+ npm install react@^18.0.0 react-dom@^18.0.0
42
+ ```
43
+
44
+ ## ๐Ÿš€ Quick Start
22
45
 
23
46
  ```tsx
24
- import { Button, PasswordInput, SelectField } from 'docthub-core-components';
47
+ import {
48
+ DoctButton,
49
+ DoctTypography,
50
+ LabeledInput,
51
+ SearchInput,
52
+ DatePickerField
53
+ } from 'docthub-core-components';
25
54
 
26
55
  function App() {
27
56
  return (
28
- <div>
29
- <Button variant="primary">Click me</Button>
30
- <PasswordInput label="Password" onChange={val => console.log(val)} />
31
- <SelectField label="Account Type" options={[{ value: 'user', label: 'User' }]} />
57
+ <div className="p-6 space-y-4">
58
+ <DoctTypography variant="h1" weight="bold">
59
+ Welcome to DocthHub Components
60
+ </DoctTypography>
61
+
62
+ <SearchInput
63
+ placeholder="Search anything..."
64
+ size="large"
65
+ />
66
+
67
+ <div className="grid grid-cols-1 md:grid-cols-2 gap-4">
68
+ <LabeledInput
69
+ label="Email"
70
+ type="email"
71
+ placeholder="Enter your email"
72
+ required
73
+ />
74
+
75
+ <DatePickerField
76
+ label="Date of Birth"
77
+ placeholder="Select date"
78
+ />
79
+ </div>
80
+
81
+ <div className="flex gap-2">
82
+ <DoctButton variant="outline">
83
+ Cancel
84
+ </DoctButton>
85
+ <DoctButton variant="primary" size="large">
86
+ Get Started
87
+ </DoctButton>
88
+ </div>
32
89
  </div>
33
90
  );
34
91
  }
35
92
  ```
36
93
 
37
- ## ๐Ÿงฉ Components
94
+ ## ๐Ÿงฉ Component Categories
95
+
96
+ ### Core Components
97
+ - **DoctButton** - Flexible button with multiple variants and icon support
98
+ - **DoctTypography** - Comprehensive typography system
99
+ - **DoctAnimationLoader** - Loading states
100
+
101
+ ### Input Components
102
+ - **LabeledInput** - Input with integrated label and validation
103
+ - **PasswordInput** - Password field with show/hide toggle
104
+ - **OtpInput** - One-time password input
105
+ - **TextareaField** - Multi-line text input
106
+ - **CurrencyInput** - Currency-specific input formatting
107
+
108
+ ### Picker Components
109
+ - **DatePickerField** - Calendar date picker
110
+ - **SelectField** - Dropdown with search functionality
111
+
112
+ ### Search Components
113
+ - **SearchInput** - Search field with icon
114
+ - **AutoComplete** - Autocomplete with suggestions
115
+ - **DoctAutocomplete** - Enhanced autocomplete
116
+
117
+ ### Display Components
118
+ - **DoctChip** - Tags and labels
119
+ - **ExpandableCard** - Collapsible content cards
120
+
121
+ ### Composed Components
122
+ - **SearchFilterSection** - Complete search and filter UI
123
+ - **UserRegistrationSection** - Full registration form
124
+ - **AddressFormSection** - Address input form
125
+ - **ContactFormSection** - Contact information form
126
+
127
+ ### Base UI Components
128
+ - **Alert, Avatar, Checkbox, Dialog, Drawer, DropdownMenu**
129
+ - **Popover, RadioGroup, Tabs, Toast, Tooltip**
130
+ - And more foundational components
131
+
132
+ ## ๐ŸŽจ Theming
133
+
134
+ Components support theming via CSS custom properties:
135
+
136
+ ```css
137
+ :root {
138
+ --customBlue: #3b82f6;
139
+ --foreground: #000000;
140
+ --background: #ffffff;
141
+ --muted-foreground: #6b7280;
142
+ --destructive: #ef4444;
143
+ /* ... customize as needed */
144
+ }
145
+ ```
38
146
 
39
- - `Button`
40
- - `PasswordInput`
41
- - `SelectField`
42
- - `LabeledInput`
43
- - `DatePickerField`
44
- - `OtpInput`
45
- - `Toast`
46
- - ...and more!
147
+ ## ๐Ÿ› ๏ธ Development
47
148
 
48
- ## ๐Ÿ”— Peer Dependencies
149
+ ### Setup
150
+ ```bash
151
+ git clone <repository>
152
+ cd docthub-core-components
153
+ npm install
154
+ ```
49
155
 
50
- - `react` (v18+)
51
- - `react-dom` (v18+)
156
+ ### Available Scripts
157
+ ```bash
158
+ npm run dev # Start development server
159
+ npm run build # Build for production
160
+ npm run storybook # Start Storybook
161
+ npm test # Run test suite
162
+ npm run analyze # Bundle size analysis
163
+ ```
52
164
 
53
- ## ๐Ÿ› ๏ธ Development
165
+ ## ๐Ÿ“š Storybook
54
166
 
55
- Clone the repo and run:
167
+ Explore all components interactively:
56
168
 
57
169
  ```bash
58
- npm install
59
- npm run dev
170
+ npm run storybook
60
171
  ```
61
172
 
173
+ View component examples, props, and interactive demos at `http://localhost:6006`
174
+
62
175
  ## ๐Ÿงช Testing
63
176
 
64
- - All tests are run with [Vitest](https://vitest.dev/) and [@testing-library/react](https://testing-library.com/docs/react-testing-library/intro/).
65
- - To run the test suite:
177
+ Comprehensive test suite with Vitest and Testing Library:
66
178
 
67
179
  ```bash
68
- npm test
180
+ npm test # Run all tests
181
+ npm test -- --watch # Watch mode
182
+ npm test -- --coverage # Coverage report
69
183
  ```
70
184
 
71
- - **Note:** Some tests for components using Radix UI's Select are skipped due to [JSDOM limitations with pointer events](https://github.com/radix-ui/primitives/issues/1822). All other tests pass without workarounds.
185
+ **Note**: Some Radix UI Select component tests are skipped due to [JSDOM limitations](https://github.com/radix-ui/primitives/issues/1822).
186
+
187
+ ## ๐Ÿ“Š Bundle Analysis
188
+
189
+ Analyze bundle size and dependencies (local development only):
190
+
191
+ ```bash
192
+ npm run analyze
193
+ ```
194
+
195
+ Opens `dist/bundle-visualizer.html` with detailed treemap visualization.
196
+
197
+ **Note**: Bundle analysis uses a separate configuration to prevent deployment issues in cloud environments like Vercel. Use `npm run build` for production builds.
198
+
199
+ ## ๐Ÿ”— Peer Dependencies
200
+
201
+ - `react` ^18.0.0
202
+ - `react-dom` ^18.0.0
203
+
204
+ ## ๐Ÿ“ TypeScript
205
+
206
+ Fully typed with TypeScript. Export interfaces for custom implementations:
207
+
208
+ ```tsx
209
+ import type {
210
+ DoctButtonProps,
211
+ LabeledInputProps,
212
+ SearchInputProps
213
+ } from 'docthub-core-components';
214
+ ```
215
+
216
+ ## ๐Ÿค Contributing
217
+
218
+ 1. Fork the repository
219
+ 2. Create a feature branch
220
+ 3. Follow the existing code style
221
+ 4. Add tests for new components
222
+ 5. Update documentation
223
+ 6. Submit a pull request
224
+
225
+ See [API Documentation](./API_DOCUMENTATION.md#contributing) for detailed guidelines.
72
226
 
73
227
  ## ๐Ÿ“„ License
74
228
 
75
- MIT
229
+ MIT License - see [LICENSE](./LICENSE) file for details.
230
+
231
+ ---
232
+
233
+ **[๐Ÿ“š View Full API Documentation](./API_DOCUMENTATION.md)**