@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.
Files changed (177) hide show
  1. package/CapLanguageProvider/actions.js +125 -0
  2. package/CapLanguageProvider/actions.js.map +1 -0
  3. package/CapLanguageProvider/constants.js +37 -0
  4. package/CapLanguageProvider/constants.js.map +1 -0
  5. package/package.json +1 -1
  6. package/CapActionBar/README.md +0 -11
  7. package/CapAdvancedIcon/README.md +0 -185
  8. package/CapAdvancedIcon/use-cases.md +0 -44
  9. package/CapAlert/README.md +0 -144
  10. package/CapAppNotEnabled/README.md +0 -84
  11. package/CapAskAira/README.md +0 -328
  12. package/CapBanner/README.md +0 -4
  13. package/CapBlock/README.md +0 -175
  14. package/CapBorderedBox/Status.md +0 -40
  15. package/CapCSVFileUploader/README.md +0 -124
  16. package/CapCSVFileUploader/Status.md +0 -47
  17. package/CapCard/README.md +0 -85
  18. package/CapCard/Status.md +0 -41
  19. package/CapCardBox/README.md +0 -169
  20. package/CapCardBox/Status.md +0 -52
  21. package/CapCarousel/README.md +0 -190
  22. package/CapCarousel/Status.md +0 -73
  23. package/CapCheckbox/README.md +0 -254
  24. package/CapCheckbox/Status.md +0 -41
  25. package/CapColorPicker/README.md +0 -112
  26. package/CapColorPicker/Status.md +0 -52
  27. package/CapColorPicker/tests/USE_CASES_ANALYSIS.md +0 -92
  28. package/CapColoredTag/README.md +0 -167
  29. package/CapColoredTag/Status.md +0 -49
  30. package/CapConditionPreview/MIGRATION_ANALYSIS.md +0 -70
  31. package/CapConditionPreview/README.md +0 -40
  32. package/CapConditionPreview/tests/USE_CASES_CapConditionPreview.md +0 -65
  33. package/CapCustomCard/README.md +0 -182
  34. package/CapCustomCard/Status.md +0 -40
  35. package/CapCustomCarousel/Status.md +0 -69
  36. package/CapCustomCheckboxList/README.md +0 -178
  37. package/CapCustomCheckboxList/Status.md +0 -52
  38. package/CapCustomCheckboxList/tests/USE_CASES_ANALYSIS.md +0 -174
  39. package/CapCustomList/README.md +0 -117
  40. package/CapCustomList/Status.md +0 -77
  41. package/CapCustomList/tests/USE_CASES_ANALYSIS.md +0 -124
  42. package/CapCustomSelect/README.md +0 -38
  43. package/CapDatePicker/README.md +0 -139
  44. package/CapDateRangePicker/README.md +0 -159
  45. package/CapDateTimePicker/README.md +0 -136
  46. package/CapDateTimeRangePicker/README.md +0 -243
  47. package/CapDivider/README.md +0 -122
  48. package/CapDrawer/README.md +0 -207
  49. package/CapDrawer/Status.md +0 -52
  50. package/CapDrawer/tests/MISSING_USE_CASES.md +0 -170
  51. package/CapDropdown/README.md +0 -515
  52. package/CapDropdown/Status.md +0 -45
  53. package/CapDropdown/tests/USE_CASES_ANALYSIS.md +0 -137
  54. package/CapError/README.md +0 -88
  55. package/CapErrorBoundary/CapErrorBoundary-use-cases.md +0 -89
  56. package/CapErrorBoundary/README.md +0 -150
  57. package/CapErrorStateIllustration/README.md +0 -222
  58. package/CapErrorStateIllustration/USE_CASES.md +0 -33
  59. package/CapExpressionEditor/README.md +0 -32
  60. package/CapForm/README.md +0 -132
  61. package/CapForm/Status.md +0 -40
  62. package/CapForm/tests/PHASE1_UNFULFILLED_USE_CASES.md +0 -113
  63. package/CapForm/tests/USE_CASES_ANALYSIS.md +0 -119
  64. package/CapFormItem/README.md +0 -320
  65. package/CapFormItem/Status.md +0 -73
  66. package/CapFormItem/tests/USE_CASES_ANALYSIS.md +0 -84
  67. package/CapGraph/README.md +0 -69
  68. package/CapGraph/USE_CASES.md +0 -66
  69. package/CapHamburgerMenu/README.md +0 -234
  70. package/CapHamburgerMenu/USE_CASES.md +0 -48
  71. package/CapHeader/Status.md +0 -41
  72. package/CapHeading/README.md +0 -220
  73. package/CapHeading/Status.md +0 -41
  74. package/CapIcon/README.md +0 -207
  75. package/CapIllustration/Status.md +0 -41
  76. package/CapImage/README.md +0 -50
  77. package/CapImportMFEComponent/README.md +0 -121
  78. package/CapInfoNote/Status.md +0 -40
  79. package/CapInfoNote/tests/USE_CASES_ANALYSIS.md +0 -114
  80. package/CapInput/README.md +0 -196
  81. package/CapInput/Status.md +0 -123
  82. package/CapInput/tests/USE_CASES_ANALYSIS.md +0 -169
  83. package/CapLanguageProvider/CapLanguageProvider-use-cases.md +0 -56
  84. package/CapLanguageProvider/README.md +0 -206
  85. package/CapLevelGraphRenderer/CapLevelGraphRenderer-test-cases.md +0 -50
  86. package/CapLevelGraphRenderer/README.md +0 -123
  87. package/CapLevelGraphRenderer/Tooltip_MIGRATION_ANALYSIS.md +0 -120
  88. package/CapLink/README.md +0 -203
  89. package/CapLink/Status.md +0 -32
  90. package/CapLink/tests/CapLink.missingUseCases.md +0 -95
  91. package/CapList/README.md +0 -129
  92. package/CapList/Status.md +0 -69
  93. package/CapListLayout/README.md +0 -7
  94. package/CapLogin/README.md +0 -7
  95. package/CapMenu/README.md +0 -86
  96. package/CapModal/README.md +0 -357
  97. package/CapModal/Status.md +0 -52
  98. package/CapModal/tests/USE_CASES_GAPS.md +0 -207
  99. package/CapMultiSelect/README.md +0 -170
  100. package/CapMultiSelect/tests/USE_CASES_ANALYSIS.md +0 -29
  101. package/CapMultiSelectDatePicker/README.md +0 -11
  102. package/CapNavigation/README.md +0 -72
  103. package/CapNotification/README.md +0 -228
  104. package/CapNotificationDropdown/README.md +0 -5
  105. package/CapPopover/README.md +0 -234
  106. package/CapProgress/Status.md +0 -40
  107. package/CapRadio/Status.md +0 -54
  108. package/CapRadioButton/README.md +0 -152
  109. package/CapRadioButton/Status.md +0 -70
  110. package/CapRadioButton/tests/USE_CASES_ANALYSIS.md +0 -120
  111. package/CapRadioCard/README.md +0 -161
  112. package/CapRadioCard/Status.md +0 -78
  113. package/CapRadioGroup/README.md +0 -141
  114. package/CapRadioGroup/Status.md +0 -59
  115. package/CapReorderComponent/README.md +0 -179
  116. package/CapReorderComponent/Status.md +0 -41
  117. package/CapRoadMap/README.md +0 -126
  118. package/CapRoadMap/Status.md +0 -53
  119. package/CapRoadMap/tests/USE_CASE_GAPS.md +0 -92
  120. package/CapRow/README.md +0 -424
  121. package/CapSKUUploader/README.md +0 -189
  122. package/CapSKUUploader/Status.md +0 -66
  123. package/CapSecondaryTopBar/README.md +0 -7
  124. package/CapSelect/README.md +0 -243
  125. package/CapSelectFilter/README.md +0 -121
  126. package/CapShape/README.md +0 -96
  127. package/CapShape/Status.md +0 -36
  128. package/CapShape/tests/USE_CASES_ANALYSIS.md +0 -120
  129. package/CapSideBar/README.md +0 -298
  130. package/CapSideBar/Status.md +0 -5
  131. package/CapSlideBox/README.md +0 -68
  132. package/CapSlider/README.md +0 -423
  133. package/CapSlider/Status.md +0 -48
  134. package/CapSlider/tests/TEST_COVERAGE.md +0 -118
  135. package/CapSnackBar/README.md +0 -222
  136. package/CapSnackBar/Status.md +0 -41
  137. package/CapSomethingWentWrong/README.md +0 -97
  138. package/CapSplit/README.md +0 -19
  139. package/CapStatisticCard/README.md +0 -138
  140. package/CapStatus/README.md +0 -148
  141. package/CapStatus/Status.md +0 -40
  142. package/CapSteps/Status.md +0 -40
  143. package/CapStepsAccordian/README.md +0 -305
  144. package/CapStepsAccordian/Status.md +0 -48
  145. package/CapSupportVideosWrapper/README.md +0 -14
  146. package/CapSwitch/README.md +0 -351
  147. package/CapTab/README.md +0 -406
  148. package/CapTab/Status.md +0 -104
  149. package/CapTab/tests/USE_CASE_GAPS.md +0 -143
  150. package/CapTabV3/ANALYSIS.md +0 -60
  151. package/CapTabV3/README.md +0 -156
  152. package/CapTabV3/Status.md +0 -52
  153. package/CapTabV3/tests/USE_CASE_GAPS.md +0 -149
  154. package/CapTable/README.md +0 -160
  155. package/CapTable/Status.md +0 -41
  156. package/CapTag/README.md +0 -16
  157. package/CapTagDropdown/README.md +0 -171
  158. package/CapTagDropdown/Status.md +0 -55
  159. package/CapTimePicker/README.md +0 -170
  160. package/CapTooltip/README.md +0 -336
  161. package/CapTooltipWithInfo/Status.md +0 -75
  162. package/CapTopBar/README.md +0 -146
  163. package/CapTree/README.md +0 -124
  164. package/CapTree/Status.md +0 -48
  165. package/CapTree/tests/STATUS.md +0 -154
  166. package/CapTreeSelect/README.md +0 -217
  167. package/CapTreeSelect/Status.md +0 -52
  168. package/CapTruncateList/README.md +0 -13
  169. package/CapUnifiedSelect/README.md +0 -40
  170. package/CapUploader/README.md +0 -313
  171. package/CapUploader/Status.md +0 -76
  172. package/CapUploader/tests/USE_CASES_ANALYSIS.md +0 -225
  173. package/CapUserProfile/README.md +0 -105
  174. package/CapUserProfile/Status.md +0 -95
  175. package/CapVirtualList/README.md +0 -162
  176. package/CapVirtualList/Status.md +0 -71
  177. package/assets/HOCs/ComponentWithLabelHOC/README.md +0 -230
