@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
|
@@ -1,174 +0,0 @@
|
|
|
1
|
-
# CapCustomCheckboxList - Use Cases Analysis
|
|
2
|
-
|
|
3
|
-
## Phase 1: Use Cases NOT Fulfilled by Component
|
|
4
|
-
|
|
5
|
-
This document identifies potential use cases that the `CapCustomCheckboxList` component may not currently fulfill, based on common checkbox list patterns and the component's current implementation.
|
|
6
|
-
|
|
7
|
-
### 1. Loading States
|
|
8
|
-
**Status**: ❌ NOT SUPPORTED
|
|
9
|
-
- **Use Case**: Display loading skeleton/spinner while checkbox items are being fetched
|
|
10
|
-
- **Current Behavior**: Component renders immediately with provided `paneList`
|
|
11
|
-
- **Gap**: No `loading` prop or loading state handling
|
|
12
|
-
- **Workaround**: Parent component can conditionally render component or show loading UI separately
|
|
13
|
-
|
|
14
|
-
### 2. Empty State Handling
|
|
15
|
-
**Status**: ❌ NOT SUPPORTED
|
|
16
|
-
- **Use Case**: Display custom message when `paneList` is empty
|
|
17
|
-
- **Current Behavior**: Component renders nothing when `paneList` is empty (no visual feedback)
|
|
18
|
-
- **Gap**: No `emptyText` or `emptyRender` prop
|
|
19
|
-
- **Workaround**: Parent component can check `paneList.length` and render empty state separately
|
|
20
|
-
|
|
21
|
-
### 3. Maximum Selection Limit
|
|
22
|
-
**Status**: ❌ NOT SUPPORTED
|
|
23
|
-
- **Use Case**: Limit the number of items that can be selected (e.g., "Select up to 3 options")
|
|
24
|
-
- **Current Behavior**: All checkboxes can be selected without limit
|
|
25
|
-
- **Gap**: No `maxSelection` prop or validation
|
|
26
|
-
- **Workaround**: Parent component can implement validation in `onChange` handler
|
|
27
|
-
|
|
28
|
-
### 4. Minimum Selection Requirement
|
|
29
|
-
**Status**: ❌ NOT SUPPORTED
|
|
30
|
-
- **Use Case**: Require at least N items to be selected (e.g., "Select at least 2 options")
|
|
31
|
-
- **Current Behavior**: No minimum selection enforcement
|
|
32
|
-
- **Gap**: No `minSelection` prop or validation
|
|
33
|
-
- **Workaround**: Parent component can implement validation in `onChange` handler
|
|
34
|
-
|
|
35
|
-
### 5. Select All / Deselect All
|
|
36
|
-
**Status**: ❌ NOT SUPPORTED
|
|
37
|
-
- **Use Case**: Provide a "Select All" checkbox to select/deselect all items at once
|
|
38
|
-
- **Current Behavior**: Users must click each checkbox individually
|
|
39
|
-
- **Gap**: No built-in select all functionality
|
|
40
|
-
- **Workaround**: Parent component can add a separate checkbox and manage state
|
|
41
|
-
|
|
42
|
-
### 6. Group-Level Error Messages
|
|
43
|
-
**Status**: ❌ NOT SUPPORTED
|
|
44
|
-
- **Use Case**: Display error message at the group level (e.g., "Please select at least one option")
|
|
45
|
-
- **Current Behavior**: Only individual items can have error messages via `errorMessage` prop
|
|
46
|
-
- **Gap**: No `errorMessage` prop at component level
|
|
47
|
-
- **Workaround**: Parent component can render error message above/below component
|
|
48
|
-
|
|
49
|
-
### 7. Custom Validation
|
|
50
|
-
**Status**: ❌ NOT SUPPORTED
|
|
51
|
-
- **Use Case**: Custom validation logic (e.g., certain combinations are invalid)
|
|
52
|
-
- **Current Behavior**: No validation beyond individual item `errorMessage`
|
|
53
|
-
- **Gap**: No `validator` or `onValidate` callback prop
|
|
54
|
-
- **Workaround**: Parent component can implement validation logic
|
|
55
|
-
|
|
56
|
-
### 8. Virtualization for Large Lists
|
|
57
|
-
**Status**: ❌ NOT SUPPORTED
|
|
58
|
-
- **Use Case**: Efficiently render hundreds or thousands of checkbox items
|
|
59
|
-
- **Current Behavior**: Renders all items in `paneList` (performance may degrade with large lists)
|
|
60
|
-
- **Gap**: No virtualization or pagination support
|
|
61
|
-
- **Workaround**: Parent component can implement pagination or virtual scrolling wrapper
|
|
62
|
-
|
|
63
|
-
### 9. Filtering/Search Functionality
|
|
64
|
-
**Status**: ❌ NOT SUPPORTED
|
|
65
|
-
- **Use Case**: Filter checkbox items by search term
|
|
66
|
-
- **Current Behavior**: All items in `paneList` are always rendered
|
|
67
|
-
- **Gap**: No built-in filtering or search
|
|
68
|
-
- **Workaround**: Parent component can filter `paneList` before passing to component
|
|
69
|
-
|
|
70
|
-
### 10. Responsive Layout
|
|
71
|
-
**Status**: ⚠️ LIMITED SUPPORT
|
|
72
|
-
- **Use Case**: Adapt layout for mobile/tablet screens (e.g., stack vertically on small screens)
|
|
73
|
-
- **Current Behavior**: Fixed horizontal flex layout (`display: flex`)
|
|
74
|
-
- **Gap**: No responsive breakpoints or layout variations
|
|
75
|
-
- **Workaround**: CSS media queries can override styles, but component doesn't provide responsive props
|
|
76
|
-
|
|
77
|
-
### 11. Custom Item Rendering
|
|
78
|
-
**Status**: ❌ NOT SUPPORTED
|
|
79
|
-
- **Use Case**: Customize rendering of individual items (e.g., add buttons, badges, custom layouts)
|
|
80
|
-
- **Current Behavior**: Fixed structure: icon container + checkbox with title + optional inductive text
|
|
81
|
-
- **Gap**: No `renderItem` prop or slot-based customization
|
|
82
|
-
- **Workaround**: Parent component can transform `paneList` data, but structure is fixed
|
|
83
|
-
|
|
84
|
-
### 12. Item Actions (Delete, Edit, etc.)
|
|
85
|
-
**Status**: ❌ NOT SUPPORTED
|
|
86
|
-
- **Use Case**: Add action buttons to each checkbox item (e.g., delete, edit, info)
|
|
87
|
-
- **Current Behavior**: No support for additional UI elements per item
|
|
88
|
-
- **Gap**: No `actions` prop or action slot
|
|
89
|
-
- **Workaround**: Not possible with current structure
|
|
90
|
-
|
|
91
|
-
### 13. Tooltips on Items
|
|
92
|
-
**Status**: ❌ NOT SUPPORTED
|
|
93
|
-
- **Use Case**: Show tooltips when hovering over checkbox items
|
|
94
|
-
- **Current Behavior**: No built-in tooltip support
|
|
95
|
-
- **Gap**: No `tooltip` prop on `PaneListItem`
|
|
96
|
-
- **Workaround**: Parent component can wrap items, but tooltip won't be part of component structure
|
|
97
|
-
|
|
98
|
-
### 14. Accessibility Enhancements
|
|
99
|
-
**Status**: ⚠️ PARTIAL SUPPORT
|
|
100
|
-
- **Use Case**: Enhanced ARIA attributes (e.g., `aria-label` for group, `aria-describedby` for descriptions)
|
|
101
|
-
- **Current Behavior**: Basic checkbox roles and labels via title
|
|
102
|
-
- **Gap**: Missing `aria-label` on Checkbox.Group, no `aria-describedby` for inductive text
|
|
103
|
-
- **Workaround**: Can be added via `...others` props, but not built-in
|
|
104
|
-
|
|
105
|
-
### 15. Loading Skeleton for Items
|
|
106
|
-
**Status**: ❌ NOT SUPPORTED
|
|
107
|
-
- **Use Case**: Show skeleton loaders while individual items are loading
|
|
108
|
-
- **Current Behavior**: Items render immediately or not at all
|
|
109
|
-
- **Gap**: No skeleton/placeholder support
|
|
110
|
-
- **Workaround**: Parent component can render skeleton UI separately
|
|
111
|
-
|
|
112
|
-
### 16. Item Grouping/Categorization
|
|
113
|
-
**Status**: ❌ NOT SUPPORTED
|
|
114
|
-
- **Use Case**: Group items into categories with headers (e.g., "Premium Features", "Basic Features")
|
|
115
|
-
- **Current Behavior**: Flat list of items
|
|
116
|
-
- **Gap**: No grouping or categorization support
|
|
117
|
-
- **Workaround**: Not possible with current structure
|
|
118
|
-
|
|
119
|
-
### 17. Drag and Drop Reordering
|
|
120
|
-
**Status**: ❌ NOT SUPPORTED
|
|
121
|
-
- **Use Case**: Allow users to reorder checkbox items via drag and drop
|
|
122
|
-
- **Current Behavior**: Items render in order of `paneList` array
|
|
123
|
-
- **Gap**: No drag and drop functionality
|
|
124
|
-
- **Workaround**: Parent component can implement drag and drop and reorder `paneList`
|
|
125
|
-
|
|
126
|
-
### 18. Checkbox State Persistence
|
|
127
|
-
**Status**: ⚠️ REQUIRES PARENT
|
|
128
|
-
- **Use Case**: Persist selected state across page reloads
|
|
129
|
-
- **Current Behavior**: State managed by parent component (controlled) or Ant Design (uncontrolled)
|
|
130
|
-
- **Gap**: No built-in persistence (localStorage, sessionStorage)
|
|
131
|
-
- **Workaround**: Parent component can implement persistence logic
|
|
132
|
-
|
|
133
|
-
### 19. Keyboard Shortcuts
|
|
134
|
-
**Status**: ⚠️ PARTIAL SUPPORT
|
|
135
|
-
- **Use Case**: Keyboard shortcuts (e.g., Ctrl+A to select all, Arrow keys to navigate)
|
|
136
|
-
- **Current Behavior**: Basic keyboard navigation (Tab, Space) via native checkbox behavior
|
|
137
|
-
- **Gap**: No custom keyboard shortcuts
|
|
138
|
-
- **Workaround**: Not possible without component modification
|
|
139
|
-
|
|
140
|
-
### 20. Item Count Display
|
|
141
|
-
**Status**: ❌ NOT SUPPORTED
|
|
142
|
-
- **Use Case**: Display "X of Y selected" counter
|
|
143
|
-
- **Current Behavior**: No built-in counter
|
|
144
|
-
- **Gap**: No `showCount` prop or count display
|
|
145
|
-
- **Workaround**: Parent component can calculate and display count separately
|
|
146
|
-
|
|
147
|
-
## Summary
|
|
148
|
-
|
|
149
|
-
**Total Use Cases Analyzed**: 20
|
|
150
|
-
- **Not Supported**: 16
|
|
151
|
-
- **Partially Supported**: 3
|
|
152
|
-
- **Requires Parent Implementation**: 1
|
|
153
|
-
|
|
154
|
-
## Recommendations
|
|
155
|
-
|
|
156
|
-
The component is well-suited for:
|
|
157
|
-
- ✅ Simple checkbox lists with icons and descriptions
|
|
158
|
-
- ✅ Controlled/uncontrolled selection state
|
|
159
|
-
- ✅ Basic accessibility needs
|
|
160
|
-
- ✅ Horizontal layout requirements
|
|
161
|
-
|
|
162
|
-
The component may need enhancement or wrapper components for:
|
|
163
|
-
- ❌ Complex validation requirements
|
|
164
|
-
- ❌ Large datasets (virtualization)
|
|
165
|
-
- ❌ Advanced interactions (select all, filtering)
|
|
166
|
-
- ❌ Custom item rendering
|
|
167
|
-
- ❌ Responsive layouts
|
|
168
|
-
|
|
169
|
-
## Notes
|
|
170
|
-
|
|
171
|
-
- This analysis is based on the component's current implementation as of the test creation date
|
|
172
|
-
- Some "gaps" may be intentional design decisions to keep the component simple and focused
|
|
173
|
-
- Workarounds are possible for most use cases, but may require additional code in parent components
|
|
174
|
-
- Future enhancements could address these gaps if they become common requirements
|
package/CapCustomList/README.md
DELETED
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
# CapCustomList
|
|
2
|
-
|
|
3
|
-
A customizable list component that displays hierarchical category data with support for subcategories and loading states.
|
|
4
|
-
|
|
5
|
-
## Migration from cap-ui-library
|
|
6
|
-
|
|
7
|
-
### Summary of Changes
|
|
8
|
-
|
|
9
|
-
The CapCustomList component has been migrated from cap-ui-library to blaze-ui with the following updates:
|
|
10
|
-
|
|
11
|
-
- **TypeScript Migration**: Converted from JavaScript to TypeScript with proper type definitions
|
|
12
|
-
- **SCSS Modules**: Converted from styled-components to SCSS modules
|
|
13
|
-
- **Functional Component**: Already a functional component, maintained with React hooks
|
|
14
|
-
- **Code Quality**: Improved code formatting and consistency
|
|
15
|
-
|
|
16
|
-
### Props
|
|
17
|
-
|
|
18
|
-
| Prop | Type | Default | Description |
|
|
19
|
-
|------|------|---------|-------------|
|
|
20
|
-
| `title` | `string` | - | Main title displayed at the top of the list |
|
|
21
|
-
| `list` | `ListItem[]` | - | Array of list items containing category data (required) |
|
|
22
|
-
| `className` | `string` | - | Custom CSS class name |
|
|
23
|
-
| `loader` | `boolean` | - | Loading state indicator |
|
|
24
|
-
| `contentId` | `string` | - | Content identifier used for fetching list data |
|
|
25
|
-
| `getList` | `(contentId: string, type: string) => void` | - | Callback function to fetch list data (required) |
|
|
26
|
-
| `type` | `string` | - | Type identifier used for fetching list data |
|
|
27
|
-
|
|
28
|
-
### Types
|
|
29
|
-
|
|
30
|
-
```typescript
|
|
31
|
-
interface ListItem {
|
|
32
|
-
levelName: string;
|
|
33
|
-
subCategory: string[];
|
|
34
|
-
levelValueCount: number | string;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
interface CapCustomListProps {
|
|
38
|
-
title?: string;
|
|
39
|
-
list: ListItem[];
|
|
40
|
-
className?: string;
|
|
41
|
-
loader?: boolean;
|
|
42
|
-
contentId?: string;
|
|
43
|
-
getList: (contentId: string, type: string) => void;
|
|
44
|
-
type?: string;
|
|
45
|
-
}
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
### Breaking Changes
|
|
49
|
-
|
|
50
|
-
**None** - The component maintains backward compatibility with cap-ui-library v8.x API.
|
|
51
|
-
|
|
52
|
-
### Deprecated Props
|
|
53
|
-
|
|
54
|
-
**None** - CapCustomList does not directly use any Ant Design components, and therefore has no deprecated Ant Design props.
|
|
55
|
-
|
|
56
|
-
#### Ant Design Component Usage
|
|
57
|
-
|
|
58
|
-
CapCustomList uses the following Cap components internally, which wrap Ant Design components:
|
|
59
|
-
|
|
60
|
-
- **CapSpin** - Wraps Ant Design `Spin` component
|
|
61
|
-
- CapCustomList passes: `spinning` prop (not deprecated)
|
|
62
|
-
- No deprecated Ant Design props are used
|
|
63
|
-
|
|
64
|
-
- **CapButton** - Wraps Ant Design `Button` component
|
|
65
|
-
- CapCustomList passes: `type="flat"` and `onClick` (not deprecated)
|
|
66
|
-
- No deprecated Ant Design props are used
|
|
67
|
-
|
|
68
|
-
- **CapHeader** - No direct Ant Design dependency
|
|
69
|
-
- **CapHeading** - No direct Ant Design dependency
|
|
70
|
-
- **CapIcon** - Uses `@ant-design-v5/icons` but no deprecated props
|
|
71
|
-
|
|
72
|
-
#### Verification Results
|
|
73
|
-
|
|
74
|
-
✅ **No deprecated Ant Design props detected**
|
|
75
|
-
|
|
76
|
-
The component was verified against the Ant Design v6 migration guide (`ANTD_V6_MIGRATION.md`) and the following deprecated APIs were confirmed as **NOT used**:
|
|
77
|
-
|
|
78
|
-
- `visible` → `open` (not applicable)
|
|
79
|
-
- `overlay` → `menu` (not applicable)
|
|
80
|
-
- `overlayClassName` → `classNames.root` (not applicable)
|
|
81
|
-
- `destroyTooltipOnHide` → `destroyOnHidden` (not applicable)
|
|
82
|
-
- `message` → `title` (not applicable)
|
|
83
|
-
- `TabPane` children → `items` prop (not applicable)
|
|
84
|
-
- `tabPosition` → `tabPlacement` (not applicable)
|
|
85
|
-
|
|
86
|
-
**Note**: Since CapCustomList does not directly consume Ant Design components, there are no Ant Design prop changes to document. All Ant Design components are accessed through Cap component wrappers, which handle Ant Design v6 compatibility internally.
|
|
87
|
-
|
|
88
|
-
### Usage Example
|
|
89
|
-
|
|
90
|
-
```tsx
|
|
91
|
-
import CapCustomList from '@capillarytech/blaze-ui/components/CapCustomList';
|
|
92
|
-
|
|
93
|
-
function MyComponent() {
|
|
94
|
-
const handleGetList = (contentId: string, type: string) => {
|
|
95
|
-
// Fetch list data
|
|
96
|
-
};
|
|
97
|
-
|
|
98
|
-
return (
|
|
99
|
-
<CapCustomList
|
|
100
|
-
title="Categories"
|
|
101
|
-
list={categoryList}
|
|
102
|
-
loader={isLoading}
|
|
103
|
-
contentId="123"
|
|
104
|
-
getList={handleGetList}
|
|
105
|
-
type="category"
|
|
106
|
-
/>
|
|
107
|
-
);
|
|
108
|
-
}
|
|
109
|
-
```
|
|
110
|
-
|
|
111
|
-
### Related Components
|
|
112
|
-
|
|
113
|
-
- CapButton - Used for category selection buttons
|
|
114
|
-
- CapHeader - Used for displaying category headers
|
|
115
|
-
- CapHeading - Used for titles and labels
|
|
116
|
-
- CapIcon - Used for navigation icons
|
|
117
|
-
- CapSpin - Used for loading state
|
package/CapCustomList/Status.md
DELETED
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
# Migration Status: CapCustomList
|
|
2
|
-
|
|
3
|
-
**Last Updated**: 2026-02-06 01:45:51
|
|
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
|
-
✅ **COMPLETE** - Verified on 2026-02-01
|
|
26
|
-
|
|
27
|
-
### Summary
|
|
28
|
-
**No deprecated Ant Design props detected.** CapCustomList does not directly use any Ant Design components.
|
|
29
|
-
|
|
30
|
-
### Ant Design Components Used Indirectly
|
|
31
|
-
CapCustomList uses Cap components that internally wrap Ant Design components:
|
|
32
|
-
- **CapSpin** - Wraps Ant Design `Spin` component
|
|
33
|
-
- Props passed: `spinning` (not deprecated)
|
|
34
|
-
- **CapButton** - Wraps Ant Design `Button` component
|
|
35
|
-
- Props passed: `type="flat"`, `onClick` (not deprecated)
|
|
36
|
-
- **CapIcon** - Uses `@ant-design-v5/icons`
|
|
37
|
-
- No deprecated props used
|
|
38
|
-
|
|
39
|
-
### Deprecated APIs Verified as NOT Used
|
|
40
|
-
✅ `visible` → `open`
|
|
41
|
-
✅ `overlay` → `menu`
|
|
42
|
-
✅ `overlayClassName` → `classNames.root`
|
|
43
|
-
✅ `destroyTooltipOnHide` → `destroyOnHidden`
|
|
44
|
-
✅ `message` → `title`
|
|
45
|
-
✅ `TabPane` children → `items` prop
|
|
46
|
-
✅ `tabPosition` → `tabPlacement`
|
|
47
|
-
|
|
48
|
-
### Documentation
|
|
49
|
-
- ✅ README.md created with "Deprecated Props" section
|
|
50
|
-
- ✅ All Ant Design component usage documented
|
|
51
|
-
- ✅ Verification results documented
|
|
52
|
-
|
|
53
|
-
**Note**: Step 2.5 is REQUIRED and enforced.
|
|
54
|
-
- Focus: **Ant Design component prop changes** (e.g., Dropdown, Input, Alert, Tooltip, etc.)
|
|
55
|
-
- Reference: MIGRATION_CHANGELOG_TEMPLATE.md for format, ANTD_V6_MIGRATION.md for Ant Design deprecated APIs
|
|
56
|
-
- All deprecated Ant Design props and prop changes must be documented before proceeding.
|
|
57
|
-
|
|
58
|
-
## Visual Testing Results
|
|
59
|
-
|
|
60
|
-
**Last Test**: 2026-02-06 01:45:51
|
|
61
|
-
**Maximum Mismatch**: 0%
|
|
62
|
-
|
|
63
|
-
### Mismatched Variants:
|
|
64
|
-
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
## CSS Fixes Applied
|
|
68
|
-
|
|
69
|
-
**Date**: 2026-02-01 02:24:59
|
|
70
|
-
**Summary**: CSS fixes applied based on visual testing analysis.
|
|
71
|
-
|
|
72
|
-
_See full analysis in: `/Users/sarahkhader/repos/migration/blaze-ui/tools/visual-testing/report/CapCustomList/css-fix-analysis.md`_
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
## Notes
|
|
76
|
-
|
|
77
|
-
_No notes yet._
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
# CapCustomList - Use Cases Analysis
|
|
2
|
-
|
|
3
|
-
## Phase 0: Use Cases from Google Sheets
|
|
4
|
-
|
|
5
|
-
**Note**: Google Sheets MCP server was not accessible during test implementation. Use cases were extracted from component analysis, existing test patterns, and USE_CASES_ANALYSIS.md.
|
|
6
|
-
|
|
7
|
-
### Identified Use Cases (from Component Analysis):
|
|
8
|
-
|
|
9
|
-
1. **Basic Rendering**
|
|
10
|
-
- Render list of categories with titles and counts
|
|
11
|
-
- Display subcategories when category is selected
|
|
12
|
-
- Show loading state during data fetch
|
|
13
|
-
|
|
14
|
-
2. **User Interactions**
|
|
15
|
-
- Click category to view subcategories
|
|
16
|
-
- Navigate back from subcategory view
|
|
17
|
-
- Keyboard navigation support
|
|
18
|
-
|
|
19
|
-
3. **Data Management**
|
|
20
|
-
- Fetch list data via `getList` callback
|
|
21
|
-
- Calculate total category count
|
|
22
|
-
- Handle empty states
|
|
23
|
-
|
|
24
|
-
4. **State Management**
|
|
25
|
-
- Maintain main list vs subcategory view state
|
|
26
|
-
- Update count when list changes
|
|
27
|
-
- Handle prop changes (loader, contentId, type)
|
|
28
|
-
|
|
29
|
-
5. **Edge Cases**
|
|
30
|
-
- Empty lists
|
|
31
|
-
- Missing optional props
|
|
32
|
-
- Empty subcategory arrays
|
|
33
|
-
- String vs number levelValueCount
|
|
34
|
-
- Missing levelName (key fallback)
|
|
35
|
-
|
|
36
|
-
## Phase 1: Use Cases NOT Fulfilled by Component
|
|
37
|
-
|
|
38
|
-
Based on component analysis, the following use cases are **NOT** currently supported:
|
|
39
|
-
|
|
40
|
-
### 1. **useEffect Dependency Issue**
|
|
41
|
-
- **Issue**: The `useEffect` hook that calls `getList` only depends on `loader`, but uses `contentId` and `type` inside the callback.
|
|
42
|
-
- **Impact**: If `contentId` or `type` props change, `getList` won't be called with the new values.
|
|
43
|
-
- **Use Case**: Dynamic content loading based on changing contentId/type.
|
|
44
|
-
|
|
45
|
-
### 2. **Error State Handling**
|
|
46
|
-
- **Issue**: No error state prop or error display mechanism.
|
|
47
|
-
- **Impact**: If `getList` fails or returns an error, users have no visual feedback.
|
|
48
|
-
- **Use Case**: Display error messages when data fetching fails.
|
|
49
|
-
|
|
50
|
-
### 3. **Empty State Messaging**
|
|
51
|
-
- **Issue**: When `list` is empty, component renders nothing without explanation.
|
|
52
|
-
- **Impact**: Users don't know if list is empty due to no data, loading, or error.
|
|
53
|
-
- **Use Case**: Show "No categories available" or similar message.
|
|
54
|
-
|
|
55
|
-
### 4. **Category Selection Callback**
|
|
56
|
-
- **Issue**: No `onCategorySelect` or similar callback prop.
|
|
57
|
-
- **Impact**: Parent components can't react to category selection.
|
|
58
|
-
- **Use Case**: Track analytics, update URL, or trigger side effects on selection.
|
|
59
|
-
|
|
60
|
-
### 5. **Subcategory Selection Callback**
|
|
61
|
-
- **Issue**: No `onSubcategorySelect` callback prop.
|
|
62
|
-
- **Impact**: Can't handle subcategory clicks for navigation or actions.
|
|
63
|
-
- **Use Case**: Navigate to detail pages, open modals, or perform actions.
|
|
64
|
-
|
|
65
|
-
### 6. **Programmatic Navigation**
|
|
66
|
-
- **Issue**: No way to set initial subcategory view or navigate programmatically.
|
|
67
|
-
- **Impact**: Can't deep-link to specific subcategory views.
|
|
68
|
-
- **Use Case**: URL-based routing, browser back/forward navigation.
|
|
69
|
-
|
|
70
|
-
### 7. **Loading State Per Category**
|
|
71
|
-
- **Issue**: Only global `loader` prop, no per-category loading states.
|
|
72
|
-
- **Impact**: Can't show loading for individual categories while fetching subcategories.
|
|
73
|
-
- **Use Case**: Lazy-load subcategories on demand.
|
|
74
|
-
|
|
75
|
-
### 8. **Customizable Empty Subcategory Message**
|
|
76
|
-
- **Issue**: When subcategory array is empty, no message is shown.
|
|
77
|
-
- **Impact**: Users don't know if category has no subcategories.
|
|
78
|
-
- **Use Case**: Display "No subcategories" message.
|
|
79
|
-
|
|
80
|
-
### 9. **Accessibility Enhancements**
|
|
81
|
-
- **Issue**: Missing ARIA labels for navigation states, no keyboard shortcuts documented.
|
|
82
|
-
- **Impact**: Screen reader users may have difficulty understanding navigation state.
|
|
83
|
-
- **Use Case**: Full keyboard navigation, screen reader support.
|
|
84
|
-
|
|
85
|
-
### 10. **Customizable Back Button**
|
|
86
|
-
- **Issue**: Back button is hardcoded with specific styling.
|
|
87
|
-
- **Impact**: Can't customize back button appearance or behavior.
|
|
88
|
-
- **Use Case**: Custom back button text, icon, or styling.
|
|
89
|
-
|
|
90
|
-
### 11. **Breadcrumb Navigation**
|
|
91
|
-
- **Issue**: No breadcrumb trail showing navigation path.
|
|
92
|
-
- **Impact**: Users can't see where they are in the hierarchy.
|
|
93
|
-
- **Use Case**: Multi-level navigation with breadcrumbs.
|
|
94
|
-
|
|
95
|
-
### 12. **Search/Filter Functionality**
|
|
96
|
-
- **Issue**: No built-in search or filter for categories/subcategories.
|
|
97
|
-
- **Impact**: Hard to find items in long lists.
|
|
98
|
-
- **Use Case**: Search categories, filter by criteria.
|
|
99
|
-
|
|
100
|
-
### 13. **Virtualization for Long Lists**
|
|
101
|
-
- **Issue**: All items render at once, no virtualization.
|
|
102
|
-
- **Impact**: Performance issues with very long lists.
|
|
103
|
-
- **Use Case**: Handle hundreds of categories efficiently.
|
|
104
|
-
|
|
105
|
-
### 14. **Selection State Management**
|
|
106
|
-
- **Issue**: No way to mark selected category/subcategory.
|
|
107
|
-
- **Impact**: Can't show which item is currently selected.
|
|
108
|
-
- **Use Case**: Highlight selected items, multi-select.
|
|
109
|
-
|
|
110
|
-
### 15. **Custom Rendering**
|
|
111
|
-
- **Issue**: Can't customize how categories/subcategories are rendered.
|
|
112
|
-
- **Impact**: Limited styling and layout options.
|
|
113
|
-
- **Use Case**: Custom card layouts, additional metadata display.
|
|
114
|
-
|
|
115
|
-
---
|
|
116
|
-
|
|
117
|
-
## Recommendations
|
|
118
|
-
|
|
119
|
-
1. **High Priority**: Fix useEffect dependency issue (add contentId and type to dependency array)
|
|
120
|
-
2. **High Priority**: Add error state handling
|
|
121
|
-
3. **Medium Priority**: Add empty state messaging
|
|
122
|
-
4. **Medium Priority**: Add category/subcategory selection callbacks
|
|
123
|
-
5. **Low Priority**: Add programmatic navigation API
|
|
124
|
-
6. **Low Priority**: Enhance accessibility with ARIA labels
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
# CapCustomSelect
|
|
2
|
-
|
|
3
|
-
Extended Ant Design Popover component with custom select functionality and Capillary design system integration.
|
|
4
|
-
|
|
5
|
-
## Migration from Antd v3 → v6
|
|
6
|
-
|
|
7
|
-
This component has been migrated to support Ant Design v6 while maintaining backward compatibility with v3/v4/v5 APIs.
|
|
8
|
-
|
|
9
|
-
## Props
|
|
10
|
-
|
|
11
|
-
### Deprecated Props (Still Supported)
|
|
12
|
-
|
|
13
|
-
These props are deprecated but still work for backward compatibility. They will show console warnings in development mode:
|
|
14
|
-
|
|
15
|
-
| Deprecated Prop | Replacement | Notes |
|
|
16
|
-
|----------------|-------------|-------|
|
|
17
|
-
| `visible` | `open` | Use `open` for controlled state |
|
|
18
|
-
| `onVisibleChange` | `onOpenChange` | Use `onOpenChange` for controlled state callbacks |
|
|
19
|
-
| `overlayClassName` | `classNames.root` | Use `classNames.root` for overlay styling |
|
|
20
|
-
| `overlayStyle` | `styles.root` | Use `styles.root` for overlay inline styles |
|
|
21
|
-
|
|
22
|
-
### React-Virtuoso Props (Virtual Scrolling)
|
|
23
|
-
|
|
24
|
-
The component uses [react-virtuoso](https://virtuoso.dev/) for virtual scrolling when `virtual={true}`. This improves performance for large lists by only rendering visible items.
|
|
25
|
-
|
|
26
|
-
| Prop | Type | Default | Description |
|
|
27
|
-
|------|------|---------|-------------|
|
|
28
|
-
| `virtual` | `boolean` | `false` | Enable virtual scrolling using react-virtuoso |
|
|
29
|
-
| `virtualScrollWidth` | `string \| number` | `'100%'` | Width of virtual scroll container (string like '100%' or number in pixels) |
|
|
30
|
-
| `virtualScrollHeight` | `string \| number` | `200` | Height of virtual scroll container (string like '200px' or number in pixels) |
|
|
31
|
-
| `rowHeight` | `string \| number` | `40` | Fixed height of each row/item in pixels (string like '40px' or number). Used as `fixedItemHeight` in react-virtuoso for optimal performance |
|
|
32
|
-
| `virtualContainerStyle` | `CSSProperties` | `{}` | Additional CSS styles to apply to the virtual scroll container |
|
|
33
|
-
|
|
34
|
-
**Note:** The component maps react-virtualized props to react-virtuoso props:
|
|
35
|
-
- `rowCount` → `totalCount` (automatically set from filtered items)
|
|
36
|
-
- `rowHeight` → `fixedItemHeight` (when provided)
|
|
37
|
-
- `rowRenderer` → `itemContent` (internal implementation)
|
|
38
|
-
- `AutoSizer` → Direct `style` prop on `Virtuoso` component
|
package/CapDatePicker/README.md
DELETED
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
# CapDatePicker
|
|
2
|
-
|
|
3
|
-
A wrapper component around Ant Design's DatePicker component that provides consistent styling, timezone support, and a simplified API for date selection in Capillary applications.
|
|
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
|
-
| `dropdownClassName` | `popupClassName` | Deprecated | Replace `dropdownClassName` with `popupClassName`. Backward compatibility maintained. |
|
|
16
|
-
| `dropdownStyle` | `popupStyle` | Deprecated | Replace `dropdownStyle` with `popupStyle`. Backward compatibility maintained. |
|
|
17
|
-
| `getCalendarContainer` | `getPopupContainer` | Deprecated | Replace `getCalendarContainer` with `getPopupContainer`. Backward compatibility maintained. |
|
|
18
|
-
| `open` | `popupOpen` | Deprecated | Replace `open` with `popupOpen`. Backward compatibility maintained. |
|
|
19
|
-
| `onOpenChange` | `onPopupOpenChange` | Deprecated | Replace `onOpenChange` with `onPopupOpenChange`. Backward compatibility maintained. |
|
|
20
|
-
| `showToday` | N/A | Deprecated | This prop is deprecated. Today button behavior is now handled internally by Ant Design. Backward compatibility maintained but discouraged. |
|
|
21
|
-
| `renderExtraFooter` | Custom Panel | Deprecated | This prop is discouraged. Consider using custom panel components instead. Backward compatibility maintained but discouraged. |
|
|
22
|
-
|
|
23
|
-
#### 2. Date Library Migration
|
|
24
|
-
|
|
25
|
-
The component now uses Day.js instead of Moment.js, consistent with Ant Design v6:
|
|
26
|
-
|
|
27
|
-
- **Props accepting dates**: `value`, `defaultValue`, `defaultPickerValue` now accept Dayjs objects
|
|
28
|
-
- **Callbacks returning dates**: `onChange` now returns Dayjs objects
|
|
29
|
-
|
|
30
|
-
**Migration Path for Consumers:**
|
|
31
|
-
```javascript
|
|
32
|
-
// Before (moment)
|
|
33
|
-
import moment from 'moment-timezone';
|
|
34
|
-
<CapDatePicker
|
|
35
|
-
value={moment('2024-01-15')}
|
|
36
|
-
onChange={(momentObj) => console.log(momentObj.format())}
|
|
37
|
-
/>
|
|
38
|
-
|
|
39
|
-
// After (dayjs)
|
|
40
|
-
import dayjs from '@dayjs';
|
|
41
|
-
<CapDatePicker
|
|
42
|
-
value={dayjs('2024-01-15')}
|
|
43
|
-
onChange={(dayjsObj) => console.log(dayjsObj.format())}
|
|
44
|
-
/>
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
**Note:** The component maintains backward compatibility for Moment.js objects passed as props - they are automatically converted to Dayjs internally. However, callbacks will always return Dayjs objects.
|
|
48
|
-
|
|
49
|
-
### Backward Compatibility
|
|
50
|
-
|
|
51
|
-
The component maintains backward compatibility for deprecated props:
|
|
52
|
-
|
|
53
|
-
- **`dropdownClassName` prop**: Still works but logs a deprecation warning in development. Use `popupClassName` instead.
|
|
54
|
-
- **`dropdownStyle` prop**: Still works but logs a deprecation warning in development. Use `popupStyle` instead.
|
|
55
|
-
- **`getCalendarContainer` prop**: Still works but logs a deprecation warning in development. Use `getPopupContainer` instead.
|
|
56
|
-
- **`open` prop**: Still works but logs a deprecation warning in development. Use `popupOpen` instead.
|
|
57
|
-
- **`onOpenChange` prop**: Still works but logs a deprecation warning in development. Use `onPopupOpenChange` instead.
|
|
58
|
-
- **`showToday` prop**: Still works but logs a deprecation warning in development. This prop is deprecated as today button behavior is handled internally.
|
|
59
|
-
- **`renderExtraFooter` prop**: Still works but logs a deprecation warning in development. Consider using custom panel components instead.
|
|
60
|
-
|
|
61
|
-
### Style Changes
|
|
62
|
-
|
|
63
|
-
**Approach**: The component uses CSS Modules with design tokens. Custom styling is applied through:
|
|
64
|
-
- CSS Modules classes for component-specific styles (timezone footer)
|
|
65
|
-
- Shared `datePickerCommon.scss` for common DatePicker styling patterns
|
|
66
|
-
- Design tokens via `$CAP_*` variables
|
|
67
|
-
|
|
68
|
-
### Code Improvements
|
|
69
|
-
|
|
70
|
-
1. **Removed PropTypes**: Replaced with TypeScript interfaces
|
|
71
|
-
2. **Using deprecation warning utility**: Now uses `logDeprecationWarning` utility for consistent deprecation warnings
|
|
72
|
-
3. **Improved backward compatibility**: Deprecated props are mapped using nullish coalescing (`??`) for cleaner code
|
|
73
|
-
4. **CSS Modules**: All styles use CSS Modules with `styles[classname]` pattern
|
|
74
|
-
5. **Type safety**: Full TypeScript support with proper Dayjs types
|
|
75
|
-
|
|
76
|
-
### What Stayed the Same
|
|
77
|
-
|
|
78
|
-
- All DatePicker functionality (date selection, formatting, etc.)
|
|
79
|
-
- Timezone footer display
|
|
80
|
-
- Custom icon support
|
|
81
|
-
- Size variants (small, default, large)
|
|
82
|
-
- ComponentWithLabelHOC integration
|
|
83
|
-
|
|
84
|
-
### What Changed
|
|
85
|
-
|
|
86
|
-
- **Removed**: PropTypes dependency
|
|
87
|
-
- **Updated**: Import from `antd-v5` (v6 compatible)
|
|
88
|
-
- **Updated**: Multiple deprecated props migrated to v6 API (with backward compatibility):
|
|
89
|
-
- `dropdownClassName` → `popupClassName`
|
|
90
|
-
- `dropdownStyle` → `popupStyle`
|
|
91
|
-
- `getCalendarContainer` → `getPopupContainer`
|
|
92
|
-
- `open` → `popupOpen`
|
|
93
|
-
- `onOpenChange` → `onPopupOpenChange`
|
|
94
|
-
- **Updated**: Moment.js → Day.js (with automatic conversion for backward compatibility)
|
|
95
|
-
|
|
96
|
-
## Usage
|
|
97
|
-
|
|
98
|
-
```tsx
|
|
99
|
-
import CapDatePicker from '@capillarytech/blaze-ui/components/CapDatePicker';
|
|
100
|
-
import dayjs from '@dayjs';
|
|
101
|
-
|
|
102
|
-
function MyComponent() {
|
|
103
|
-
const [date, setDate] = useState<dayjs.Dayjs | null>(null);
|
|
104
|
-
|
|
105
|
-
return (
|
|
106
|
-
<CapDatePicker
|
|
107
|
-
value={date}
|
|
108
|
-
onChange={(newDate) => setDate(newDate)}
|
|
109
|
-
size="large"
|
|
110
|
-
timezone="America/New_York"
|
|
111
|
-
showTimezone
|
|
112
|
-
popupClassName="my-custom-popup"
|
|
113
|
-
/>
|
|
114
|
-
);
|
|
115
|
-
}
|
|
116
|
-
```
|
|
117
|
-
|
|
118
|
-
## Props
|
|
119
|
-
|
|
120
|
-
See `types.ts` for complete prop definitions. Key props:
|
|
121
|
-
|
|
122
|
-
- `value`: Dayjs object or null
|
|
123
|
-
- `defaultValue`: Dayjs object or null
|
|
124
|
-
- `onChange`: Callback with (date: Dayjs | null, dateString: string)
|
|
125
|
-
- `size`: 'small' | 'default' | 'large' (default: 'large')
|
|
126
|
-
- `timezone`: Timezone string (default: 'UTC')
|
|
127
|
-
- `showTimezone`: Whether to show timezone footer (default: false)
|
|
128
|
-
- `popupClassName`: Custom class for popup (v6 API)
|
|
129
|
-
- `popupStyle`: Custom style for popup (v6 API)
|
|
130
|
-
- `getPopupContainer`: Container for popup (v6 API)
|
|
131
|
-
- `popupOpen`: Whether popup is open (v6 API)
|
|
132
|
-
- `onPopupOpenChange`: Callback when popup open state changes (v6 API)
|
|
133
|
-
- `dropdownClassName`: Deprecated - use `popupClassName` instead
|
|
134
|
-
- `dropdownStyle`: Deprecated - use `popupStyle` instead
|
|
135
|
-
- `getCalendarContainer`: Deprecated - use `getPopupContainer` instead
|
|
136
|
-
- `open`: Deprecated - use `popupOpen` instead
|
|
137
|
-
- `onOpenChange`: Deprecated - use `onPopupOpenChange` instead
|
|
138
|
-
- `showToday`: Deprecated - behavior handled internally
|
|
139
|
-
- `renderExtraFooter`: Deprecated - consider custom panel components
|