@capillarytech/blaze-ui 5.21.0 → 5.22.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/CapLanguageProvider/actions.js +125 -0
- package/CapLanguageProvider/actions.js.map +1 -0
- package/CapLanguageProvider/constants.js +37 -0
- package/CapLanguageProvider/constants.js.map +1 -0
- package/package.json +1 -1
- package/CapActionBar/README.md +0 -11
- package/CapAdvancedIcon/README.md +0 -185
- package/CapAdvancedIcon/use-cases.md +0 -44
- package/CapAlert/README.md +0 -144
- package/CapAppNotEnabled/README.md +0 -84
- package/CapAskAira/README.md +0 -328
- package/CapBanner/README.md +0 -4
- package/CapBlock/README.md +0 -175
- package/CapBorderedBox/Status.md +0 -40
- package/CapCSVFileUploader/README.md +0 -124
- package/CapCSVFileUploader/Status.md +0 -47
- package/CapCard/README.md +0 -85
- package/CapCard/Status.md +0 -41
- package/CapCardBox/README.md +0 -169
- package/CapCardBox/Status.md +0 -52
- package/CapCarousel/README.md +0 -190
- package/CapCarousel/Status.md +0 -73
- package/CapCheckbox/README.md +0 -254
- package/CapCheckbox/Status.md +0 -41
- package/CapColorPicker/README.md +0 -112
- package/CapColorPicker/Status.md +0 -52
- package/CapColorPicker/tests/USE_CASES_ANALYSIS.md +0 -92
- package/CapColoredTag/README.md +0 -167
- package/CapColoredTag/Status.md +0 -49
- package/CapConditionPreview/MIGRATION_ANALYSIS.md +0 -70
- package/CapConditionPreview/README.md +0 -40
- package/CapConditionPreview/tests/USE_CASES_CapConditionPreview.md +0 -65
- package/CapCustomCard/README.md +0 -182
- package/CapCustomCard/Status.md +0 -40
- package/CapCustomCarousel/Status.md +0 -69
- package/CapCustomCheckboxList/README.md +0 -178
- package/CapCustomCheckboxList/Status.md +0 -52
- package/CapCustomCheckboxList/tests/USE_CASES_ANALYSIS.md +0 -174
- package/CapCustomList/README.md +0 -117
- package/CapCustomList/Status.md +0 -77
- package/CapCustomList/tests/USE_CASES_ANALYSIS.md +0 -124
- package/CapCustomSelect/README.md +0 -38
- package/CapDatePicker/README.md +0 -139
- package/CapDateRangePicker/README.md +0 -159
- package/CapDateTimePicker/README.md +0 -136
- package/CapDateTimeRangePicker/README.md +0 -243
- package/CapDivider/README.md +0 -122
- package/CapDrawer/README.md +0 -207
- package/CapDrawer/Status.md +0 -52
- package/CapDrawer/tests/MISSING_USE_CASES.md +0 -170
- package/CapDropdown/README.md +0 -515
- package/CapDropdown/Status.md +0 -45
- package/CapDropdown/tests/USE_CASES_ANALYSIS.md +0 -137
- package/CapError/README.md +0 -88
- package/CapErrorBoundary/CapErrorBoundary-use-cases.md +0 -89
- package/CapErrorBoundary/README.md +0 -150
- package/CapErrorStateIllustration/README.md +0 -222
- package/CapErrorStateIllustration/USE_CASES.md +0 -33
- package/CapExpressionEditor/README.md +0 -32
- package/CapForm/README.md +0 -132
- package/CapForm/Status.md +0 -40
- package/CapForm/tests/PHASE1_UNFULFILLED_USE_CASES.md +0 -113
- package/CapForm/tests/USE_CASES_ANALYSIS.md +0 -119
- package/CapFormItem/README.md +0 -320
- package/CapFormItem/Status.md +0 -73
- package/CapFormItem/tests/USE_CASES_ANALYSIS.md +0 -84
- package/CapGraph/README.md +0 -69
- package/CapGraph/USE_CASES.md +0 -66
- package/CapHamburgerMenu/README.md +0 -234
- package/CapHamburgerMenu/USE_CASES.md +0 -48
- package/CapHeader/Status.md +0 -41
- package/CapHeading/README.md +0 -220
- package/CapHeading/Status.md +0 -41
- package/CapIcon/README.md +0 -207
- package/CapIllustration/Status.md +0 -41
- package/CapImage/README.md +0 -50
- package/CapImportMFEComponent/README.md +0 -121
- package/CapInfoNote/Status.md +0 -40
- package/CapInfoNote/tests/USE_CASES_ANALYSIS.md +0 -114
- package/CapInput/README.md +0 -196
- package/CapInput/Status.md +0 -123
- package/CapInput/tests/USE_CASES_ANALYSIS.md +0 -169
- package/CapLanguageProvider/CapLanguageProvider-use-cases.md +0 -56
- package/CapLanguageProvider/README.md +0 -206
- package/CapLevelGraphRenderer/CapLevelGraphRenderer-test-cases.md +0 -50
- package/CapLevelGraphRenderer/README.md +0 -123
- package/CapLevelGraphRenderer/Tooltip_MIGRATION_ANALYSIS.md +0 -120
- package/CapLink/README.md +0 -203
- package/CapLink/Status.md +0 -32
- package/CapLink/tests/CapLink.missingUseCases.md +0 -95
- package/CapList/README.md +0 -129
- package/CapList/Status.md +0 -69
- package/CapListLayout/README.md +0 -7
- package/CapLogin/README.md +0 -7
- package/CapMenu/README.md +0 -86
- package/CapModal/README.md +0 -357
- package/CapModal/Status.md +0 -52
- package/CapModal/tests/USE_CASES_GAPS.md +0 -207
- package/CapMultiSelect/README.md +0 -170
- package/CapMultiSelect/tests/USE_CASES_ANALYSIS.md +0 -29
- package/CapMultiSelectDatePicker/README.md +0 -11
- package/CapNavigation/README.md +0 -72
- package/CapNotification/README.md +0 -228
- package/CapNotificationDropdown/README.md +0 -5
- package/CapPopover/README.md +0 -234
- package/CapProgress/Status.md +0 -40
- package/CapRadio/Status.md +0 -54
- package/CapRadioButton/README.md +0 -152
- package/CapRadioButton/Status.md +0 -70
- package/CapRadioButton/tests/USE_CASES_ANALYSIS.md +0 -120
- package/CapRadioCard/README.md +0 -161
- package/CapRadioCard/Status.md +0 -78
- package/CapRadioGroup/README.md +0 -141
- package/CapRadioGroup/Status.md +0 -59
- package/CapReorderComponent/README.md +0 -179
- package/CapReorderComponent/Status.md +0 -41
- package/CapRoadMap/README.md +0 -126
- package/CapRoadMap/Status.md +0 -53
- package/CapRoadMap/tests/USE_CASE_GAPS.md +0 -92
- package/CapRow/README.md +0 -424
- package/CapSKUUploader/README.md +0 -189
- package/CapSKUUploader/Status.md +0 -66
- package/CapSecondaryTopBar/README.md +0 -7
- package/CapSelect/README.md +0 -243
- package/CapSelectFilter/README.md +0 -121
- package/CapShape/README.md +0 -96
- package/CapShape/Status.md +0 -36
- package/CapShape/tests/USE_CASES_ANALYSIS.md +0 -120
- package/CapSideBar/README.md +0 -298
- package/CapSideBar/Status.md +0 -5
- package/CapSlideBox/README.md +0 -68
- package/CapSlider/README.md +0 -423
- package/CapSlider/Status.md +0 -48
- package/CapSlider/tests/TEST_COVERAGE.md +0 -118
- package/CapSnackBar/README.md +0 -222
- package/CapSnackBar/Status.md +0 -41
- package/CapSomethingWentWrong/README.md +0 -97
- package/CapSplit/README.md +0 -19
- package/CapStatisticCard/README.md +0 -138
- package/CapStatus/README.md +0 -148
- package/CapStatus/Status.md +0 -40
- package/CapSteps/Status.md +0 -40
- package/CapStepsAccordian/README.md +0 -305
- package/CapStepsAccordian/Status.md +0 -48
- package/CapSupportVideosWrapper/README.md +0 -14
- package/CapSwitch/README.md +0 -351
- package/CapTab/README.md +0 -406
- package/CapTab/Status.md +0 -104
- package/CapTab/tests/USE_CASE_GAPS.md +0 -143
- package/CapTabV3/ANALYSIS.md +0 -60
- package/CapTabV3/README.md +0 -156
- package/CapTabV3/Status.md +0 -52
- package/CapTabV3/tests/USE_CASE_GAPS.md +0 -149
- package/CapTable/README.md +0 -160
- package/CapTable/Status.md +0 -41
- package/CapTag/README.md +0 -16
- package/CapTagDropdown/README.md +0 -171
- package/CapTagDropdown/Status.md +0 -55
- package/CapTimePicker/README.md +0 -170
- package/CapTooltip/README.md +0 -336
- package/CapTooltipWithInfo/Status.md +0 -75
- package/CapTopBar/README.md +0 -146
- package/CapTree/README.md +0 -124
- package/CapTree/Status.md +0 -48
- package/CapTree/tests/STATUS.md +0 -154
- package/CapTreeSelect/README.md +0 -217
- package/CapTreeSelect/Status.md +0 -52
- package/CapTruncateList/README.md +0 -13
- package/CapUnifiedSelect/README.md +0 -40
- package/CapUploader/README.md +0 -313
- package/CapUploader/Status.md +0 -76
- package/CapUploader/tests/USE_CASES_ANALYSIS.md +0 -225
- package/CapUserProfile/README.md +0 -105
- package/CapUserProfile/Status.md +0 -95
- package/CapVirtualList/README.md +0 -162
- package/CapVirtualList/Status.md +0 -71
- package/assets/HOCs/ComponentWithLabelHOC/README.md +0 -230
package/CapDropdown/Status.md
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
# Migration Status: CapDropdown
|
|
2
|
-
|
|
3
|
-
**Last Updated**: 2026-01-19 03:33:12
|
|
4
|
-
|
|
5
|
-
## Migration Steps
|
|
6
|
-
|
|
7
|
-
- [x] **Step 0**: Setup branch and remote tracking
|
|
8
|
-
- [x] **Step 1**: Migration Prompt 1 (Main migration)
|
|
9
|
-
- [x] **Step 2**: Migration Prompt 2 (Storybook support)
|
|
10
|
-
- [x] **Step 3**: Migration Prompt 3 (Unit tests)
|
|
11
|
-
- [x] **Step 4**: Linting (ESLint)
|
|
12
|
-
- [x] **Step 5**: Pre-build Validation
|
|
13
|
-
- [x] **Step 6**: Build blaze-ui
|
|
14
|
-
- [x] **Step 7**: Visual Testing
|
|
15
|
-
- [x] **Step 8**: CSS Analysis (if mismatches found)
|
|
16
|
-
- [x] **Step 8.5**: CSS Analysis Completed
|
|
17
|
-
- [x] **Step 9**: Git Commit & Push to branch (pre-commit hook will run tests)
|
|
18
|
-
- [x] **Step 10**: Create Pull Request
|
|
19
|
-
|
|
20
|
-
## Visual Testing Results
|
|
21
|
-
|
|
22
|
-
**Last Test**: 2026-01-19 03:31:42
|
|
23
|
-
**Maximum Mismatch**: 3.60%
|
|
24
|
-
|
|
25
|
-
### Mismatched Variants:
|
|
26
|
-
- default:2.04%
|
|
27
|
-
- placement-top:2.35%
|
|
28
|
-
- trigger-click:2.60%
|
|
29
|
-
- disabled:3.60%
|
|
30
|
-
- open (with 2 interactions):3.41%
|
|
31
|
-
- hover-open (with 2 interactions):3.41%
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
## CSS Fixes Applied
|
|
35
|
-
|
|
36
|
-
**Date**: 2026-01-19 03:32:15
|
|
37
|
-
**Summary**: CSS fixes applied based on visual testing analysis.
|
|
38
|
-
|
|
39
|
-
_See full analysis in: `/Users/sarahkhader/repos/migration/blaze-ui/tools/visual-testing/report/CapDropdown/css-fix-analysis.md`_
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
## Notes
|
|
43
|
-
|
|
44
|
-
_No notes yet._
|
|
45
|
-
|
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
# CapDropdown Use Cases Analysis
|
|
2
|
-
|
|
3
|
-
## Phase 1: Use Cases NOT Fulfilled by Component
|
|
4
|
-
|
|
5
|
-
Based on analysis of the CapDropdown component implementation and comparison with Ant Design v6 Dropdown API, the following use cases may NOT be fully fulfilled:
|
|
6
|
-
|
|
7
|
-
### 1. **Menu Item Disabled State**
|
|
8
|
-
- **Status**: ✅ Supported (via Ant Design menu items API)
|
|
9
|
-
- **Note**: Component passes through menu prop, so disabled items should work via `menu.items[].disabled`
|
|
10
|
-
|
|
11
|
-
### 2. **Submenu/Nested Menus**
|
|
12
|
-
- **Status**: ✅ Supported (via Ant Design menu items API)
|
|
13
|
-
- **Note**: Component passes through menu prop, so nested menus should work via `menu.items[].children`
|
|
14
|
-
|
|
15
|
-
### 3. **Menu Item Icons**
|
|
16
|
-
- **Status**: ✅ Supported (via Ant Design menu items API)
|
|
17
|
-
- **Note**: Component passes through menu prop, so icons work via `menu.items[].icon`
|
|
18
|
-
|
|
19
|
-
### 4. **Menu Item Danger State**
|
|
20
|
-
- **Status**: ✅ Supported (via Ant Design menu items API)
|
|
21
|
-
- **Note**: Component passes through menu prop, so danger items work via `menu.items[].danger`
|
|
22
|
-
|
|
23
|
-
### 5. **Custom Menu Rendering**
|
|
24
|
-
- **Status**: ⚠️ Limited Support
|
|
25
|
-
- **Issue**: Component doesn't expose `menu` render prop or custom menu component support
|
|
26
|
-
- **Workaround**: Can use `menu` prop with `items` array, but cannot use render props pattern
|
|
27
|
-
|
|
28
|
-
### 6. **Menu Item Click Prevention**
|
|
29
|
-
- **Status**: ✅ Supported
|
|
30
|
-
- **Note**: Can prevent default behavior in `onClick` handler
|
|
31
|
-
|
|
32
|
-
### 7. **Menu Positioning with getPopupContainer**
|
|
33
|
-
- **Status**: ⚠️ Not Explicitly Supported
|
|
34
|
-
- **Issue**: Component doesn't expose `getPopupContainer` prop from Ant Design Dropdown
|
|
35
|
-
- **Impact**: Menus always render in document.body portal, cannot be scoped to specific container
|
|
36
|
-
- **Workaround**: None - would need to add prop passthrough
|
|
37
|
-
|
|
38
|
-
### 8. **Menu Destroy on Hide**
|
|
39
|
-
- **Status**: ⚠️ Not Explicitly Supported
|
|
40
|
-
- **Issue**: Component doesn't expose `destroyPopupOnHide` prop from Ant Design Dropdown
|
|
41
|
-
- **Impact**: Menu DOM persists when closed (may affect performance with many dropdowns)
|
|
42
|
-
- **Workaround**: None - would need to add prop passthrough
|
|
43
|
-
|
|
44
|
-
### 9. **Menu Animation Control**
|
|
45
|
-
- **Status**: ⚠️ Not Explicitly Supported
|
|
46
|
-
- **Issue**: Component doesn't expose `transitionName` or animation-related props
|
|
47
|
-
- **Impact**: Cannot customize menu open/close animations
|
|
48
|
-
- **Workaround**: None - would need to add prop passthrough
|
|
49
|
-
|
|
50
|
-
### 10. **Menu Arrow Indicator**
|
|
51
|
-
- **Status**: ⚠️ Not Explicitly Supported
|
|
52
|
-
- **Issue**: Component doesn't expose `arrow` prop from Ant Design Dropdown
|
|
53
|
-
- **Impact**: Cannot show/hide arrow indicator on dropdown menu
|
|
54
|
-
- **Workaround**: None - would need to add prop passthrough
|
|
55
|
-
|
|
56
|
-
### 11. **Menu Overlay Style/ClassName per Part**
|
|
57
|
-
- **Status**: ⚠️ Partially Supported
|
|
58
|
-
- **Issue**: Component only supports `classNames.root` and deprecated `overlayClassName`
|
|
59
|
-
- **Missing**: `classNames.menu` and other v6 classNames API parts
|
|
60
|
-
- **Workaround**: Limited - can only style root overlay, not individual menu parts
|
|
61
|
-
|
|
62
|
-
### 12. **Menu Auto Adjust Placement**
|
|
63
|
-
- **Status**: ⚠️ Not Explicitly Supported
|
|
64
|
-
- **Issue**: Component doesn't expose `autoAdjustOverflow` prop
|
|
65
|
-
- **Impact**: Menu may overflow viewport if placement doesn't fit
|
|
66
|
-
- **Workaround**: None - would need to add prop passthrough
|
|
67
|
-
|
|
68
|
-
### 13. **Menu Trigger Element Ref Access**
|
|
69
|
-
- **Status**: ⚠️ Not Explicitly Supported
|
|
70
|
-
- **Issue**: Component doesn't expose ref forwarding for trigger element
|
|
71
|
-
- **Impact**: Cannot programmatically access trigger element
|
|
72
|
-
- **Workaround**: Wrap trigger in ref-accessible element
|
|
73
|
-
|
|
74
|
-
### 14. **Menu onMenuClick Callback**
|
|
75
|
-
- **Status**: ⚠️ Not Explicitly Supported
|
|
76
|
-
- **Issue**: Component doesn't expose `onMenuClick` prop from Ant Design Dropdown
|
|
77
|
-
- **Impact**: Cannot listen to all menu clicks at dropdown level
|
|
78
|
-
- **Workaround**: Use individual item `onClick` handlers
|
|
79
|
-
|
|
80
|
-
### 15. **Menu Item Selection State**
|
|
81
|
-
- **Status**: ⚠️ Not Explicitly Supported
|
|
82
|
-
- **Issue**: Component doesn't expose menu selection state management
|
|
83
|
-
- **Impact**: Cannot create selectable menu items (like radio/checkbox menus)
|
|
84
|
-
- **Workaround**: None - would need custom menu implementation
|
|
85
|
-
|
|
86
|
-
### 16. **Menu Keyboard Navigation**
|
|
87
|
-
- **Status**: ✅ Supported (via Ant Design)
|
|
88
|
-
- **Note**: Ant Design handles keyboard navigation automatically
|
|
89
|
-
|
|
90
|
-
### 17. **Menu Accessibility (ARIA)**
|
|
91
|
-
- **Status**: ✅ Supported (via Ant Design)
|
|
92
|
-
- **Note**: Ant Design provides ARIA attributes automatically
|
|
93
|
-
|
|
94
|
-
### 18. **Menu Loading State**
|
|
95
|
-
- **Status**: ⚠️ Not Explicitly Supported
|
|
96
|
-
- **Issue**: Component doesn't expose menu loading state
|
|
97
|
-
- **Impact**: Cannot show loading indicator in menu
|
|
98
|
-
- **Workaround**: Use menu items with loading icons
|
|
99
|
-
|
|
100
|
-
### 19. **Menu Empty State**
|
|
101
|
-
- **Status**: ⚠️ Not Explicitly Supported
|
|
102
|
-
- **Issue**: Component doesn't expose empty state rendering
|
|
103
|
-
- **Impact**: Empty menu shows nothing (no empty message)
|
|
104
|
-
- **Workaround**: Check menu.items.length and conditionally render
|
|
105
|
-
|
|
106
|
-
### 20. **Menu Item Tooltips**
|
|
107
|
-
- **Status**: ⚠️ Not Explicitly Supported
|
|
108
|
-
- **Issue**: Component doesn't expose tooltip support for menu items
|
|
109
|
-
- **Impact**: Cannot show tooltips on hover for truncated items
|
|
110
|
-
- **Workaround**: Use menu item `title` attribute or wrap in CapTooltip
|
|
111
|
-
|
|
112
|
-
## Summary
|
|
113
|
-
|
|
114
|
-
**Total Use Cases Analyzed**: 20
|
|
115
|
-
**Fully Supported**: 6 (30%)
|
|
116
|
-
**Partially Supported**: 4 (20%)
|
|
117
|
-
**Not Supported**: 10 (50%)
|
|
118
|
-
|
|
119
|
-
### Recommendations
|
|
120
|
-
|
|
121
|
-
1. **High Priority**: Add prop passthrough for commonly used Ant Design Dropdown props:
|
|
122
|
-
- `getPopupContainer`
|
|
123
|
-
- `destroyPopupOnHide`
|
|
124
|
-
- `arrow`
|
|
125
|
-
- `autoAdjustOverflow`
|
|
126
|
-
- `onMenuClick`
|
|
127
|
-
|
|
128
|
-
2. **Medium Priority**: Enhance classNames API support:
|
|
129
|
-
- Add `classNames.menu` support
|
|
130
|
-
- Support all v6 classNames parts
|
|
131
|
-
|
|
132
|
-
3. **Low Priority**: Add convenience features:
|
|
133
|
-
- Menu loading state
|
|
134
|
-
- Empty state rendering
|
|
135
|
-
- Ref forwarding for trigger
|
|
136
|
-
|
|
137
|
-
4. **Documentation**: Document limitations and workarounds for unsupported use cases
|
package/CapError/README.md
DELETED
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
# CapError
|
|
2
|
-
|
|
3
|
-
A simple text component for displaying error and warning messages.
|
|
4
|
-
|
|
5
|
-
## Migration from cap-ui-library to blaze-ui
|
|
6
|
-
|
|
7
|
-
### Summary of Changes
|
|
8
|
-
|
|
9
|
-
- **Styled-components → SCSS Modules**: Converted from styled-components to SCSS modules for better performance and maintainability
|
|
10
|
-
- **TypeScript**: Added full TypeScript support with proper type definitions
|
|
11
|
-
- **Functional Component**: Migrated to functional component with React.forwardRef
|
|
12
|
-
- **Prop Types**: Replaced PropTypes with TypeScript interfaces
|
|
13
|
-
- **Accessibility**: Added ref forwarding for better accessibility support
|
|
14
|
-
|
|
15
|
-
### Props
|
|
16
|
-
|
|
17
|
-
| Prop | Type | Default | Description |
|
|
18
|
-
|------|------|---------|-------------|
|
|
19
|
-
| `children` | `React.ReactNode` | - | Content to display |
|
|
20
|
-
| `type` | `'error' \| 'warning'` | `'error'` | Type of message (controls color) |
|
|
21
|
-
| `className` | `string` | `''` | Additional CSS classes |
|
|
22
|
-
| `style` | `React.CSSProperties` | `{}` | Inline styles |
|
|
23
|
-
|
|
24
|
-
### Breaking Changes
|
|
25
|
-
|
|
26
|
-
**No breaking changes from cap-ui-library v8.x**
|
|
27
|
-
|
|
28
|
-
All existing props and behaviors are maintained. The API remains identical.
|
|
29
|
-
|
|
30
|
-
### Behavioral Changes
|
|
31
|
-
|
|
32
|
-
- Colors are now defined using SCSS variables for consistency
|
|
33
|
-
- Component now supports ref forwarding
|
|
34
|
-
- TypeScript support provides better type safety
|
|
35
|
-
|
|
36
|
-
### Usage
|
|
37
|
-
|
|
38
|
-
#### Basic Usage
|
|
39
|
-
|
|
40
|
-
```tsx
|
|
41
|
-
import { CapError } from '@capillarytech/blaze-ui';
|
|
42
|
-
|
|
43
|
-
// Error message (default)
|
|
44
|
-
<CapError>This is an error message</CapError>
|
|
45
|
-
|
|
46
|
-
// Warning message
|
|
47
|
-
<CapError type="warning">This is a warning message</CapError>
|
|
48
|
-
|
|
49
|
-
// Inline error message
|
|
50
|
-
<CapError.CapErrorInline>Inline error</CapError.CapErrorInline>
|
|
51
|
-
|
|
52
|
-
// Inline warning message
|
|
53
|
-
<CapError.CapErrorInline type="warning">Inline warning</CapError.CapErrorInline>
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
#### With Custom Styling
|
|
57
|
-
|
|
58
|
-
```tsx
|
|
59
|
-
<CapError className="my-custom-class" style={{ marginTop: '10px' }}>
|
|
60
|
-
Custom styled error
|
|
61
|
-
</CapError>
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
#### With Ref
|
|
65
|
-
|
|
66
|
-
```tsx
|
|
67
|
-
const errorRef = useRef<HTMLDivElement>(null);
|
|
68
|
-
|
|
69
|
-
<CapError ref={errorRef}>Error with ref</CapError>
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
### Import Examples
|
|
73
|
-
|
|
74
|
-
```tsx
|
|
75
|
-
// Named import (recommended)
|
|
76
|
-
import { CapError } from '@capillarytech/blaze-ui';
|
|
77
|
-
|
|
78
|
-
// With types
|
|
79
|
-
import { CapError, CapErrorProps, CapErrorInlineProps } from '@capillarytech/blaze-ui';
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
## Styling
|
|
83
|
-
|
|
84
|
-
The component uses two color variables:
|
|
85
|
-
- **Error**: `$cap-red` (#ea213a)
|
|
86
|
-
- **Warning**: `$cap-orange` (#f87d23)
|
|
87
|
-
|
|
88
|
-
Font size is set to `$font-size-s` (0.857rem / 12px) with a line height of 1.429rem (20px).
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
# Test Cases: CapErrorBoundary (Antd v3→v6)
|
|
2
|
-
|
|
3
|
-
## Role
|
|
4
|
-
Senior frontend engineer documenting ESSENTIAL test cases for Storybook stories and migration validation.
|
|
5
|
-
|
|
6
|
-
## Input
|
|
7
|
-
- **Component**: CapErrorBoundary
|
|
8
|
-
- **Complexity**: medium (≤20 test cases)
|
|
9
|
-
- **Source**: blaze-ui/components/CapErrorBoundary/
|
|
10
|
-
|
|
11
|
-
---
|
|
12
|
-
|
|
13
|
-
## Google Sheets Output
|
|
14
|
-
|
|
15
|
-
**Spreadsheet ID**: `1Xt8l8Q6Hw0cUYV65SlGvGcPnOtzprr0fukDR9UWJ3kg`
|
|
16
|
-
**Tab**: CapErrorBoundary
|
|
17
|
-
|
|
18
|
-
### Steps
|
|
19
|
-
1. Check connection: `COMPOSIO_CHECK_ACTIVE_CONNECTION` toolkit="googlesheets"
|
|
20
|
-
2. Create tab: `GOOGLESHEETS_ADD_SHEET`
|
|
21
|
-
```json
|
|
22
|
-
{
|
|
23
|
-
"spreadsheetId": "1Xt8l8Q6Hw0cUYV65SlGvGcPnOtzprr0fukDR9UWJ3kg",
|
|
24
|
-
"properties": {
|
|
25
|
-
"title": "CapErrorBoundary",
|
|
26
|
-
"gridProperties": {"rowCount": 100, "columnCount": 6}
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
```
|
|
30
|
-
3. Write data: `GOOGLESHEETS_VALUES_UPDATE`
|
|
31
|
-
```json
|
|
32
|
-
{
|
|
33
|
-
"spreadsheet_id": "1Xt8l8Q6Hw0cUYV65SlGvGcPnOtzprr0fukDR9UWJ3kg",
|
|
34
|
-
"range": "CapErrorBoundary!A1",
|
|
35
|
-
"value_input_option": "USER_ENTERED",
|
|
36
|
-
"values": [
|
|
37
|
-
["ID", "Use Case", "Props/Config", "Expected Visual/Behavior", "Priority", "Storybook Story", "Notes"],
|
|
38
|
-
["UC-001", "React ErrorBoundary mode: child throws", "children (component that throws), useSlideBox: false/true", "Error boundary catches; fallbackRender runs; errorHandler(error) called; error illustration shows inline or inside CapSlideBox per useSlideBox", "P0", "ReactErrorBoundaryMode", "Core ErrorBoundary behavior"],
|
|
39
|
-
["UC-002", "API error boundary mode", "isApiErrorBoundary: true, isApiError: true | false", "When isApiError true: error illustration only. When false: children render. No ErrorBoundary when isApiErrorBoundary", "P0", "ApiErrorBoundaryMode", "Grouped isApiErrorBoundary + isApiError"],
|
|
40
|
-
["UC-003", "SlideBox vs inline fallback", "useSlideBox: true | false, slideBoxProps (e.g. className)", "useSlideBox true: fallback in CapSlideBox with show, content, handleClose, slideBoxProps spread. false: inline illustration only", "P0", "SlideBoxVsInline", "Grouped useSlideBox and slideBoxProps"],
|
|
41
|
-
["UC-004", "Boolean and config variants", "showIllustrationImage, showAnimation, isExpired, refreshThreshold (e.g. 3, 1, 0)", "Image show/hide; animation class when showAnimation; isExpired or refreshCount >= refreshThreshold sets isRefreshExpired on illustration", "P1", "ConfigVariants", "Grouped boolean/config visual state"],
|
|
42
|
-
["UC-005", "Content props (copy and slots)", "refreshText, expiryTitle, refreshTitle, expiryDescription (string or node); prefix, suffix", "All text passed to illustration; prefix/suffix render before/after in same row", "P1", "ContentProps", "Grouped content and prefix/suffix"],
|
|
43
|
-
["UC-006", "Refresh interaction and expiry", "onRefreshClick, refreshThreshold, isApiErrorBoundary: false", "Click refresh → onRefreshClick called, refreshCount increments; refreshCount === refreshThreshold → isRefreshExpired; key updates so ErrorBoundary remounts", "P1", "RefreshInteraction", "Grouped click and threshold/remount"],
|
|
44
|
-
["UC-007", "SlideBox close interaction", "useSlideBox: true, onCloseSlideBox", "Closing slide box calls onCloseSlideBox; handleClose wired correctly", "P1", "SlideBoxClose", "Single interaction test"],
|
|
45
|
-
["UC-008", "Event handlers invoked", "errorHandler, onRefreshClick, onCloseSlideBox", "errorHandler called with error in fallbackRender; onRefreshClick on refresh; onCloseSlideBox when slide box closed", "P1", "EventHandlers", "Grouped all handler invocations"],
|
|
46
|
-
["UC-009", "Styling (className and slideBoxProps)", "className, slideBoxProps: { className }", "className on illustration container; slideBoxProps spread to CapSlideBox including className", "P2", "Styling", "Grouped className + slideBoxProps"],
|
|
47
|
-
["UC-010", "Default props and minimal usage", "No optional props (or only children)", "Defaults apply; component renders without error", "P1", "DefaultProps", "Sanity with defaults"],
|
|
48
|
-
["UC-011", "Edge: refreshThreshold 0 or 1", "refreshThreshold: 0 | 1, trigger refresh", "Expired state after 0 or 1 refresh click; no crash", "P2", "EdgeRefreshThreshold", "Production edge for quick expiry"],
|
|
49
|
-
["UC-012", "Edge: children null or valid content", "children: null | valid React node", "null children don't throw; valid children render until throw. API mode: children when isApiError false", "P2", "EdgeChildren", "Grouped empty/valid children"]
|
|
50
|
-
]
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
---
|
|
56
|
-
|
|
57
|
-
## Use Cases Table
|
|
58
|
-
|
|
59
|
-
| ID | Use Case | Props/Config | Expected Visual/Behavior | Priority | Storybook Story | Notes |
|
|
60
|
-
|----|----------|---------------|--------------------------|----------|-----------------|--------|
|
|
61
|
-
| UC-001 | React ErrorBoundary mode: child throws | children (component that throws), useSlideBox: false/true | Error boundary catches; fallbackRender runs; errorHandler(error) called; error illustration shows inline or inside CapSlideBox per useSlideBox | P0 | ReactErrorBoundaryMode | Core ErrorBoundary behavior |
|
|
62
|
-
| UC-002 | API error boundary mode | isApiErrorBoundary: true, isApiError: true \| false | When isApiError true: error illustration only (no ErrorBoundary wrapper). When false: children render. No ErrorBoundary when isApiErrorBoundary | P0 | ApiErrorBoundaryMode | Grouped isApiErrorBoundary + isApiError |
|
|
63
|
-
| UC-003 | SlideBox vs inline fallback | useSlideBox: true \| false, slideBoxProps (e.g. className) | useSlideBox true: fallback in CapSlideBox with show, content, handleClose, slideBoxProps spread. false: fallback is inline illustration only | P0 | SlideBoxVsInline | Grouped useSlideBox and slideBoxProps usage |
|
|
64
|
-
| UC-004 | Boolean and config variants | showIllustrationImage, showAnimation, isExpired, refreshThreshold (e.g. 3, 1, 0) | Illustration shows/hides image; animation class applied when showAnimation; isExpired or refreshCount >= refreshThreshold sets isRefreshExpired on CapErrorStateIllustration | P1 | ConfigVariants | Grouped all boolean/config that affect visual state |
|
|
65
|
-
| UC-005 | Content props (copy and slots) | refreshText, expiryTitle, refreshTitle, expiryDescription (string or node); prefix, suffix | All text/copy passed to CapErrorStateIllustration; prefix/suffix render before/after illustration in same row | P1 | ContentProps | Grouped all content and prefix/suffix |
|
|
66
|
-
| UC-006 | Refresh interaction and expiry | onRefreshClick, refreshThreshold, isApiErrorBoundary: false | Click refresh → onRefreshClick called, refreshCount increments; when refreshCount === refreshThreshold, isRefreshExpired true (expired state). When !isApiErrorBoundary, key updates so ErrorBoundary remounts | P1 | RefreshInteraction | Grouped click behavior and threshold/remount |
|
|
67
|
-
| UC-007 | SlideBox close interaction | useSlideBox: true, onCloseSlideBox | Closing slide box calls onCloseSlideBox; handleClose wired to onCloseSlideBox | P1 | SlideBoxClose | Single interaction test |
|
|
68
|
-
| UC-008 | Event handlers invoked | errorHandler, onRefreshClick, onCloseSlideBox | errorHandler called with error object in fallbackRender; onRefreshClick on refresh; onCloseSlideBox when slide box closed | P1 | EventHandlers | Grouped all handler invocations |
|
|
69
|
-
| UC-009 | Styling (className and slideBoxProps) | className, slideBoxProps: { className } | className on illustration container (CapRow); slideBoxProps spread to CapSlideBox including className for slide box | P2 | Styling | Grouped className + slideBoxProps styling |
|
|
70
|
-
| UC-010 | Default props and minimal usage | No optional props (or only children) | Defaults: empty strings for text, refreshThreshold 3, showIllustrationImage true, showAnimation true, useSlideBox false, isApiErrorBoundary false; component renders without error | P1 | DefaultProps | Sanity with defaults |
|
|
71
|
-
| UC-011 | Edge: refreshThreshold 0 or 1 | refreshThreshold: 0 \| 1, trigger refresh | Expired state (isRefreshExpired) after 0 or 1 refresh click; no crash | P2 | EdgeRefreshThreshold | Production edge for quick expiry |
|
|
72
|
-
| UC-012 | Edge: children null or valid content | children: null \| valid React node | With React ErrorBoundary: null children don’t throw; valid children render until throw. With API mode: children render when isApiError false | P2 | EdgeChildren | Grouped empty/valid children |
|
|
73
|
-
|
|
74
|
-
---
|
|
75
|
-
|
|
76
|
-
## Summary
|
|
77
|
-
|
|
78
|
-
- **Total use cases**: 12 (within medium limit of 20).
|
|
79
|
-
- **Grouping**: Config/boolean variants, content props, event handlers, styling, and edge cases each combined into single tests.
|
|
80
|
-
- **P0**: React vs API mode, SlideBox vs inline (3). **P1**: Config, content, refresh/slide interactions, handlers, defaults (6). **P2**: Styling, refreshThreshold edge, children edge (3).
|
|
81
|
-
- **Storybook stories**: ReactErrorBoundaryMode, ApiErrorBoundaryMode, SlideBoxVsInline, ConfigVariants, ContentProps, RefreshInteraction, SlideBoxClose, EventHandlers, Styling, DefaultProps, EdgeRefreshThreshold, EdgeChildren.
|
|
82
|
-
|
|
83
|
-
## Test Implementation Notes
|
|
84
|
-
|
|
85
|
-
- Use **React Testing Library** with **Jest**.
|
|
86
|
-
- Prefer `data-testid` for querying (add to component if needed).
|
|
87
|
-
- Clear mocks between tests where applicable.
|
|
88
|
-
- Do **not** mock Cap UI components (e.g. CapErrorStateIllustration, CapSlideBox, CapRow) unless instructed.
|
|
89
|
-
- Avoid relying on getByRole where avoidable; keep tests focused and not overly complex.
|
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
# CapErrorBoundary
|
|
2
|
-
|
|
3
|
-
A wrapper component that provides error boundary functionality for React applications, catching JavaScript errors anywhere in the child component tree and displaying a fallback UI.
|
|
4
|
-
|
|
5
|
-
## Migration from Ant Design v3 to v6
|
|
6
|
-
|
|
7
|
-
This component has been migrated from Ant Design v3 to v6 with the following changes:
|
|
8
|
-
|
|
9
|
-
### Breaking Changes
|
|
10
|
-
|
|
11
|
-
**None** - The component maintains full backward compatibility. No API changes were made.
|
|
12
|
-
|
|
13
|
-
### Style Changes
|
|
14
|
-
|
|
15
|
-
**Approach**: The component now uses CSS Modules with the `styles[classname]` pattern instead of global class names. All styling remains functionally identical.
|
|
16
|
-
|
|
17
|
-
### Code Improvements
|
|
18
|
-
|
|
19
|
-
1. **Removed PropTypes**: Replaced with TypeScript types from `types.ts`
|
|
20
|
-
2. **Removed defaultProps**: Converted to default parameters in function arguments
|
|
21
|
-
3. **TypeScript support**: Full TypeScript type definitions with proper types
|
|
22
|
-
4. **CSS Modules**: Using `styles[classname]` pattern for scoped styling
|
|
23
|
-
|
|
24
|
-
### What Stayed the Same
|
|
25
|
-
|
|
26
|
-
- All component props and behavior
|
|
27
|
-
- Error boundary functionality (React ErrorBoundary mode)
|
|
28
|
-
- API error boundary mode (`isApiErrorBoundary` prop)
|
|
29
|
-
- Slide box vs inline fallback rendering
|
|
30
|
-
- Refresh threshold and expiry logic
|
|
31
|
-
- Animation support
|
|
32
|
-
- Prefix/suffix content slots
|
|
33
|
-
- All event handlers
|
|
34
|
-
|
|
35
|
-
### What Changed
|
|
36
|
-
|
|
37
|
-
- **Removed**: `PropTypes` (replaced with TypeScript types)
|
|
38
|
-
- **Removed**: `defaultProps` (replaced with default parameters)
|
|
39
|
-
- **Updated**: CSS class names now use CSS Modules pattern
|
|
40
|
-
- **Added**: TypeScript type definitions in `types.ts`
|
|
41
|
-
- **Added**: CSS Modules for scoped styling
|
|
42
|
-
|
|
43
|
-
## Usage
|
|
44
|
-
|
|
45
|
-
### Basic Usage (React ErrorBoundary Mode)
|
|
46
|
-
|
|
47
|
-
```tsx
|
|
48
|
-
import CapErrorBoundary from '@capillarytech/blaze-ui/components/CapErrorBoundary';
|
|
49
|
-
|
|
50
|
-
function App() {
|
|
51
|
-
return (
|
|
52
|
-
<CapErrorBoundary>
|
|
53
|
-
<YourComponent />
|
|
54
|
-
</CapErrorBoundary>
|
|
55
|
-
);
|
|
56
|
-
}
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
### With Custom Error Handler
|
|
60
|
-
|
|
61
|
-
```tsx
|
|
62
|
-
<CapErrorBoundary
|
|
63
|
-
errorHandler={(error) => {
|
|
64
|
-
console.error('Error caught:', error);
|
|
65
|
-
// Send to error tracking service
|
|
66
|
-
}}
|
|
67
|
-
>
|
|
68
|
-
<YourComponent />
|
|
69
|
-
</CapErrorBoundary>
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
### API Error Boundary Mode
|
|
73
|
-
|
|
74
|
-
```tsx
|
|
75
|
-
<CapErrorBoundary
|
|
76
|
-
isApiErrorBoundary
|
|
77
|
-
isApiError={hasApiError}
|
|
78
|
-
>
|
|
79
|
-
<YourComponent />
|
|
80
|
-
</CapErrorBoundary>
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
### With Slide Box
|
|
84
|
-
|
|
85
|
-
```tsx
|
|
86
|
-
<CapErrorBoundary
|
|
87
|
-
useSlideBox
|
|
88
|
-
onCloseSlideBox={() => {
|
|
89
|
-
console.log('Slide box closed');
|
|
90
|
-
}}
|
|
91
|
-
>
|
|
92
|
-
<YourComponent />
|
|
93
|
-
</CapErrorBoundary>
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
### With Custom Content
|
|
97
|
-
|
|
98
|
-
```tsx
|
|
99
|
-
<CapErrorBoundary
|
|
100
|
-
refreshText="Try Again"
|
|
101
|
-
refreshTitle="Something went wrong"
|
|
102
|
-
expiryTitle="Refresh limit reached"
|
|
103
|
-
expiryDescription="Please contact support"
|
|
104
|
-
prefix={<CustomHeader />}
|
|
105
|
-
suffix={<CustomFooter />}
|
|
106
|
-
>
|
|
107
|
-
<YourComponent />
|
|
108
|
-
</CapErrorBoundary>
|
|
109
|
-
```
|
|
110
|
-
|
|
111
|
-
## Props
|
|
112
|
-
|
|
113
|
-
| Prop | Type | Default | Description |
|
|
114
|
-
|------|------|---------|-------------|
|
|
115
|
-
| `children` | `React.ReactNode` | - | Child components to wrap with error boundary |
|
|
116
|
-
| `className` | `string` | `''` | Additional CSS class name |
|
|
117
|
-
| `isExpired` | `boolean` | `false` | Whether the refresh action has expired |
|
|
118
|
-
| `isApiError` | `boolean` | `false` | Whether to show API error state (only used when `isApiErrorBoundary` is true) |
|
|
119
|
-
| `refreshText` | `string \| React.ReactNode` | `''` | Text to display for refresh action |
|
|
120
|
-
| `expiryTitle` | `string \| React.ReactNode` | `''` | Title to display when refresh has expired |
|
|
121
|
-
| `refreshTitle` | `string \| React.ReactNode` | `''` | Title to display for refresh action |
|
|
122
|
-
| `useSlideBox` | `boolean` | `false` | Whether to display error in a slide box instead of inline |
|
|
123
|
-
| `errorHandler` | `(error: Error) => void` | `() => {}` | Handler called when an error is caught |
|
|
124
|
-
| `slideBoxProps` | `Record<string, unknown>` | `{}` | Props to pass to CapSlideBox when `useSlideBox` is true |
|
|
125
|
-
| `onRefreshClick` | `() => void` | `() => {}` | Handler called when refresh button is clicked |
|
|
126
|
-
| `onCloseSlideBox` | `() => void` | `() => {}` | Handler called when slide box is closed |
|
|
127
|
-
| `refreshThreshold` | `number` | `3` | Number of refresh clicks before showing expired state |
|
|
128
|
-
| `expiryDescription` | `string \| React.ReactNode` | `''` | Description to display when refresh has expired |
|
|
129
|
-
| `isApiErrorBoundary` | `boolean` | `false` | Whether to use API error boundary mode (shows error based on `isApiError` prop instead of catching React errors) |
|
|
130
|
-
| `showIllustrationImage` | `boolean` | `true` | Whether to show illustration image |
|
|
131
|
-
| `prefix` | `string \| React.ReactNode` | `''` | Content to render before the error illustration |
|
|
132
|
-
| `suffix` | `string \| React.ReactNode` | `''` | Content to render after the error illustration |
|
|
133
|
-
| `showAnimation` | `boolean` | `true` | Whether to show animation when error illustration appears |
|
|
134
|
-
|
|
135
|
-
## Modes
|
|
136
|
-
|
|
137
|
-
### React ErrorBoundary Mode (Default)
|
|
138
|
-
|
|
139
|
-
When `isApiErrorBoundary` is `false` (default), the component wraps children with React's `ErrorBoundary` from `react-error-boundary`. This catches JavaScript errors during rendering, in lifecycle methods, and in constructors of the whole tree below.
|
|
140
|
-
|
|
141
|
-
### API Error Boundary Mode
|
|
142
|
-
|
|
143
|
-
When `isApiErrorBoundary` is `true`, the component does not use React's ErrorBoundary. Instead, it conditionally renders the error illustration based on the `isApiError` prop. This is useful for handling API errors that don't cause React component errors.
|
|
144
|
-
|
|
145
|
-
## Notes
|
|
146
|
-
|
|
147
|
-
- The component uses `react-error-boundary` library for React error boundary functionality
|
|
148
|
-
- When refresh is clicked in React ErrorBoundary mode, the component remounts the ErrorBoundary by updating its key
|
|
149
|
-
- The refresh count is tracked internally and compared against `refreshThreshold` to determine expired state
|
|
150
|
-
- All additional props passed to `CapErrorBoundary` are spread to `CapErrorStateIllustration`
|