@@ -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
@@ -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
@@ -1,159 +0,0 @@
1
- # CapDateRangePicker
2
-
3
- A wrapper component around Ant Design's DatePicker.RangePicker that provides consistent styling, timezone support, and a simplified API for date range selection in Capillary applications.
4
-
5
- ## Migration from react-dates to Ant Design v6
6
-
7
- This component has been **completely rewritten** — the underlying library changed from `react-dates` (Airbnb) to `antd-v5` (Ant Design v6) `DatePicker.RangePicker`.
8
-
9
- ### Breaking Changes
10
-
11
- #### 1. Library Change
12
-
13
- | Before | After |
14
- |--------|-------|
15
- | `react-dates` (Airbnb) | `antd-v5` DatePicker.RangePicker |
16
- | Moment.js | Day.js |
17
- | Class component with internal state | Functional component (stateless) |
18
- | `react-dates/initialize` + CSS import | No separate initialization needed |
19
-
20
- #### 2. API Changes
21
-
22
- | Old API (react-dates) | New API (antd v6) | Status | Migration Guide |
23
- |-----------------------|-------------------|--------|-----------------|
24
- | `initialStartDate` / `initialEndDate` | `defaultValue: [Dayjs, Dayjs]` | Deprecated | Use `defaultValue` with Dayjs array |
25
- | `onDatesChange({startDate, endDate})` | `onChange([start, end], [str1, str2])` | Changed | Callback shape changed |
26
- | `focusedInput` / `onFocusChange` | `open` / `onOpenChange` | Deprecated | Antd manages focus internally |
27
- | `showCalendarOnly` | N/A | Deprecated | Limited support via CSS |
28
- | `allowYearNavigation` | N/A | Deprecated | Built-in in antd RangePicker |
29
- | `hideCalendar` | `open={false}` | Deprecated | Use `open` prop directly |
30
- | `isDayBlocked` | `disabledDate` | Deprecated | Use `disabledDate` |
31
- | `customInputIcon` | `suffixIcon` | Deprecated | Use `suffixIcon` |
32
- | `customArrowIcon` | `separator` | Deprecated | Use `separator` |
33
- | `displayFormat` | `format` | Deprecated | Use `format` |
34
- | `rootClass` | `getPopupContainer` | Deprecated | Use `getPopupContainer` |
35
- | `dropdownClassName` | `popupClassName` | Deprecated | Use `popupClassName` |
36
- | `dropdownStyle` | `popupStyle` | Deprecated | Use `popupStyle` |
37
- | `getCalendarContainer` | `getPopupContainer` | Deprecated | Use `getPopupContainer` |
38
- | `minimumNights` | `disabledDate` | Deprecated | Implement via `disabledDate` |
39
- | `autoFocusEndDate` | `autoFocus` | Deprecated | Use `autoFocus` |
40
- | `minDate` (string) | `minDate` (Dayjs) / `disabledDate` | Deprecated | Use `disabledDate` or `minDate` |
41
-
42
- #### 3. Date Library Migration
43
-
44
- The component now uses Day.js instead of Moment.js:
45
-
46
- ```javascript
47
- // Before (moment)
48
- import moment from 'moment-timezone';
49
- <CapDateRangePicker
50
- initialStartDate={moment('2024-01-01')}
51
- initialEndDate={moment('2024-01-31')}
52
- onChange={(dates) => console.log(dates)} // dates = [momentStart, momentEnd]
53
- />
54
-
55
- // After (dayjs)
56
- import dayjs from '@dayjs';
57
- <CapDateRangePicker
58
- defaultValue={[dayjs('2024-01-01'), dayjs('2024-01-31')]}
59
- onChange={(dates, dateStrings) => console.log(dates, dateStrings)}
60
- />
61
- ```
62
-
63
- **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.
64
-
65
- ### Backward Compatibility
66
-
67
- All deprecated props still work with deprecation warnings in development:
68
-
69
- - **`initialStartDate` / `initialEndDate`**: Mapped to `defaultValue` array
70
- - **`onFocusChange`**: Mapped to `onOpenChange`
71
- - **`isDayBlocked`**: Merged into `disabledDate`
72
- - **`customInputIcon`**: Mapped to `suffixIcon`
73
- - **`customArrowIcon`**: Mapped to `separator`
74
- - **`displayFormat`**: Mapped to `format`
75
- - **`dropdownClassName`**: Mapped to `popupClassName`
76
- - **`dropdownStyle`**: Mapped to `popupStyle`
77
- - **`getCalendarContainer`**: Mapped to `getPopupContainer`
78
- - **`showCalendarOnly`**: Supported via CSS (hides input, keeps picker open)
79
- - **`hideCalendar`**: Mapped to `open={false}`
80
- - **`allowYearNavigation`**: No-op (built-in in antd)
81
- - **`autoFocusEndDate`**: Mapped to `autoFocus`
82
-
83
- ### Style Changes
84
-
85
- **Approach**: The component uses CSS Modules with design tokens:
86
- - All react-dates CSS overrides removed (no longer relevant)
87
- - CSS Modules classes for component-specific styles (timezone footer)
88
- - Shared `datePickerCommon.scss` for common DatePicker styling patterns
89
- - Design tokens via `$CAP_*` variables and `getCapThemeConfig` DatePicker section
90
-
91
- ### Timezone Footer
92
-
93
- The timezone footer is preserved from the original implementation:
94
-
95
- ```tsx
96
- <CapDateRangePicker
97
- showTimezone
98
- timezone="Asia/Kolkata"
99
- onChange={(dates) => console.log(dates)}
100
- />
101
- // Footer shows: "Asia/Kolkata (UTC+05:30)"
102
- ```
103
-
104
- ### What Stayed the Same
105
-
106
- - Timezone footer display
107
- - Custom icon support (calendar suffix icon, separator)
108
- - Size variants (small, default, large)
109
- - ComponentWithLabelHOC integration
110
- - Default date format (`DD MMM YYYY`)
111
-
112
- ### What Changed
113
-
114
- - **Removed**: react-dates dependency, PropTypes, class component, internal state management
115
- - **Added**: TypeScript types, CSS Modules, Day.js support, deprecation warnings
116
- - **Updated**: Import from `antd-v5` DatePicker.RangePicker
117
- - **Updated**: Moment.js → Day.js (with automatic backward conversion)
118
-
119
- ## Usage
120
-
121
- ```tsx
122
- import CapDateRangePicker from '@capillarytech/blaze-ui/components/CapDateRangePicker';
123
- import dayjs from '@dayjs';
124
-
125
- function MyComponent() {
126
- const [dates, setDates] = useState<[dayjs.Dayjs | null, dayjs.Dayjs | null] | null>(null);
127
-
128
- return (
129
- <CapDateRangePicker
130
- value={dates}
131
- onChange={(newDates) => setDates(newDates)}
132
- size="large"
133
- timezone="America/New_York"
134
- showTimezone
135
- format="DD MMM YYYY"
136
- popupClassName="my-custom-popup"
137
- />
138
- );
139
- }
140
- ```
141
-
142
- ## Props
143
-
144
- See `types.ts` for complete prop definitions. Key props:
145
-
146
- - `value`: `[Dayjs | null, Dayjs | null] | null`
147
- - `defaultValue`: `[Dayjs | null, Dayjs | null] | null`
148
- - `onChange`: `(dates, dateStrings) => void`
149
- - `size`: `'small' | 'default' | 'large'` (default: `'large'`)
150
- - `timezone`: Timezone string (default: `'UTC'`)
151
- - `showTimezone`: Whether to show timezone footer (default: `false`)
152
- - `format`: Date format string (default: `'DD MMM YYYY'`)
153
- - `popupClassName`: Custom class for popup
154
- - `popupStyle`: Custom style for popup
155
- - `getPopupContainer`: Container for popup
156
- - `suffixIcon`: Custom suffix icon
157
- - `separator`: Custom separator between date inputs
158
- - `disabledDate`: Function to disable specific dates
159
- - `renderExtraFooter`: Render extra footer in calendar panel
@@ -1,136 +0,0 @@
1
- # CapDateTimePicker
2
-
3
- A wrapper around Ant Design's DatePicker with `showTime` support, timezone-aware date parsing, and a consistent API for datetime selection in Capillary applications.
4
-
5
- ## Migration from Ant Design v3 to v6
6
-
7
- ### Breaking Changes
8
-
9
- #### 1. API Changes
10
-
11
- | v3 API | v6 API | Status | Migration Guide |
12
- |--------|--------|--------|-----------------|
13
- | `dateRender` | `cellRender` | Deprecated | Replace `dateRender` with `cellRender`. Backward compatibility maintained. |
14
- | `dropdownClassName` | `popupClassName` | Deprecated | Replace `dropdownClassName` with `popupClassName`. Backward compatibility maintained. |
15
- | `dropdownStyle` | `popupStyle` | Deprecated | Replace `dropdownStyle` with `popupStyle`. Backward compatibility maintained. |
16
- | `getCalendarContainer` | `getPopupContainer` | Deprecated | Replace `getCalendarContainer` with `getPopupContainer`. Backward compatibility maintained. |
17
- | `open` | `popupOpen` | Deprecated | Replace `open` with `popupOpen`. Backward compatibility maintained. |
18
- | `onOpenChange` | `onPopupOpenChange` | Deprecated | Replace `onOpenChange` with `onPopupOpenChange`. Backward compatibility maintained. |
19
- | `showToday` | N/A | Deprecated | This prop is deprecated. Today button behavior is now handled internally by Ant Design. Backward compatibility maintained but discouraged. |
20
- | `renderExtraFooter` | Custom Panel | Deprecated | This prop is discouraged. Consider using custom panel components instead. Backward compatibility maintained but discouraged. |
21
-
22
- #### 2. Date Library Migration
23
-
24
- The component continues to support both Moment.js and Day.js objects for backward compatibility:
25
-
26
- - **Props accepting dates**: `value` now accepts `Dayjs | Moment | string | null`
27
- - **Callbacks returning dates**: `onChange` returns the same type as the input (`Dayjs` if `Dayjs` was passed, `Moment` if `Moment` was passed)
28
-
29
- **Migration Path for Consumers:**
30
- ```javascript
31
- // Before (moment) - still works
32
- import moment from 'moment-timezone';
33
- <CapDateTimePicker
34
- value={moment('2024-01-15 10:30')}
35
- onChange={(momentObj) => console.log(momentObj.format())}
36
- />
37
-
38
- // After (dayjs) - preferred
39
- import dayjs from '@dayjs';
40
- <CapDateTimePicker
41
- value={dayjs('2024-01-15 10:30')}
42
- onChange={(dayjsObj) => console.log(dayjsObj.format())}
43
- />
44
- ```
45
-
46
- ### Backward Compatibility
47
-
48
- All deprecated props still work but log a warning in development:
49
-
50
- - **`dateRender`**: Still works but mapped to `cellRender` internally. Use `cellRender` instead.
51
- - **`dropdownClassName`**: Still works. Use `popupClassName` instead.
52
- - **`dropdownStyle`**: Still works. Use `popupStyle` instead.
53
- - **`getCalendarContainer`**: Still works. Use `getPopupContainer` instead.
54
- - **`open`**: Still works. Use `popupOpen` instead.
55
- - **`onOpenChange`**: Still works. Use `onPopupOpenChange` instead.
56
- - **`showToday`**: Still works but is deprecated.
57
- - **`renderExtraFooter`**: Still works but is discouraged.
58
-
59
- ### Style Changes
60
-
61
- The SCSS file (`styles.scss`) targets v3 class names (`.ant-calendar-*`) and is preserved as-is in this migration pass. Full SCSS migration to v6 class names (`.ant-picker-*`) will be done in a subsequent pass.
62
-
63
- **Theme config**: `DatePicker.cellHoverBg` added to `getCapThemeConfig.ts` to control date cell hover background color.
64
-
65
- ### Code Improvements
66
-
67
- 1. **Removed PropTypes**: Replaced with TypeScript interfaces in `types.ts`
68
- 2. **Removed defaultProps**: Default values moved to function argument destructuring
69
- 3. **Using deprecation warning utility**: `logDeprecationWarning` for consistent warnings
70
- 4. **Type safety**: Full TypeScript support with proper Dayjs/Moment union types
71
- 5. **Backward compatibility**: All deprecated props mapped using nullish coalescing (`??`)
72
-
73
- ### What Stayed the Same
74
-
75
- - `injectIntl` HOC pattern for i18n (no consumer-facing change)
76
- - Timezone-aware date parsing logic
77
- - Internal open/close state management for OK button behavior
78
- - `showTime` config with timezone-aware `defaultValue`
79
- - Calendar icon suffix
80
- - `okText` from i18n messages
81
-
82
- ### What Changed
83
-
84
- - **Updated**: Import from `antd-v5` (v6 compatible)
85
- - **Removed**: `import 'antd/lib/date-picker/style/css'`
86
- - **Removed**: PropTypes dependency
87
- - **Removed**: `defaultProps` assignment
88
- - **Updated**: Multiple deprecated props migrated to v6 API (with backward compatibility)
89
- - **Added**: `cellRender` support (v6 replacement for `dateRender`)
90
- - **Added**: `popupClassName`, `popupStyle`, `getPopupContainer`, `popupOpen`, `onPopupOpenChange`
91
-
92
- ## Usage
93
-
94
- ```tsx
95
- import CapDateTimePicker from '@capillarytech/blaze-ui/components/CapDateTimePicker';
96
- import dayjs from '@dayjs';
97
-
98
- function MyComponent() {
99
- const [date, setDate] = useState(null);
100
-
101
- return (
102
- <CapDateTimePicker
103
- value={date}
104
- onChange={(newDate) => setDate(newDate)}
105
- timezone="Asia/Kolkata"
106
- showTime={{ format: 'HH:mm' }}
107
- format="DD-MM-YYYY | HH:mm"
108
- popupClassName="my-custom-popup"
109
- />
110
- );
111
- }
112
- ```
113
-
114
- ## Props
115
-
116
- See `types.ts` for complete prop definitions. Key props:
117
-
118
- - `value`: `Dayjs | Moment | string | null`
119
- - `onChange`: `(value: Dayjs | Moment | null, dateString: string) => void`
120
- - `timezone`: Timezone string (default: `'Asia/Kolkata'`)
121
- - `showTime`: `boolean | { format?: string }` (default: `{ format: 'HH:mm' }`)
122
- - `format`: Date format string (default: `'DD-MM-YYYY | HH:mm'`)
123
- - `cellRender`: Custom cell renderer (v6 API)
124
- - `popupClassName`: Custom class for popup (v6 API)
125
- - `popupStyle`: Custom style for popup (v6 API)
126
- - `getPopupContainer`: Container for popup (v6 API)
127
- - `popupOpen`: Whether popup is open (v6 API)
128
- - `onPopupOpenChange`: Callback when popup open state changes (v6 API)
129
- - `dateRender`: Deprecated — use `cellRender` instead
130
- - `dropdownClassName`: Deprecated — use `popupClassName` instead
131
- - `dropdownStyle`: Deprecated — use `popupStyle` instead
132
- - `getCalendarContainer`: Deprecated — use `getPopupContainer` instead
133
- - `open`: Deprecated — use `popupOpen` instead
134
- - `onOpenChange`: Deprecated — use `onPopupOpenChange` instead
135
- - `showToday`: Deprecated — handled internally by Ant Design
136
- - `renderExtraFooter`: Deprecated — consider custom panel components