@capillarytech/blaze-ui 5.20.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/CapAskAira/CapAiMediaGeneration/saga.js +1446 -0
- package/CapAskAira/CapAiMediaGeneration/saga.js.map +1 -0
- package/CapCollapsibleLeftNavigation/saga.js +1441 -0
- package/CapCollapsibleLeftNavigation/saga.js.map +1 -0
- 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/CapLanguageProvider/reducer.js +130 -0
- package/CapLanguageProvider/reducer.js.map +1 -0
- package/CapLanguageProvider/saga.js +1457 -0
- package/CapLanguageProvider/saga.js.map +1 -0
- package/CapLanguageProvider/selector.js +186 -0
- package/CapLanguageProvider/selector.js.map +1 -0
- package/CapSupportVideosWrapper/utils.js +34 -0
- package/CapSupportVideosWrapper/utils.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/CapTab/README.md
DELETED
|
@@ -1,406 +0,0 @@
|
|
|
1
|
-
# CapTab
|
|
2
|
-
|
|
3
|
-
Enhanced tab component built on Ant Design v6 with backward compatibility for Ant Design v3/v5 APIs.
|
|
4
|
-
|
|
5
|
-
## Summary of Changes from cap-ui-library
|
|
6
|
-
|
|
7
|
-
The `CapTab` component has been migrated from `cap-ui-library` to `blaze-ui` with the following updates:
|
|
8
|
-
|
|
9
|
-
- **TypeScript**: Full TypeScript implementation with proper type definitions
|
|
10
|
-
- **Ant Design v6**: Updated to use Ant Design v6 APIs while maintaining backward compatibility
|
|
11
|
-
- **SCSS Modules**: Uses SCSS modules for styling
|
|
12
|
-
- **Enhanced API**: Added support for Ant Design v6 `items` prop pattern
|
|
13
|
-
- **Backward Compatible**: All deprecated props from Ant Design v3/v5 still work with console warnings
|
|
14
|
-
|
|
15
|
-
## Props
|
|
16
|
-
|
|
17
|
-
### Supported Props
|
|
18
|
-
|
|
19
|
-
The component accepts all Ant Design v6 `Tabs` props, plus the following additions:
|
|
20
|
-
|
|
21
|
-
| Prop | Type | Default | Description |
|
|
22
|
-
|------|------|---------|-------------|
|
|
23
|
-
| `panes` | `TabPaneData[]` | `[]` | Array of tab pane data objects |
|
|
24
|
-
| `className` | `string` | - | Custom class name for the tabs wrapper |
|
|
25
|
-
| `animated` | `boolean \| { inkBar?: boolean; tabPane?: boolean }` | `true` (except when `type="card"`) | Animation configuration |
|
|
26
|
-
| `type` | `'line' \| 'card' \| 'editable-card'` | `'line'` | Tab type |
|
|
27
|
-
| `size` | `'large' \| 'middle' \| 'small'` | `'middle'` | Tab size |
|
|
28
|
-
| `tabPlacement` | `'top' \| 'end' \| 'bottom' \| 'start'` | - | Tab placement (v6 API) |
|
|
29
|
-
| `activeKey` | `string` | - | Active tab key |
|
|
30
|
-
| `defaultActiveKey` | `string` | - | Default active tab key |
|
|
31
|
-
| `onChange` | `(activeKey: string) => void` | - | Callback when active tab changes |
|
|
32
|
-
| `onEdit` | `(targetKey: string, action: 'add' \| 'remove') => void` | - | Callback for editable tabs |
|
|
33
|
-
|
|
34
|
-
### Deprecated Props (Still Supported)
|
|
35
|
-
|
|
36
|
-
The following Ant Design component APIs are deprecated but still supported for backward compatibility:
|
|
37
|
-
|
|
38
|
-
#### `tabPosition` Prop (Ant Design Tabs Component)
|
|
39
|
-
|
|
40
|
-
- **Status:** ⚠️ Deprecated
|
|
41
|
-
- **Ant Design Component:** Tabs
|
|
42
|
-
- **Deprecated Prop:** `tabPosition`
|
|
43
|
-
- **Replacement:** Use `tabPlacement` prop instead
|
|
44
|
-
- **Migration:** Replace `tabPosition` with `tabPlacement` and update values (`left` → `start`, `right` → `end`)
|
|
45
|
-
- **Removal:** Will be removed in next major version
|
|
46
|
-
|
|
47
|
-
**Before (Deprecated):**
|
|
48
|
-
```tsx
|
|
49
|
-
import { CapTab } from '@capillarytech/blaze-ui';
|
|
50
|
-
|
|
51
|
-
<CapTab
|
|
52
|
-
tabPosition="left"
|
|
53
|
-
panes={[
|
|
54
|
-
{ tab: 'Tab 1', content: 'Content 1' },
|
|
55
|
-
{ tab: 'Tab 2', content: 'Content 2' },
|
|
56
|
-
]}
|
|
57
|
-
/>
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
**After (Recommended):**
|
|
61
|
-
```tsx
|
|
62
|
-
import { CapTab } from '@capillarytech/blaze-ui';
|
|
63
|
-
|
|
64
|
-
<CapTab
|
|
65
|
-
tabPlacement="start"
|
|
66
|
-
panes={[
|
|
67
|
-
{ tab: 'Tab 1', content: 'Content 1' },
|
|
68
|
-
{ tab: 'Tab 2', content: 'Content 2' },
|
|
69
|
-
]}
|
|
70
|
-
/>
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
**Placement Value Mapping:**
|
|
74
|
-
- `left` → `start` (v6 API)
|
|
75
|
-
- `right` → `end` (v6 API)
|
|
76
|
-
- `top` → `top` (unchanged)
|
|
77
|
-
- `bottom` → `bottom` (unchanged)
|
|
78
|
-
|
|
79
|
-
**Note:** A deprecation warning will be shown in development mode when using `tabPosition` instead of `tabPlacement`.
|
|
80
|
-
|
|
81
|
-
#### `TabPane` Children Pattern (Ant Design Tabs Component)
|
|
82
|
-
|
|
83
|
-
- **Status:** ⚠️ Deprecated
|
|
84
|
-
- **Ant Design Component:** Tabs
|
|
85
|
-
- **Deprecated Pattern:** `TabPane` children pattern (using `<TabPane>` components as children)
|
|
86
|
-
- **Replacement:** Use `items` prop (via `panes` prop in CapTab)
|
|
87
|
-
- **Migration:** Convert `TabPane` children structure to `panes` array format
|
|
88
|
-
- **Removal:** Will be removed in next major version
|
|
89
|
-
|
|
90
|
-
**Before (Deprecated in Ant Design v6):**
|
|
91
|
-
```tsx
|
|
92
|
-
import { Tabs } from 'antd';
|
|
93
|
-
const { TabPane } = Tabs;
|
|
94
|
-
|
|
95
|
-
<Tabs>
|
|
96
|
-
<TabPane tab="Tab 1" key="1">Content 1</TabPane>
|
|
97
|
-
<TabPane tab="Tab 2" key="2">Content 2</TabPane>
|
|
98
|
-
</Tabs>
|
|
99
|
-
```
|
|
100
|
-
|
|
101
|
-
**After (Recommended):**
|
|
102
|
-
```tsx
|
|
103
|
-
import { CapTab } from '@capillarytech/blaze-ui';
|
|
104
|
-
|
|
105
|
-
<CapTab
|
|
106
|
-
panes={[
|
|
107
|
-
{ tab: 'Tab 1', key: '1', content: 'Content 1' },
|
|
108
|
-
{ tab: 'Tab 2', key: '2', content: 'Content 2' },
|
|
109
|
-
]}
|
|
110
|
-
/>
|
|
111
|
-
```
|
|
112
|
-
|
|
113
|
-
**Note:** CapTab internally converts the `panes` prop to Ant Design v6's `items` format. The original component from `cap-ui-library` used the `TabPane` children pattern, which is deprecated in Ant Design v6. The migrated component handles this conversion automatically.
|
|
114
|
-
|
|
115
|
-
## Deprecated APIs Summary
|
|
116
|
-
|
|
117
|
-
| Deprecated API | Ant Design Component | Replacement | Removal Version |
|
|
118
|
-
|----------------|---------------------|-------------|----------------|
|
|
119
|
-
| `tabPosition` prop | Tabs | `tabPlacement` prop | Next major version |
|
|
120
|
-
| `TabPane` children pattern | Tabs | `items` prop (via `panes`) | Next major version |
|
|
121
|
-
|
|
122
|
-
## API Changes
|
|
123
|
-
|
|
124
|
-
### Tab Placement (Ant Design Tabs Component)
|
|
125
|
-
|
|
126
|
-
**Old API (deprecated):**
|
|
127
|
-
```tsx
|
|
128
|
-
<CapTab
|
|
129
|
-
tabPosition="left"
|
|
130
|
-
panes={[
|
|
131
|
-
{ tab: 'Tab 1', content: 'Content 1' },
|
|
132
|
-
{ tab: 'Tab 2', content: 'Content 2' },
|
|
133
|
-
]}
|
|
134
|
-
/>
|
|
135
|
-
```
|
|
136
|
-
|
|
137
|
-
**New API (recommended):**
|
|
138
|
-
```tsx
|
|
139
|
-
<CapTab
|
|
140
|
-
tabPlacement="start"
|
|
141
|
-
panes={[
|
|
142
|
-
{ tab: 'Tab 1', content: 'Content 1' },
|
|
143
|
-
{ tab: 'Tab 2', content: 'Content 2' },
|
|
144
|
-
]}
|
|
145
|
-
/>
|
|
146
|
-
```
|
|
147
|
-
|
|
148
|
-
**Placement Value Mapping:**
|
|
149
|
-
- `left` → `start` (v6 API)
|
|
150
|
-
- `right` → `end` (v6 API)
|
|
151
|
-
- `top` → `top` (unchanged)
|
|
152
|
-
- `bottom` → `bottom` (unchanged)
|
|
153
|
-
|
|
154
|
-
### TabPane Children Pattern (Ant Design Tabs Component)
|
|
155
|
-
|
|
156
|
-
The original component used `TabPane` children pattern, which is deprecated in Ant Design v6. The migrated component handles this internally by converting the `panes` prop to the `items` format required by Ant Design v6.
|
|
157
|
-
|
|
158
|
-
**Original Pattern (deprecated in Ant Design v6):**
|
|
159
|
-
```tsx
|
|
160
|
-
// This pattern is deprecated in Ant Design v6
|
|
161
|
-
<Tabs>
|
|
162
|
-
<TabPane tab="Tab 1" key="1">Content 1</TabPane>
|
|
163
|
-
<TabPane tab="Tab 2" key="2">Content 2</TabPane>
|
|
164
|
-
</Tabs>
|
|
165
|
-
```
|
|
166
|
-
|
|
167
|
-
**Current Pattern (recommended):**
|
|
168
|
-
```tsx
|
|
169
|
-
// CapTab handles this conversion internally
|
|
170
|
-
<CapTab
|
|
171
|
-
panes={[
|
|
172
|
-
{ tab: 'Tab 1', key: '1', content: 'Content 1' },
|
|
173
|
-
{ tab: 'Tab 2', key: '2', content: 'Content 2' },
|
|
174
|
-
]}
|
|
175
|
-
/>
|
|
176
|
-
```
|
|
177
|
-
|
|
178
|
-
## Behavioral Changes
|
|
179
|
-
|
|
180
|
-
### No Breaking Changes
|
|
181
|
-
|
|
182
|
-
The component maintains **100% backward compatibility** with `cap-ui-library` v8.x. All existing code will continue to work without modifications.
|
|
183
|
-
|
|
184
|
-
### Enhanced Features
|
|
185
|
-
|
|
186
|
-
- **Tab Placement**: Support for Ant Design v6 `tabPlacement` API with automatic mapping of deprecated values
|
|
187
|
-
- **Items Format**: Internal conversion from `panes` to Ant Design v6 `items` format
|
|
188
|
-
- **Animation Configuration**: Enhanced animation API supporting boolean or object configuration
|
|
189
|
-
- **Stable Keys**: Automatic key generation for panes without explicit keys
|
|
190
|
-
|
|
191
|
-
## Migration Steps for Consumers
|
|
192
|
-
|
|
193
|
-
### Step 1: Update Imports
|
|
194
|
-
|
|
195
|
-
**Before:**
|
|
196
|
-
```tsx
|
|
197
|
-
import { CapTab } from '@capillarytech/cap-ui-library';
|
|
198
|
-
```
|
|
199
|
-
|
|
200
|
-
**After:**
|
|
201
|
-
```tsx
|
|
202
|
-
import { CapTab } from '@capillarytech/blaze-ui';
|
|
203
|
-
```
|
|
204
|
-
|
|
205
|
-
### Step 2: Update Deprecated Props (Optional)
|
|
206
|
-
|
|
207
|
-
While deprecated props still work, it's recommended to update them:
|
|
208
|
-
|
|
209
|
-
**Before:**
|
|
210
|
-
```tsx
|
|
211
|
-
<CapTab
|
|
212
|
-
tabPosition="left"
|
|
213
|
-
panes={[
|
|
214
|
-
{ tab: 'Tab 1', content: 'Content 1' },
|
|
215
|
-
{ tab: 'Tab 2', content: 'Content 2' },
|
|
216
|
-
]}
|
|
217
|
-
/>
|
|
218
|
-
```
|
|
219
|
-
|
|
220
|
-
**After:**
|
|
221
|
-
```tsx
|
|
222
|
-
<CapTab
|
|
223
|
-
tabPlacement="start"
|
|
224
|
-
panes={[
|
|
225
|
-
{ tab: 'Tab 1', content: 'Content 1' },
|
|
226
|
-
{ tab: 'Tab 2', content: 'Content 2' },
|
|
227
|
-
]}
|
|
228
|
-
/>
|
|
229
|
-
```
|
|
230
|
-
|
|
231
|
-
## Code Examples
|
|
232
|
-
|
|
233
|
-
### Basic Usage
|
|
234
|
-
|
|
235
|
-
```tsx
|
|
236
|
-
import { CapTab } from '@capillarytech/blaze-ui';
|
|
237
|
-
|
|
238
|
-
function MyComponent() {
|
|
239
|
-
return (
|
|
240
|
-
<CapTab
|
|
241
|
-
panes={[
|
|
242
|
-
{ tab: 'Tab 1', content: 'Content 1' },
|
|
243
|
-
{ tab: 'Tab 2', content: 'Content 2' },
|
|
244
|
-
{ tab: 'Tab 3', content: 'Content 3' },
|
|
245
|
-
]}
|
|
246
|
-
/>
|
|
247
|
-
);
|
|
248
|
-
}
|
|
249
|
-
```
|
|
250
|
-
|
|
251
|
-
### With Different Tab Types
|
|
252
|
-
|
|
253
|
-
```tsx
|
|
254
|
-
// Line tabs (default)
|
|
255
|
-
<CapTab type="line" panes={panes} />
|
|
256
|
-
|
|
257
|
-
// Card tabs
|
|
258
|
-
<CapTab type="card" panes={panes} />
|
|
259
|
-
|
|
260
|
-
// Editable card tabs
|
|
261
|
-
<CapTab
|
|
262
|
-
type="editable-card"
|
|
263
|
-
panes={panes}
|
|
264
|
-
onEdit={(key, action) => {
|
|
265
|
-
if (action === 'add') {
|
|
266
|
-
// Handle add
|
|
267
|
-
} else {
|
|
268
|
-
// Handle remove
|
|
269
|
-
}
|
|
270
|
-
}}
|
|
271
|
-
/>
|
|
272
|
-
```
|
|
273
|
-
|
|
274
|
-
### With Different Tab Placements
|
|
275
|
-
|
|
276
|
-
```tsx
|
|
277
|
-
// Top (default)
|
|
278
|
-
<CapTab tabPlacement="top" panes={panes} />
|
|
279
|
-
|
|
280
|
-
// Bottom
|
|
281
|
-
<CapTab tabPlacement="bottom" panes={panes} />
|
|
282
|
-
|
|
283
|
-
// Start (left)
|
|
284
|
-
<CapTab tabPlacement="start" panes={panes} />
|
|
285
|
-
|
|
286
|
-
// End (right)
|
|
287
|
-
<CapTab tabPlacement="end" panes={panes} />
|
|
288
|
-
```
|
|
289
|
-
|
|
290
|
-
### With Controlled Active Key
|
|
291
|
-
|
|
292
|
-
```tsx
|
|
293
|
-
import { useState } from 'react';
|
|
294
|
-
|
|
295
|
-
function ControlledExample() {
|
|
296
|
-
const [activeKey, setActiveKey] = useState('1');
|
|
297
|
-
|
|
298
|
-
return (
|
|
299
|
-
<CapTab
|
|
300
|
-
activeKey={activeKey}
|
|
301
|
-
onChange={setActiveKey}
|
|
302
|
-
panes={[
|
|
303
|
-
{ key: '1', tab: 'Tab 1', content: 'Content 1' },
|
|
304
|
-
{ key: '2', tab: 'Tab 2', content: 'Content 2' },
|
|
305
|
-
]}
|
|
306
|
-
/>
|
|
307
|
-
);
|
|
308
|
-
}
|
|
309
|
-
```
|
|
310
|
-
|
|
311
|
-
### With Disabled Tabs
|
|
312
|
-
|
|
313
|
-
```tsx
|
|
314
|
-
<CapTab
|
|
315
|
-
panes={[
|
|
316
|
-
{ tab: 'Tab 1', content: 'Content 1' },
|
|
317
|
-
{ tab: 'Tab 2', content: 'Content 2', disabled: true },
|
|
318
|
-
{ tab: 'Tab 3', content: 'Content 3' },
|
|
319
|
-
]}
|
|
320
|
-
/>
|
|
321
|
-
```
|
|
322
|
-
|
|
323
|
-
### With Custom Tab Content
|
|
324
|
-
|
|
325
|
-
```tsx
|
|
326
|
-
<CapTab
|
|
327
|
-
panes={[
|
|
328
|
-
{
|
|
329
|
-
tab: (
|
|
330
|
-
<span>
|
|
331
|
-
<Icon type="user" /> User Tab
|
|
332
|
-
</span>
|
|
333
|
-
),
|
|
334
|
-
content: 'User content'
|
|
335
|
-
},
|
|
336
|
-
{
|
|
337
|
-
tab: (
|
|
338
|
-
<span>
|
|
339
|
-
<Icon type="setting" /> Settings Tab
|
|
340
|
-
</span>
|
|
341
|
-
),
|
|
342
|
-
content: 'Settings content'
|
|
343
|
-
},
|
|
344
|
-
]}
|
|
345
|
-
/>
|
|
346
|
-
```
|
|
347
|
-
|
|
348
|
-
### With Animation Configuration
|
|
349
|
-
|
|
350
|
-
```tsx
|
|
351
|
-
// Disable all animations
|
|
352
|
-
<CapTab animated={false} panes={panes} />
|
|
353
|
-
|
|
354
|
-
// Enable only ink bar animation
|
|
355
|
-
<CapTab animated={{ inkBar: true, tabPane: false }} panes={panes} />
|
|
356
|
-
|
|
357
|
-
// Enable only tab pane animation
|
|
358
|
-
<CapTab animated={{ inkBar: false, tabPane: true }} panes={panes} />
|
|
359
|
-
```
|
|
360
|
-
|
|
361
|
-
## Import Examples
|
|
362
|
-
|
|
363
|
-
### Default Import
|
|
364
|
-
|
|
365
|
-
```tsx
|
|
366
|
-
import CapTab from '@capillarytech/blaze-ui/components/CapTab';
|
|
367
|
-
```
|
|
368
|
-
|
|
369
|
-
### Named Import
|
|
370
|
-
|
|
371
|
-
```tsx
|
|
372
|
-
import { CapTab } from '@capillarytech/blaze-ui';
|
|
373
|
-
```
|
|
374
|
-
|
|
375
|
-
### With TypeScript Types
|
|
376
|
-
|
|
377
|
-
```tsx
|
|
378
|
-
import { CapTab } from '@capillarytech/blaze-ui';
|
|
379
|
-
import type { CapTabProps, TabPaneData } from '@capillarytech/blaze-ui';
|
|
380
|
-
|
|
381
|
-
const panes: TabPaneData[] = [
|
|
382
|
-
{ tab: 'Tab 1', content: 'Content 1' },
|
|
383
|
-
{ tab: 'Tab 2', content: 'Content 2' },
|
|
384
|
-
];
|
|
385
|
-
|
|
386
|
-
const props: CapTabProps = {
|
|
387
|
-
panes,
|
|
388
|
-
type: 'line',
|
|
389
|
-
size: 'middle',
|
|
390
|
-
};
|
|
391
|
-
```
|
|
392
|
-
|
|
393
|
-
## Notes
|
|
394
|
-
|
|
395
|
-
- **No Breaking Changes**: The component is fully backward compatible with `cap-ui-library` v8.x
|
|
396
|
-
- **Deprecated Props**: Deprecated props will show console warnings in development mode but continue to work
|
|
397
|
-
- **Tab Placement**: The `tabPosition` prop with values `left`/`right` is automatically mapped to `start`/`end` for Ant Design v6 compatibility
|
|
398
|
-
- **Panes Format**: The component internally converts the `panes` prop to Ant Design v6's `items` format
|
|
399
|
-
- **Animation**: By default, animations are enabled except when `type="card"` (matching original behavior)
|
|
400
|
-
- **Stable Keys**: If panes don't have explicit `key` props, stable keys are generated automatically based on tab content
|
|
401
|
-
|
|
402
|
-
## Related Components
|
|
403
|
-
|
|
404
|
-
- `CapButton` - Button component that can be used in tab content
|
|
405
|
-
- `CapIcon` - Icon component that can be used in tab labels
|
|
406
|
-
- `CapCard` - Card component that can be used in tab content
|
package/CapTab/Status.md
DELETED
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
# Migration Status: CapTab
|
|
2
|
-
|
|
3
|
-
**Last Updated**: 2026-02-06 17:31:34
|
|
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
|
-
**Status**: ✅ **VERIFIED** - All Ant Design prop changes properly documented
|
|
26
|
-
|
|
27
|
-
**Verified Date**: 2026-02-06
|
|
28
|
-
|
|
29
|
-
### Ant Design Components Used
|
|
30
|
-
- **Tabs** (`antd-v5` / Ant Design v6)
|
|
31
|
-
|
|
32
|
-
### Deprecated Ant Design Props Documented
|
|
33
|
-
|
|
34
|
-
#### 1. `tabPosition` → `tabPlacement` (Ant Design Tabs Component)
|
|
35
|
-
- **Status**: ✅ Documented
|
|
36
|
-
- **Location**: README.md (lines 38-79), types.ts (line 26)
|
|
37
|
-
- **Implementation**:
|
|
38
|
-
- ✅ @deprecated JSDoc comment in types.ts
|
|
39
|
-
- ✅ Backward compatibility code in index.tsx (mapTabPlacement function)
|
|
40
|
-
- ✅ Console warning via logDeprecationWarning
|
|
41
|
-
- ✅ Value mapping: `left` → `start`, `right` → `end`
|
|
42
|
-
- **Documentation**: Complete with Before/After examples and value mapping table
|
|
43
|
-
|
|
44
|
-
#### 2. `TabPane` Children Pattern → `items` Prop (Ant Design Tabs Component)
|
|
45
|
-
- **Status**: ✅ Documented
|
|
46
|
-
- **Location**: README.md (lines 81-113)
|
|
47
|
-
- **Implementation**:
|
|
48
|
-
- ✅ Internal conversion from `panes` prop to `items` format
|
|
49
|
-
- ✅ Handled automatically in component implementation
|
|
50
|
-
- **Documentation**: Complete with Before/After examples explaining the pattern change
|
|
51
|
-
|
|
52
|
-
### Verification Checklist
|
|
53
|
-
|
|
54
|
-
- [x] **Ant Design Components Identified**: Tabs component identified
|
|
55
|
-
- [x] **MIGRATION_CHANGELOG_TEMPLATE.md Checked**: Referenced for format guidance
|
|
56
|
-
- [x] **ANTD_V6_MIGRATION.md Checked**: Confirmed Tabs prop changes match documented patterns
|
|
57
|
-
- [x] **README.md Documentation**: Complete "Deprecated Props" section with:
|
|
58
|
-
- [x] Status indicators (⚠️ Deprecated)
|
|
59
|
-
- [x] Ant Design component identification
|
|
60
|
-
- [x] Deprecated prop names
|
|
61
|
-
- [x] Replacement prop names
|
|
62
|
-
- [x] Migration examples (Before/After)
|
|
63
|
-
- [x] Value mapping tables
|
|
64
|
-
- [x] Removal version information
|
|
65
|
-
- [x] **@deprecated JSDoc Comments**: Present in types.ts for `tabPosition` prop
|
|
66
|
-
- [x] **Backward Compatibility**: Implemented with prop mapping and fallback logic
|
|
67
|
-
- [x] **Console Warnings**: Implemented via logDeprecationWarning utility
|
|
68
|
-
- [x] **Deprecated APIs Summary Table**: Present in README.md (lines 115-120)
|
|
69
|
-
|
|
70
|
-
### Summary
|
|
71
|
-
|
|
72
|
-
All Ant Design component prop changes for CapTab have been properly documented and implemented:
|
|
73
|
-
- ✅ Both deprecated Ant Design props (`tabPosition` and `TabPane` pattern) are documented
|
|
74
|
-
- ✅ Documentation follows the format from MIGRATION_CHANGELOG_TEMPLATE.md and ANTD_V6_MIGRATION.md
|
|
75
|
-
- ✅ Backward compatibility is maintained with console warnings
|
|
76
|
-
- ✅ Migration examples are provided for each deprecated prop
|
|
77
|
-
- ✅ All deprecated props clearly indicate which Ant Design component they belong to
|
|
78
|
-
|
|
79
|
-
**Note**: Step 2.5 is REQUIRED and enforced.
|
|
80
|
-
- Focus: **Ant Design component prop changes** (e.g., Dropdown, Input, Alert, Tooltip, etc.)
|
|
81
|
-
- Reference: MIGRATION_CHANGELOG_TEMPLATE.md for format, ANTD_V6_MIGRATION.md for Ant Design deprecated APIs
|
|
82
|
-
- Skip: If original component doesn't exist in cap-ui-library
|
|
83
|
-
- All deprecated Ant Design props and prop changes must be documented before proceeding.
|
|
84
|
-
|
|
85
|
-
## Visual Testing Results
|
|
86
|
-
|
|
87
|
-
**Last Test**: 2026-02-06 17:29:59
|
|
88
|
-
**Maximum Mismatch**: 2.41%
|
|
89
|
-
|
|
90
|
-
### Mismatched Variants:
|
|
91
|
-
- default:1.99%
|
|
92
|
-
- selected:2.02%
|
|
93
|
-
- disabled-tabs:2.41%
|
|
94
|
-
- tab-switch (with 2 interactions):1.89%
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
## CSS Fixes Applied
|
|
98
|
-
|
|
99
|
-
_No CSS fixes applied yet._
|
|
100
|
-
|
|
101
|
-
## Notes
|
|
102
|
-
|
|
103
|
-
_No notes yet._
|
|
104
|
-
|
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
# CapTab Use Case Gaps Analysis
|
|
2
|
-
|
|
3
|
-
## Phase 0: Google Sheets Access
|
|
4
|
-
|
|
5
|
-
**Status**: ⚠️ **Unable to access Google Sheets**
|
|
6
|
-
|
|
7
|
-
- MCP Server `google_sheets` was not available
|
|
8
|
-
- Spreadsheet ID: `1Xt8l8Q6Hw0cUYV65SlGvGcPnOtzprr0fukDR9UWJ3kg`
|
|
9
|
-
- Tab: `CapTab`
|
|
10
|
-
|
|
11
|
-
**Action Required**: Manual review of Google Sheets to compare use cases against component implementation.
|
|
12
|
-
|
|
13
|
-
**Note**: Tests were created based on component implementation analysis, existing Storybook stories, and standard tab component requirements.
|
|
14
|
-
|
|
15
|
-
---
|
|
16
|
-
|
|
17
|
-
## Phase 2: Test Implementation
|
|
18
|
-
|
|
19
|
-
**Status**: ✅ **Complete & Optimized**
|
|
20
|
-
|
|
21
|
-
**Test Coverage**: Comprehensive unit tests implemented covering:
|
|
22
|
-
- Default rendering and initialization
|
|
23
|
-
- Prop variations (types, sizes, placements, animations) - consolidated with `it.each`
|
|
24
|
-
- User interactions (click, keyboard navigation, focus) - consolidated with `it.each`
|
|
25
|
-
- Callbacks and event handlers
|
|
26
|
-
- Edge cases (empty states, null/undefined values, ReactNode handling) - consolidated
|
|
27
|
-
- Accessibility (ARIA attributes, keyboard navigation)
|
|
28
|
-
- Backward compatibility (deprecated props)
|
|
29
|
-
- Data flow and state management
|
|
30
|
-
- Conditional rendering logic - consolidated with `it.each`
|
|
31
|
-
- Key generation for panes without explicit keys (including ReactNode edge cases)
|
|
32
|
-
- Wrapper structure and CSS classes
|
|
33
|
-
- Animation config edge cases
|
|
34
|
-
- mapTabPlacement edge cases
|
|
35
|
-
|
|
36
|
-
**Optimizations Applied**:
|
|
37
|
-
- Removed duplicate tests (consolidated ~159 tests to ~102 tests)
|
|
38
|
-
- Used `it.each` for repetitive test patterns
|
|
39
|
-
- Consolidated similar edge case tests
|
|
40
|
-
- Added missing coverage for key generation edge cases (ReactNode without children, minimal panes)
|
|
41
|
-
- Improved test maintainability and readability
|
|
42
|
-
|
|
43
|
-
---
|
|
44
|
-
|
|
45
|
-
## Phase 1: Use Cases NOT Fulfilled by CapTab
|
|
46
|
-
|
|
47
|
-
Based on component analysis, the following use cases are **NOT** currently supported:
|
|
48
|
-
|
|
49
|
-
### 1. **Loading States**
|
|
50
|
-
- ❌ **Loading indicator**: No loading state for tabs or tab content
|
|
51
|
-
- ❌ **Skeleton loading**: No skeleton/placeholder while content loads
|
|
52
|
-
- ❌ **Async content loading**: No built-in support for lazy loading tab content
|
|
53
|
-
|
|
54
|
-
### 2. **Error States**
|
|
55
|
-
- ❌ **Error handling**: No error state display for failed tab content
|
|
56
|
-
- ❌ **Error boundaries**: No error boundary integration for tab panes
|
|
57
|
-
- ❌ **Retry mechanisms**: No retry functionality for failed content
|
|
58
|
-
|
|
59
|
-
### 3. **Empty States**
|
|
60
|
-
- ❌ **Custom empty state**: No custom empty state message when panes array is empty
|
|
61
|
-
- ❌ **Empty tab content**: No empty state for individual tab panes with no content
|
|
62
|
-
- ❌ **Empty state callbacks**: No callback when empty state is displayed
|
|
63
|
-
|
|
64
|
-
### 4. **Advanced Interactions**
|
|
65
|
-
- ❌ **Drag and drop**: No ability to reorder tabs via drag and drop
|
|
66
|
-
- ❌ **Tab closing**: No built-in close button for tabs (except editable-card type)
|
|
67
|
-
- ❌ **Tab duplication**: No ability to duplicate tabs
|
|
68
|
-
- ❌ **Tab context menu**: No right-click context menu for tabs
|
|
69
|
-
- ❌ **Tab tooltips**: No tooltip support for tab labels
|
|
70
|
-
|
|
71
|
-
### 5. **Customization**
|
|
72
|
-
- ❌ **Custom tab icons**: No built-in icon prop support (requires ReactNode)
|
|
73
|
-
- ❌ **Tab badges/notifications**: No badge or notification count display
|
|
74
|
-
- ❌ **Custom tab styling per pane**: All tabs use same styling
|
|
75
|
-
- ❌ **Tab width customization**: No per-tab width control
|
|
76
|
-
- ❌ **Tab alignment options**: Limited alignment options beyond centered
|
|
77
|
-
|
|
78
|
-
### 6. **Data Features**
|
|
79
|
-
- ❌ **Tab persistence**: No localStorage/sessionStorage persistence
|
|
80
|
-
- ❌ **Tab state management**: No built-in state management integration
|
|
81
|
-
- ❌ **Tab analytics**: No analytics/tracking hooks
|
|
82
|
-
- ❌ **Tab validation**: No validation before tab switch
|
|
83
|
-
- ❌ **Tab dependencies**: No way to show/enforce tab dependencies
|
|
84
|
-
|
|
85
|
-
### 7. **Accessibility Enhancements**
|
|
86
|
-
- ❌ **Custom ARIA labels**: No per-tab ARIA label customization
|
|
87
|
-
- ❌ **Screen reader announcements**: No custom announcements for tab changes
|
|
88
|
-
- ❌ **Focus management**: Limited focus management options
|
|
89
|
-
- ❌ **Skip links**: No skip-to-content links
|
|
90
|
-
|
|
91
|
-
### 8. **Performance Features**
|
|
92
|
-
- ❌ **Lazy loading**: No lazy loading for tab content
|
|
93
|
-
- ❌ **Virtual scrolling**: No virtual scrolling for many tabs
|
|
94
|
-
- ❌ **Content preloading**: No preloading for adjacent tabs
|
|
95
|
-
- ❌ **Memoization helpers**: No built-in memoization for tab content
|
|
96
|
-
|
|
97
|
-
### 9. **Integration Features**
|
|
98
|
-
- ❌ **URL synchronization**: No URL hash/query param sync
|
|
99
|
-
- ❌ **Router integration**: No direct router integration
|
|
100
|
-
- ❌ **Form integration**: No form state preservation across tabs
|
|
101
|
-
- ❌ **Multi-tab selection**: No multi-select mode
|
|
102
|
-
|
|
103
|
-
### 10. **Developer Experience**
|
|
104
|
-
- ❌ **Tab refs**: No ref forwarding for individual tabs
|
|
105
|
-
- ❌ **Tab lifecycle hooks**: No onMount/onUnmount callbacks per tab
|
|
106
|
-
- ❌ **Tab validation callbacks**: No beforeChange validation
|
|
107
|
-
- ❌ **Tab animation callbacks**: No animation start/end callbacks
|
|
108
|
-
|
|
109
|
-
---
|
|
110
|
-
|
|
111
|
-
## Component Capabilities (Verified)
|
|
112
|
-
|
|
113
|
-
### ✅ **Supported Features**:
|
|
114
|
-
- ✅ Basic tab rendering with panes prop
|
|
115
|
-
- ✅ Multiple tab types (line, card, editable-card)
|
|
116
|
-
- ✅ Tab sizes (small, middle, large)
|
|
117
|
-
- ✅ Tab placements (top, bottom, start, end)
|
|
118
|
-
- ✅ Controlled and uncontrolled modes
|
|
119
|
-
- ✅ Disabled tabs
|
|
120
|
-
- ✅ Custom className
|
|
121
|
-
- ✅ Animation configuration (boolean or object)
|
|
122
|
-
- ✅ ReactNode support for tab labels and content
|
|
123
|
-
- ✅ Backward compatibility with deprecated props
|
|
124
|
-
- ✅ onChange callback for tab switching
|
|
125
|
-
- ✅ onEdit callback for editable-card type
|
|
126
|
-
- ✅ Stable key generation for panes without keys
|
|
127
|
-
- ✅ All Ant Design Tabs props via rest spread
|
|
128
|
-
|
|
129
|
-
---
|
|
130
|
-
|
|
131
|
-
## Recommendations
|
|
132
|
-
|
|
133
|
-
1. **High Priority**: Add loading states and error handling for better UX
|
|
134
|
-
2. **Medium Priority**: Add URL synchronization and router integration
|
|
135
|
-
3. **Low Priority**: Add advanced features like drag-and-drop and tab badges
|
|
136
|
-
|
|
137
|
-
---
|
|
138
|
-
|
|
139
|
-
## Notes
|
|
140
|
-
|
|
141
|
-
- Component is a wrapper around Ant Design v6 Tabs
|
|
142
|
-
- Most missing features can be implemented by consumers using Ant Design props
|
|
143
|
-
- Focus should be on features that require component-level logic
|