@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.
- package/CapLanguageProvider/actions.js +125 -0
- package/CapLanguageProvider/actions.js.map +1 -0
- package/CapLanguageProvider/constants.js +37 -0
- package/CapLanguageProvider/constants.js.map +1 -0
- package/package.json +1 -1
- package/CapActionBar/README.md +0 -11
- package/CapAdvancedIcon/README.md +0 -185
- package/CapAdvancedIcon/use-cases.md +0 -44
- package/CapAlert/README.md +0 -144
- package/CapAppNotEnabled/README.md +0 -84
- package/CapAskAira/README.md +0 -328
- package/CapBanner/README.md +0 -4
- package/CapBlock/README.md +0 -175
- package/CapBorderedBox/Status.md +0 -40
- package/CapCSVFileUploader/README.md +0 -124
- package/CapCSVFileUploader/Status.md +0 -47
- package/CapCard/README.md +0 -85
- package/CapCard/Status.md +0 -41
- package/CapCardBox/README.md +0 -169
- package/CapCardBox/Status.md +0 -52
- package/CapCarousel/README.md +0 -190
- package/CapCarousel/Status.md +0 -73
- package/CapCheckbox/README.md +0 -254
- package/CapCheckbox/Status.md +0 -41
- package/CapColorPicker/README.md +0 -112
- package/CapColorPicker/Status.md +0 -52
- package/CapColorPicker/tests/USE_CASES_ANALYSIS.md +0 -92
- package/CapColoredTag/README.md +0 -167
- package/CapColoredTag/Status.md +0 -49
- package/CapConditionPreview/MIGRATION_ANALYSIS.md +0 -70
- package/CapConditionPreview/README.md +0 -40
- package/CapConditionPreview/tests/USE_CASES_CapConditionPreview.md +0 -65
- package/CapCustomCard/README.md +0 -182
- package/CapCustomCard/Status.md +0 -40
- package/CapCustomCarousel/Status.md +0 -69
- package/CapCustomCheckboxList/README.md +0 -178
- package/CapCustomCheckboxList/Status.md +0 -52
- package/CapCustomCheckboxList/tests/USE_CASES_ANALYSIS.md +0 -174
- package/CapCustomList/README.md +0 -117
- package/CapCustomList/Status.md +0 -77
- package/CapCustomList/tests/USE_CASES_ANALYSIS.md +0 -124
- package/CapCustomSelect/README.md +0 -38
- package/CapDatePicker/README.md +0 -139
- package/CapDateRangePicker/README.md +0 -159
- package/CapDateTimePicker/README.md +0 -136
- package/CapDateTimeRangePicker/README.md +0 -243
- package/CapDivider/README.md +0 -122
- package/CapDrawer/README.md +0 -207
- package/CapDrawer/Status.md +0 -52
- package/CapDrawer/tests/MISSING_USE_CASES.md +0 -170
- package/CapDropdown/README.md +0 -515
- package/CapDropdown/Status.md +0 -45
- package/CapDropdown/tests/USE_CASES_ANALYSIS.md +0 -137
- package/CapError/README.md +0 -88
- package/CapErrorBoundary/CapErrorBoundary-use-cases.md +0 -89
- package/CapErrorBoundary/README.md +0 -150
- package/CapErrorStateIllustration/README.md +0 -222
- package/CapErrorStateIllustration/USE_CASES.md +0 -33
- package/CapExpressionEditor/README.md +0 -32
- package/CapForm/README.md +0 -132
- package/CapForm/Status.md +0 -40
- package/CapForm/tests/PHASE1_UNFULFILLED_USE_CASES.md +0 -113
- package/CapForm/tests/USE_CASES_ANALYSIS.md +0 -119
- package/CapFormItem/README.md +0 -320
- package/CapFormItem/Status.md +0 -73
- package/CapFormItem/tests/USE_CASES_ANALYSIS.md +0 -84
- package/CapGraph/README.md +0 -69
- package/CapGraph/USE_CASES.md +0 -66
- package/CapHamburgerMenu/README.md +0 -234
- package/CapHamburgerMenu/USE_CASES.md +0 -48
- package/CapHeader/Status.md +0 -41
- package/CapHeading/README.md +0 -220
- package/CapHeading/Status.md +0 -41
- package/CapIcon/README.md +0 -207
- package/CapIllustration/Status.md +0 -41
- package/CapImage/README.md +0 -50
- package/CapImportMFEComponent/README.md +0 -121
- package/CapInfoNote/Status.md +0 -40
- package/CapInfoNote/tests/USE_CASES_ANALYSIS.md +0 -114
- package/CapInput/README.md +0 -196
- package/CapInput/Status.md +0 -123
- package/CapInput/tests/USE_CASES_ANALYSIS.md +0 -169
- package/CapLanguageProvider/CapLanguageProvider-use-cases.md +0 -56
- package/CapLanguageProvider/README.md +0 -206
- package/CapLevelGraphRenderer/CapLevelGraphRenderer-test-cases.md +0 -50
- package/CapLevelGraphRenderer/README.md +0 -123
- package/CapLevelGraphRenderer/Tooltip_MIGRATION_ANALYSIS.md +0 -120
- package/CapLink/README.md +0 -203
- package/CapLink/Status.md +0 -32
- package/CapLink/tests/CapLink.missingUseCases.md +0 -95
- package/CapList/README.md +0 -129
- package/CapList/Status.md +0 -69
- package/CapListLayout/README.md +0 -7
- package/CapLogin/README.md +0 -7
- package/CapMenu/README.md +0 -86
- package/CapModal/README.md +0 -357
- package/CapModal/Status.md +0 -52
- package/CapModal/tests/USE_CASES_GAPS.md +0 -207
- package/CapMultiSelect/README.md +0 -170
- package/CapMultiSelect/tests/USE_CASES_ANALYSIS.md +0 -29
- package/CapMultiSelectDatePicker/README.md +0 -11
- package/CapNavigation/README.md +0 -72
- package/CapNotification/README.md +0 -228
- package/CapNotificationDropdown/README.md +0 -5
- package/CapPopover/README.md +0 -234
- package/CapProgress/Status.md +0 -40
- package/CapRadio/Status.md +0 -54
- package/CapRadioButton/README.md +0 -152
- package/CapRadioButton/Status.md +0 -70
- package/CapRadioButton/tests/USE_CASES_ANALYSIS.md +0 -120
- package/CapRadioCard/README.md +0 -161
- package/CapRadioCard/Status.md +0 -78
- package/CapRadioGroup/README.md +0 -141
- package/CapRadioGroup/Status.md +0 -59
- package/CapReorderComponent/README.md +0 -179
- package/CapReorderComponent/Status.md +0 -41
- package/CapRoadMap/README.md +0 -126
- package/CapRoadMap/Status.md +0 -53
- package/CapRoadMap/tests/USE_CASE_GAPS.md +0 -92
- package/CapRow/README.md +0 -424
- package/CapSKUUploader/README.md +0 -189
- package/CapSKUUploader/Status.md +0 -66
- package/CapSecondaryTopBar/README.md +0 -7
- package/CapSelect/README.md +0 -243
- package/CapSelectFilter/README.md +0 -121
- package/CapShape/README.md +0 -96
- package/CapShape/Status.md +0 -36
- package/CapShape/tests/USE_CASES_ANALYSIS.md +0 -120
- package/CapSideBar/README.md +0 -298
- package/CapSideBar/Status.md +0 -5
- package/CapSlideBox/README.md +0 -68
- package/CapSlider/README.md +0 -423
- package/CapSlider/Status.md +0 -48
- package/CapSlider/tests/TEST_COVERAGE.md +0 -118
- package/CapSnackBar/README.md +0 -222
- package/CapSnackBar/Status.md +0 -41
- package/CapSomethingWentWrong/README.md +0 -97
- package/CapSplit/README.md +0 -19
- package/CapStatisticCard/README.md +0 -138
- package/CapStatus/README.md +0 -148
- package/CapStatus/Status.md +0 -40
- package/CapSteps/Status.md +0 -40
- package/CapStepsAccordian/README.md +0 -305
- package/CapStepsAccordian/Status.md +0 -48
- package/CapSupportVideosWrapper/README.md +0 -14
- package/CapSwitch/README.md +0 -351
- package/CapTab/README.md +0 -406
- package/CapTab/Status.md +0 -104
- package/CapTab/tests/USE_CASE_GAPS.md +0 -143
- package/CapTabV3/ANALYSIS.md +0 -60
- package/CapTabV3/README.md +0 -156
- package/CapTabV3/Status.md +0 -52
- package/CapTabV3/tests/USE_CASE_GAPS.md +0 -149
- package/CapTable/README.md +0 -160
- package/CapTable/Status.md +0 -41
- package/CapTag/README.md +0 -16
- package/CapTagDropdown/README.md +0 -171
- package/CapTagDropdown/Status.md +0 -55
- package/CapTimePicker/README.md +0 -170
- package/CapTooltip/README.md +0 -336
- package/CapTooltipWithInfo/Status.md +0 -75
- package/CapTopBar/README.md +0 -146
- package/CapTree/README.md +0 -124
- package/CapTree/Status.md +0 -48
- package/CapTree/tests/STATUS.md +0 -154
- package/CapTreeSelect/README.md +0 -217
- package/CapTreeSelect/Status.md +0 -52
- package/CapTruncateList/README.md +0 -13
- package/CapUnifiedSelect/README.md +0 -40
- package/CapUploader/README.md +0 -313
- package/CapUploader/Status.md +0 -76
- package/CapUploader/tests/USE_CASES_ANALYSIS.md +0 -225
- package/CapUserProfile/README.md +0 -105
- package/CapUserProfile/Status.md +0 -95
- package/CapVirtualList/README.md +0 -162
- package/CapVirtualList/Status.md +0 -71
- package/assets/HOCs/ComponentWithLabelHOC/README.md +0 -230
|
@@ -1,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
|
-
```
|
package/CapDivider/README.md
DELETED
|
@@ -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
|
-
|
package/CapDrawer/README.md
DELETED
|
@@ -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)
|
package/CapDrawer/Status.md
DELETED
|
@@ -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._
|