@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,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
-
@@ -1,207 +0,0 @@
1
- # CapDrawer
2
-
3
- A wrapper component around Ant Design's Drawer component that provides consistent styling and a simplified API for displaying drawer panels 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. Ant Design Drawer Component API Changes
12
-
13
- The following Ant Design `Drawer` component props have been deprecated in v6:
14
-
15
- | Ant Design Component | Deprecated Prop (v3/v5) | New Prop (v6) | Status | Migration Guide |
16
- |---------------------|-------------------------|---------------|--------|-----------------|
17
- | **Drawer** | `visible` | `open` | ⚠️ Deprecated | Replace `visible={...}` with `open={...}`. Backward compatibility maintained. |
18
- | **Drawer** | `onVisibleChange` | `onOpenChange` | ⚠️ Deprecated | Replace `onVisibleChange={...}` with `onOpenChange={...}`. Backward compatibility maintained. |
19
-
20
- **Example:**
21
- ```tsx
22
- // ❌ Deprecated (still works with warning)
23
- <CapDrawer visible={isOpen} onVisibleChange={setIsOpen} />
24
-
25
- // ✅ Recommended
26
- <CapDrawer open={isOpen} onOpenChange={setIsOpen} />
27
- ```
28
-
29
- ### Backward Compatibility
30
-
31
- The component maintains backward compatibility for deprecated Ant Design Drawer props:
32
-
33
- - **`visible` prop** (Ant Design Drawer): Still works but logs a deprecation warning in development. Use `open` instead.
34
- - **`onVisibleChange` prop** (Ant Design Drawer): Still works but logs a deprecation warning in development. Use `onOpenChange` instead.
35
-
36
- ### Style Changes
37
-
38
- **Approach**: The component uses Ant Design v6's Drawer component which applies styling through theme tokens. No custom SCSS overrides are needed for the drawer itself.
39
-
40
- **Note**: Consumer components like `CapTopBar` and `CapHamburgerMenu` may have their own drawer styling overrides, but these are handled within those components' stylesheets.
41
-
42
- ### Code Improvements
43
-
44
- 1. **TypeScript support**: Full TypeScript definitions with proper prop types
45
- 2. **Using deprecation warning utility**: Now uses `logDeprecationWarning` utility for consistent deprecation warnings
46
- 3. **Improved backward compatibility**: Deprecated props are mapped using nullish coalescing (`??`) for cleaner code
47
- 4. **Modern React patterns**: Uses functional component with React.FC
48
-
49
- ### What Stayed the Same
50
-
51
- - Custom `content` prop (maps to children)
52
- - Custom `size` prop for width presets (`'s'`, `'r'`, `'l'`)
53
- - Custom `width` prop for explicit width values
54
- - All other Ant Design Drawer props pass through unchanged
55
-
56
- ### What Changed
57
-
58
- - **Removed**: PropTypes (replaced with TypeScript)
59
- - **Updated**: Import from `antd` to `antd-v5`
60
- - **Added**: TypeScript type definitions in `types.ts`
61
- - **Added**: Deprecation warnings for `visible` and `onVisibleChange` props
62
-
63
- ## Props
64
-
65
- ### Standard Props
66
-
67
- All standard Ant Design Drawer props are supported. Refer to [Ant Design Drawer documentation](https://ant.design/components/drawer) for complete API reference.
68
-
69
- ### Custom Props
70
-
71
- | Prop | Type | Default | Description |
72
- |------|------|---------|-------------|
73
- | `content` | `ReactNode` | - | Content to display inside the drawer (maps to children) |
74
- | `width` | `number \| string` | `256` | Width of the drawer in pixels or CSS units |
75
- | `size` | `'s' \| 'r' \| 'l'` | - | Size preset: 's' = 25vw, 'r' = 50vw, 'l' = 75vw |
76
- | `open` | `boolean` | - | Controlled open state |
77
- | `defaultOpen` | `boolean` | `false` | Default open state (uncontrolled) |
78
- | `onOpenChange` | `(open: boolean) => void` | - | Callback when open state changes |
79
-
80
- ### Deprecated Props
81
-
82
- The following props are deprecated but still supported for backward compatibility. They will show console warnings in development mode and will be removed in v10.0.0.
83
-
84
- #### Ant Design Drawer Component Props
85
-
86
- | Deprecated Prop | Ant Design Component | Replacement | Migration Example |
87
- |----------------|---------------------|-------------|-------------------|
88
- | `visible` | **Drawer** | `open` | See example below |
89
- | `onVisibleChange` | **Drawer** | `onOpenChange` | See example below |
90
-
91
- **Migration Example:**
92
- ```tsx
93
- // Before (deprecated)
94
- <CapDrawer
95
- visible={isOpen}
96
- onVisibleChange={setIsOpen}
97
- title="Drawer"
98
- content={<div>Content</div>}
99
- />
100
-
101
- // After (recommended)
102
- <CapDrawer
103
- open={isOpen}
104
- onOpenChange={setIsOpen}
105
- title="Drawer"
106
- content={<div>Content</div>}
107
- />
108
- ```
109
-
110
- **Note:** The deprecated `visible` and `onVisibleChange` props are automatically mapped to `open` and `onOpenChange` internally. However, you should migrate to the new API to avoid future breaking changes.
111
-
112
- ## Examples
113
-
114
- ### Basic Usage
115
-
116
- ```tsx
117
- import { CapDrawer, CapButton } from '@capillarytech/blaze-ui';
118
- import { useState } from 'react';
119
-
120
- const MyComponent = () => {
121
- const [open, setOpen] = useState(false);
122
-
123
- return (
124
- <>
125
- <CapButton onClick={() => setOpen(true)}>Open Drawer</CapButton>
126
- <CapDrawer
127
- open={open}
128
- onOpenChange={setOpen}
129
- title="Drawer Title"
130
- content={<div>Drawer content goes here</div>}
131
- />
132
- </>
133
- );
134
- };
135
- ```
136
-
137
- ### Using Size Presets
138
-
139
- ```tsx
140
- <CapDrawer
141
- open={open}
142
- onOpenChange={setOpen}
143
- size="l" // 75vw width
144
- title="Large Drawer"
145
- content={<div>Content</div>}
146
- />
147
-
148
- <CapDrawer
149
- open={open}
150
- onOpenChange={setOpen}
151
- size="r" // 50vw width
152
- title="Regular Drawer"
153
- content={<div>Content</div>}
154
- />
155
-
156
- <CapDrawer
157
- open={open}
158
- onOpenChange={setOpen}
159
- size="s" // 25vw width
160
- title="Small Drawer"
161
- content={<div>Content</div>}
162
- />
163
- ```
164
-
165
- ### Custom Width
166
-
167
- ```tsx
168
- <CapDrawer
169
- open={open}
170
- onOpenChange={setOpen}
171
- width={400} // 400px
172
- title="Custom Width Drawer"
173
- content={<div>Content</div>}
174
- />
175
-
176
- <CapDrawer
177
- open={open}
178
- onOpenChange={setOpen}
179
- width="30vw" // 30% viewport width
180
- title="Viewport Width Drawer"
181
- content={<div>Content</div>}
182
- />
183
- ```
184
-
185
-
186
- ## TypeScript
187
-
188
- The component is fully typed with TypeScript. Import types as needed:
189
-
190
- ```tsx
191
- import type { CapDrawerProps } from '@capillarytech/blaze-ui';
192
-
193
- const MyDrawer: React.FC<CapDrawerProps> = (props) => {
194
- // ...
195
- };
196
- ```
197
-
198
- ## Related Components
199
-
200
- - `CapModal` - Modal dialog component
201
- - `CapPopover` - Popover component
202
- - `CapTooltip` - Tooltip component
203
-
204
- ## References
205
-
206
- - [Ant Design Drawer Documentation](https://ant.design/components/drawer)
207
- - [Ant Design Migration Guide](https://ant.design/docs/react/migration-v6)
@@ -1,52 +0,0 @@
1
- # Migration Status: CapDrawer
2
-
3
- **Last Updated**: 2026-02-06 02:24:50
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
- _No deprecated props verification results yet._
26
-
27
- **Note**: Step 2.5 is REQUIRED and enforced.
28
- - Focus: **Ant Design component prop changes** (e.g., Dropdown, Input, Alert, Tooltip, etc.)
29
- - Reference: MIGRATION_CHANGELOG_TEMPLATE.md for format, ANTD_V6_MIGRATION.md for Ant Design deprecated APIs
30
- - Skip: If original component doesn't exist in cap-ui-library
31
- - All deprecated Ant Design props and prop changes must be documented before proceeding.
32
-
33
- ## Visual Testing Results
34
-
35
- **Last Test**: 2026-02-06 02:24:50
36
- **Maximum Mismatch**: 0%
37
-
38
- ### Mismatched Variants:
39
- -
40
-
41
-
42
- ## CSS Fixes Applied
43
-
44
- **Date**: 2026-01-31 20:57:16
45
- **Summary**: CSS fixes applied based on visual testing analysis.
46
-
47
- _See full analysis in: `/Users/sarahkhader/repos/migration/blaze-ui/tools/visual-testing/report/CapDrawer/css-fix-analysis.md`_
48
-
49
-
50
- ## Notes
51
-
52
- _No notes yet._