@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/CapColoredTag/README.md
DELETED
|
@@ -1,167 +0,0 @@
|
|
|
1
|
-
# CapColoredTag
|
|
2
|
-
|
|
3
|
-
An extended version of Ant Design's Tag component with custom color styling capabilities and enhanced customization options.
|
|
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
|
-
### Ant Design Components Used
|
|
10
|
-
|
|
11
|
-
This component uses the following Ant Design components:
|
|
12
|
-
- **Tag** (`antd-v5`) - Base tag component
|
|
13
|
-
- **Tag.CheckableTag** (`antd-v5`) - Checkable tag variant
|
|
14
|
-
|
|
15
|
-
**Verification Status:** ✅ No deprecated props found
|
|
16
|
-
- The `Tag` component is not listed in the Ant Design v6 migration guide's deprecated API fixes table
|
|
17
|
-
- All `Tag` component props remain valid and unchanged between v3 and v6
|
|
18
|
-
- No prop mapping or backward compatibility code required for Ant Design props
|
|
19
|
-
|
|
20
|
-
### Breaking Changes
|
|
21
|
-
|
|
22
|
-
**No breaking changes** - The component maintains full backward compatibility with the previous version.
|
|
23
|
-
|
|
24
|
-
**Ant Design Tag Component:** The Ant Design `Tag` component API remains fully compatible between v3 and v6, so no API changes were required. All Ant Design `Tag` props continue to work as before.
|
|
25
|
-
|
|
26
|
-
### Deprecated Props
|
|
27
|
-
|
|
28
|
-
**No deprecated Ant Design props** - The Ant Design `Tag` component API remains fully compatible between v3 and v6, with no deprecated props.
|
|
29
|
-
|
|
30
|
-
**Verification:**
|
|
31
|
-
- ✅ Checked against Ant Design v6 migration guide - `Tag` component is not listed in deprecated API fixes
|
|
32
|
-
- ✅ All Ant Design `Tag` props (`closable`, `onClose`, `color`, `icon`, etc.) remain valid and unchanged
|
|
33
|
-
- ✅ `Tag.CheckableTag` API remains unchanged
|
|
34
|
-
- ✅ No backward compatibility mapping required for Ant Design props
|
|
35
|
-
|
|
36
|
-
**Note:** This component uses the Ant Design `Tag` component internally. All standard Ant Design `Tag` props are passed through via `{...rest}` and remain fully supported.
|
|
37
|
-
|
|
38
|
-
### Prop Changes
|
|
39
|
-
|
|
40
|
-
#### Cap Component Props
|
|
41
|
-
|
|
42
|
-
| Prop | Status | Notes |
|
|
43
|
-
|------|--------|-------|
|
|
44
|
-
| `tagColor` | ✅ Unchanged | Custom background color for the tag |
|
|
45
|
-
| `tagTextColor` | ✅ Unchanged | Custom text color for the tag |
|
|
46
|
-
| `tagHeight` | ✅ Unchanged | Custom height for the tag (default: '24px') |
|
|
47
|
-
| `tagFontSize` | ✅ Unchanged | Custom font size for the tag (default: 0.857rem / 12px) |
|
|
48
|
-
| `tagBorderColor` | ✅ Unchanged | Custom border color for the tag |
|
|
49
|
-
| `tagCloseIconColor` | ✅ Unchanged | Custom close icon color for the tag (default: white) |
|
|
50
|
-
| `styleProps` | ✅ Unchanged | Unused prop kept for backward compatibility |
|
|
51
|
-
| `type` | ✅ Unchanged | Tag type modifier ('static') |
|
|
52
|
-
| `disabled` | ✅ Unchanged | Whether the tag is disabled |
|
|
53
|
-
| `className` | ✅ Unchanged | Additional CSS class name |
|
|
54
|
-
|
|
55
|
-
#### Ant Design Tag Component Props
|
|
56
|
-
|
|
57
|
-
| Prop | Status | Notes |
|
|
58
|
-
|------|--------|-------|
|
|
59
|
-
| `closable` | ✅ Unchanged | Whether the tag can be closed (Ant Design Tag prop) |
|
|
60
|
-
| `onClose` | ✅ Unchanged | Callback when tag is closed (Ant Design Tag prop) |
|
|
61
|
-
| `color` | ✅ Unchanged | Tag color preset (Ant Design Tag prop) |
|
|
62
|
-
| `icon` | ✅ Unchanged | Custom icon (Ant Design Tag prop) |
|
|
63
|
-
| `bordered` | ✅ Unchanged | Whether to show border (Ant Design Tag prop) |
|
|
64
|
-
| All other Ant Design Tag props | ✅ Unchanged | All props from `TagProps` are passed through to underlying Ant Design `Tag` component |
|
|
65
|
-
|
|
66
|
-
**Note:** This component extends Ant Design's `TagProps` interface, so all standard Ant Design `Tag` component props are supported and passed through unchanged.
|
|
67
|
-
|
|
68
|
-
### API Changes
|
|
69
|
-
|
|
70
|
-
- **TypeScript Support:** Full TypeScript support with exported `CapColoredTagProps` interface
|
|
71
|
-
- **Ant Design Version:** Upgraded from Ant Design v3 to v6
|
|
72
|
-
- **Styling:** Uses SCSS modules with design tokens
|
|
73
|
-
|
|
74
|
-
### Behavioral Changes
|
|
75
|
-
|
|
76
|
-
- **Dynamic Styling:** The component uses inline styles for dynamic color props (`tagColor`, `tagTextColor`, etc.) to allow runtime customization
|
|
77
|
-
- **Close Icon Styling:** Close icon color is controlled via CSS custom property (`--tag-close-icon-color`) for consistent theming
|
|
78
|
-
- **Static Type:** Tags with `type="static"` have `pointer-events: none` to prevent interaction
|
|
79
|
-
|
|
80
|
-
### Code Improvements
|
|
81
|
-
|
|
82
|
-
1. **Design Tokens:** Uses `$CAP_*` variables from the design system
|
|
83
|
-
2. **Type Safety:** Full TypeScript support with proper type definitions
|
|
84
|
-
3. **Backward Compatibility:** All props from previous versions remain supported
|
|
85
|
-
|
|
86
|
-
### Usage Examples
|
|
87
|
-
|
|
88
|
-
#### Basic Usage
|
|
89
|
-
|
|
90
|
-
```tsx
|
|
91
|
-
import { CapColoredTag } from '@capillarytech/blaze-ui';
|
|
92
|
-
|
|
93
|
-
<CapColoredTag>Default Tag</CapColoredTag>
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
#### Custom Colors
|
|
97
|
-
|
|
98
|
-
```tsx
|
|
99
|
-
<CapColoredTag
|
|
100
|
-
tagColor="#1890ff"
|
|
101
|
-
tagTextColor="#ffffff"
|
|
102
|
-
>
|
|
103
|
-
Custom Colored Tag
|
|
104
|
-
</CapColoredTag>
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
#### Static Tag
|
|
108
|
-
|
|
109
|
-
```tsx
|
|
110
|
-
<CapColoredTag type="static">
|
|
111
|
-
Static Tag (non-interactive)
|
|
112
|
-
</CapColoredTag>
|
|
113
|
-
```
|
|
114
|
-
|
|
115
|
-
#### Closable Tag with Custom Close Icon Color
|
|
116
|
-
|
|
117
|
-
```tsx
|
|
118
|
-
<CapColoredTag
|
|
119
|
-
closable
|
|
120
|
-
tagCloseIconColor="#ff0000"
|
|
121
|
-
onClose={() => console.log('Tag closed')}
|
|
122
|
-
>
|
|
123
|
-
Closable Tag
|
|
124
|
-
</CapColoredTag>
|
|
125
|
-
```
|
|
126
|
-
|
|
127
|
-
#### Disabled Tag
|
|
128
|
-
|
|
129
|
-
```tsx
|
|
130
|
-
<CapColoredTag disabled>
|
|
131
|
-
Disabled Tag
|
|
132
|
-
</CapColoredTag>
|
|
133
|
-
```
|
|
134
|
-
|
|
135
|
-
#### Checkable Tag
|
|
136
|
-
|
|
137
|
-
```tsx
|
|
138
|
-
<CapColoredTag.CheckableTag
|
|
139
|
-
checked={isChecked}
|
|
140
|
-
onChange={(checked) => setChecked(checked)}
|
|
141
|
-
>
|
|
142
|
-
Checkable Tag
|
|
143
|
-
</CapColoredTag.CheckableTag>
|
|
144
|
-
```
|
|
145
|
-
|
|
146
|
-
### Styling
|
|
147
|
-
|
|
148
|
-
The component uses SCSS modules with the following design tokens:
|
|
149
|
-
- `$CAP_SPACE_24` - Default tag height
|
|
150
|
-
- `$CAP_G08` - Default background color
|
|
151
|
-
- `$CAP_WHITE` - Default text and close icon color
|
|
152
|
-
- `$FONT_SIZE_S` - Default font size
|
|
153
|
-
|
|
154
|
-
Custom colors can be applied via props (`tagColor`, `tagTextColor`, etc.) which override the default styles.
|
|
155
|
-
|
|
156
|
-
### Migration Guide
|
|
157
|
-
|
|
158
|
-
If you're migrating from an older version:
|
|
159
|
-
|
|
160
|
-
1. **No code changes required** - The component maintains full backward compatibility
|
|
161
|
-
2. **Import path unchanged** - Continue using `@capillarytech/blaze-ui`
|
|
162
|
-
3. **Props unchanged** - All existing props continue to work as before
|
|
163
|
-
|
|
164
|
-
### Related Components
|
|
165
|
-
|
|
166
|
-
- `CapTag` - Standard tag component with predefined variants
|
|
167
|
-
- `Tag` (Ant Design) - Base tag component from Ant Design
|
package/CapColoredTag/Status.md
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
# Migration Status: CapColoredTag
|
|
2
|
-
|
|
3
|
-
**Last Updated**: 2026-01-31 11:15:48
|
|
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
|
-
- [ ] **Step 9**: CSS Analysis (if mismatches found)
|
|
19
|
-
- [ ] **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-01-31 11:14:49
|
|
36
|
-
**Maximum Mismatch**: 0%
|
|
37
|
-
|
|
38
|
-
### Mismatched Variants:
|
|
39
|
-
- ✅ All variants match perfectly!
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
## CSS Fixes Applied
|
|
43
|
-
|
|
44
|
-
_No CSS fixes applied yet._
|
|
45
|
-
|
|
46
|
-
## Notes
|
|
47
|
-
|
|
48
|
-
_No notes yet._
|
|
49
|
-
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
# Stage 1: Pre-Analysis Report for CapConditionPreview
|
|
2
|
-
|
|
3
|
-
## 1. Antd Style Overrides Found
|
|
4
|
-
|
|
5
|
-
| Line # | Old Override | Can Tokenize? | Token Path | Token Value | Override Reason |
|
|
6
|
-
|--------|-------------|---------------|------------|-------------|-----------------|
|
|
7
|
-
| — | — | — | — | — | — |
|
|
8
|
-
|
|
9
|
-
**Tokenizable overrides**: 0
|
|
10
|
-
**Non-tokenizable overrides**: 0
|
|
11
|
-
**No antd overrides found - will skip theme config update.**
|
|
12
|
-
|
|
13
|
-
CapConditionPreview does not use any Ant Design components. It uses only Cap UI primitives (CapRow, CapColumn, CapLabel, CapIcon, CapTruncateList) and react-intl FormattedMessage. `styles.scss` contains only BEM class `.capConditionPreview__string` (text-overflow/ellipsis) with no `:global` or `.ant-` usage.
|
|
14
|
-
|
|
15
|
-
---
|
|
16
|
-
|
|
17
|
-
## 2. API Breaking Changes
|
|
18
|
-
|
|
19
|
-
| Old API | New API | Affected Props |
|
|
20
|
-
|---------|---------|----------------|
|
|
21
|
-
| — | — | None |
|
|
22
|
-
|
|
23
|
-
No Antd components are used; no v3→v6 API changes apply to this component.
|
|
24
|
-
|
|
25
|
-
---
|
|
26
|
-
|
|
27
|
-
## 3. Backward Compatibility Plan
|
|
28
|
-
|
|
29
|
-
| Deprecated Prop | Fallback Logic |
|
|
30
|
-
|----------------|----------------|
|
|
31
|
-
| — | — |
|
|
32
|
-
|
|
33
|
-
No deprecated props in this component.
|
|
34
|
-
|
|
35
|
-
---
|
|
36
|
-
|
|
37
|
-
## 4. Type Definitions Needed
|
|
38
|
-
|
|
39
|
-
- **CapConditionPreviewProps** – Main props interface (all current props with TypeScript types).
|
|
40
|
-
- **LinkedConditionExpression** – Shape for `additionalFields[key].expression` (operator, operand, storeSource, isStoreUploadFailed, isStoreUploadInvalid, storeUploadIsInProgress).
|
|
41
|
-
- **AdditionalFieldEntry** – Shape for `additionalFields[key]` (description, factId, expression).
|
|
42
|
-
- **DateTypeData** – Shape for `dateTypeData` (dateType, startDate, endDate, date, days, contextData with profileName).
|
|
43
|
-
- **DstData** – Shape for `dstData` (e.g. couponSeriesNames); optional/minimal for type safety.
|
|
44
|
-
- **ViewMoreLinkComponent** – React component type for `ViewMoreLink` (e.g. `React.ComponentType<{ onClick: () => void; children: React.ReactNode }>`).
|
|
45
|
-
|
|
46
|
-
Complex types: `operand` and `listData` are polymorphic (number, string, string[], etc.) depending on `type`; we will use union types or careful typing to avoid `any`.
|
|
47
|
-
|
|
48
|
-
---
|
|
49
|
-
|
|
50
|
-
## 5. PropTypes Removal
|
|
51
|
-
|
|
52
|
-
- [x] Component uses PropTypes: **YES**
|
|
53
|
-
- [x] PropTypes file exists: **NO** (PropTypes live in index.tsx)
|
|
54
|
-
- [x] PropTypes imports found: **YES** (`import PropTypes from 'prop-types'` in index.tsx)
|
|
55
|
-
- [x] Component.propTypes assignments found: **YES** (`CapConditionPreview.propTypes = { ... }` in index.tsx)
|
|
56
|
-
- **Action**: Remove all PropTypes and replace with TypeScript types from `types.ts`.
|
|
57
|
-
|
|
58
|
-
---
|
|
59
|
-
|
|
60
|
-
## 6. DefaultProps Removal
|
|
61
|
-
|
|
62
|
-
- [x] Component uses defaultProps: **NO**
|
|
63
|
-
- [x] Component.defaultProps assignments found: **NO**
|
|
64
|
-
- [x] Old function syntax with props parameter: **NO** (already uses destructuring `({ ... })`)
|
|
65
|
-
- [x] Default values assigned inside function body: **NO** (only `listData = null` and `hideNumberAndProductFields = false` in destructuring)
|
|
66
|
-
- **Action**: No defaultProps to remove. Keep destructuring defaults as-is; ensure any other optional props that need defaults get them in destructuring in index.tsx.
|
|
67
|
-
|
|
68
|
-
---
|
|
69
|
-
|
|
70
|
-
**STAGE 1 COMPLETE. Proceeding to Stage 2 (skip theme config) and Stage 3 (implementation).**
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
# CapConditionPreview
|
|
2
|
-
|
|
3
|
-
Preview block for condition configuration (e.g. "Include whose [condition name] is [operator] [operand]").
|
|
4
|
-
|
|
5
|
-
## Migration (Antd v3 → v6)
|
|
6
|
-
|
|
7
|
-
- **Antd usage**: This component does **not** use any Ant Design components. It uses only Cap UI primitives (CapRow, CapColumn, CapLabel, CapIcon, CapTruncateList) and `react-intl` FormattedMessage. No theme config or antd API changes apply.
|
|
8
|
-
- **PropTypes removed**: All runtime PropTypes were removed and replaced with TypeScript types from `types.ts`.
|
|
9
|
-
- **defaultProps**: None were present; default values use destructuring in the component signature (`listData = null`, `hideNumberAndProductFields = false`).
|
|
10
|
-
- **Styles**: `styles.scss` has no `:global` or `.ant-` overrides. A single BEM-style class is used for the string truncation state, applied via CSS Modules (`styles.capConditionPreview__string`).
|
|
11
|
-
|
|
12
|
-
## Props
|
|
13
|
-
|
|
14
|
-
See `types.ts` for full interfaces. Main props:
|
|
15
|
-
|
|
16
|
-
| Prop | Type | Description |
|
|
17
|
-
|------|------|-------------|
|
|
18
|
-
| `type` | `string` | Data type: NUMBER, STRING, LIST, MULTI_SELECT, STRING_LIST, DATE, entryTriggerEventAttribute, etc. |
|
|
19
|
-
| `operand` | `number \| string \| string[]` | Value(s) for the condition. |
|
|
20
|
-
| `operator` | `string` | Operator key (EQ, GT, LT, IN, NOT_IN, IS_EXACT_DATE, etc.). |
|
|
21
|
-
| `conditionName` | `string` | Label for the condition (e.g. "Extended fields in the transaction"). |
|
|
22
|
-
| `isExcluded` | `boolean` | When true, shows "Exclude" instead of "Include". |
|
|
23
|
-
| `listData` | `string[] \| null` | List of values for MULTI_SELECT (e.g. SKU list). Default `null`. |
|
|
24
|
-
| `additionalFields` | `Record<string, AdditionalFieldEntry>` | Extra condition entries (EXTENDED_FIELD, CUSTOM_FIELD, STORE_FILTER, etc.). |
|
|
25
|
-
| `hideNumberAndProductFields` | `boolean` | When true, hides operand/operator block (e.g. journey context). Default `false`. |
|
|
26
|
-
| `dateTypeData` | `DateTypeData \| null` | For DATE type: RANGE, SINGLE, DAYS_AFTER, DAYS_BEFORE. |
|
|
27
|
-
| `ViewMoreLink` | `ComponentType<ViewMoreLinkProps>` | Custom link component for "View more" (e.g. store filter). |
|
|
28
|
-
| `onClickConfigure` | `(blockId: string) => void` | Called when "View more" is clicked. |
|
|
29
|
-
| `setPopoverVisible` | `(visible: boolean) => void` | Called to close popover when "View more" is used. |
|
|
30
|
-
|
|
31
|
-
Message props (`includeMsg`, `excludeMsg`, `whoseMsg`, `equalMsg`, etc.) are typically provided by `LocaleHoc` from translations.
|
|
32
|
-
|
|
33
|
-
## Breaking changes
|
|
34
|
-
|
|
35
|
-
None. This component did not use antd or deprecated APIs.
|
|
36
|
-
|
|
37
|
-
## Dependencies
|
|
38
|
-
|
|
39
|
-
- `classnames`, `lodash`, `react-intl` (already in blaze-ui dependencies).
|
|
40
|
-
- No new package.json entries required for this migration.
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
# Test Cases: CapConditionPreview (Antd v3→v6)
|
|
2
|
-
|
|
3
|
-
**Component:** CapConditionPreview
|
|
4
|
-
**Complexity:** medium (≤20 test cases)
|
|
5
|
-
**Source:** blaze-ui/components/CapConditionPreview/
|
|
6
|
-
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
## Google Sheets
|
|
10
|
-
|
|
11
|
-
**Spreadsheet ID:** `1Xt8l8Q6Hw0cUYV65SlGvGcPnOtzprr0fukDR9UWJ3kg`
|
|
12
|
-
**Tab:** CapConditionPreview
|
|
13
|
-
|
|
14
|
-
### Steps (run in your environment)
|
|
15
|
-
|
|
16
|
-
1. Check connection: `COMPOSIO_CHECK_ACTIVE_CONNECTION` toolkit="googlesheets"
|
|
17
|
-
2. Create tab: `GOOGLESHEETS_ADD_SHEET` with title `CapConditionPreview`, gridProperties `{ "rowCount": 100, "columnCount": 7 }`
|
|
18
|
-
3. Write data: `GOOGLESHEETS_VALUES_UPDATE` with range `CapConditionPreview!A1` and the values table below.
|
|
19
|
-
|
|
20
|
-
---
|
|
21
|
-
|
|
22
|
-
## Use cases table (for Storybook + migration validation)
|
|
23
|
-
|
|
24
|
-
| ID | Use Case | Props/Config | Expected Visual/Behavior | Priority | Storybook Story | Notes |
|
|
25
|
-
|----|----------|--------------|---------------------------|----------|-----------------|--------|
|
|
26
|
-
| UC-001 | All data type and operator variants | type: NUMBER \| STRING \| LIST \| MULTI_SELECT \| STRING_LIST \| ENTRY_TRIGGER_EVENT_ATTRIBUTE \| DATE; operator: EQ, GT, LT, GTE, LTE, IN_RANGE, NEQ, IN, NOT_IN, IS_EXACT_DATE, IS_BEFORE_DATE, IS_AFTER_DATE, IS_INBETWEEN_DATES, IS_BEFORE_DAYS, IS_AFTER_DAYS; operand/listData/dateTypeData as needed | Correct label and value for each type and operator (e.g. "greater than" + "42" for NUMBER+GT; "Include whose … is on 1/15/2024" for DATE SINGLE) | P0 | TypeAndOperatorVariants | Grouped all type + operator combos into one test |
|
|
27
|
-
| UC-002 | Include vs Exclude and hideNumberAndProductFields | isExcluded: true \| false; hideNumberAndProductFields: true \| false | "Exclude" vs "Include"; when hideNumberAndProductFields true, operand/operator block hidden for STRING/NUMBER/etc., condition name and "whose" still visible | P0 | VisualStates | Default, excluded, and journey/store profile modes |
|
|
28
|
-
| UC-003 | Store upload states (STORE_FILTER) | additionalFields.STORE_FILTER with storeSource: UPLOAD; storeUploadIsInProgress \| isStoreUploadFailed \| isStoreUploadInvalid \| success (operand count) | Progress icon + "Upload in progress"; error icon + "Upload failed" or "Invalid file uploaded"; or "N Stores" when success | P0 | StoreUploadStates | Grouped in progress / failed / invalid / success |
|
|
29
|
-
| UC-004 | ViewMoreLink and SKU download interactions | ViewMoreLink with onClick; setPopoverVisible, onClickConfigure, blockId; MULTI_SELECT + listData (SKU) for download link | Click View more → setPopoverVisible(false) and onClickConfigure(blockId); click "uploaded" → CSV download with SKU list and skuFileName | P0 | Interactions | All interactive handlers in one test |
|
|
30
|
-
| UC-005 | Content: normal, empty, long | operand/listData: normal values; empty listData or []; long operand string; additionalFields: {} vs multiple entries | Renders without crash; empty list shows attachment icon or empty state; long text truncates or wraps; multiple additional conditions show "and" + lineItemMsg | P1 | ContentVariants | Normal, empty, long, multiple conditions |
|
|
31
|
-
| UC-006 | Styling (className) | className: "custom-class" | Root has class "custom-class" and "cap-condition-wrapper"; layout and styled labels (pill background) unchanged | P1 | Styling | className only; no style prop on component |
|
|
32
|
-
| UC-007 | Additional fields (EXTENDED_FIELD, CUSTOM_FIELD, STORE_FILTER, multiple) | additionalFields: EXTENDED_FIELD, CUSTOM_FIELD, STORE_FILTER; expression with operator/operand; multiple keys | Correct description, operator label, and OperandValues for each; "only for lineitems with" and "and" between items when multiple | P0 | AdditionalFields | Grouped all additional field variants |
|
|
33
|
-
| UC-008 | DATE_TYPE sub-variants (RANGE, SINGLE, DAYS_AFTER, DAYS_BEFORE) | type: DATE; dateTypeData: RANGE (startDate, endDate), SINGLE (date or contextData.profileName), DAYS_AFTER/DAYS_BEFORE (days, contextData) | RANGE: "between" + two formatted dates; SINGLE: date or "End date of {profileName} event date attribute"; DAYS_AFTER/BEFORE: "{days} days after/before" + End date of profile | P0 | DateTypeVariants | Grouped RANGE, SINGLE, DAYS_AFTER, DAYS_BEFORE |
|
|
34
|
-
| UC-009 | DATE_TYPE edge cases | dateTypeData: null, undefined; dateType: null, "", "INVALID_TYPE"; startDate/endDate/date: null, undefined, "", invalid string | No date content rendered when null/undefined/invalid; no crash; empty dates show "and" only where applicable | P1 | DateTypeEdgeCases | Production-safe null/undefined/invalid handling |
|
|
35
|
-
| UC-010 | STRING_LIST single vs multiple | type: STRING_LIST; operand: [single] vs [v1, v2, …] | Single: "value1" only; multiple: "value1 +N more" with correct count | P1 | StringListContent | Grouped single and multiple values |
|
|
36
|
-
| UC-011 | MULTI_SELECT: SKU (download) vs non-SKU vs store upload | type: MULTI_SELECT; listData; additionalFields SKU vs none vs STORE_FILTER with UPLOAD | SKU: TruncateList + "uploaded" download link; non-SKU: TruncateList only; store upload: StoreUploadMsg + View more | P0 | MultiSelectVariants | SKU download, list-only, store upload |
|
|
37
|
-
| UC-012 | Entry trigger event attribute | type: ENTRY_TRIGGER_EVENT_ATTRIBUTE; entryTriggerEventAttribute: string; operator | Shows operator label and "Entry trigger event attribute" + attribute name (e.g. "fact1") | P1 | EntryTriggerAttribute | Single test for entry trigger block |
|
|
38
|
-
| UC-013 | Event handlers and callbacks | ViewMoreLink onClick, setPopoverVisible, onClickConfigure; download (setAttribute href/download) | All callbacks invoked with correct args; download link gets correct data URI and filename | P1 | EventHandlers | Grouped all handlers; no mock of Cap components |
|
|
39
|
-
| UC-014 | OperandsMapping labels (i18n) | All operator keys: equalMsg, greaterThanMsg, lessThanMsg, greaterThanOrEqualMsg, lessThanorEqualMsg, inRangeMsg, notEqualMsg, inMsg, notInMsg, date msgs | Correct translated label for each operator in UI | P1 | OperandsMapping | Grouped all operator label props |
|
|
40
|
-
| UC-015 | Empty or missing operand / listData | operand: null, undefined, ""; listData: null, []; type NUMBER/STRING/LIST/MULTI_SELECT | No crash; missing values render empty or fallback (e.g. attachment icon for MULTI_SELECT with no listData) | P1 | EmptyOperand | Edge case for missing data |
|
|
41
|
-
| UC-016 | DATE_TYPE_SINGLE with contextData vs raw date | dateTypeData: SINGLE with date only vs contextData only vs both (contextData takes precedence) | Raw date: formatted date; contextData: "End date of {profileName} event date attribute"; both: contextData branch shown | P1 | DateSingleContext | Precedence and profile name display |
|
|
42
|
-
| UC-017 | Format date for preview (YYYY-MM-DD, ISO, invalid) | dateTypeData with date: "2024-01-15", "2024-01-15T00:00:00.000Z", "invalid" | YYYY-MM-DD and ISO format as en-US locale; invalid returns empty string, no broken UI | P1 | FormatDateForPreview | Timezone-safe and invalid handling |
|
|
43
|
-
| UC-018 | Migration parity (v3 → v6) | Same props as v3 usage; FormattedMessage (react-intl); no antd in component | Same copy and structure as v3; FormattedMessage resolves; no antd dependency in CapConditionPreview | P0 | MigrationParity | i18n and structure parity |
|
|
44
|
-
| UC-019 | Default and optional props | listData=null, hideNumberAndProductFields=false; omit optional msg props (use defaults from LocaleHoc) | Sensible defaults; no crash when optional props omitted; LocaleHoc provides messages | P2 | DefaultProps | Grouped default/optional behavior |
|
|
45
|
-
| UC-020 | Multiple additional conditions (and + lineItemMsg) | additionalFields with 2+ entries (e.g. EXTENDED_FIELD + CUSTOM_FIELD) | First condition without "and"; subsequent with "and" + lineItemMsg; each shows description + operator + OperandValues | P1 | MultipleAdditionalConditions | And/lineItemMsg grouping |
|
|
46
|
-
|
|
47
|
-
---
|
|
48
|
-
|
|
49
|
-
## Requirements checklist
|
|
50
|
-
|
|
51
|
-
- Stay within strict limit for complexity level: **medium ≤20** (20 rows).
|
|
52
|
-
- Group similar scenarios aggressively (types, operators, store states, date variants, events).
|
|
53
|
-
- Each test is manually verifiable in Storybook and with RTL.
|
|
54
|
-
- Focus on real-world usage (conditions, store filter, SKU, dates).
|
|
55
|
-
- Prioritize P0/P1 over P2.
|
|
56
|
-
- Grouping rationale noted in Notes column.
|
|
57
|
-
|
|
58
|
-
---
|
|
59
|
-
|
|
60
|
-
## Testing notes (Do / Don't)
|
|
61
|
-
|
|
62
|
-
- **Do:** Use React Testing Library with Jest; prefer `data-testid` for querying; clear mocks between tests if applicable.
|
|
63
|
-
- **Don't:** Mock Cap UI Library components unless instructed; avoid over-reliance on getByRole; don’t write overly complex tests.
|
|
64
|
-
|
|
65
|
-
**If approaching limit, merge more test cases. Quality > quantity.**
|
package/CapCustomCard/README.md
DELETED
|
@@ -1,182 +0,0 @@
|
|
|
1
|
-
# CapCustomCard
|
|
2
|
-
|
|
3
|
-
A custom Card component wrapper around Ant Design's Card component that provides specialized styling and content rendering for various communication channel types (SMS, Email, Mobile Push, WeChat, etc.).
|
|
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
|
-
#### 1. API Changes
|
|
12
|
-
|
|
13
|
-
| v3 API | v6 API | Status | Migration Guide |
|
|
14
|
-
|--------|--------|--------|-----------------|
|
|
15
|
-
| `Avatar icon="user"` | `Avatar icon={<UserOutlined />}` | Breaking | Import `UserOutlined` from `@ant-design/icons` and use as React component |
|
|
16
|
-
|
|
17
|
-
**Example Migration:**
|
|
18
|
-
|
|
19
|
-
```tsx
|
|
20
|
-
// ❌ v3 (deprecated)
|
|
21
|
-
import { Avatar } from 'antd';
|
|
22
|
-
<Avatar icon="user" />
|
|
23
|
-
|
|
24
|
-
// ✅ v6 (current)
|
|
25
|
-
import { Avatar } from 'antd-v5';
|
|
26
|
-
import { UserOutlined } from '@ant-design/icons';
|
|
27
|
-
<Avatar icon={<UserOutlined />} />
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
### Deprecated Props
|
|
31
|
-
|
|
32
|
-
**No deprecated props exposed to consumers** - This component doesn't expose any deprecated Ant Design props to consumers. All Ant Design Card props passed via `{...rest}` are supported and passed through to the underlying Card component.
|
|
33
|
-
|
|
34
|
-
#### Internal Changes
|
|
35
|
-
|
|
36
|
-
The component uses Ant Design v6 APIs internally:
|
|
37
|
-
- **Avatar icon prop**: Updated from string (`icon="user"`) to React component (`icon={<UserOutlined />}`)
|
|
38
|
-
- **Note**: This change is internal to the component. Consumers don't need to change their code.
|
|
39
|
-
|
|
40
|
-
### Backward Compatibility
|
|
41
|
-
|
|
42
|
-
**Full backward compatibility** - All existing code using CapCustomCard will continue to work without changes. The component maintains the same API surface area and behavior as the v3 version.
|
|
43
|
-
|
|
44
|
-
### Style Changes
|
|
45
|
-
|
|
46
|
-
**Approach**: The component uses `:global()` wrapper in SCSS (nested inside component classes) to target Ant Design's internal Card component structure. All styling has been preserved from the v3 version.
|
|
47
|
-
|
|
48
|
-
### Code Improvements
|
|
49
|
-
|
|
50
|
-
1. **TypeScript Migration**: Converted from PropTypes to TypeScript interfaces
|
|
51
|
-
2. **Functional Component**: Converted CapCustomCardList from class component to functional component
|
|
52
|
-
3. **Icon Updates**: Updated Avatar icon prop to use React component instead of string
|
|
53
|
-
4. **Type Safety**: Added proper TypeScript types for all helper functions and props
|
|
54
|
-
5. **Import Updates**: Updated imports to use `antd-v5` instead of `antd`
|
|
55
|
-
6. **CSS Modules**: Updated to use CSS modules with `import * as styles`
|
|
56
|
-
|
|
57
|
-
### What Stayed the Same
|
|
58
|
-
|
|
59
|
-
- All card types and channel-specific rendering logic
|
|
60
|
-
- All styling and visual appearance
|
|
61
|
-
- Component API surface area
|
|
62
|
-
- Static method `getRichMediaPreview`
|
|
63
|
-
- `CapCustomCardList` subcomponent access via `CapCustomCard.CapCustomCardList`
|
|
64
|
-
- DOM structure (no wrapper divs added)
|
|
65
|
-
|
|
66
|
-
### What Changed
|
|
67
|
-
|
|
68
|
-
- **Removed**: PropTypes dependency
|
|
69
|
-
- **Updated**: Ant Design imports from `antd` to `antd-v5`
|
|
70
|
-
- **Updated**: Avatar icon prop from string to React component (internal change)
|
|
71
|
-
- **Added**: TypeScript type definitions in `types.ts`
|
|
72
|
-
- **Updated**: CapCustomCardList converted to functional component with TypeScript
|
|
73
|
-
|
|
74
|
-
### Props
|
|
75
|
-
|
|
76
|
-
CapCustomCard accepts all props from Ant Design's [Card component](https://ant.design/components/card) plus:
|
|
77
|
-
|
|
78
|
-
| Prop | Type | Default | Description |
|
|
79
|
-
|------|------|---------|-------------|
|
|
80
|
-
| `className` | `string` | - | Additional CSS class name |
|
|
81
|
-
| `type` | `string` | - | Card type/channel (SMS, EMAIL, MOBILEPUSH, WECHAT, etc.) |
|
|
82
|
-
| `content` | `React.ReactNode` | - | Card content to display |
|
|
83
|
-
| `hoverOption` | `React.ReactNode` | - | Content to show on hover |
|
|
84
|
-
| `url` | `string` | - | Image URL for card |
|
|
85
|
-
| `width` | `number \| string` | - | Image width |
|
|
86
|
-
| `height` | `number \| string` | - | Image height |
|
|
87
|
-
| `cardTop` | `React.ReactNode` | - | Content to render above the card |
|
|
88
|
-
| `FBDynamicComponent` | `React.ComponentType` | - | Dynamic component for Facebook card type |
|
|
89
|
-
| `buttonText` | `React.ReactNode` | - | Button text for Viber card type |
|
|
90
|
-
| `fbType` | `string` | - | Facebook card type ('list' or default) |
|
|
91
|
-
| `mediaContent` | `React.ReactNode` | - | Custom media content for Viber |
|
|
92
|
-
| `isNewMobilePush` | `boolean` | - | Whether to use new mobile push format |
|
|
93
|
-
|
|
94
|
-
### Usage
|
|
95
|
-
|
|
96
|
-
```tsx
|
|
97
|
-
import { CapCustomCard } from '@capillarytech/blaze-ui';
|
|
98
|
-
|
|
99
|
-
// Basic usage
|
|
100
|
-
<CapCustomCard type="SMS" content="Hello world" />
|
|
101
|
-
|
|
102
|
-
// With image
|
|
103
|
-
<CapCustomCard
|
|
104
|
-
type="EMAIL"
|
|
105
|
-
url="/path/to/image.jpg"
|
|
106
|
-
width={244}
|
|
107
|
-
height={279}
|
|
108
|
-
/>
|
|
109
|
-
|
|
110
|
-
// With hover option
|
|
111
|
-
<CapCustomCard
|
|
112
|
-
type="MOBILEPUSH"
|
|
113
|
-
content={previewContent}
|
|
114
|
-
hoverOption={<button>Edit</button>}
|
|
115
|
-
/>
|
|
116
|
-
|
|
117
|
-
// Using CapCustomCardList
|
|
118
|
-
import CapCustomCard from '@capillarytech/blaze-ui/components/CapCustomCard';
|
|
119
|
-
|
|
120
|
-
<CapCustomCard.CapCustomCardList
|
|
121
|
-
cardList={[
|
|
122
|
-
{ type: 'SMS', content: 'Message 1', key: '1' },
|
|
123
|
-
{ type: 'EMAIL', content: 'Message 2', key: '2' },
|
|
124
|
-
]}
|
|
125
|
-
type="SMS"
|
|
126
|
-
/>
|
|
127
|
-
```
|
|
128
|
-
|
|
129
|
-
### Import Examples
|
|
130
|
-
|
|
131
|
-
```tsx
|
|
132
|
-
// Default import
|
|
133
|
-
import CapCustomCard from '@capillarytech/blaze-ui/components/CapCustomCard';
|
|
134
|
-
|
|
135
|
-
// Named import
|
|
136
|
-
import { CapCustomCard } from '@capillarytech/blaze-ui';
|
|
137
|
-
|
|
138
|
-
// Type import
|
|
139
|
-
import type { CapCustomCardProps, CapCustomCardListProps } from '@capillarytech/blaze-ui';
|
|
140
|
-
```
|
|
141
|
-
|
|
142
|
-
### Supported Channel Types
|
|
143
|
-
|
|
144
|
-
The component supports the following channel types with specialized rendering:
|
|
145
|
-
|
|
146
|
-
- `SMS` - Text message preview
|
|
147
|
-
- `EMAIL` - Email template preview with image support
|
|
148
|
-
- `MOBILEPUSH` / `MPUSH` - Mobile push notification preview
|
|
149
|
-
- `WECHAT` - WeChat message preview with rich media support
|
|
150
|
-
- `FACEBOOK` - Facebook post preview
|
|
151
|
-
- `VIBER` - Viber message preview
|
|
152
|
-
- `WHATSAPP` - WhatsApp message preview
|
|
153
|
-
- `RCS` - RCS message preview
|
|
154
|
-
- `ZALO` - Zalo message preview
|
|
155
|
-
- `INAPP` - In-app message preview
|
|
156
|
-
- `LINE` - LINE message preview
|
|
157
|
-
- `CALL_TASK` - Call task preview
|
|
158
|
-
|
|
159
|
-
### Static Methods
|
|
160
|
-
|
|
161
|
-
#### `getRichMediaPreview`
|
|
162
|
-
|
|
163
|
-
Static method to generate rich media preview content:
|
|
164
|
-
|
|
165
|
-
```tsx
|
|
166
|
-
import CapCustomCard from '@capillarytech/blaze-ui/components/CapCustomCard';
|
|
167
|
-
|
|
168
|
-
const preview = CapCustomCard.getRichMediaPreview(contentDetails);
|
|
169
|
-
```
|
|
170
|
-
|
|
171
|
-
### Styling
|
|
172
|
-
|
|
173
|
-
The component uses SCSS with CSS modules. Key classes:
|
|
174
|
-
|
|
175
|
-
- `.cap-custom-card` - Applied to the Ant Design Card component
|
|
176
|
-
- `.hover-content` - Content shown on hover
|
|
177
|
-
- `.app-name` - App name header for mobile push/in-app cards
|
|
178
|
-
- `.ios-action-buttons` - iOS action buttons container
|
|
179
|
-
- `.wechat-card-body` - WeChat card body container
|
|
180
|
-
- `.richmedia-template` - Rich media template container
|
|
181
|
-
|
|
182
|
-
Custom styling can be applied via the `className` prop or by overriding the SCSS classes.
|
package/CapCustomCard/Status.md
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
# Migration Status: CapCustomCard
|
|
2
|
-
|
|
3
|
-
**Last Updated**: 2026-02-12 11:35:43
|
|
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-02-12 11:35:43
|
|
24
|
-
**Maximum Mismatch**: 0%
|
|
25
|
-
|
|
26
|
-
### Mismatched Variants:
|
|
27
|
-
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
## CSS Fixes Applied
|
|
31
|
-
|
|
32
|
-
**Date**: 2026-01-29 09:37:38
|
|
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/CapCustomCard/css-fix-analysis.md`_
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
## Notes
|
|
39
|
-
|
|
40
|
-
_No notes yet._
|