docthub-core-components 2.97.0 โ†’ 2.98.0

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
@@ -1,255 +1,256 @@
1
- # docthub-core-components
2
-
3
- A modern, reusable React component library built with TypeScript and Vite. Includes accessible, customizable UI components for rapid development.
4
-
5
- ## โœจ Features
6
-
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
29
-
30
- ## ๐Ÿ“ฆ Installation
31
-
32
- ```bash
33
- npm install docthub-core-components
34
- # or
35
- yarn add docthub-core-components
36
- ```
37
-
38
- ### Peer Dependencies
39
-
40
- ```bash
41
- npm install react@^18.0.0 react-dom@^18.0.0
42
- ```
43
-
44
- ## ๐ŸŒ€ Usage with Tailwind CSS
45
-
46
- To ensure all Tailwind classes (including arbitrary values like `text-['#002830']`) work with `docthub-core-components`, follow these steps:
47
-
48
- 1. **Do NOT import `docthub-core-components/dist/docthub-core-components.css`** unless you only want base styles. Let your app's Tailwind build generate all needed utilities.
49
- 2. **Add the library to your `tailwind.config.js` content array:**
50
-
51
- ```js
52
- module.exports = {
53
- content: [
54
- "./node_modules/docthub-core-components/dist/**/*.js",
55
- "./pages/**/*.{ts,tsx,js,jsx}",
56
- "./components/**/*.{ts,tsx,js,jsx}",
57
- "./app/**/*.{ts,tsx,js,jsx}",
58
- "./src/**/*.{ts,tsx,js,jsx}",
59
- ],
60
- // ...rest of config
61
- }
62
- ```
63
-
64
- This ensures all Tailwind classes used in your app and in the component library are available, including arbitrary values.
65
-
66
- ## ๐Ÿš€ Quick Start
67
-
68
- ```tsx
69
- import {
70
- DoctButton,
71
- DoctTypography,
72
- LabeledInput,
73
- SearchInput,
74
- DatePickerField
75
- } from 'docthub-core-components';
76
-
77
- function App() {
78
- return (
79
- <div className="p-6 space-y-4">
80
- <DoctTypography variant="h1" weight="bold">
81
- Welcome to DocthHub Components
82
- </DoctTypography>
83
-
84
- <SearchInput
85
- placeholder="Search anything..."
86
- size="large"
87
- />
88
-
89
- <div className="grid grid-cols-1 md:grid-cols-2 gap-4">
90
- <LabeledInput
91
- label="Email"
92
- type="email"
93
- placeholder="Enter your email"
94
- required
95
- />
96
-
97
- <DatePickerField
98
- label="Date of Birth"
99
- placeholder="Select date"
100
- />
101
- </div>
102
-
103
- <div className="flex gap-2">
104
- <DoctButton variant="outline">
105
- Cancel
106
- </DoctButton>
107
- <DoctButton variant="primary" size="large">
108
- Get Started
109
- </DoctButton>
110
- </div>
111
- </div>
112
- );
113
- }
114
- ```
115
-
116
- ## ๐Ÿงฉ Component Categories
117
-
118
- ### Core Components
119
- - **DoctButton** - Flexible button with multiple variants and icon support
120
- - **DoctTypography** - Comprehensive typography system
121
- - **DoctAnimationLoader** - Loading states
122
-
123
- ### Input Components
124
- - **LabeledInput** - Input with integrated label and validation
125
- - **PasswordInput** - Password field with show/hide toggle
126
- - **OtpInput** - One-time password input
127
- - **TextareaField** - Multi-line text input
128
- - **CurrencyInput** - Currency-specific input formatting
129
-
130
- ### Picker Components
131
- - **DatePickerField** - Calendar date picker
132
- - **SelectField** - Dropdown with search functionality
133
-
134
- ### Search Components
135
- - **SearchInput** - Search field with icon
136
- - **AutoComplete** - Autocomplete with suggestions
137
- - **DoctAutocomplete** - Enhanced autocomplete
138
-
139
- ### Display Components
140
- - **DoctChip** - Tags and labels
141
- - **ExpandableCard** - Collapsible content cards
142
-
143
- ### Composed Components
144
- - **SearchFilterSection** - Complete search and filter UI
145
- - **UserRegistrationSection** - Full registration form
146
- - **AddressFormSection** - Address input form
147
- - **ContactFormSection** - Contact information form
148
-
149
- ### Base UI Components
150
- - **Alert, Avatar, Checkbox, Dialog, Drawer, DropdownMenu**
151
- - **Popover, RadioGroup, Tabs, Toast, Tooltip**
152
- - And more foundational components
153
-
154
- ## ๐ŸŽจ Theming
155
-
156
- Components support theming via CSS custom properties:
157
-
158
- ```css
159
- :root {
160
- --customBlue: #3b82f6;
161
- --foreground: #000000;
162
- --background: #ffffff;
163
- --muted-foreground: #6b7280;
164
- --destructive: #ef4444;
165
- /* ... customize as needed */
166
- }
167
- ```
168
-
169
- ## ๐Ÿ› ๏ธ Development
170
-
171
- ### Setup
172
- ```bash
173
- git clone <repository>
174
- cd docthub-core-components
175
- npm install
176
- ```
177
-
178
- ### Available Scripts
179
- ```bash
180
- npm run dev # Start development server
181
- npm run build # Build for production
182
- npm run storybook # Start Storybook
183
- npm test # Run test suite
184
- npm run analyze # Bundle size analysis
185
- ```
186
-
187
- ## ๐Ÿ“š Storybook
188
-
189
- Explore all components interactively:
190
-
191
- ```bash
192
- npm run storybook
193
- ```
194
-
195
- View component examples, props, and interactive demos at `http://localhost:6006`
196
-
197
- ## ๐Ÿงช Testing
198
-
199
- Comprehensive test suite with Vitest and Testing Library:
200
-
201
- ```bash
202
- npm test # Run all tests
203
- npm test -- --watch # Watch mode
204
- npm test -- --coverage # Coverage report
205
- ```
206
-
207
- **Note**: Some Radix UI Select component tests are skipped due to [JSDOM limitations](https://github.com/radix-ui/primitives/issues/1822).
208
-
209
- ## ๐Ÿ“Š Bundle Analysis
210
-
211
- Analyze bundle size and dependencies (local development only):
212
-
213
- ```bash
214
- npm run analyze
215
- ```
216
-
217
- Opens `dist/bundle-visualizer.html` with detailed treemap visualization.
218
-
219
- **Note**: Bundle analysis uses a separate configuration to prevent deployment issues in cloud environments like Vercel. Use `npm run build` for production builds.
220
-
221
- ## ๐Ÿ”— Peer Dependencies
222
-
223
- - `react` ^18.0.0
224
- - `react-dom` ^18.0.0
225
-
226
- ## ๐Ÿ“ TypeScript
227
-
228
- Fully typed with TypeScript. Export interfaces for custom implementations:
229
-
230
- ```tsx
231
- import type {
232
- DoctButtonProps,
233
- LabeledInputProps,
234
- SearchInputProps
235
- } from 'docthub-core-components';
236
- ```
237
-
238
- ## ๐Ÿค Contributing
239
-
240
- 1. Fork the repository
241
- 2. Create a feature branch
242
- 3. Follow the existing code style
243
- 4. Add tests for new components
244
- 5. Update documentation
245
- 6. Submit a pull request
246
-
247
- See [API Documentation](./API_DOCUMENTATION.md#contributing) for detailed guidelines.
248
-
249
- ## ๐Ÿ“„ License
250
-
251
- MIT License - see [LICENSE](./LICENSE) file for details.
252
-
253
- ---
254
-
255
- **[๐Ÿ“š View Full API Documentation](./API_DOCUMENTATION.md)**
1
+ # docthub-core-components
2
+
3
+ A modern, reusable React component library built with TypeScript and Vite. Includes accessible, customizable UI components for rapid development.
4
+
5
+ ## โœจ Features
6
+
7
+ - **๐Ÿš€ Modern Stack**: Built with React 19, 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
29
+
30
+ ## ๐Ÿ“ฆ Installation
31
+
32
+ ```bash
33
+ npm install docthub-core-components
34
+ # or
35
+ yarn add docthub-core-components
36
+ ```
37
+
38
+ ### Peer Dependencies
39
+
40
+ ```bash
41
+ npm install react@^19.0.0 react-dom@^19.0.0
42
+ ```
43
+
44
+ ## ๐ŸŒ€ Usage with Tailwind CSS
45
+
46
+ To ensure all Tailwind classes (including arbitrary values like `text-['#002830']`) work with `docthub-core-components`, follow these steps:
47
+
48
+ 1. **Do NOT import `docthub-core-components/dist/docthub-core-components.css`** unless you only want base styles. Let your app's Tailwind build generate all needed utilities.
49
+ 2. **Add the library to your `tailwind.config.js` content array:**
50
+
51
+ ```js
52
+ module.exports = {
53
+ content: [
54
+ "./node_modules/docthub-core-components/dist/**/*.js",
55
+ "./pages/**/*.{ts,tsx,js,jsx}",
56
+ "./components/**/*.{ts,tsx,js,jsx}",
57
+ "./app/**/*.{ts,tsx,js,jsx}",
58
+ "./src/**/*.{ts,tsx,js,jsx}",
59
+ ],
60
+ // ...rest of config
61
+ }
62
+ ```
63
+
64
+ This ensures all Tailwind classes used in your app and in the component library are available, including arbitrary values.
65
+
66
+ ## ๐Ÿš€ Quick Start
67
+
68
+ ```tsx
69
+ import {
70
+ DoctButton,
71
+ DoctTypography,
72
+ DoctLabeledInput,
73
+ DoctSearchInput,
74
+ DoctDatePickerField
75
+ } from 'docthub-core-components';
76
+
77
+ function App() {
78
+ return (
79
+ <div className="p-6 space-y-4">
80
+ <DoctTypography variant="h1" weight="bold">
81
+ Welcome to DocthHub Components
82
+ </DoctTypography>
83
+
84
+ <DoctSearchInput
85
+ placeholder="Search anything..."
86
+ size="large"
87
+ />
88
+
89
+ <div className="grid grid-cols-1 md:grid-cols-2 gap-4">
90
+ <DoctLabeledInput
91
+ label="Email"
92
+ type="email"
93
+ placeholder="Enter your email"
94
+ required
95
+ />
96
+
97
+ <DoctDatePickerField
98
+ label="Date of Birth"
99
+ placeholder="Select date"
100
+ />
101
+ </div>
102
+
103
+ <div className="flex gap-2">
104
+ <DoctButton variant="outline">
105
+ Cancel
106
+ </DoctButton>
107
+ <DoctButton variant="primary" size="large">
108
+ Get Started
109
+ </DoctButton>
110
+ </div>
111
+ </div>
112
+ );
113
+ }
114
+ ```
115
+
116
+ ## ๐Ÿงฉ Component Categories
117
+
118
+ ### Core Components
119
+ - **DoctButton** - Flexible button with multiple variants and icon support
120
+ - **DoctTypography** - Comprehensive typography system
121
+ - **DoctAnimationLoader** - Loading states
122
+
123
+ ### Input Components
124
+ - **DoctLabeledInput** - Input with integrated label and validation
125
+ - **DoctPasswordInput** - Password field with show/hide toggle
126
+ - **DoctOtpInput** - One-time password input
127
+ - **DoctTextareaField** - Multi-line text input
128
+ - **DoctCurrencyInput** - Currency-specific input formatting
129
+
130
+ ### Picker Components
131
+ - **DoctDatePickerField** - Calendar date picker
132
+ - **DoctDateRangePickerField** - Date range picker with manual mode
133
+ - **DoctSelectField** - Dropdown with search functionality
134
+
135
+ ### Search Components
136
+ - **DoctSearchInput** - Search field with icon
137
+ - **DoctAutoComplete** - Autocomplete with suggestions
138
+ - **DoctAutocomplete** - Enhanced autocomplete
139
+
140
+ ### Display Components
141
+ - **DoctChip** - Tags and labels
142
+ - **DoctExpandableCard** - Collapsible content cards
143
+
144
+ ### Composed Components
145
+ - **DoctSearchFilterSection** - Complete search and filter UI
146
+ - **DoctUserRegistrationSection** - Full registration form
147
+ - **DoctAddressFormSection** - Address input form
148
+ - **DoctContactFormSection** - Contact information form
149
+
150
+ ### Base UI Components
151
+ - **Alert, Avatar, Checkbox, Dialog, Drawer, DropdownMenu**
152
+ - **Popover, RadioGroup, Tabs, Toast, Tooltip**
153
+ - And more foundational components
154
+
155
+ ## ๐ŸŽจ Theming
156
+
157
+ Components support theming via CSS custom properties:
158
+
159
+ ```css
160
+ :root {
161
+ --customBlue: #3b82f6;
162
+ --foreground: #000000;
163
+ --background: #ffffff;
164
+ --muted-foreground: #6b7280;
165
+ --destructive: #ef4444;
166
+ /* ... customize as needed */
167
+ }
168
+ ```
169
+
170
+ ## ๐Ÿ› ๏ธ Development
171
+
172
+ ### Setup
173
+ ```bash
174
+ git clone <repository>
175
+ cd docthub-core-components
176
+ npm install
177
+ ```
178
+
179
+ ### Available Scripts
180
+ ```bash
181
+ npm run dev # Start development server
182
+ npm run build # Build for production
183
+ npm run storybook # Start Storybook
184
+ npm test # Run test suite
185
+ npm run analyze # Bundle size analysis
186
+ ```
187
+
188
+ ## ๐Ÿ“š Storybook
189
+
190
+ Explore all components interactively:
191
+
192
+ ```bash
193
+ npm run storybook
194
+ ```
195
+
196
+ View component examples, props, and interactive demos at `http://localhost:6006`
197
+
198
+ ## ๐Ÿงช Testing
199
+
200
+ Comprehensive test suite with Vitest and Testing Library:
201
+
202
+ ```bash
203
+ npm test # Run all tests
204
+ npm test -- --watch # Watch mode
205
+ npm test -- --coverage # Coverage report
206
+ ```
207
+
208
+ **Note**: The library uses Base UI primitives; JSDOM-based tests may need `PointerEvent` support in test setup for certain interaction flows.
209
+
210
+ ## ๐Ÿ“Š Bundle Analysis
211
+
212
+ Analyze bundle size and dependencies (local development only):
213
+
214
+ ```bash
215
+ npm run analyze
216
+ ```
217
+
218
+ Opens `dist/bundle-visualizer.html` with detailed treemap visualization.
219
+
220
+ **Note**: Bundle analysis uses a separate configuration to prevent deployment issues in cloud environments like Vercel. Use `npm run build` for production builds.
221
+
222
+ ## ๐Ÿ”— Peer Dependencies
223
+
224
+ - `react` ^19.0.0
225
+ - `react-dom` ^19.0.0
226
+
227
+ ## ๐Ÿ“ TypeScript
228
+
229
+ Fully typed with TypeScript. Export interfaces for custom implementations:
230
+
231
+ ```tsx
232
+ import type {
233
+ DoctFooterProps,
234
+ DoctNavigationMenuProps,
235
+ DoctPhoneInputProps
236
+ } from 'docthub-core-components';
237
+ ```
238
+
239
+ ## ๐Ÿค Contributing
240
+
241
+ 1. Fork the repository
242
+ 2. Create a feature branch
243
+ 3. Follow the existing code style
244
+ 4. Add tests for new components
245
+ 5. Update documentation
246
+ 6. Submit a pull request
247
+
248
+ See [API Documentation](./API_DOCUMENTATION.md#contributing) for detailed guidelines.
249
+
250
+ ## ๐Ÿ“„ License
251
+
252
+ MIT License - see [LICENSE](./LICENSE) file for details.
253
+
254
+ ---
255
+
256
+ **[๐Ÿ“š View Full API Documentation](./API_DOCUMENTATION.md)**