@cayuse-test/react 1.0.4 → 1.0.5
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,346 +1,250 @@
|
|
|
1
|
-
# @cayuse-react
|
|
1
|
+
# @cayuse-test/react
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
React component library with TypeScript, tree-shaking support, and shared configs.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Installation
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
npm install @cayuse-react
|
|
8
|
+
npm install @cayuse-test/react
|
|
9
9
|
# or
|
|
10
|
-
pnpm add @cayuse-react
|
|
10
|
+
pnpm add @cayuse-test/react
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
-
##
|
|
13
|
+
## Usage
|
|
14
14
|
|
|
15
15
|
```tsx
|
|
16
|
-
|
|
17
|
-
import
|
|
18
|
-
Button,
|
|
19
|
-
Input,
|
|
20
|
-
DynamicTable,
|
|
21
|
-
isValidEmail,
|
|
22
|
-
formatDate,
|
|
23
|
-
useClickOutside,
|
|
24
|
-
useDictionary,
|
|
25
|
-
} from '@cayuse-react-2/core';
|
|
26
|
-
|
|
27
|
-
function MyApp() {
|
|
28
|
-
return (
|
|
29
|
-
<div>
|
|
30
|
-
<Button variant="primary">Click me</Button>
|
|
31
|
-
<Input label="Email" type="email" />
|
|
32
|
-
</div>
|
|
33
|
-
);
|
|
34
|
-
}
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
### Using Shared Configs
|
|
38
|
-
|
|
39
|
-
**ESLint Configuration:**
|
|
40
|
-
|
|
41
|
-
```js
|
|
42
|
-
// eslint.config.js
|
|
43
|
-
import { config } from '@cayuse-react-2/core/eslint-config/base';
|
|
44
|
-
// or for React projects
|
|
45
|
-
import { config } from '@cayuse-react-2/core/eslint-config/react-internal';
|
|
46
|
-
// or for Next.js
|
|
47
|
-
import { config } from '@cayuse-react-2/core/eslint-config/next';
|
|
16
|
+
import { Button, Input, DynamicTable } from '@cayuse-test/react';
|
|
17
|
+
import '@cayuse-test/react/css'; // Import styles
|
|
48
18
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
**TypeScript Configuration:**
|
|
53
|
-
|
|
54
|
-
```json
|
|
55
|
-
{
|
|
56
|
-
"extends": "@cayuse-react-2/core/typescript-config/base.json"
|
|
19
|
+
function App() {
|
|
20
|
+
return <Button variant="primary">Click me</Button>;
|
|
57
21
|
}
|
|
58
22
|
```
|
|
59
23
|
|
|
60
|
-
##
|
|
61
|
-
|
|
62
|
-
### Components (40+)
|
|
63
|
-
|
|
64
|
-
- **Forms**: Input, Checkbox, Radio, TextArea, RichText, FileUpload, Toggle, Combobox, UserSelect
|
|
65
|
-
- **Navigation**: Breadcrumbs, NavLink, Submenu, Tabs
|
|
66
|
-
- **Layout**: Button, ButtonGroup, Divider, SectionHeader, SubHeader, BasePadding
|
|
67
|
-
- **Data Display**: DynamicTable, FormattedDate, FormattedRichText, SetView, Pagination
|
|
68
|
-
- **Modals & Dialogs**: ModalDialog, AlertDialog, ConfirmationModal, PreventLeavePageDialog
|
|
69
|
-
- **Complex Components**: TaskForm, AttachmentsForm, FormNoteAttachmentsView
|
|
70
|
-
- **Misc**: Icon, IconButton, LoadingIndicator, Popup, DateSelector, CustomDropdown
|
|
71
|
-
|
|
72
|
-
### Hooks
|
|
73
|
-
|
|
74
|
-
- `useClickOutside` - Detect clicks outside elements
|
|
75
|
-
- `useConfirmNavigation` - Confirmation dialogs for unsaved changes
|
|
76
|
-
- `useDebounceCallback` - Debounced callbacks
|
|
77
|
-
- `useDictionary` - Internationalization/translations
|
|
78
|
-
- `useFileUploader` - File uploads with Uppy integration
|
|
79
|
-
- `useModalState` - Modal state management
|
|
80
|
-
|
|
81
|
-
### Utilities
|
|
82
|
-
|
|
83
|
-
- **Auth**: Token management, authentication helpers
|
|
84
|
-
- **DOM**: DOM manipulation utilities
|
|
85
|
-
- **Forms**: Validation, form helpers
|
|
86
|
-
- **HTTP**: Request utilities and constants
|
|
87
|
-
- **Helpers**: Date formatting, ID generation, common utilities
|
|
88
|
-
- **Type Checks**: Type guard functions
|
|
89
|
-
|
|
90
|
-
### Context
|
|
91
|
-
|
|
92
|
-
- `TenantContextProvider` - Multi-tenancy support
|
|
93
|
-
|
|
94
|
-
### Globals
|
|
95
|
-
|
|
96
|
-
- **Constants**: Shared application constants
|
|
97
|
-
- **CSS**: Global styles, CSS variables, media queries, reset
|
|
98
|
-
|
|
99
|
-
### Shared Configs
|
|
24
|
+
## What's Included
|
|
100
25
|
|
|
101
|
-
- **
|
|
102
|
-
- **
|
|
26
|
+
- **40+ Components**: Button, Input, DynamicTable, ModalDialog, etc.
|
|
27
|
+
- **Hooks**: `useClickOutside`, `useDictionary`, `useFileUploader`, etc.
|
|
28
|
+
- **Utils**: Form validation, date formatting, type checks, HTTP helpers
|
|
29
|
+
- **Context**: Multi-tenancy support via `TenantProvider`
|
|
30
|
+
- **Shared Configs**: ESLint & TypeScript configurations
|
|
103
31
|
|
|
104
|
-
##
|
|
105
|
-
|
|
106
|
-
### Prerequisites
|
|
107
|
-
|
|
108
|
-
- Node.js >= 20
|
|
109
|
-
- PNPM v10.14.0
|
|
32
|
+
## Development
|
|
110
33
|
|
|
111
34
|
### Setup
|
|
112
35
|
|
|
113
36
|
```bash
|
|
114
|
-
# Clone and install
|
|
115
|
-
git clone <repository-url>
|
|
116
|
-
cd cayuse-react-components-single-repo
|
|
117
37
|
pnpm install
|
|
118
|
-
|
|
119
|
-
# Start Storybook for development
|
|
120
|
-
pnpm run storybook
|
|
121
|
-
```
|
|
122
|
-
|
|
123
|
-
### Development Commands
|
|
124
|
-
|
|
125
|
-
```bash
|
|
126
|
-
# Build the package
|
|
127
|
-
pnpm run build
|
|
128
|
-
|
|
129
|
-
# Build in watch mode
|
|
130
|
-
pnpm run dev
|
|
131
|
-
|
|
132
|
-
# Type checking
|
|
133
|
-
pnpm run check-types
|
|
134
|
-
|
|
135
|
-
# Linting
|
|
136
|
-
pnpm run lint
|
|
137
|
-
pnpm run lint:fix
|
|
138
|
-
|
|
139
|
-
# Format code
|
|
140
|
-
pnpm run format
|
|
141
|
-
|
|
142
|
-
# Run tests
|
|
143
|
-
pnpm test
|
|
144
|
-
|
|
145
|
-
# Storybook
|
|
146
|
-
pnpm run storybook
|
|
147
|
-
pnpm run build-storybook
|
|
38
|
+
pnpm run storybook # View components at http://localhost:6006
|
|
148
39
|
```
|
|
149
40
|
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
View interactive component documentation and examples:
|
|
41
|
+
### Commands
|
|
153
42
|
|
|
154
43
|
```bash
|
|
155
|
-
pnpm run
|
|
156
|
-
#
|
|
44
|
+
pnpm run build # Build package
|
|
45
|
+
pnpm run dev # Build in watch mode
|
|
46
|
+
pnpm run check-types # TypeScript validation
|
|
47
|
+
pnpm run lint # Check code quality
|
|
48
|
+
pnpm run lint:fix # Auto-fix linting issues
|
|
49
|
+
pnpm run format # Format with Prettier
|
|
50
|
+
pnpm test # Run tests
|
|
157
51
|
```
|
|
158
52
|
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
- Interactive component playground
|
|
162
|
-
- Accessibility testing (a11y addon)
|
|
163
|
-
- Visual testing with Vitest integration
|
|
164
|
-
- CSS custom properties documentation
|
|
165
|
-
|
|
166
|
-
## 🚀 Publishing & Version Management
|
|
53
|
+
## Publishing
|
|
167
54
|
|
|
168
|
-
###
|
|
55
|
+
### Create a New Version
|
|
169
56
|
|
|
170
57
|
```bash
|
|
171
|
-
# 1. Make changes and commit
|
|
58
|
+
# 1. Make your changes and commit
|
|
172
59
|
git add .
|
|
173
60
|
git commit -m "feat: add new component"
|
|
174
61
|
|
|
175
62
|
# 2. Run quality checks
|
|
176
63
|
pnpm run check-types && pnpm run lint && pnpm run build
|
|
177
64
|
|
|
178
|
-
# 3. Bump version
|
|
179
|
-
npm version patch
|
|
65
|
+
# 3. Bump version
|
|
66
|
+
npm version patch # 1.0.0 → 1.0.1 (bug fixes)
|
|
67
|
+
npm version minor # 1.0.0 → 1.1.0 (new features)
|
|
68
|
+
npm version major # 1.0.0 → 2.0.0 (breaking changes)
|
|
180
69
|
|
|
181
70
|
# 4. Push with tags
|
|
182
71
|
git push --follow-tags
|
|
183
72
|
|
|
184
|
-
# 5. Publish
|
|
185
|
-
pnpm publish
|
|
73
|
+
# 5. Publish
|
|
74
|
+
pnpm publish --access public
|
|
186
75
|
```
|
|
187
76
|
|
|
188
|
-
###
|
|
77
|
+
### Custom Versions
|
|
189
78
|
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
| **Breaking Change** | `npm version major` | 1.0.0 → 2.0.0 | Breaking changes |
|
|
195
|
-
| **Pre-release** | `npm version prerelease` | 1.0.0 → 1.0.1-0 | Alpha/beta testing |
|
|
79
|
+
```bash
|
|
80
|
+
# Manual version (you choose exact number)
|
|
81
|
+
npm version 1.2.3
|
|
82
|
+
# Result: 1.2.3
|
|
196
83
|
|
|
197
|
-
|
|
84
|
+
# Pre-release versions
|
|
85
|
+
npm version prerelease
|
|
86
|
+
# Example: 1.0.4 → 1.0.5-0
|
|
198
87
|
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
3. Creates a git tag (e.g., `v1.0.1`)
|
|
88
|
+
npm version preminor --preid=beta
|
|
89
|
+
# Example: 1.0.4 → 1.1.0-beta.0
|
|
202
90
|
|
|
203
|
-
|
|
91
|
+
npm version premajor --preid=rc
|
|
92
|
+
# Example: 1.0.4 → 2.0.0-rc.0
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
#### Hotfix with JIRA Ticket
|
|
204
96
|
|
|
205
97
|
```bash
|
|
206
|
-
#
|
|
207
|
-
|
|
98
|
+
# Option 1: Manual version (full control)
|
|
99
|
+
npm version 1.0.5-hotfix.PROJ-1234
|
|
100
|
+
# Result: 1.0.5-hotfix.PROJ-1234
|
|
208
101
|
|
|
209
|
-
#
|
|
210
|
-
|
|
102
|
+
# Option 2: Auto-increment (safer for multiple iterations)
|
|
103
|
+
npm version prerelease --preid=hotfix-PROJ-1234
|
|
104
|
+
# Result: 1.0.5-hotfix-PROJ-1234.0
|
|
105
|
+
|
|
106
|
+
# For subsequent hotfix iterations, just run:
|
|
107
|
+
npm version prerelease
|
|
108
|
+
# 1.0.5-hotfix-PROJ-1234.0 → 1.0.5-hotfix-PROJ-1234.1
|
|
109
|
+
# 1.0.5-hotfix-PROJ-1234.1 → 1.0.5-hotfix-PROJ-1234.2
|
|
211
110
|
```
|
|
212
111
|
|
|
213
|
-
|
|
112
|
+
#### Publish with Distribution Tags
|
|
214
113
|
|
|
215
114
|
```bash
|
|
216
|
-
#
|
|
217
|
-
|
|
115
|
+
# Publish as beta (not latest)
|
|
116
|
+
pnpm publish --tag beta --access public
|
|
218
117
|
|
|
219
|
-
#
|
|
220
|
-
|
|
118
|
+
# Publish as hotfix (not latest)
|
|
119
|
+
pnpm publish --tag hotfix --access public
|
|
221
120
|
|
|
222
|
-
#
|
|
223
|
-
|
|
121
|
+
# Publish as next (for upcoming features)
|
|
122
|
+
pnpm publish --tag next --access public
|
|
123
|
+
|
|
124
|
+
# Users install specific tags:
|
|
125
|
+
# npm install @cayuse-test/react@beta
|
|
126
|
+
# npm install @cayuse-test/react@hotfix
|
|
224
127
|
```
|
|
225
128
|
|
|
226
|
-
|
|
129
|
+
### Hotfix Workflow with JIRA Ticket
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
# 1. Create hotfix branch
|
|
133
|
+
git checkout -b hotfix/PROJ-1234
|
|
227
134
|
|
|
228
|
-
|
|
135
|
+
# 2. Fix the bug and commit
|
|
136
|
+
git add .
|
|
137
|
+
git commit -m "fix(PROJ-1234): description"
|
|
229
138
|
|
|
230
|
-
|
|
139
|
+
# 3. Create hotfix version
|
|
140
|
+
npm version 1.0.5-hotfix.PROJ-1234
|
|
231
141
|
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
- **TypeScript** - Validates types
|
|
142
|
+
# 4. Quality checks and build
|
|
143
|
+
pnpm run check-types && pnpm run lint && pnpm run build
|
|
235
144
|
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
145
|
+
# 5. Publish as hotfix
|
|
146
|
+
pnpm publish --tag hotfix --access public
|
|
147
|
+
|
|
148
|
+
# 6. Push with tags
|
|
149
|
+
git push origin hotfix/PROJ-1234 --follow-tags
|
|
150
|
+
|
|
151
|
+
# Users install: npm install @cayuse-test/react@hotfix
|
|
239
152
|
```
|
|
240
153
|
|
|
241
|
-
###
|
|
154
|
+
### Verify Publication
|
|
155
|
+
|
|
156
|
+
```bash
|
|
157
|
+
npm view @cayuse-test/react version # Latest version
|
|
158
|
+
npm view @cayuse-test/react versions # All versions
|
|
159
|
+
npm view @cayuse-test/react dist-tags # Published tags (latest, beta, hotfix, etc.)
|
|
160
|
+
|
|
161
|
+
# View specific tag
|
|
162
|
+
npm view @cayuse-test/react@hotfix version
|
|
242
163
|
|
|
243
|
-
|
|
244
|
-
-
|
|
245
|
-
|
|
164
|
+
# View all hotfix versions
|
|
165
|
+
npm view @cayuse-test/react versions | grep hotfix
|
|
166
|
+
```
|
|
246
167
|
|
|
247
|
-
##
|
|
168
|
+
## Project Structure
|
|
248
169
|
|
|
249
170
|
```
|
|
250
|
-
|
|
251
|
-
├──
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
├── dist/ # Built package (generated)
|
|
261
|
-
├── .storybook/ # Storybook configuration
|
|
262
|
-
└── package.json # Single package config
|
|
171
|
+
packages/
|
|
172
|
+
├── components/ # React components
|
|
173
|
+
├── hooks/ # React hooks
|
|
174
|
+
├── utils/ # Utilities
|
|
175
|
+
├── context/ # React context providers
|
|
176
|
+
├── globals/ # Constants & CSS
|
|
177
|
+
├── services/ # S3 upload service
|
|
178
|
+
├── eslint-config/ # Shared ESLint configs
|
|
179
|
+
└── typescript-config/ # Shared TypeScript configs
|
|
180
|
+
dist/ # Built output
|
|
263
181
|
```
|
|
264
182
|
|
|
265
|
-
##
|
|
183
|
+
## Build Configuration
|
|
266
184
|
|
|
267
|
-
|
|
268
|
-
2. Make changes following existing patterns
|
|
269
|
-
3. Add Storybook stories for new components
|
|
270
|
-
4. Write tests as needed
|
|
271
|
-
5. Commit changes (hooks run automatically)
|
|
272
|
-
6. Create pull request
|
|
185
|
+
### Current Setup
|
|
273
186
|
|
|
274
|
-
|
|
187
|
+
- **Build Tool**: tsup (esbuild)
|
|
188
|
+
- **Format**: ESM only
|
|
189
|
+
- **TypeScript**: Enabled with declaration files
|
|
190
|
+
- **CSS**: Bundled and processed with PostCSS
|
|
191
|
+
- **Tree-shaking**: ✅ Enabled
|
|
275
192
|
|
|
276
|
-
|
|
277
|
-
- React Aria Components for accessibility
|
|
278
|
-
- CSS custom properties for styling
|
|
279
|
-
- Conventional commits recommended
|
|
193
|
+
### Build Output
|
|
280
194
|
|
|
281
|
-
|
|
195
|
+
```
|
|
196
|
+
dist/
|
|
197
|
+
├── index.js # Main entry point
|
|
198
|
+
├── index.css # All styles
|
|
199
|
+
├── index.d.ts # TypeScript types
|
|
200
|
+
└── chunk-*.js # Code-split chunks (shared code)
|
|
201
|
+
```
|
|
282
202
|
|
|
283
|
-
|
|
203
|
+
## Git Hooks
|
|
284
204
|
|
|
285
|
-
|
|
286
|
-
# Check for errors
|
|
287
|
-
pnpm run check-types
|
|
288
|
-
pnpm run lint
|
|
205
|
+
Pre-commit hook automatically runs:
|
|
289
206
|
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
```
|
|
207
|
+
- Prettier (format code)
|
|
208
|
+
- ESLint (check quality)
|
|
209
|
+
- TypeScript (validate types)
|
|
294
210
|
|
|
295
|
-
|
|
211
|
+
Skip in emergencies:
|
|
296
212
|
|
|
297
213
|
```bash
|
|
298
|
-
# Fix the reported issues
|
|
299
|
-
pnpm run check-types
|
|
300
|
-
pnpm run lint:fix
|
|
301
|
-
|
|
302
|
-
# Emergency bypass (use sparingly!)
|
|
303
214
|
git commit --no-verify -m "emergency fix"
|
|
304
215
|
```
|
|
305
216
|
|
|
306
|
-
|
|
217
|
+
## Troubleshooting
|
|
307
218
|
|
|
308
|
-
|
|
309
|
-
# Cause: Uncommitted changes
|
|
310
|
-
git status
|
|
219
|
+
### Build fails
|
|
311
220
|
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
npm version patch
|
|
221
|
+
```bash
|
|
222
|
+
pnpm run check-types # Find TypeScript errors
|
|
223
|
+
pnpm run lint:fix # Auto-fix lint issues
|
|
316
224
|
```
|
|
317
225
|
|
|
318
|
-
###
|
|
226
|
+
### Can't commit
|
|
319
227
|
|
|
320
228
|
```bash
|
|
321
|
-
|
|
322
|
-
|
|
229
|
+
pnpm run check-types && pnpm run lint:fix
|
|
230
|
+
git commit -m "your message"
|
|
231
|
+
```
|
|
323
232
|
|
|
324
|
-
|
|
325
|
-
npm login
|
|
233
|
+
### Publish fails
|
|
326
234
|
|
|
327
|
-
|
|
235
|
+
```bash
|
|
236
|
+
npm whoami # Check if logged in
|
|
237
|
+
npm login # Login if needed
|
|
328
238
|
pnpm publish --access public
|
|
329
239
|
```
|
|
330
240
|
|
|
331
|
-
##
|
|
241
|
+
## Requirements
|
|
332
242
|
|
|
333
|
-
-
|
|
334
|
-
-
|
|
335
|
-
- **PNPM**: [https://pnpm.io/](https://pnpm.io/)
|
|
336
|
-
|
|
337
|
-
## 📄 License
|
|
338
|
-
|
|
339
|
-
See LICENSE file for details.
|
|
243
|
+
- Node.js >= 20
|
|
244
|
+
- PNPM v10.14.0
|
|
340
245
|
|
|
341
246
|
---
|
|
342
247
|
|
|
343
|
-
**Package**: `@cayuse-react
|
|
344
|
-
**Version**:
|
|
345
|
-
**
|
|
346
|
-
**Package Manager**: PNPM 10.14.0
|
|
248
|
+
**Package**: `@cayuse-test/react`
|
|
249
|
+
**Version**: See package.json
|
|
250
|
+
**License**: See LICENSE
|
|
@@ -3274,7 +3274,8 @@ var Control = (props) => {
|
|
|
3274
3274
|
);
|
|
3275
3275
|
};
|
|
3276
3276
|
var MultiValueRemove = (props) => {
|
|
3277
|
-
|
|
3277
|
+
const { ClearIcon } = props.selectProps.components;
|
|
3278
|
+
return /* @__PURE__ */ jsx43(components.MultiValueRemove, { ...props, children: typeof ClearIcon === "function" ? ClearIcon(props) : React28.isValidElement(ClearIcon) ? ClearIcon : baseClearIcon });
|
|
3278
3279
|
};
|
|
3279
3280
|
var Input3 = (props) => {
|
|
3280
3281
|
const { describedById } = props.selectProps;
|
|
@@ -10331,4 +10332,4 @@ export {
|
|
|
10331
10332
|
MilestoneProgress2 as MilestoneProgress,
|
|
10332
10333
|
TaskFormHeader
|
|
10333
10334
|
};
|
|
10334
|
-
//# sourceMappingURL=chunk-
|
|
10335
|
+
//# sourceMappingURL=chunk-JKHZBLRB.js.map
|