@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
|
@@ -1,222 +0,0 @@
|
|
|
1
|
-
# CapErrorStateIllustration Migration Documentation
|
|
2
|
-
|
|
3
|
-
## Summary
|
|
4
|
-
|
|
5
|
-
`CapErrorStateIllustration` has been migrated from `@capillarytech/cap-ui-library` (Ant Design v3) to `@capillarytech/blaze-ui` (Ant Design v6). The component displays error state illustrations with optional refresh functionality or expiry messages.
|
|
6
|
-
|
|
7
|
-
## Migration Changes
|
|
8
|
-
|
|
9
|
-
### Component Structure
|
|
10
|
-
|
|
11
|
-
**Before (cap-ui-library):**
|
|
12
|
-
- Used PropTypes for runtime type checking
|
|
13
|
-
- Used defaultProps for default values
|
|
14
|
-
- Used styled-components for styling
|
|
15
|
-
- Function component with destructuring
|
|
16
|
-
|
|
17
|
-
**After (blaze-ui):**
|
|
18
|
-
- TypeScript types from `types.ts` (no PropTypes)
|
|
19
|
-
- Default values in function argument destructuring (no defaultProps)
|
|
20
|
-
- CSS Modules with SCSS (no styled-components)
|
|
21
|
-
- Functional component with React.FC type
|
|
22
|
-
|
|
23
|
-
## Props
|
|
24
|
-
|
|
25
|
-
### Props Comparison
|
|
26
|
-
|
|
27
|
-
| Prop | cap-ui-library | blaze-ui | Status |
|
|
28
|
-
|------|----------------|----------|--------|
|
|
29
|
-
| `showImage` | ✅ | ✅ | **Unchanged** |
|
|
30
|
-
| `className` | ✅ | ✅ | **Unchanged** |
|
|
31
|
-
| `refreshText` | ✅ | ✅ | **Unchanged** |
|
|
32
|
-
| `expiryTitle` | ✅ | ✅ | **Unchanged** |
|
|
33
|
-
| `refreshTitle` | ✅ | ✅ | **Unchanged** |
|
|
34
|
-
| `onRefreshClick` | ✅ | ✅ | **Unchanged** |
|
|
35
|
-
| `isRefreshExpired` | ✅ | ✅ | **Unchanged** |
|
|
36
|
-
| `expiryDescription` | ✅ | ✅ | **Unchanged** |
|
|
37
|
-
| `...rest` | ✅ | ✅ | **Unchanged** (HTML div attributes) |
|
|
38
|
-
|
|
39
|
-
### All Props
|
|
40
|
-
|
|
41
|
-
#### `showImage`
|
|
42
|
-
- **Type:** `boolean`
|
|
43
|
-
- **Default:** `true`
|
|
44
|
-
- **Description:** Whether to show the error state illustration image
|
|
45
|
-
- **Example:**
|
|
46
|
-
```tsx
|
|
47
|
-
<CapErrorStateIllustration showImage={false} />
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
#### `className`
|
|
51
|
-
- **Type:** `string`
|
|
52
|
-
- **Default:** `''`
|
|
53
|
-
- **Description:** Additional CSS class name
|
|
54
|
-
- **Example:**
|
|
55
|
-
```tsx
|
|
56
|
-
<CapErrorStateIllustration className="custom-class" />
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
#### `refreshText`
|
|
60
|
-
- **Type:** `string | React.ReactNode`
|
|
61
|
-
- **Default:** `''`
|
|
62
|
-
- **Description:** Text or node to display in the refresh button (when not expired)
|
|
63
|
-
- **Example:**
|
|
64
|
-
```tsx
|
|
65
|
-
<CapErrorStateIllustration refreshText="Refresh" />
|
|
66
|
-
<CapErrorStateIllustration refreshText={<span>Custom Refresh</span>} />
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
#### `expiryTitle`
|
|
70
|
-
- **Type:** `string | React.ReactNode`
|
|
71
|
-
- **Default:** `''`
|
|
72
|
-
- **Description:** Title to display when refresh is expired
|
|
73
|
-
- **Example:**
|
|
74
|
-
```tsx
|
|
75
|
-
<CapErrorStateIllustration expiryTitle="Session Expired" isRefreshExpired />
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
#### `refreshTitle`
|
|
79
|
-
- **Type:** `string | React.ReactNode`
|
|
80
|
-
- **Default:** `''`
|
|
81
|
-
- **Description:** Title to display when refresh is available
|
|
82
|
-
- **Example:**
|
|
83
|
-
```tsx
|
|
84
|
-
<CapErrorStateIllustration refreshTitle="Something went wrong" />
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
#### `onRefreshClick`
|
|
88
|
-
- **Type:** `() => void`
|
|
89
|
-
- **Default:** `() => {}`
|
|
90
|
-
- **Description:** Callback function when refresh button is clicked
|
|
91
|
-
- **Example:**
|
|
92
|
-
```tsx
|
|
93
|
-
<CapErrorStateIllustration
|
|
94
|
-
onRefreshClick={() => window.location.reload()}
|
|
95
|
-
/>
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
#### `isRefreshExpired`
|
|
99
|
-
- **Type:** `boolean`
|
|
100
|
-
- **Default:** `false`
|
|
101
|
-
- **Description:** Whether the refresh has expired
|
|
102
|
-
- **Example:**
|
|
103
|
-
```tsx
|
|
104
|
-
<CapErrorStateIllustration isRefreshExpired={true} />
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
#### `expiryDescription`
|
|
108
|
-
- **Type:** `string | React.ReactNode`
|
|
109
|
-
- **Default:** `''`
|
|
110
|
-
- **Description:** Description to display when refresh is expired
|
|
111
|
-
- **Example:**
|
|
112
|
-
```tsx
|
|
113
|
-
<CapErrorStateIllustration
|
|
114
|
-
expiryDescription="Please refresh the page"
|
|
115
|
-
isRefreshExpired
|
|
116
|
-
/>
|
|
117
|
-
```
|
|
118
|
-
|
|
119
|
-
## Usage Examples
|
|
120
|
-
|
|
121
|
-
### Basic Usage
|
|
122
|
-
|
|
123
|
-
```tsx
|
|
124
|
-
import CapErrorStateIllustration from '@capillarytech/blaze-ui/CapErrorStateIllustration';
|
|
125
|
-
|
|
126
|
-
<CapErrorStateIllustration
|
|
127
|
-
refreshTitle="Something went wrong"
|
|
128
|
-
refreshText="Refresh"
|
|
129
|
-
onRefreshClick={() => window.location.reload()}
|
|
130
|
-
/>
|
|
131
|
-
```
|
|
132
|
-
|
|
133
|
-
### Expired State
|
|
134
|
-
|
|
135
|
-
```tsx
|
|
136
|
-
<CapErrorStateIllustration
|
|
137
|
-
isRefreshExpired={true}
|
|
138
|
-
expiryTitle="Session Expired"
|
|
139
|
-
expiryDescription="Please refresh the page"
|
|
140
|
-
/>
|
|
141
|
-
```
|
|
142
|
-
|
|
143
|
-
### Without Image
|
|
144
|
-
|
|
145
|
-
```tsx
|
|
146
|
-
<CapErrorStateIllustration
|
|
147
|
-
showImage={false}
|
|
148
|
-
refreshTitle="Error occurred"
|
|
149
|
-
refreshText="Try again"
|
|
150
|
-
onRefreshClick={handleRefresh}
|
|
151
|
-
/>
|
|
152
|
-
```
|
|
153
|
-
|
|
154
|
-
### Custom Content
|
|
155
|
-
|
|
156
|
-
```tsx
|
|
157
|
-
<CapErrorStateIllustration
|
|
158
|
-
refreshTitle={<strong>Error</strong>}
|
|
159
|
-
refreshText={<span>Click to <em>refresh</em></span>}
|
|
160
|
-
onRefreshClick={handleRefresh}
|
|
161
|
-
/>
|
|
162
|
-
```
|
|
163
|
-
|
|
164
|
-
## Style Changes
|
|
165
|
-
|
|
166
|
-
**Approach**: The component now uses CSS Modules with SCSS instead of styled-components. All styling is done through CSS classes.
|
|
167
|
-
|
|
168
|
-
### Removed Dependencies
|
|
169
|
-
- `styled-components` - Replaced with CSS Modules
|
|
170
|
-
- `prop-types` - Replaced with TypeScript types
|
|
171
|
-
|
|
172
|
-
### CSS Classes
|
|
173
|
-
|
|
174
|
-
The component uses the following CSS classes:
|
|
175
|
-
- `.cap-error-state-illustration` - Main container
|
|
176
|
-
- `.error-state-image` - Image wrapper
|
|
177
|
-
- `.error-state-refresh-button` - Refresh button
|
|
178
|
-
- `.error-state-refresh-icon` - Refresh icon
|
|
179
|
-
- `.refresh-button-text-container` - Refresh button text container
|
|
180
|
-
|
|
181
|
-
## Code Improvements
|
|
182
|
-
|
|
183
|
-
1. **Removed PropTypes**: Replaced with TypeScript types from `types.ts`
|
|
184
|
-
2. **Removed defaultProps**: Default values now in function argument destructuring
|
|
185
|
-
3. **Removed styled-components**: Converted to CSS Modules with SCSS
|
|
186
|
-
4. **Type safety**: Full TypeScript support with proper type exports
|
|
187
|
-
5. **Better maintainability**: CSS Modules provide better encapsulation
|
|
188
|
-
|
|
189
|
-
## What Stayed the Same
|
|
190
|
-
|
|
191
|
-
- All props and their behavior
|
|
192
|
-
- Component functionality and logic
|
|
193
|
-
- Visual appearance (styling preserved)
|
|
194
|
-
- API surface area (backward compatible)
|
|
195
|
-
|
|
196
|
-
## What Changed
|
|
197
|
-
|
|
198
|
-
- **Removed**: `PropTypes` import and usage
|
|
199
|
-
- **Removed**: `defaultProps` assignment
|
|
200
|
-
- **Removed**: `styled-components` dependency
|
|
201
|
-
- **Added**: TypeScript types in `types.ts`
|
|
202
|
-
- **Added**: CSS Modules classes in `styles.scss`
|
|
203
|
-
- **Changed**: Default values now in function arguments
|
|
204
|
-
|
|
205
|
-
## Migration Guide
|
|
206
|
-
|
|
207
|
-
If you're migrating from the old version:
|
|
208
|
-
|
|
209
|
-
1. **No code changes required** - The component API is backward compatible
|
|
210
|
-
2. **TypeScript users**: You can now import types:
|
|
211
|
-
```tsx
|
|
212
|
-
import type { CapErrorStateIllustrationProps } from '@capillarytech/blaze-ui/CapErrorStateIllustration';
|
|
213
|
-
```
|
|
214
|
-
3. **Styling**: If you were overriding styles, update selectors to use CSS Modules classes
|
|
215
|
-
|
|
216
|
-
## Related Components
|
|
217
|
-
|
|
218
|
-
- `CapButton` - Used for the refresh button
|
|
219
|
-
- `CapHeading` - Used for titles
|
|
220
|
-
- `CapIcon` - Used for refresh icon
|
|
221
|
-
- `CapImage` - Used for error illustrations
|
|
222
|
-
- `CapRow` - Used for layout
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
# Test Cases: CapErrorStateIllustration (Antd v3→v6)
|
|
2
|
-
|
|
3
|
-
## Component Analysis
|
|
4
|
-
- **Component**: CapErrorStateIllustration
|
|
5
|
-
- **Complexity**: simple
|
|
6
|
-
- **Test Case Limit**: ≤10 test cases
|
|
7
|
-
|
|
8
|
-
## Generated Test Cases
|
|
9
|
-
|
|
10
|
-
| ID | Use Case | Props/Config | Expected Visual/Behavior | Priority | Storybook Story | Notes |
|
|
11
|
-
|----|----------|--------------|-------------------------|----------|-----------------|-------|
|
|
12
|
-
| UC-001 | Default rendering | All default props (showImage: true, isRefreshExpired: false, empty strings) | Component renders with refresh illustration image, no visible text or button | P0 | Default | Basic rendering with default props |
|
|
13
|
-
| UC-002 | Refresh state vs Expiry state | isRefreshExpired: false vs true | When false: shows refreshErrorStateIllustration, refreshTitle, refresh button. When true: shows expiryErrorStateIllustration, expiryTitle, expiryDescription | P0 | StateVariants | Grouped both state variants into single test |
|
|
14
|
-
| UC-003 | Image visibility toggle | showImage: true vs false | When true: image renders. When false: no image displayed | P1 | ImageVisibility | Grouped both image states |
|
|
15
|
-
| UC-004 | Content variants | refreshTitle, expiryTitle, expiryDescription, refreshText with various values (string, node, empty) | All text props render correctly. String and node types supported. Empty strings hide elements | P1 | ContentVariants | Grouped all text content props |
|
|
16
|
-
| UC-005 | Refresh button interaction | refreshText: "Refresh", onRefreshClick: mock function | Button renders with refresh icon and text. Click triggers onRefreshClick handler | P0 | RefreshInteraction | Critical user interaction |
|
|
17
|
-
| UC-006 | Custom styling | className: "custom-class" | Custom className applied to container element | P2 | CustomStyling | Basic styling support |
|
|
18
|
-
| UC-007 | Edge cases - minimal content | Only showImage: true, all text props empty | Component renders with only image, no text or buttons | P1 | MinimalContent | Edge case for empty content |
|
|
19
|
-
| UC-008 | HTML attributes passthrough | {...rest} props (data-testid, aria-label, etc.) | Additional HTML attributes passed to container element | P2 | AttributesPassthrough | Grouped all HTML/ARIA attributes |
|
|
20
|
-
| UC-009 | Refresh button with node content | refreshText: <span>Custom Node</span> | Button accepts node type for refreshText and renders correctly | P1 | NodeContentSupport | Tests PropTypes.oneOfType support |
|
|
21
|
-
| UC-010 | Complete refresh state | showImage: true, isRefreshExpired: false, refreshTitle: "Error", refreshText: "Retry", onRefreshClick: handler | All refresh state elements visible: image, title, button with icon and text | P0 | CompleteRefreshState | Full refresh state integration |
|
|
22
|
-
|
|
23
|
-
## Summary
|
|
24
|
-
- **Total Test Cases**: 10
|
|
25
|
-
- **P0 (Blocking)**: 3
|
|
26
|
-
- **P1 (High)**: 5
|
|
27
|
-
- **P2 (Medium)**: 2
|
|
28
|
-
|
|
29
|
-
## Grouping Rationale
|
|
30
|
-
- State variants (UC-002): Combined refresh and expiry states as they're mutually exclusive
|
|
31
|
-
- Content variants (UC-004): Grouped all text props since they follow similar patterns
|
|
32
|
-
- Image visibility (UC-003): Simple boolean toggle grouped together
|
|
33
|
-
- Attributes (UC-008): All HTML/ARIA attributes grouped as passthrough props
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
# CapExpressionEditor
|
|
2
|
-
|
|
3
|
-
Expression editor component with grammar validation, syntax highlighting, and autocomplete. Uses a jQuery-based expredit plugin for parsing and validation.
|
|
4
|
-
|
|
5
|
-
## Migration Notes (Antd v3 → v6)
|
|
6
|
-
|
|
7
|
-
### Changes Applied
|
|
8
|
-
|
|
9
|
-
- **Runtime prop validation removed**: Replaced with TypeScript types from `types.ts`
|
|
10
|
-
- **defaultProps removed**: Default values now use destructuring in function arguments
|
|
11
|
-
- **Class → Functional component**: Converted to React.FC with hooks
|
|
12
|
-
- **SCSS**: Hardcoded colors replaced with `$CAP_*` design tokens from `_variables.scss`
|
|
13
|
-
- **No Antd overrides**: Component uses `CapInput.TextArea` (wraps Antd Input); no theme config changes required
|
|
14
|
-
|
|
15
|
-
### Props
|
|
16
|
-
|
|
17
|
-
| Prop | Type | Default | Description |
|
|
18
|
-
|------|------|---------|-------------|
|
|
19
|
-
| `grammar` | `ExpressionGrammar` | defaultGrammar | Expression grammar configuration |
|
|
20
|
-
| `expected` | `string[]` | `['boolean']` | Expected types for validation |
|
|
21
|
-
| `typeSource` | `string` | - | Type source identifier |
|
|
22
|
-
| `delims` | `string[]` | `['{{', '}}']` | Delimiters for expression parsing |
|
|
23
|
-
| `expression` | `string` | `''` | Initial expression value |
|
|
24
|
-
| `onChange` | `(expressionJSON, expression, isError) => void` | - | Callback when expression changes |
|
|
25
|
-
| `className` | `string` | - | Additional CSS class |
|
|
26
|
-
| `disabled` | `boolean` | - | Disable the editor |
|
|
27
|
-
| ...rest | `CapInputTextAreaProps` | - | Passed through to underlying TextArea |
|
|
28
|
-
|
|
29
|
-
### Dependencies
|
|
30
|
-
|
|
31
|
-
- **jquery** (^3.6.0): Required for expredit plugin
|
|
32
|
-
- **rangy** (^1.3.2): Selection/range library used by expredit plugin
|
package/CapForm/README.md
DELETED
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
# CapForm Migration: Ant Design v3 → v6
|
|
2
|
-
|
|
3
|
-
## Migration Summary
|
|
4
|
-
|
|
5
|
-
CapForm has been migrated from Ant Design v3 to v6. This component is a thin wrapper around Ant Design's Form component that provides consistent styling and layout defaults.
|
|
6
|
-
|
|
7
|
-
## Breaking Changes
|
|
8
|
-
|
|
9
|
-
### Form.create() No Longer Exported
|
|
10
|
-
|
|
11
|
-
**Breaking Change:** The original `cap-ui-library` component exported `Form.create` as part of its API. This is **no longer exported** in the migrated component.
|
|
12
|
-
|
|
13
|
-
**Before (cap-ui-library):**
|
|
14
|
-
```javascript
|
|
15
|
-
import CapForm from '@capillarytech/cap-ui-library/CapForm';
|
|
16
|
-
|
|
17
|
-
// Form.create was available
|
|
18
|
-
const WrappedForm = CapForm.create()(MyComponent);
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
**After (blaze-ui):**
|
|
22
|
-
```tsx
|
|
23
|
-
import { Form } from 'antd-v5';
|
|
24
|
-
import CapForm from '@capillarytech/blaze-ui';
|
|
25
|
-
|
|
26
|
-
// Use Form.useForm() hook instead
|
|
27
|
-
const [form] = Form.useForm();
|
|
28
|
-
|
|
29
|
-
<CapForm form={form}>
|
|
30
|
-
{/* form content */}
|
|
31
|
-
</CapForm>
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
**Migration:** Replace `Form.create()` HOC pattern with `Form.useForm()` hook pattern, which is the recommended approach in Ant Design v6.
|
|
35
|
-
|
|
36
|
-
### All Other Props
|
|
37
|
-
|
|
38
|
-
All other CapForm props maintain full backward compatibility. All Ant Design Form props are passed through unchanged.
|
|
39
|
-
|
|
40
|
-
## Deprecated Props
|
|
41
|
-
|
|
42
|
-
### Ant Design Form Component Props
|
|
43
|
-
|
|
44
|
-
**Status:** ✅ **No deprecated props**
|
|
45
|
-
|
|
46
|
-
The Ant Design `Form` component does not have any deprecated props in v6 that require backward compatibility mapping. Unlike other Ant Design components (Dropdown, Tooltip, Tabs, etc.), the Form component's prop API remained stable during the v3 → v6 migration.
|
|
47
|
-
|
|
48
|
-
**Verified Ant Design Form Props (All Supported):**
|
|
49
|
-
- `layout` - Form layout type (`'horizontal' | 'vertical' | 'inline'`)
|
|
50
|
-
- `labelCol` - Label layout configuration
|
|
51
|
-
- `wrapperCol` - Wrapper layout configuration
|
|
52
|
-
- `colon` - Whether to show colon after label
|
|
53
|
-
- `preserve` - Whether to preserve field values
|
|
54
|
-
- `scrollToFirstError` - Whether to scroll to first error on submit
|
|
55
|
-
- `size` - Form size (`'small' | 'middle' | 'large'`)
|
|
56
|
-
- `requiredMark` - Required mark style
|
|
57
|
-
- `form` - Form instance (from `Form.useForm()`)
|
|
58
|
-
- All other `FormProps` from Ant Design v6
|
|
59
|
-
|
|
60
|
-
**Note:** The Form component API changed from using `Form.create()` HOC to `Form.useForm()` hook, but this is an API pattern change, not a prop deprecation.
|
|
61
|
-
|
|
62
|
-
## API Changes
|
|
63
|
-
|
|
64
|
-
CapForm maintains full compatibility with Ant Design v6 Form API:
|
|
65
|
-
- Uses `Form.useForm()` hook pattern (recommended in v6)
|
|
66
|
-
- Passes through all `FormProps` from Ant Design v6
|
|
67
|
-
- Maintains the same prop interface (except `Form.create` export)
|
|
68
|
-
|
|
69
|
-
## Styling Migration
|
|
70
|
-
|
|
71
|
-
### Before (v3/v5)
|
|
72
|
-
- Used `:global` SCSS blocks to override Ant Design form styles
|
|
73
|
-
- Multiple `.ant-form-*` class overrides for spacing and layout
|
|
74
|
-
|
|
75
|
-
### After (v6)
|
|
76
|
-
- All form styling migrated to theme tokens in `getCapThemeConfig.ts`
|
|
77
|
-
- Removed all `:global` blocks and `.ant-*` selectors from `styles.scss`
|
|
78
|
-
- Form spacing controlled via Ant Design design tokens:
|
|
79
|
-
- `components.Form.itemMarginBottom` - Form item spacing (24px)
|
|
80
|
-
- `components.Form.labelColonMarginInlineEnd` - Label padding (16px)
|
|
81
|
-
|
|
82
|
-
### Custom Styles
|
|
83
|
-
|
|
84
|
-
The component now only includes minimal wrapper styles. All Ant Design form styling is handled through the theme configuration system.
|
|
85
|
-
|
|
86
|
-
## Usage
|
|
87
|
-
|
|
88
|
-
```tsx
|
|
89
|
-
import CapForm from '@capillarytech/blaze-ui';
|
|
90
|
-
import { Form } from 'antd-v5';
|
|
91
|
-
|
|
92
|
-
// Basic usage
|
|
93
|
-
<CapForm layout="vertical">
|
|
94
|
-
<Form.Item name="username">
|
|
95
|
-
<Input />
|
|
96
|
-
</Form.Item>
|
|
97
|
-
</CapForm>
|
|
98
|
-
|
|
99
|
-
// With form instance (v6 recommended pattern)
|
|
100
|
-
const [form] = Form.useForm();
|
|
101
|
-
|
|
102
|
-
<CapForm form={form} layout="horizontal">
|
|
103
|
-
<Form.Item name="email">
|
|
104
|
-
<Input />
|
|
105
|
-
</Form.Item>
|
|
106
|
-
</CapForm>
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
## Theme Configuration
|
|
110
|
-
|
|
111
|
-
Form styling is controlled via `getCapThemeConfig()`. To customize form appearance:
|
|
112
|
-
|
|
113
|
-
```tsx
|
|
114
|
-
import { getCapThemeConfig } from '@capillarytech/blaze-ui/utils';
|
|
115
|
-
|
|
116
|
-
const customTheme = getCapThemeConfig({
|
|
117
|
-
components: {
|
|
118
|
-
Form: {
|
|
119
|
-
itemMarginBottom: 32, // Custom spacing
|
|
120
|
-
labelColonMarginInlineEnd: 20, // Custom label padding
|
|
121
|
-
},
|
|
122
|
-
},
|
|
123
|
-
});
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
## Migration Notes
|
|
127
|
-
|
|
128
|
-
- **Breaking Change:** If you were using `CapForm.create()`, you must migrate to `Form.useForm()` hook pattern
|
|
129
|
-
- **No prop changes required** - All Form props work identically to v5/v6
|
|
130
|
-
- Form validation, layout, and styling work identically to v5
|
|
131
|
-
- Component is fully compatible with Ant Design v6 Form API
|
|
132
|
-
- All Ant Design Form props are passed through unchanged (no deprecated props to handle)
|
package/CapForm/Status.md
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
# Migration Status: CapForm
|
|
2
|
-
|
|
3
|
-
**Last Updated**: 2026-01-31 19:17:58
|
|
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**: Migration Prompt 4 (Visual test cases)
|
|
12
|
-
- [x] **Step 5**: Linting (ESLint)
|
|
13
|
-
- [x] **Step 6**: Pre-build Validation
|
|
14
|
-
- [] **Step 7**: Build blaze-ui
|
|
15
|
-
- [] **Step 8**: Visual Testing
|
|
16
|
-
- [] **Step 9**: CSS Analysis (if mismatches found)
|
|
17
|
-
- [] **Step 9.5**: CSS Analysis Completed
|
|
18
|
-
- [] **Step 10**: Git Commit & Push to branch (pre-commit hook will run tests)
|
|
19
|
-
- [] **Step 11**: Create Pull Request
|
|
20
|
-
|
|
21
|
-
## Visual Testing Results
|
|
22
|
-
|
|
23
|
-
**Last Test**: 2026-01-31 19:17:58
|
|
24
|
-
**Maximum Mismatch**: 0%
|
|
25
|
-
|
|
26
|
-
### Mismatched Variants:
|
|
27
|
-
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
## CSS Fixes Applied
|
|
31
|
-
|
|
32
|
-
**Date**: 2026-01-31 12:41:18
|
|
33
|
-
**Summary**: CSS fixes applied based on visual testing analysis.
|
|
34
|
-
|
|
35
|
-
_See full analysis in: `/Users/sarahkhader/repos/migration/blaze-ui/tools/visual-testing/report/CapForm/css-fix-analysis.md`_
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
## Notes
|
|
39
|
-
|
|
40
|
-
_No notes yet._
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
# Phase 1: CapForm Use Cases NOT Currently Fulfilled
|
|
2
|
-
|
|
3
|
-
## Overview
|
|
4
|
-
This document identifies use cases that CapForm component does **NOT** currently fulfill or support out-of-the-box.
|
|
5
|
-
|
|
6
|
-
## ⚠️ Use Cases NOT Fulfilled
|
|
7
|
-
|
|
8
|
-
### 1. Form Instance Access via Ref Forwarding
|
|
9
|
-
**Status**: ❌ **NOT Supported**
|
|
10
|
-
- **Issue**: Component doesn't expose Form instance methods via ref forwarding
|
|
11
|
-
- **Current Behavior**:
|
|
12
|
-
- Users must use `Form.useForm()` hook separately
|
|
13
|
-
- No `ref` prop that forwards to Form instance
|
|
14
|
-
- Cannot access form methods directly from parent component via ref
|
|
15
|
-
- **Workaround**: Users must use `Form.useForm()` hook and pass `form` prop
|
|
16
|
-
- **Impact**: Medium - Requires additional boilerplate code
|
|
17
|
-
- **Recommendation**: Consider adding `React.forwardRef` to expose form instance methods
|
|
18
|
-
|
|
19
|
-
### 2. Built-in Loading State Management
|
|
20
|
-
**Status**: ❌ **NOT Built-in**
|
|
21
|
-
- **Issue**: No built-in loading state management during form submission
|
|
22
|
-
- **Current Behavior**:
|
|
23
|
-
- Users must manage loading state manually
|
|
24
|
-
- No `loading` prop on CapForm
|
|
25
|
-
- Form doesn't automatically disable during async submission
|
|
26
|
-
- **Expected Behavior** (if required):
|
|
27
|
-
- Add `loading` prop that disables form fields during submission
|
|
28
|
-
- Or provide loading state management helper
|
|
29
|
-
- **Impact**: Low - Typically handled at application level
|
|
30
|
-
- **Recommendation**: This is typically handled at application level, but could be a convenience feature
|
|
31
|
-
|
|
32
|
-
### 3. Nested Forms Support
|
|
33
|
-
**Status**: ❌ **NOT Supported/Recommended**
|
|
34
|
-
- **Issue**: Ant Design doesn't officially support nested forms, and CapForm doesn't prevent or handle this
|
|
35
|
-
- **Current Behavior**:
|
|
36
|
-
- Nested forms may cause unexpected behavior
|
|
37
|
-
- Not tested or documented
|
|
38
|
-
- No validation or prevention mechanism
|
|
39
|
-
- **Impact**: Low - Nested forms are anti-pattern
|
|
40
|
-
- **Recommendation**: Document that nested forms are not supported and may cause issues
|
|
41
|
-
|
|
42
|
-
### 4. Form.create() HOC Pattern
|
|
43
|
-
**Status**: ❌ **NOT Supported** (Breaking Change from v3)
|
|
44
|
-
- **Issue**: Original `cap-ui-library` component exported `Form.create` HOC, which is no longer available
|
|
45
|
-
- **Current Behavior**:
|
|
46
|
-
- `Form.create()` is not exported
|
|
47
|
-
- Must use `Form.useForm()` hook pattern instead
|
|
48
|
-
- **Migration Required**: Replace `Form.create()` HOC with `Form.useForm()` hook
|
|
49
|
-
- **Impact**: High - Breaking change for existing codebases
|
|
50
|
-
- **Recommendation**: Document migration path clearly
|
|
51
|
-
|
|
52
|
-
## ✅ Use Cases Supported (But Require Explicit Implementation)
|
|
53
|
-
|
|
54
|
-
The following use cases ARE supported via Ant Design FormProps passthrough, but require users to implement them explicitly:
|
|
55
|
-
|
|
56
|
-
### 5. Form List/Dynamic Fields
|
|
57
|
-
**Status**: ✅ Supported (via Ant Design Form.List)
|
|
58
|
-
- **Note**: Component passes through all FormProps, so Form.List works
|
|
59
|
-
- **Requirement**: Users must implement Form.List manually
|
|
60
|
-
- **Test Coverage**: ✅ Now tested
|
|
61
|
-
|
|
62
|
-
### 6. Form Field Dependencies
|
|
63
|
-
**Status**: ✅ Supported (via Ant Design Form.Item dependencies)
|
|
64
|
-
- **Note**: Component passes through FormProps, so dependencies work
|
|
65
|
-
- **Requirement**: Users must implement `shouldUpdate` or `dependencies` manually
|
|
66
|
-
- **Test Coverage**: ✅ Now tested
|
|
67
|
-
|
|
68
|
-
### 7. Custom Validation Rules
|
|
69
|
-
**Status**: ✅ Supported (via Ant Design Form.Item rules)
|
|
70
|
-
- **Note**: Component passes through FormProps, so custom validation rules work
|
|
71
|
-
- **Requirement**: Users must implement custom validators manually
|
|
72
|
-
- **Test Coverage**: ✅ Now tested
|
|
73
|
-
|
|
74
|
-
### 8. Form Reset Functionality
|
|
75
|
-
**Status**: ✅ Supported (via Ant Design Form instance methods)
|
|
76
|
-
- **Note**: Form reset is available via form instance methods
|
|
77
|
-
- **Requirement**: Users must call `form.resetFields()` manually
|
|
78
|
-
- **Test Coverage**: ✅ Now tested
|
|
79
|
-
|
|
80
|
-
### 9. Form Field Value Watching
|
|
81
|
-
**Status**: ✅ Supported (via Ant Design Form.Item shouldUpdate or Form.useWatch)
|
|
82
|
-
- **Note**: Component supports this via Ant Design APIs
|
|
83
|
-
- **Requirement**: Users must implement `Form.useWatch` or `shouldUpdate` manually
|
|
84
|
-
- **Test Coverage**: ✅ Now tested
|
|
85
|
-
|
|
86
|
-
### 10. Form Validation Feedback Timing
|
|
87
|
-
**Status**: ✅ Supported (via Ant Design validateTrigger)
|
|
88
|
-
- **Note**: Component passes through FormProps, so validateTrigger works
|
|
89
|
-
- **Requirement**: Users must set `validateTrigger` prop manually
|
|
90
|
-
- **Test Coverage**: ✅ Now tested
|
|
91
|
-
|
|
92
|
-
## Summary
|
|
93
|
-
|
|
94
|
-
### Critical Gaps (Must Address)
|
|
95
|
-
1. **Form.create() HOC removal** - Breaking change requiring migration
|
|
96
|
-
2. **No ref forwarding** - Cannot access form instance via ref
|
|
97
|
-
|
|
98
|
-
### Nice-to-Have Features
|
|
99
|
-
1. **Built-in loading state** - Convenience feature, typically handled at app level
|
|
100
|
-
2. **Nested forms prevention** - Documentation/warning needed
|
|
101
|
-
|
|
102
|
-
### Well-Supported (Via Passthrough)
|
|
103
|
-
- All Ant Design Form features work via FormProps passthrough
|
|
104
|
-
- Form instance methods available via `Form.useForm()` hook
|
|
105
|
-
- Dynamic fields, dependencies, validation all supported
|
|
106
|
-
- Test coverage now comprehensive
|
|
107
|
-
|
|
108
|
-
## Recommendations
|
|
109
|
-
|
|
110
|
-
1. **High Priority**: Document `Form.create()` migration path clearly
|
|
111
|
-
2. **Medium Priority**: Consider adding ref forwarding for form instance access
|
|
112
|
-
3. **Low Priority**: Add `loading` prop if commonly needed across codebase
|
|
113
|
-
4. **Low Priority**: Add warning/documentation for nested forms anti-pattern
|