@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.
Files changed (189) hide show
  1. package/CapAskAira/CapAiMediaGeneration/saga.js +1446 -0
  2. package/CapAskAira/CapAiMediaGeneration/saga.js.map +1 -0
  3. package/CapCollapsibleLeftNavigation/saga.js +1441 -0
  4. package/CapCollapsibleLeftNavigation/saga.js.map +1 -0
  5. package/CapLanguageProvider/actions.js +125 -0
  6. package/CapLanguageProvider/actions.js.map +1 -0
  7. package/CapLanguageProvider/constants.js +37 -0
  8. package/CapLanguageProvider/constants.js.map +1 -0
  9. package/CapLanguageProvider/reducer.js +130 -0
  10. package/CapLanguageProvider/reducer.js.map +1 -0
  11. package/CapLanguageProvider/saga.js +1457 -0
  12. package/CapLanguageProvider/saga.js.map +1 -0
  13. package/CapLanguageProvider/selector.js +186 -0
  14. package/CapLanguageProvider/selector.js.map +1 -0
  15. package/CapSupportVideosWrapper/utils.js +34 -0
  16. package/CapSupportVideosWrapper/utils.js.map +1 -0
  17. package/package.json +1 -1
  18. package/CapActionBar/README.md +0 -11
  19. package/CapAdvancedIcon/README.md +0 -185
  20. package/CapAdvancedIcon/use-cases.md +0 -44
  21. package/CapAlert/README.md +0 -144
  22. package/CapAppNotEnabled/README.md +0 -84
  23. package/CapAskAira/README.md +0 -328
  24. package/CapBanner/README.md +0 -4
  25. package/CapBlock/README.md +0 -175
  26. package/CapBorderedBox/Status.md +0 -40
  27. package/CapCSVFileUploader/README.md +0 -124
  28. package/CapCSVFileUploader/Status.md +0 -47
  29. package/CapCard/README.md +0 -85
  30. package/CapCard/Status.md +0 -41
  31. package/CapCardBox/README.md +0 -169
  32. package/CapCardBox/Status.md +0 -52
  33. package/CapCarousel/README.md +0 -190
  34. package/CapCarousel/Status.md +0 -73
  35. package/CapCheckbox/README.md +0 -254
  36. package/CapCheckbox/Status.md +0 -41
  37. package/CapColorPicker/README.md +0 -112
  38. package/CapColorPicker/Status.md +0 -52
  39. package/CapColorPicker/tests/USE_CASES_ANALYSIS.md +0 -92
  40. package/CapColoredTag/README.md +0 -167
  41. package/CapColoredTag/Status.md +0 -49
  42. package/CapConditionPreview/MIGRATION_ANALYSIS.md +0 -70
  43. package/CapConditionPreview/README.md +0 -40
  44. package/CapConditionPreview/tests/USE_CASES_CapConditionPreview.md +0 -65
  45. package/CapCustomCard/README.md +0 -182
  46. package/CapCustomCard/Status.md +0 -40
  47. package/CapCustomCarousel/Status.md +0 -69
  48. package/CapCustomCheckboxList/README.md +0 -178
  49. package/CapCustomCheckboxList/Status.md +0 -52
  50. package/CapCustomCheckboxList/tests/USE_CASES_ANALYSIS.md +0 -174
  51. package/CapCustomList/README.md +0 -117
  52. package/CapCustomList/Status.md +0 -77
  53. package/CapCustomList/tests/USE_CASES_ANALYSIS.md +0 -124
  54. package/CapCustomSelect/README.md +0 -38
  55. package/CapDatePicker/README.md +0 -139
  56. package/CapDateRangePicker/README.md +0 -159
  57. package/CapDateTimePicker/README.md +0 -136
  58. package/CapDateTimeRangePicker/README.md +0 -243
  59. package/CapDivider/README.md +0 -122
  60. package/CapDrawer/README.md +0 -207
  61. package/CapDrawer/Status.md +0 -52
  62. package/CapDrawer/tests/MISSING_USE_CASES.md +0 -170
  63. package/CapDropdown/README.md +0 -515
  64. package/CapDropdown/Status.md +0 -45
  65. package/CapDropdown/tests/USE_CASES_ANALYSIS.md +0 -137
  66. package/CapError/README.md +0 -88
  67. package/CapErrorBoundary/CapErrorBoundary-use-cases.md +0 -89
  68. package/CapErrorBoundary/README.md +0 -150
  69. package/CapErrorStateIllustration/README.md +0 -222
  70. package/CapErrorStateIllustration/USE_CASES.md +0 -33
  71. package/CapExpressionEditor/README.md +0 -32
  72. package/CapForm/README.md +0 -132
  73. package/CapForm/Status.md +0 -40
  74. package/CapForm/tests/PHASE1_UNFULFILLED_USE_CASES.md +0 -113
  75. package/CapForm/tests/USE_CASES_ANALYSIS.md +0 -119
  76. package/CapFormItem/README.md +0 -320
  77. package/CapFormItem/Status.md +0 -73
  78. package/CapFormItem/tests/USE_CASES_ANALYSIS.md +0 -84
  79. package/CapGraph/README.md +0 -69
  80. package/CapGraph/USE_CASES.md +0 -66
  81. package/CapHamburgerMenu/README.md +0 -234
  82. package/CapHamburgerMenu/USE_CASES.md +0 -48
  83. package/CapHeader/Status.md +0 -41
  84. package/CapHeading/README.md +0 -220
  85. package/CapHeading/Status.md +0 -41
  86. package/CapIcon/README.md +0 -207
  87. package/CapIllustration/Status.md +0 -41
  88. package/CapImage/README.md +0 -50
  89. package/CapImportMFEComponent/README.md +0 -121
  90. package/CapInfoNote/Status.md +0 -40
  91. package/CapInfoNote/tests/USE_CASES_ANALYSIS.md +0 -114
  92. package/CapInput/README.md +0 -196
  93. package/CapInput/Status.md +0 -123
  94. package/CapInput/tests/USE_CASES_ANALYSIS.md +0 -169
  95. package/CapLanguageProvider/CapLanguageProvider-use-cases.md +0 -56
  96. package/CapLanguageProvider/README.md +0 -206
  97. package/CapLevelGraphRenderer/CapLevelGraphRenderer-test-cases.md +0 -50
  98. package/CapLevelGraphRenderer/README.md +0 -123
  99. package/CapLevelGraphRenderer/Tooltip_MIGRATION_ANALYSIS.md +0 -120
  100. package/CapLink/README.md +0 -203
  101. package/CapLink/Status.md +0 -32
  102. package/CapLink/tests/CapLink.missingUseCases.md +0 -95
  103. package/CapList/README.md +0 -129
  104. package/CapList/Status.md +0 -69
  105. package/CapListLayout/README.md +0 -7
  106. package/CapLogin/README.md +0 -7
  107. package/CapMenu/README.md +0 -86
  108. package/CapModal/README.md +0 -357
  109. package/CapModal/Status.md +0 -52
  110. package/CapModal/tests/USE_CASES_GAPS.md +0 -207
  111. package/CapMultiSelect/README.md +0 -170
  112. package/CapMultiSelect/tests/USE_CASES_ANALYSIS.md +0 -29
  113. package/CapMultiSelectDatePicker/README.md +0 -11
  114. package/CapNavigation/README.md +0 -72
  115. package/CapNotification/README.md +0 -228
  116. package/CapNotificationDropdown/README.md +0 -5
  117. package/CapPopover/README.md +0 -234
  118. package/CapProgress/Status.md +0 -40
  119. package/CapRadio/Status.md +0 -54
  120. package/CapRadioButton/README.md +0 -152
  121. package/CapRadioButton/Status.md +0 -70
  122. package/CapRadioButton/tests/USE_CASES_ANALYSIS.md +0 -120
  123. package/CapRadioCard/README.md +0 -161
  124. package/CapRadioCard/Status.md +0 -78
  125. package/CapRadioGroup/README.md +0 -141
  126. package/CapRadioGroup/Status.md +0 -59
  127. package/CapReorderComponent/README.md +0 -179
  128. package/CapReorderComponent/Status.md +0 -41
  129. package/CapRoadMap/README.md +0 -126
  130. package/CapRoadMap/Status.md +0 -53
  131. package/CapRoadMap/tests/USE_CASE_GAPS.md +0 -92
  132. package/CapRow/README.md +0 -424
  133. package/CapSKUUploader/README.md +0 -189
  134. package/CapSKUUploader/Status.md +0 -66
  135. package/CapSecondaryTopBar/README.md +0 -7
  136. package/CapSelect/README.md +0 -243
  137. package/CapSelectFilter/README.md +0 -121
  138. package/CapShape/README.md +0 -96
  139. package/CapShape/Status.md +0 -36
  140. package/CapShape/tests/USE_CASES_ANALYSIS.md +0 -120
  141. package/CapSideBar/README.md +0 -298
  142. package/CapSideBar/Status.md +0 -5
  143. package/CapSlideBox/README.md +0 -68
  144. package/CapSlider/README.md +0 -423
  145. package/CapSlider/Status.md +0 -48
  146. package/CapSlider/tests/TEST_COVERAGE.md +0 -118
  147. package/CapSnackBar/README.md +0 -222
  148. package/CapSnackBar/Status.md +0 -41
  149. package/CapSomethingWentWrong/README.md +0 -97
  150. package/CapSplit/README.md +0 -19
  151. package/CapStatisticCard/README.md +0 -138
  152. package/CapStatus/README.md +0 -148
  153. package/CapStatus/Status.md +0 -40
  154. package/CapSteps/Status.md +0 -40
  155. package/CapStepsAccordian/README.md +0 -305
  156. package/CapStepsAccordian/Status.md +0 -48
  157. package/CapSupportVideosWrapper/README.md +0 -14
  158. package/CapSwitch/README.md +0 -351
  159. package/CapTab/README.md +0 -406
  160. package/CapTab/Status.md +0 -104
  161. package/CapTab/tests/USE_CASE_GAPS.md +0 -143
  162. package/CapTabV3/ANALYSIS.md +0 -60
  163. package/CapTabV3/README.md +0 -156
  164. package/CapTabV3/Status.md +0 -52
  165. package/CapTabV3/tests/USE_CASE_GAPS.md +0 -149
  166. package/CapTable/README.md +0 -160
  167. package/CapTable/Status.md +0 -41
  168. package/CapTag/README.md +0 -16
  169. package/CapTagDropdown/README.md +0 -171
  170. package/CapTagDropdown/Status.md +0 -55
  171. package/CapTimePicker/README.md +0 -170
  172. package/CapTooltip/README.md +0 -336
  173. package/CapTooltipWithInfo/Status.md +0 -75
  174. package/CapTopBar/README.md +0 -146
  175. package/CapTree/README.md +0 -124
  176. package/CapTree/Status.md +0 -48
  177. package/CapTree/tests/STATUS.md +0 -154
  178. package/CapTreeSelect/README.md +0 -217
  179. package/CapTreeSelect/Status.md +0 -52
  180. package/CapTruncateList/README.md +0 -13
  181. package/CapUnifiedSelect/README.md +0 -40
  182. package/CapUploader/README.md +0 -313
  183. package/CapUploader/Status.md +0 -76
  184. package/CapUploader/tests/USE_CASES_ANALYSIS.md +0 -225
  185. package/CapUserProfile/README.md +0 -105
  186. package/CapUserProfile/Status.md +0 -95
  187. package/CapVirtualList/README.md +0 -162
  188. package/CapVirtualList/Status.md +0 -71
  189. package/assets/HOCs/ComponentWithLabelHOC/README.md +0 -230
