@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/CapModal/README.md
DELETED
|
@@ -1,357 +0,0 @@
|
|
|
1
|
-
# CapModal Migration Guide
|
|
2
|
-
|
|
3
|
-
## Summary
|
|
4
|
-
|
|
5
|
-
CapModal has been migrated from `cap-ui-library` to `blaze-ui` with the following changes:
|
|
6
|
-
|
|
7
|
-
- Converted from JavaScript to TypeScript
|
|
8
|
-
- Uses SCSS modules for styling (imported as `import * as styles from './styles.scss'`)
|
|
9
|
-
- Migrated to Ant Design v6 APIs
|
|
10
|
-
- Added backward compatibility for deprecated props
|
|
11
|
-
- Added TypeScript interfaces for props
|
|
12
|
-
- Maintained backward compatibility with the existing API
|
|
13
|
-
|
|
14
|
-
## Breaking Changes
|
|
15
|
-
|
|
16
|
-
**No breaking changes from cap-ui-library v8.x**
|
|
17
|
-
|
|
18
|
-
The component maintains backward compatibility with deprecated props. However, deprecated props will show console warnings in development mode and should be migrated to the new API.
|
|
19
|
-
|
|
20
|
-
## Prop Changes
|
|
21
|
-
|
|
22
|
-
### New Props (v6 API)
|
|
23
|
-
|
|
24
|
-
| Prop | Type | Default | Description |
|
|
25
|
-
|------|------|---------|-------------|
|
|
26
|
-
| `open` | `boolean` | `undefined` | Whether the modal is open (Ant Design v6 API) |
|
|
27
|
-
| `onOpenChange` | `(open: boolean) => void` | `undefined` | Callback when modal open state changes (Ant Design v6 API) |
|
|
28
|
-
|
|
29
|
-
### Deprecated Props
|
|
30
|
-
|
|
31
|
-
The following Ant Design Modal component props are deprecated but still supported for backward compatibility:
|
|
32
|
-
|
|
33
|
-
#### `visible` (deprecated)
|
|
34
|
-
|
|
35
|
-
- **Status:** Deprecated
|
|
36
|
-
- **Ant Design Component:** Modal
|
|
37
|
-
- **Replacement:** Use `open` prop instead
|
|
38
|
-
- **Migration:** Replace `visible={...}` with `open={...}`
|
|
39
|
-
- **Removal:** Will be removed in v10.0.0
|
|
40
|
-
|
|
41
|
-
**Example:**
|
|
42
|
-
|
|
43
|
-
```tsx
|
|
44
|
-
// ❌ Deprecated (Ant Design v3/v4/v5 API)
|
|
45
|
-
<CapModal visible={isOpen} onVisibleChange={setIsOpen}>
|
|
46
|
-
<p>Modal content</p>
|
|
47
|
-
</CapModal>
|
|
48
|
-
|
|
49
|
-
// ✅ Recommended (Ant Design v6 API)
|
|
50
|
-
<CapModal open={isOpen} onOpenChange={setIsOpen}>
|
|
51
|
-
<p>Modal content</p>
|
|
52
|
-
</CapModal>
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
**Note:** If both `open` and `visible` are provided, `open` takes precedence. A console warning will be shown in development mode when using the deprecated `visible` prop.
|
|
56
|
-
|
|
57
|
-
#### `onVisibleChange` (deprecated)
|
|
58
|
-
|
|
59
|
-
- **Status:** Deprecated
|
|
60
|
-
- **Ant Design Component:** Modal
|
|
61
|
-
- **Replacement:** Use `onOpenChange` prop instead
|
|
62
|
-
- **Migration:** Replace `onVisibleChange={...}` with `onOpenChange={...}`
|
|
63
|
-
- **Removal:** Will be removed in v10.0.0
|
|
64
|
-
|
|
65
|
-
**Example:**
|
|
66
|
-
|
|
67
|
-
```tsx
|
|
68
|
-
// ❌ Deprecated (Ant Design v3/v4/v5 API)
|
|
69
|
-
<CapModal
|
|
70
|
-
visible={isOpen}
|
|
71
|
-
onVisibleChange={(visible) => setIsOpen(visible)}
|
|
72
|
-
>
|
|
73
|
-
<p>Modal content</p>
|
|
74
|
-
</CapModal>
|
|
75
|
-
|
|
76
|
-
// ✅ Recommended (Ant Design v6 API)
|
|
77
|
-
<CapModal
|
|
78
|
-
open={isOpen}
|
|
79
|
-
onOpenChange={(open) => setIsOpen(open)}
|
|
80
|
-
>
|
|
81
|
-
<p>Modal content</p>
|
|
82
|
-
</CapModal>
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
**Note:** If both `onOpenChange` and `onVisibleChange` are provided, `onOpenChange` takes precedence. A console warning will be shown in development mode when using the deprecated `onVisibleChange` prop.
|
|
86
|
-
|
|
87
|
-
### Prop Changes Summary
|
|
88
|
-
|
|
89
|
-
| Prop | Type | Status | Notes |
|
|
90
|
-
|------|------|--------|-------|
|
|
91
|
-
| `open` | `boolean` | ✅ New | Preferred prop name for modal visibility (Ant Design v6 API) |
|
|
92
|
-
| `visible` | `boolean` | ⚠️ Deprecated | Use `open` instead. Still supported for backward compatibility |
|
|
93
|
-
| `onOpenChange` | `(open: boolean) => void` | ✅ New | Preferred callback for modal state changes (Ant Design v6 API) |
|
|
94
|
-
| `onVisibleChange` | `(visible: boolean) => void` | ⚠️ Deprecated | Use `onOpenChange` instead. Still supported for backward compatibility |
|
|
95
|
-
| `defaultOpen` | `boolean` | ✅ Unchanged | Default open state for uncontrolled mode |
|
|
96
|
-
|
|
97
|
-
### Custom Props
|
|
98
|
-
|
|
99
|
-
| Prop | Type | Default | Description |
|
|
100
|
-
|------|------|---------|-------------|
|
|
101
|
-
| `okText` | `string` | - | Text for the OK button |
|
|
102
|
-
| `closeText` | `string` | - | Text for the Cancel/Close button |
|
|
103
|
-
| `cancelButtonType` | `'flat' \| 'default' \| 'primary' \| 'dashed' \| 'link' \| 'text'` | `'flat'` | Type of the cancel button |
|
|
104
|
-
|
|
105
|
-
### Other Props
|
|
106
|
-
|
|
107
|
-
All standard Ant Design Modal props are supported. Refer to [Ant Design Modal documentation](https://ant.design/components/modal) for complete API reference.
|
|
108
|
-
|
|
109
|
-
## API Changes
|
|
110
|
-
|
|
111
|
-
### Controlled vs Uncontrolled Mode
|
|
112
|
-
|
|
113
|
-
The component now supports both controlled and uncontrolled modes:
|
|
114
|
-
|
|
115
|
-
**Controlled Mode:**
|
|
116
|
-
```tsx
|
|
117
|
-
const [open, setOpen] = useState(false);
|
|
118
|
-
|
|
119
|
-
<CapModal
|
|
120
|
-
title="Controlled Modal"
|
|
121
|
-
open={open}
|
|
122
|
-
onOpenChange={setOpen}
|
|
123
|
-
>
|
|
124
|
-
<p>Modal content</p>
|
|
125
|
-
</CapModal>
|
|
126
|
-
```
|
|
127
|
-
|
|
128
|
-
**Uncontrolled Mode:**
|
|
129
|
-
```tsx
|
|
130
|
-
<CapModal
|
|
131
|
-
title="Uncontrolled Modal"
|
|
132
|
-
defaultOpen={false}
|
|
133
|
-
>
|
|
134
|
-
<p>Modal content</p>
|
|
135
|
-
</CapModal>
|
|
136
|
-
```
|
|
137
|
-
|
|
138
|
-
## Migration Examples
|
|
139
|
-
|
|
140
|
-
### Basic Usage
|
|
141
|
-
|
|
142
|
-
**Before (v3/v4/v5):**
|
|
143
|
-
```tsx
|
|
144
|
-
<CapModal
|
|
145
|
-
visible={isOpen}
|
|
146
|
-
onVisibleChange={setIsOpen}
|
|
147
|
-
okText="Confirm"
|
|
148
|
-
closeText="Cancel"
|
|
149
|
-
>
|
|
150
|
-
<p>Modal content</p>
|
|
151
|
-
</CapModal>
|
|
152
|
-
```
|
|
153
|
-
|
|
154
|
-
**After (v6):**
|
|
155
|
-
```tsx
|
|
156
|
-
<CapModal
|
|
157
|
-
open={isOpen}
|
|
158
|
-
onOpenChange={setIsOpen}
|
|
159
|
-
okText="Confirm"
|
|
160
|
-
closeText="Cancel"
|
|
161
|
-
>
|
|
162
|
-
<p>Modal content</p>
|
|
163
|
-
</CapModal>
|
|
164
|
-
```
|
|
165
|
-
|
|
166
|
-
### Static Methods
|
|
167
|
-
|
|
168
|
-
The static methods (`info`, `success`, `error`, `warning`, `confirm`) remain unchanged:
|
|
169
|
-
|
|
170
|
-
```tsx
|
|
171
|
-
// Success modal
|
|
172
|
-
CapModal.success({
|
|
173
|
-
title: 'Success',
|
|
174
|
-
content: 'Operation completed successfully!',
|
|
175
|
-
});
|
|
176
|
-
|
|
177
|
-
// Confirm modal
|
|
178
|
-
CapModal.confirm({
|
|
179
|
-
title: 'Confirm',
|
|
180
|
-
content: 'Are you sure you want to proceed?',
|
|
181
|
-
onOk: () => {
|
|
182
|
-
// Handle confirmation
|
|
183
|
-
},
|
|
184
|
-
});
|
|
185
|
-
```
|
|
186
|
-
|
|
187
|
-
## Styling Changes
|
|
188
|
-
|
|
189
|
-
### Theme Tokens
|
|
190
|
-
|
|
191
|
-
The following Modal tokens have been added to `getCapThemeConfig`:
|
|
192
|
-
|
|
193
|
-
- `bodyPadding`: Custom padding for modal body (top: 4px, bottom: 0)
|
|
194
|
-
- `footerPadding`: Custom padding for modal footer (bottom: 24px)
|
|
195
|
-
- `closeIconColor`: Color for the close icon (#091e42)
|
|
196
|
-
|
|
197
|
-
### SCSS Classes
|
|
198
|
-
|
|
199
|
-
The component uses custom SCSS classes applied via `classNames` prop:
|
|
200
|
-
|
|
201
|
-
- `.cap-modal-v2-content`: Max-width constraint (372px)
|
|
202
|
-
- `.cap-modal-v2-header`: Header styling (no border bottom)
|
|
203
|
-
- `.cap-modal-v2-body`: Body styling (custom padding)
|
|
204
|
-
- `.cap-modal-v2-footer`: Footer styling (no border top, custom padding)
|
|
205
|
-
- `.cap-modal-v2-close`: Close icon styling (custom color)
|
|
206
|
-
|
|
207
|
-
**Note**: All styling uses component-specific classes without `.ant-` selectors, following Ant Design v6 best practices.
|
|
208
|
-
|
|
209
|
-
## Behavioral Changes
|
|
210
|
-
|
|
211
|
-
### No Breaking Changes
|
|
212
|
-
|
|
213
|
-
The component maintains **100% backward compatibility** with `cap-ui-library` v8.x. All existing code will continue to work without modifications.
|
|
214
|
-
|
|
215
|
-
### Enhanced Features
|
|
216
|
-
|
|
217
|
-
- **Controlled State**: Full support for controlled modal state management
|
|
218
|
-
- **TypeScript Support**: Complete type definitions for all props
|
|
219
|
-
- **Deprecation Warnings**: Development warnings for deprecated prop usage
|
|
220
|
-
- **Theme Integration**: Automatic theming via `getCapThemeConfig`
|
|
221
|
-
|
|
222
|
-
## Examples
|
|
223
|
-
|
|
224
|
-
### Basic Modal
|
|
225
|
-
|
|
226
|
-
```tsx
|
|
227
|
-
import { CapModal, CapButton } from '@capillarytech/blaze-ui';
|
|
228
|
-
import { useState } from 'react';
|
|
229
|
-
|
|
230
|
-
const MyComponent = () => {
|
|
231
|
-
const [open, setOpen] = useState(false);
|
|
232
|
-
|
|
233
|
-
return (
|
|
234
|
-
<>
|
|
235
|
-
<CapButton onClick={() => setOpen(true)}>Open Modal</CapButton>
|
|
236
|
-
<CapModal
|
|
237
|
-
title="Basic Modal"
|
|
238
|
-
open={open}
|
|
239
|
-
onOpenChange={setOpen}
|
|
240
|
-
okText="OK"
|
|
241
|
-
closeText="Close"
|
|
242
|
-
>
|
|
243
|
-
<p>This is a basic modal example.</p>
|
|
244
|
-
</CapModal>
|
|
245
|
-
</>
|
|
246
|
-
);
|
|
247
|
-
};
|
|
248
|
-
```
|
|
249
|
-
|
|
250
|
-
### Custom Footer
|
|
251
|
-
|
|
252
|
-
```tsx
|
|
253
|
-
<CapModal
|
|
254
|
-
title="Custom Footer"
|
|
255
|
-
open={open}
|
|
256
|
-
onOpenChange={setOpen}
|
|
257
|
-
footer={[
|
|
258
|
-
<CapButton key="custom" onClick={handleCustom}>
|
|
259
|
-
Custom Action
|
|
260
|
-
</CapButton>,
|
|
261
|
-
]}
|
|
262
|
-
>
|
|
263
|
-
<p>Modal with custom footer buttons.</p>
|
|
264
|
-
</CapModal>
|
|
265
|
-
```
|
|
266
|
-
|
|
267
|
-
### Using Deprecated Props (Still Works)
|
|
268
|
-
|
|
269
|
-
```tsx
|
|
270
|
-
// ⚠️ Deprecated but still functional
|
|
271
|
-
<CapModal
|
|
272
|
-
visible={isOpen}
|
|
273
|
-
onVisibleChange={setIsOpen}
|
|
274
|
-
okText="Confirm"
|
|
275
|
-
closeText="Cancel"
|
|
276
|
-
>
|
|
277
|
-
<p>This will show deprecation warnings in development.</p>
|
|
278
|
-
</CapModal>
|
|
279
|
-
```
|
|
280
|
-
|
|
281
|
-
## Technical Details
|
|
282
|
-
|
|
283
|
-
### Import Changes
|
|
284
|
-
|
|
285
|
-
**Before:**
|
|
286
|
-
```tsx
|
|
287
|
-
import { Modal } from 'antd';
|
|
288
|
-
```
|
|
289
|
-
|
|
290
|
-
**After:**
|
|
291
|
-
```tsx
|
|
292
|
-
import { Modal } from 'antd-v5';
|
|
293
|
-
```
|
|
294
|
-
|
|
295
|
-
### Type Exports
|
|
296
|
-
|
|
297
|
-
```tsx
|
|
298
|
-
import type { CapModalProps } from '@capillarytech/blaze-ui';
|
|
299
|
-
```
|
|
300
|
-
|
|
301
|
-
### LocaleHoc Integration
|
|
302
|
-
|
|
303
|
-
The component uses `LocaleHoc` for internationalization support. Translation keys are under `app.commonUtils.capUiLibrary.CapModal`:
|
|
304
|
-
|
|
305
|
-
- `okText`: Default OK button text
|
|
306
|
-
- `closeText`: Default Close button text
|
|
307
|
-
|
|
308
|
-
## Troubleshooting
|
|
309
|
-
|
|
310
|
-
### Modal Not Opening
|
|
311
|
-
|
|
312
|
-
**Issue**: Modal doesn't open when using `visible` prop.
|
|
313
|
-
|
|
314
|
-
**Solution**: Migrate to `open` prop:
|
|
315
|
-
```tsx
|
|
316
|
-
// ❌ Deprecated
|
|
317
|
-
<CapModal visible={true} />
|
|
318
|
-
|
|
319
|
-
// ✅ Correct
|
|
320
|
-
<CapModal open={true} />
|
|
321
|
-
```
|
|
322
|
-
|
|
323
|
-
### Styling Not Applied
|
|
324
|
-
|
|
325
|
-
**Issue**: Custom styles not appearing.
|
|
326
|
-
|
|
327
|
-
**Solution**: Ensure `getCapThemeConfig` is applied via `ConfigProvider`:
|
|
328
|
-
```tsx
|
|
329
|
-
import { ConfigProvider } from 'antd-v5';
|
|
330
|
-
import { getCapThemeConfig } from '@capillarytech/blaze-ui';
|
|
331
|
-
|
|
332
|
-
<ConfigProvider theme={getCapThemeConfig()}>
|
|
333
|
-
<YourApp />
|
|
334
|
-
</ConfigProvider>
|
|
335
|
-
```
|
|
336
|
-
|
|
337
|
-
### Type Errors
|
|
338
|
-
|
|
339
|
-
**Issue**: TypeScript errors with props.
|
|
340
|
-
|
|
341
|
-
**Solution**: Import types from the component:
|
|
342
|
-
```tsx
|
|
343
|
-
import type { CapModalProps } from '@capillarytech/blaze-ui';
|
|
344
|
-
```
|
|
345
|
-
|
|
346
|
-
## Additional Resources
|
|
347
|
-
|
|
348
|
-
- [Ant Design Modal Documentation](https://ant.design/components/modal)
|
|
349
|
-
- [Ant Design v6 Migration Guide](https://ant.design/docs/react/migration-v6)
|
|
350
|
-
- [Cap UI Storybook](http://localhost:6006) - See CapModal in action
|
|
351
|
-
|
|
352
|
-
## Support
|
|
353
|
-
|
|
354
|
-
For issues or questions:
|
|
355
|
-
- Check the [README.md](../../README.md) for general usage
|
|
356
|
-
- Review Ant Design v6 Modal documentation
|
|
357
|
-
- Open an issue in the repository
|
package/CapModal/Status.md
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
# Migration Status: CapModal
|
|
2
|
-
|
|
3
|
-
**Last Updated**: 2026-02-06 10:35:26
|
|
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 1.5**: Export component in blaze-ui/components/index.ts
|
|
10
|
-
- [x] **Step 2**: Migration Prompt 2 (Storybook support)
|
|
11
|
-
- [x] **Step 2.5**: Verify deprecated props and prop changes (REQUIRED - enforced)
|
|
12
|
-
- [x] **Step 3**: Migration Prompt 3 (Unit tests)
|
|
13
|
-
- [x] **Step 4**: Migration Prompt 4 (Visual test cases)
|
|
14
|
-
- [x] **Step 5**: Linting (ESLint)
|
|
15
|
-
- [x] **Step 6**: Pre-build Validation
|
|
16
|
-
- [x] **Step 7**: Build blaze-ui
|
|
17
|
-
- [x] **Step 8**: Visual Testing
|
|
18
|
-
- [x] **Step 9**: CSS Analysis (if mismatches found)
|
|
19
|
-
- [x] **Step 9.5**: CSS Analysis Completed
|
|
20
|
-
- [x] **Step 10**: Git Commit & Push to branch (pre-commit hook will run tests)
|
|
21
|
-
- [x] **Step 11**: Create Pull Request
|
|
22
|
-
|
|
23
|
-
## Deprecated Props Verification
|
|
24
|
-
|
|
25
|
-
_No deprecated props verification results yet._
|
|
26
|
-
|
|
27
|
-
**Note**: Step 2.5 is REQUIRED and enforced.
|
|
28
|
-
- Focus: **Ant Design component prop changes** (e.g., Dropdown, Input, Alert, Tooltip, etc.)
|
|
29
|
-
- Reference: MIGRATION_CHANGELOG_TEMPLATE.md for format, ANTD_V6_MIGRATION.md for Ant Design deprecated APIs
|
|
30
|
-
- Skip: If original component doesn't exist in cap-ui-library
|
|
31
|
-
- All deprecated Ant Design props and prop changes must be documented before proceeding.
|
|
32
|
-
|
|
33
|
-
## Visual Testing Results
|
|
34
|
-
|
|
35
|
-
**Last Test**: 2026-02-06 10:35:26
|
|
36
|
-
**Maximum Mismatch**: 0%
|
|
37
|
-
|
|
38
|
-
### Mismatched Variants:
|
|
39
|
-
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
## CSS Fixes Applied
|
|
43
|
-
|
|
44
|
-
**Date**: 2026-02-01 11:49:36
|
|
45
|
-
**Summary**: CSS fixes applied based on visual testing analysis.
|
|
46
|
-
|
|
47
|
-
_See full analysis in: `/Users/sarahkhader/repos/migration/blaze-ui/tools/visual-testing/report/CapModal/css-fix-analysis.md`_
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
## Notes
|
|
51
|
-
|
|
52
|
-
_No notes yet._
|
|
@@ -1,207 +0,0 @@
|
|
|
1
|
-
# CapModal Use Cases Analysis - Gaps Identified
|
|
2
|
-
|
|
3
|
-
**Date**: 2026-02-01
|
|
4
|
-
**Component**: CapModal
|
|
5
|
-
**Analysis Type**: Use Cases Not Fulfilled
|
|
6
|
-
|
|
7
|
-
## Overview
|
|
8
|
-
|
|
9
|
-
This document identifies use cases and features that the CapModal component may not fully support based on code analysis. Since Google Sheets access was unavailable, this analysis is based on component implementation review.
|
|
10
|
-
|
|
11
|
-
---
|
|
12
|
-
|
|
13
|
-
## Use Cases NOT Fully Fulfilled
|
|
14
|
-
|
|
15
|
-
### 1. **OK Button Does Not Auto-Close Modal**
|
|
16
|
-
|
|
17
|
-
**Issue**: When the OK button is clicked, `onOk` callback is called but `onOpenChange(false)` is NOT automatically called. The modal remains open unless the parent component explicitly closes it.
|
|
18
|
-
|
|
19
|
-
**Current Behavior**:
|
|
20
|
-
```tsx
|
|
21
|
-
const handleOk = React.useCallback(
|
|
22
|
-
(e: React.MouseEvent<HTMLElement>) => {
|
|
23
|
-
if (originalOnOk) {
|
|
24
|
-
originalOnOk(e as unknown as React.MouseEvent<HTMLButtonElement>);
|
|
25
|
-
}
|
|
26
|
-
// Missing: onOpenChange(false) is not called
|
|
27
|
-
},
|
|
28
|
-
[originalOnOk]
|
|
29
|
-
);
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
**Expected Use Case**: Users may expect the modal to close automatically when OK is clicked, similar to how Close button works.
|
|
33
|
-
|
|
34
|
-
**Impact**: Medium - Requires manual state management in parent components.
|
|
35
|
-
|
|
36
|
-
**Recommendation**: Consider adding an `autoCloseOnOk` prop (default: false) or making OK button behavior consistent with Close button.
|
|
37
|
-
|
|
38
|
-
---
|
|
39
|
-
|
|
40
|
-
### 2. **Limited okButtonProps Support**
|
|
41
|
-
|
|
42
|
-
**Issue**: Only `okButtonProps.disabled` is passed to the OK button. Other Ant Design Button props (like `loading`, `danger`, `icon`, etc.) are not supported.
|
|
43
|
-
|
|
44
|
-
**Current Implementation**:
|
|
45
|
-
```tsx
|
|
46
|
-
<CapButton
|
|
47
|
-
onClick={handleOk}
|
|
48
|
-
disabled={restProps?.okButtonProps?.disabled}
|
|
49
|
-
type="primary"
|
|
50
|
-
>
|
|
51
|
-
{okText}
|
|
52
|
-
</CapButton>
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
**Expected Use Case**: Users may want to show loading state on OK button, add icons, or apply danger styling.
|
|
56
|
-
|
|
57
|
-
**Impact**: Low-Medium - Limits customization options.
|
|
58
|
-
|
|
59
|
-
**Recommendation**: Spread all `okButtonProps` to CapButton:
|
|
60
|
-
```tsx
|
|
61
|
-
<CapButton
|
|
62
|
-
onClick={handleOk}
|
|
63
|
-
type="primary"
|
|
64
|
-
{...restProps?.okButtonProps}
|
|
65
|
-
>
|
|
66
|
-
{okText}
|
|
67
|
-
</CapButton>
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
---
|
|
71
|
-
|
|
72
|
-
### 3. **No okButtonType Prop**
|
|
73
|
-
|
|
74
|
-
**Issue**: The OK button is hardcoded to `type="primary"`. There's no way to customize it, unlike `cancelButtonType` for the Close button.
|
|
75
|
-
|
|
76
|
-
**Current Implementation**:
|
|
77
|
-
```tsx
|
|
78
|
-
<CapButton
|
|
79
|
-
onClick={handleOk}
|
|
80
|
-
disabled={restProps?.okButtonProps?.disabled}
|
|
81
|
-
type="primary" // Hardcoded
|
|
82
|
-
>
|
|
83
|
-
{okText}
|
|
84
|
-
</CapButton>
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
**Expected Use Case**: Users may want a secondary or flat OK button in certain contexts.
|
|
88
|
-
|
|
89
|
-
**Impact**: Low - Most use cases use primary OK buttons.
|
|
90
|
-
|
|
91
|
-
**Recommendation**: Add `okButtonType` prop similar to `cancelButtonType`.
|
|
92
|
-
|
|
93
|
-
---
|
|
94
|
-
|
|
95
|
-
### 4. **Footer Cannot Be Completely Hidden**
|
|
96
|
-
|
|
97
|
-
**Issue**: The component always renders a footer (either default or custom). Setting `footer={null}` removes the footer, but there's no prop to conditionally hide it while keeping modal functionality.
|
|
98
|
-
|
|
99
|
-
**Current Behavior**:
|
|
100
|
-
- `footer={undefined}` → Default footer rendered
|
|
101
|
-
- `footer={null}` → No footer rendered
|
|
102
|
-
- `footer={<Custom />}` → Custom footer rendered
|
|
103
|
-
|
|
104
|
-
**Expected Use Case**: Users may want a footer-less modal for certain scenarios (e.g., full-screen content modals).
|
|
105
|
-
|
|
106
|
-
**Impact**: Low - Workaround exists (footer={null}).
|
|
107
|
-
|
|
108
|
-
**Recommendation**: Document the `footer={null}` pattern or add a `showFooter` prop for clarity.
|
|
109
|
-
|
|
110
|
-
---
|
|
111
|
-
|
|
112
|
-
### 5. **Static Methods Don't Use LocaleHoc Defaults**
|
|
113
|
-
|
|
114
|
-
**Issue**: Static methods (`info`, `success`, `error`, `warning`, `confirm`) are directly attached from Ant Design Modal and don't use the default `okText`/`closeText` from LocaleHoc.
|
|
115
|
-
|
|
116
|
-
**Current Implementation**:
|
|
117
|
-
```tsx
|
|
118
|
-
CapModalWithHoc.info = info; // Direct assignment from Ant Design
|
|
119
|
-
```
|
|
120
|
-
|
|
121
|
-
**Expected Use Case**: Users may expect static methods to respect i18n defaults.
|
|
122
|
-
|
|
123
|
-
**Impact**: Low - Static methods typically provide their own text.
|
|
124
|
-
|
|
125
|
-
**Recommendation**: Consider wrapping static methods to inject default translations, or document that static methods require explicit text.
|
|
126
|
-
|
|
127
|
-
---
|
|
128
|
-
|
|
129
|
-
### 6. **onOpenChange Not Called on OK Click**
|
|
130
|
-
|
|
131
|
-
**Issue**: When OK button is clicked, `onOpenChange` is never called, even if provided. Only `onOk` is called.
|
|
132
|
-
|
|
133
|
-
**Current Behavior**:
|
|
134
|
-
- Close button → Calls both `onCancel` and `onOpenChange(false)`
|
|
135
|
-
- OK button → Calls only `onOk`, does NOT call `onOpenChange`
|
|
136
|
-
|
|
137
|
-
**Expected Use Case**: Users may want consistent state management where both buttons trigger `onOpenChange`.
|
|
138
|
-
|
|
139
|
-
**Impact**: Medium - Inconsistent behavior between OK and Close buttons.
|
|
140
|
-
|
|
141
|
-
**Recommendation**: Consider calling `onOpenChange(false)` when OK is clicked, or add a prop to control this behavior.
|
|
142
|
-
|
|
143
|
-
---
|
|
144
|
-
|
|
145
|
-
### 7. **No Built-in Loading State Management**
|
|
146
|
-
|
|
147
|
-
**Issue**: There's no built-in way to show loading state on buttons during async operations. Users must manually manage loading state.
|
|
148
|
-
|
|
149
|
-
**Expected Use Case**: Common pattern where OK button shows loading during form submission or API calls.
|
|
150
|
-
|
|
151
|
-
**Impact**: Low-Medium - Can be handled via `okButtonProps`, but requires manual state management.
|
|
152
|
-
|
|
153
|
-
**Recommendation**: Consider adding `loading` prop that automatically manages button loading states.
|
|
154
|
-
|
|
155
|
-
---
|
|
156
|
-
|
|
157
|
-
### 8. **classNames 'close' Key Ignored**
|
|
158
|
-
|
|
159
|
-
**Issue**: The `classNames.close` key is filtered out and not applied, even though it's accepted in the type definition.
|
|
160
|
-
|
|
161
|
-
**Current Implementation**:
|
|
162
|
-
```tsx
|
|
163
|
-
...(Object.fromEntries(
|
|
164
|
-
Object.entries(existingClassNames).filter(([key]) => !['content', 'close'].includes(key))
|
|
165
|
-
```
|
|
166
|
-
|
|
167
|
-
**Expected Use Case**: Users may want to style the close icon via classNames.
|
|
168
|
-
|
|
169
|
-
**Impact**: Low - Workaround exists via CSS selectors.
|
|
170
|
-
|
|
171
|
-
**Recommendation**: Document that `classNames.close` is not supported, or implement support for it.
|
|
172
|
-
|
|
173
|
-
---
|
|
174
|
-
|
|
175
|
-
## Summary
|
|
176
|
-
|
|
177
|
-
### High Priority Gaps
|
|
178
|
-
- None identified
|
|
179
|
-
|
|
180
|
-
### Medium Priority Gaps
|
|
181
|
-
1. OK button doesn't auto-close modal (inconsistent with Close button)
|
|
182
|
-
2. `onOpenChange` not called on OK click
|
|
183
|
-
3. Limited `okButtonProps` support
|
|
184
|
-
|
|
185
|
-
### Low Priority Gaps
|
|
186
|
-
1. No `okButtonType` prop
|
|
187
|
-
2. Static methods don't use LocaleHoc defaults
|
|
188
|
-
3. Footer visibility not explicitly documented
|
|
189
|
-
4. No built-in loading state management
|
|
190
|
-
5. `classNames.close` ignored
|
|
191
|
-
|
|
192
|
-
---
|
|
193
|
-
|
|
194
|
-
## Notes
|
|
195
|
-
|
|
196
|
-
- **Google Sheets Access**: Unable to access Google Sheets to compare against documented use cases. This analysis is based on code review.
|
|
197
|
-
- **Component Purpose**: CapModal is a wrapper around Ant Design Modal, so some limitations may be intentional design decisions.
|
|
198
|
-
- **Backward Compatibility**: Component maintains 100% backward compatibility with cap-ui-library v8.x.
|
|
199
|
-
|
|
200
|
-
---
|
|
201
|
-
|
|
202
|
-
## Recommendations
|
|
203
|
-
|
|
204
|
-
1. **Documentation**: Add clear documentation about OK vs Close button behavior differences.
|
|
205
|
-
2. **Consistency**: Consider making OK and Close button behavior more consistent.
|
|
206
|
-
3. **Enhancement**: Add `okButtonType` and full `okButtonProps` support for better customization.
|
|
207
|
-
4. **Testing**: All identified gaps are covered in the test suite to ensure current behavior is maintained.
|