@@ -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
@@ -1,243 +0,0 @@
1
- # CapDateTimeRangePicker
2
-
3
- Migrated from `cap-ui-library` (antd v3 + moment.js) to `blaze-ui` (antd v6 + dayjs).
4
-
5
- A comprehensive date and time range picker component with timezone support, locked date modes, and intelligent default time handling.
6
-
7
- ## Breaking Changes (v3 → v6)
8
-
9
- | v3 API | v6 API | Notes |
10
- |--------|--------|-------|
11
- | `dropdownClassName` | `popupClassName` | Backward compatible via fallback |
12
- | `getCalendarContainer` | `getPopupContainer` | Backward compatible via fallback |
13
- | `dateRender` | `cellRender` | Signature changed: `(current, info) => ReactNode` |
14
- | Moment.js values | Dayjs values | Auto-detected: moment values are converted internally |
15
- | `.ant-calendar-*` CSS classes | `.ant-picker-*` CSS classes | SCSS fully rewritten |
16
-
17
- ## Backward Compatibility
18
-
19
- | Deprecated Prop | Replacement | Fallback |
20
- |----------------|-------------|----------|
21
- | `dropdownClassName` | `popupClassName` | `popupClassName ?? dropdownClassName` |
22
- | `getCalendarContainer` | `getPopupContainer` | `getPopupContainer ?? getCalendarContainer` |
23
- | `dateRender` | `cellRender` | Legacy `dateRender` wrapped with capture handlers |
24
- | `dropdownStyle` | `popupStyle` | `popupStyle ?? dropdownStyle` |
25
-
26
- All deprecated props log a development-only console warning.
27
-
28
- ## Moment.js Compatibility
29
-
30
- The component auto-detects when consumers pass moment.js values:
31
- - Moment values in `value` prop are converted to dayjs internally
32
- - Results returned via `onChange` are converted back to moment format
33
-
34
- ## Props
35
-
36
- ### Core Props
37
-
38
- | Prop | Type | Default | Description |
39
- |------|------|---------|-------------|
40
- | `value` | `[DateValue, DateValue]` | `undefined` | Current date range value. Accepts Dayjs, Moment, or ISO strings. |
41
- | `onChange` | `(result: CapDateTimeRangePickerOnChangeResult) => void` | `() => {}` | Callback fired when the date range is confirmed. Returns `{ start, end, startTime, endTime }`. |
42
- | `timezone` | `string` | `'UTC'` | Timezone string (e.g., 'America/New_York'). All dates are converted to this timezone. |
43
- | `format` | `string` | `'DD-MM-YYYY \| HH:mm'` | Display format for the date/time string. |
44
- | `showTime` | `boolean \| Record<string, unknown>` | `{ format: 'HH:mm' }` | Whether to show time selection alongside dates. Can be an object with format options. |
45
- | `showNow` | `boolean` | `true` | Whether to show the "Now" button. Automatically disabled when dates are locked. |
46
- | `placeholder` | `[string, string]` | `['Start Date', 'End Date']` | Placeholder text as `[startPlaceholder, endPlaceholder]`. |
47
- | `className` | `string` | `undefined` | Additional class name for the picker input. |
48
- | `disabledDate` | `(current: dayjs.Dayjs) => boolean` | `() => false` | Function to determine if a date is disabled. |
49
- | `disabledTime` | `RangePickerProps['disabledTime']` | `undefined` | Function to determine if specific times are disabled. |
50
- | `disabledDateRanges` | `Array<{ start: DateValue; end: DateValue }>` | `undefined` | Array of disabled date ranges. Each range specifies a start and end date that should be disabled. |
51
-
52
- ### Locked Date Mode Props
53
-
54
- | Prop | Type | Default | Description |
55
- |------|------|---------|-------------|
56
- | `disableStartDate` | `boolean` | `false` | Whether the start date is locked and cannot be changed. Enables one-click range selection. |
57
- | `disableEndDate` | `boolean` | `false` | Whether the end date is locked and cannot be changed. Enables one-click range selection. |
58
- | `disabledStartDateText` | `string` | `'Start date is disabled...'` | Custom tooltip text when start date is disabled. |
59
- | `disabledEndDateText` | `string` | `'End date is disabled...'` | Custom tooltip text when end date is disabled. |
60
- | `disabledBothDatesText` | `string` | `'Both start and end dates are disabled'` | Custom tooltip text when both dates are disabled. |
61
-
62
- ### Customization Props
63
-
64
- | Prop | Type | Default | Description |
65
- |------|------|---------|-------------|
66
- | `cellRender` | `RangePickerProps['cellRender']` | `undefined` | Custom cell render function (v6 API). Signature: `(current, info) => ReactNode`. |
67
- | `suffixIcon` | `React.ReactNode` | `<CapIcon type="calendar" />` | Custom suffix icon for the picker input. |
68
- | `separator` | `React.ReactNode` | `<CapIcon type="forward-arrow" />` | Custom separator between start and end inputs. |
69
- | `popupClassName` | `string` | `undefined` | Custom class name for the popup/dropdown (v6 API). |
70
- | `popupStyle` | `React.CSSProperties` | `undefined` | Custom style for the popup/dropdown (v6 API). |
71
- | `getPopupContainer` | `(triggerNode: HTMLElement) => HTMLElement` | `undefined` | Function returning the container node for the popup (v6 API). |
72
- | `showTimezoneRow` | `boolean` | `true` | Whether to show the timezone row in the footer. |
73
- | `todayButtonText` | `string` | `'Today'` | Text for the Today button. |
74
- | `onTodaySelect` | `(dates: [dayjs.Dayjs, dayjs.Dayjs]) => void` | `() => {}` | Callback fired when the Today button is clicked. |
75
- | `allowClearSelection` | `boolean` | `true` | Whether to allow clearing the selection. |
76
- | `allowClearSelectionText` | `string` | `undefined` | Custom text for the clear selection button. |
77
-
78
- ### Deprecated Props
79
-
80
- | Prop | Type | Replacement | Notes |
81
- |------|------|-------------|-------|
82
- | `dropdownClassName` | `string` | `popupClassName` | Logs deprecation warning |
83
- | `dropdownStyle` | `React.CSSProperties` | `popupStyle` | Logs deprecation warning |
84
- | `getCalendarContainer` | `(triggerNode: HTMLElement) => HTMLElement` | `getPopupContainer` | Logs deprecation warning |
85
- | `dateRender` | `(current: dayjs.Dayjs) => React.ReactNode` | `cellRender` | Logs deprecation warning |
86
-
87
- ## Features
88
-
89
- ### Locked Date Modes
90
-
91
- When `disableStartDate` or `disableEndDate` is enabled, the component enters a locked date mode:
92
-
93
- - **One-click selection**: Clicking a date immediately selects the range (locked start + clicked end, or clicked start + locked end)
94
- - **Input focus management**: Automatically focuses the unlocked input and prevents interaction with the locked input
95
- - **Visual feedback**: Locked inputs are visually dimmed and show tooltips explaining the locked state
96
- - **Smart constraints**: Disabled dates are automatically adjusted based on locked dates (end cannot be before locked start, start cannot be after locked end)
97
- - **Today button**: Automatically adjusts to respect locked dates when selecting today's range
98
-
99
- ### Default Time Handling
100
-
101
- The component intelligently handles default times:
102
-
103
- - **Today's date**: If the selected start date is today, uses the current time instead of midnight
104
- - **Past dates**: Uses midnight (00:00:00) for start dates
105
- - **End dates**: Uses end of day (23:59:59) for end dates when different from start date
106
- - **Midnight detection**: Automatically detects when times are at midnight and applies appropriate defaults
107
-
108
- ### Timezone Support
109
-
110
- - All dates are converted to the specified `timezone`
111
- - Timezone label is displayed in the footer (can be hidden with `showTimezoneRow={false}`)
112
- - Format: `{timezone} (UTC{offset})` (e.g., "America/New_York (UTC-05:00)")
113
-
114
- ### onChange Result Shape
115
-
116
- The `onChange` callback receives an object with:
117
-
118
- ```typescript
119
- {
120
- start: dayjs.Dayjs | Moment | null; // Same type as input (auto-detected)
121
- end: dayjs.Dayjs | Moment | null; // Same type as input (auto-detected)
122
- startTime: string | null; // ISO string
123
- endTime: string | null; // ISO string
124
- }
125
- ```
126
-
127
- ## Non-Tokenizable Overrides
128
-
129
- The following antd class overrides use `:global` in `styles.scss` with `// OVERRIDE:` comments:
130
-
131
- | Override | Reason |
132
- |----------|--------|
133
- | `.ant-picker-ok { display: none }` | Component uses custom Confirm button |
134
- | `.ant-picker-now { display: none }` | Component uses custom Today button |
135
- | `.ant-picker-cell-inner { border-radius: 50% }` | Round date cells; no per-cell radius token |
136
- | `.ant-picker-cell-in-range` styling | Custom in-range appearance with rounded edges |
137
- | Month/year/decade panel selection colors | No dedicated panel selection color tokens |
138
- | Time panel `text-transform: capitalize` | No text-transform token |
139
- | Locked panel dimming (`.cap-cal-lock-start`, `.cap-cal-lock-end`) | Custom feature with no antd token support |
140
- | Footer layout (`display: contents`, flex) | Custom footer button arrangement |
141
-
142
- ## Design Tokens
143
-
144
- DatePicker tokens are configured in `getCapThemeConfig.ts`:
145
-
146
- ```typescript
147
- DatePicker: {
148
- colorTextPlaceholder: styledVars.CAP_G05,
149
- colorBorder: styledVars.CAP_G06,
150
- colorPrimaryHover: styledVars.CAP_G06,
151
- colorBgContainer: styledVars.CAP_WHITE,
152
- colorBgElevated: styledVars.CAP_WHITE,
153
- controlItemBgHover: styledVars.CAP_COLOR_08,
154
- colorTextDisabled: styledVars.CAP_G06,
155
- activeBorderColor: styledVars.CAP_G06,
156
- activeShadow: 'transparent',
157
- }
158
- ```
159
-
160
- ## Usage
161
-
162
- ### Basic Usage
163
-
164
- ```tsx
165
- import CapDateTimeRangePicker from 'blaze-ui/components/CapDateTimeRangePicker';
166
-
167
- <CapDateTimeRangePicker
168
- timezone="America/New_York"
169
- showTime={{ format: 'HH:mm' }}
170
- format="DD-MM-YYYY | HH:mm"
171
- onChange={({ start, end, startTime, endTime }) => {
172
- console.log(start, end, startTime, endTime);
173
- }}
174
- />
175
- ```
176
-
177
- ### Locked Start Date
178
-
179
- ```tsx
180
- <CapDateTimeRangePicker
181
- value={[lockedStartDate, null]}
182
- disableStartDate={true}
183
- timezone="UTC"
184
- onChange={({ start, end }) => {
185
- // start will always be lockedStartDate
186
- // end will be the selected date
187
- }}
188
- />
189
- ```
190
-
191
- ### Locked End Date
192
-
193
- ```tsx
194
- <CapDateTimeRangePicker
195
- value={[null, lockedEndDate]}
196
- disableEndDate={true}
197
- timezone="America/New_York"
198
- disabledEndDateText="End date is fixed"
199
- onChange={({ start, end }) => {
200
- // start will be the selected date
201
- // end will always be lockedEndDate
202
- }}
203
- />
204
- ```
205
-
206
- ### Custom Cell Rendering
207
-
208
- ```tsx
209
- <CapDateTimeRangePicker
210
- cellRender={(current, info) => {
211
- if (info.type === 'date') {
212
- // Custom rendering for date cells
213
- return <span className="custom-date">{current.date()}</span>;
214
- }
215
- return info.originNode;
216
- }}
217
- />
218
- ```
219
-
220
- ### Without Timezone Display
221
-
222
- ```tsx
223
- <CapDateTimeRangePicker
224
- showTimezoneRow={false}
225
- timezone="UTC"
226
- onChange={({ start, end }) => {
227
- // Timezone row hidden in footer
228
- }}
229
- />
230
- ```
231
-
232
- ### Custom Placeholders and Icons
233
-
234
- ```tsx
235
- <CapDateTimeRangePicker
236
- placeholder={['From', 'To']}
237
- suffixIcon={<CustomIcon />}
238
- separator={<span>→</span>}
239
- onChange={({ start, end }) => {
240
- // Custom UI elements
241
- }}
242
- />
243
- ```
@@ -1,122 +0,0 @@
1
- # CapDivider
2
-
3
- A divider component for separating content sections.
4
-
5
- ## Migration from cap-ui-library
6
-
7
- ### Summary of Changes
8
-
9
- CapDivider has been migrated from cap-ui-library to blaze-ui with minimal breaking changes. The component now uses Ant Design v6 APIs while maintaining backward compatibility with deprecated props.
10
-
11
- ### Prop Changes
12
-
13
- #### Renamed Props
14
- - None
15
-
16
- #### Deprecated Props (Still Supported)
17
- - `orientation="left"` → Maps to `orientation="start"` (deprecated, use `start` instead)
18
- - `orientation="right"` → Maps to `orientation="end"` (deprecated, use `end` instead)
19
-
20
- **Note:** Deprecated values (`left` and `right`) will show console warnings in development mode but continue to work for backward compatibility.
21
-
22
- #### New Props
23
- - `type` - Controls divider direction: `'horizontal' | 'vertical'` (maps to Ant Design's `orientation` prop)
24
- - `orientation` - Controls text alignment: `'start' | 'center' | 'end'` (maps to Ant Design's `titlePlacement` prop)
25
-
26
- ### API Changes
27
-
28
- #### Before (cap-ui-library)
29
- ```jsx
30
- import CapDivider from '@capillarytech/cap-ui-library/components/CapDivider';
31
-
32
- <CapDivider orientation="left">Text</CapDivider>
33
- ```
34
-
35
- #### After (blaze-ui)
36
- ```jsx
37
- import { CapDivider } from '@capillarytech/blaze-ui';
38
-
39
- // New API (recommended)
40
- <CapDivider orientation="start">Text</CapDivider>
41
-
42
- // Legacy API (still works, shows deprecation warning)
43
- <CapDivider orientation="left">Text</CapDivider>
44
- ```
45
-
46
- ### Behavioral Changes
47
-
48
- - **No breaking changes** - All existing functionality is preserved
49
- - Deprecated `orientation` values (`left`/`right`) are automatically mapped to their new equivalents (`start`/`end`)
50
- - Console warnings are shown in development mode when deprecated props are used
51
-
52
- ### Migration Steps for Consumers
53
-
54
- 1. **Update imports:**
55
- ```jsx
56
- // Old
57
- import CapDivider from '@capillarytech/cap-ui-library/components/CapDivider';
58
-
59
- // New
60
- import { CapDivider } from '@capillarytech/blaze-ui';
61
- ```
62
-
63
- 2. **Update deprecated prop values (optional, but recommended):**
64
- ```jsx
65
- // Old
66
- <CapDivider orientation="left">Text</CapDivider>
67
- <CapDivider orientation="right">Text</CapDivider>
68
-
69
- // New
70
- <CapDivider orientation="start">Text</CapDivider>
71
- <CapDivider orientation="end">Text</CapDivider>
72
- ```
73
-
74
- **Note:** The old values still work, but you'll see deprecation warnings in development.
75
-
76
- ### Code Examples
77
-
78
- #### Basic Usage
79
- ```jsx
80
- import { CapDivider } from '@capillarytech/blaze-ui';
81
-
82
- // Horizontal divider without text
83
- <CapDivider />
84
-
85
- // Horizontal divider with centered text
86
- <CapDivider>Section Title</CapDivider>
87
-
88
- // Horizontal divider with left-aligned text
89
- <CapDivider orientation="start">Left Text</CapDivider>
90
-
91
- // Horizontal divider with right-aligned text
92
- <CapDivider orientation="end">Right Text</CapDivider>
93
-
94
- // Vertical divider
95
- <CapDivider type="vertical" />
96
- ```
97
-
98
- #### With Custom Styling
99
- ```jsx
100
- <CapDivider className="custom-divider" style={{ margin: '2rem 0' }}>
101
- Custom Styled Divider
102
- </CapDivider>
103
- ```
104
-
105
- #### With Ant Design Props
106
- ```jsx
107
- <CapDivider dashed plain>
108
- Dashed Plain Divider
109
- </CapDivider>
110
- ```
111
-
112
- ### Import Examples
113
-
114
- ```tsx
115
- // Default import
116
- import { CapDivider } from '@capillarytech/blaze-ui';
117
-
118
- // With type import
119
- import { CapDivider } from '@capillarytech/blaze-ui';
120
- import type { CapDividerProps } from '@capillarytech/blaze-ui';
121
- ```
122
-