@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,88 +0,0 @@
1
- # CapError
2
-
3
- A simple text component for displaying error and warning messages.
4
-
5
- ## Migration from cap-ui-library to blaze-ui
6
-
7
- ### Summary of Changes
8
-
9
- - **Styled-components → SCSS Modules**: Converted from styled-components to SCSS modules for better performance and maintainability
10
- - **TypeScript**: Added full TypeScript support with proper type definitions
11
- - **Functional Component**: Migrated to functional component with React.forwardRef
12
- - **Prop Types**: Replaced PropTypes with TypeScript interfaces
13
- - **Accessibility**: Added ref forwarding for better accessibility support
14
-
15
- ### Props
16
-
17
- | Prop | Type | Default | Description |
18
- |------|------|---------|-------------|
19
- | `children` | `React.ReactNode` | - | Content to display |
20
- | `type` | `'error' \| 'warning'` | `'error'` | Type of message (controls color) |
21
- | `className` | `string` | `''` | Additional CSS classes |
22
- | `style` | `React.CSSProperties` | `{}` | Inline styles |
23
-
24
- ### Breaking Changes
25
-
26
- **No breaking changes from cap-ui-library v8.x**
27
-
28
- All existing props and behaviors are maintained. The API remains identical.
29
-
30
- ### Behavioral Changes
31
-
32
- - Colors are now defined using SCSS variables for consistency
33
- - Component now supports ref forwarding
34
- - TypeScript support provides better type safety
35
-
36
- ### Usage
37
-
38
- #### Basic Usage
39
-
40
- ```tsx
41
- import { CapError } from '@capillarytech/blaze-ui';
42
-
43
- // Error message (default)
44
- <CapError>This is an error message</CapError>
45
-
46
- // Warning message
47
- <CapError type="warning">This is a warning message</CapError>
48
-
49
- // Inline error message
50
- <CapError.CapErrorInline>Inline error</CapError.CapErrorInline>
51
-
52
- // Inline warning message
53
- <CapError.CapErrorInline type="warning">Inline warning</CapError.CapErrorInline>
54
- ```
55
-
56
- #### With Custom Styling
57
-
58
- ```tsx
59
- <CapError className="my-custom-class" style={{ marginTop: '10px' }}>
60
- Custom styled error
61
- </CapError>
62
- ```
63
-
64
- #### With Ref
65
-
66
- ```tsx
67
- const errorRef = useRef<HTMLDivElement>(null);
68
-
69
- <CapError ref={errorRef}>Error with ref</CapError>
70
- ```
71
-
72
- ### Import Examples
73
-
74
- ```tsx
75
- // Named import (recommended)
76
- import { CapError } from '@capillarytech/blaze-ui';
77
-
78
- // With types
79
- import { CapError, CapErrorProps, CapErrorInlineProps } from '@capillarytech/blaze-ui';
80
- ```
81
-
82
- ## Styling
83
-
84
- The component uses two color variables:
85
- - **Error**: `$cap-red` (#ea213a)
86
- - **Warning**: `$cap-orange` (#f87d23)
87
-
88
- Font size is set to `$font-size-s` (0.857rem / 12px) with a line height of 1.429rem (20px).
@@ -1,89 +0,0 @@
1
- # Test Cases: CapErrorBoundary (Antd v3→v6)
2
-
3
- ## Role
4
- Senior frontend engineer documenting ESSENTIAL test cases for Storybook stories and migration validation.
5
-
6
- ## Input
7
- - **Component**: CapErrorBoundary
8
- - **Complexity**: medium (≤20 test cases)
9
- - **Source**: blaze-ui/components/CapErrorBoundary/
10
-
11
- ---
12
-
13
- ## Google Sheets Output
14
-
15
- **Spreadsheet ID**: `1Xt8l8Q6Hw0cUYV65SlGvGcPnOtzprr0fukDR9UWJ3kg`
16
- **Tab**: CapErrorBoundary
17
-
18
- ### Steps
19
- 1. Check connection: `COMPOSIO_CHECK_ACTIVE_CONNECTION` toolkit="googlesheets"
20
- 2. Create tab: `GOOGLESHEETS_ADD_SHEET`
21
- ```json
22
- {
23
- "spreadsheetId": "1Xt8l8Q6Hw0cUYV65SlGvGcPnOtzprr0fukDR9UWJ3kg",
24
- "properties": {
25
- "title": "CapErrorBoundary",
26
- "gridProperties": {"rowCount": 100, "columnCount": 6}
27
- }
28
- }
29
- ```
30
- 3. Write data: `GOOGLESHEETS_VALUES_UPDATE`
31
- ```json
32
- {
33
- "spreadsheet_id": "1Xt8l8Q6Hw0cUYV65SlGvGcPnOtzprr0fukDR9UWJ3kg",
34
- "range": "CapErrorBoundary!A1",
35
- "value_input_option": "USER_ENTERED",
36
- "values": [
37
- ["ID", "Use Case", "Props/Config", "Expected Visual/Behavior", "Priority", "Storybook Story", "Notes"],
38
- ["UC-001", "React ErrorBoundary mode: child throws", "children (component that throws), useSlideBox: false/true", "Error boundary catches; fallbackRender runs; errorHandler(error) called; error illustration shows inline or inside CapSlideBox per useSlideBox", "P0", "ReactErrorBoundaryMode", "Core ErrorBoundary behavior"],
39
- ["UC-002", "API error boundary mode", "isApiErrorBoundary: true, isApiError: true | false", "When isApiError true: error illustration only. When false: children render. No ErrorBoundary when isApiErrorBoundary", "P0", "ApiErrorBoundaryMode", "Grouped isApiErrorBoundary + isApiError"],
40
- ["UC-003", "SlideBox vs inline fallback", "useSlideBox: true | false, slideBoxProps (e.g. className)", "useSlideBox true: fallback in CapSlideBox with show, content, handleClose, slideBoxProps spread. false: inline illustration only", "P0", "SlideBoxVsInline", "Grouped useSlideBox and slideBoxProps"],
41
- ["UC-004", "Boolean and config variants", "showIllustrationImage, showAnimation, isExpired, refreshThreshold (e.g. 3, 1, 0)", "Image show/hide; animation class when showAnimation; isExpired or refreshCount >= refreshThreshold sets isRefreshExpired on illustration", "P1", "ConfigVariants", "Grouped boolean/config visual state"],
42
- ["UC-005", "Content props (copy and slots)", "refreshText, expiryTitle, refreshTitle, expiryDescription (string or node); prefix, suffix", "All text passed to illustration; prefix/suffix render before/after in same row", "P1", "ContentProps", "Grouped content and prefix/suffix"],
43
- ["UC-006", "Refresh interaction and expiry", "onRefreshClick, refreshThreshold, isApiErrorBoundary: false", "Click refresh → onRefreshClick called, refreshCount increments; refreshCount === refreshThreshold → isRefreshExpired; key updates so ErrorBoundary remounts", "P1", "RefreshInteraction", "Grouped click and threshold/remount"],
44
- ["UC-007", "SlideBox close interaction", "useSlideBox: true, onCloseSlideBox", "Closing slide box calls onCloseSlideBox; handleClose wired correctly", "P1", "SlideBoxClose", "Single interaction test"],
45
- ["UC-008", "Event handlers invoked", "errorHandler, onRefreshClick, onCloseSlideBox", "errorHandler called with error in fallbackRender; onRefreshClick on refresh; onCloseSlideBox when slide box closed", "P1", "EventHandlers", "Grouped all handler invocations"],
46
- ["UC-009", "Styling (className and slideBoxProps)", "className, slideBoxProps: { className }", "className on illustration container; slideBoxProps spread to CapSlideBox including className", "P2", "Styling", "Grouped className + slideBoxProps"],
47
- ["UC-010", "Default props and minimal usage", "No optional props (or only children)", "Defaults apply; component renders without error", "P1", "DefaultProps", "Sanity with defaults"],
48
- ["UC-011", "Edge: refreshThreshold 0 or 1", "refreshThreshold: 0 | 1, trigger refresh", "Expired state after 0 or 1 refresh click; no crash", "P2", "EdgeRefreshThreshold", "Production edge for quick expiry"],
49
- ["UC-012", "Edge: children null or valid content", "children: null | valid React node", "null children don't throw; valid children render until throw. API mode: children when isApiError false", "P2", "EdgeChildren", "Grouped empty/valid children"]
50
- ]
51
- }
52
- }
53
- ```
54
-
55
- ---
56
-
57
- ## Use Cases Table
58
-
59
- | ID | Use Case | Props/Config | Expected Visual/Behavior | Priority | Storybook Story | Notes |
60
- |----|----------|---------------|--------------------------|----------|-----------------|--------|
61
- | UC-001 | React ErrorBoundary mode: child throws | children (component that throws), useSlideBox: false/true | Error boundary catches; fallbackRender runs; errorHandler(error) called; error illustration shows inline or inside CapSlideBox per useSlideBox | P0 | ReactErrorBoundaryMode | Core ErrorBoundary behavior |
62
- | UC-002 | API error boundary mode | isApiErrorBoundary: true, isApiError: true \| false | When isApiError true: error illustration only (no ErrorBoundary wrapper). When false: children render. No ErrorBoundary when isApiErrorBoundary | P0 | ApiErrorBoundaryMode | Grouped isApiErrorBoundary + isApiError |
63
- | UC-003 | SlideBox vs inline fallback | useSlideBox: true \| false, slideBoxProps (e.g. className) | useSlideBox true: fallback in CapSlideBox with show, content, handleClose, slideBoxProps spread. false: fallback is inline illustration only | P0 | SlideBoxVsInline | Grouped useSlideBox and slideBoxProps usage |
64
- | UC-004 | Boolean and config variants | showIllustrationImage, showAnimation, isExpired, refreshThreshold (e.g. 3, 1, 0) | Illustration shows/hides image; animation class applied when showAnimation; isExpired or refreshCount >= refreshThreshold sets isRefreshExpired on CapErrorStateIllustration | P1 | ConfigVariants | Grouped all boolean/config that affect visual state |
65
- | UC-005 | Content props (copy and slots) | refreshText, expiryTitle, refreshTitle, expiryDescription (string or node); prefix, suffix | All text/copy passed to CapErrorStateIllustration; prefix/suffix render before/after illustration in same row | P1 | ContentProps | Grouped all content and prefix/suffix |
66
- | UC-006 | Refresh interaction and expiry | onRefreshClick, refreshThreshold, isApiErrorBoundary: false | Click refresh → onRefreshClick called, refreshCount increments; when refreshCount === refreshThreshold, isRefreshExpired true (expired state). When !isApiErrorBoundary, key updates so ErrorBoundary remounts | P1 | RefreshInteraction | Grouped click behavior and threshold/remount |
67
- | UC-007 | SlideBox close interaction | useSlideBox: true, onCloseSlideBox | Closing slide box calls onCloseSlideBox; handleClose wired to onCloseSlideBox | P1 | SlideBoxClose | Single interaction test |
68
- | UC-008 | Event handlers invoked | errorHandler, onRefreshClick, onCloseSlideBox | errorHandler called with error object in fallbackRender; onRefreshClick on refresh; onCloseSlideBox when slide box closed | P1 | EventHandlers | Grouped all handler invocations |
69
- | UC-009 | Styling (className and slideBoxProps) | className, slideBoxProps: { className } | className on illustration container (CapRow); slideBoxProps spread to CapSlideBox including className for slide box | P2 | Styling | Grouped className + slideBoxProps styling |
70
- | UC-010 | Default props and minimal usage | No optional props (or only children) | Defaults: empty strings for text, refreshThreshold 3, showIllustrationImage true, showAnimation true, useSlideBox false, isApiErrorBoundary false; component renders without error | P1 | DefaultProps | Sanity with defaults |
71
- | UC-011 | Edge: refreshThreshold 0 or 1 | refreshThreshold: 0 \| 1, trigger refresh | Expired state (isRefreshExpired) after 0 or 1 refresh click; no crash | P2 | EdgeRefreshThreshold | Production edge for quick expiry |
72
- | UC-012 | Edge: children null or valid content | children: null \| valid React node | With React ErrorBoundary: null children don’t throw; valid children render until throw. With API mode: children render when isApiError false | P2 | EdgeChildren | Grouped empty/valid children |
73
-
74
- ---
75
-
76
- ## Summary
77
-
78
- - **Total use cases**: 12 (within medium limit of 20).
79
- - **Grouping**: Config/boolean variants, content props, event handlers, styling, and edge cases each combined into single tests.
80
- - **P0**: React vs API mode, SlideBox vs inline (3). **P1**: Config, content, refresh/slide interactions, handlers, defaults (6). **P2**: Styling, refreshThreshold edge, children edge (3).
81
- - **Storybook stories**: ReactErrorBoundaryMode, ApiErrorBoundaryMode, SlideBoxVsInline, ConfigVariants, ContentProps, RefreshInteraction, SlideBoxClose, EventHandlers, Styling, DefaultProps, EdgeRefreshThreshold, EdgeChildren.
82
-
83
- ## Test Implementation Notes
84
-
85
- - Use **React Testing Library** with **Jest**.
86
- - Prefer `data-testid` for querying (add to component if needed).
87
- - Clear mocks between tests where applicable.
88
- - Do **not** mock Cap UI components (e.g. CapErrorStateIllustration, CapSlideBox, CapRow) unless instructed.
89
- - Avoid relying on getByRole where avoidable; keep tests focused and not overly complex.
@@ -1,150 +0,0 @@
1
- # CapErrorBoundary
2
-
3
- A wrapper component that provides error boundary functionality for React applications, catching JavaScript errors anywhere in the child component tree and displaying a fallback UI.
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
- **None** - The component maintains full backward compatibility. No API changes were made.
12
-
13
- ### Style Changes
14
-
15
- **Approach**: The component now uses CSS Modules with the `styles[classname]` pattern instead of global class names. All styling remains functionally identical.
16
-
17
- ### Code Improvements
18
-
19
- 1. **Removed PropTypes**: Replaced with TypeScript types from `types.ts`
20
- 2. **Removed defaultProps**: Converted to default parameters in function arguments
21
- 3. **TypeScript support**: Full TypeScript type definitions with proper types
22
- 4. **CSS Modules**: Using `styles[classname]` pattern for scoped styling
23
-
24
- ### What Stayed the Same
25
-
26
- - All component props and behavior
27
- - Error boundary functionality (React ErrorBoundary mode)
28
- - API error boundary mode (`isApiErrorBoundary` prop)
29
- - Slide box vs inline fallback rendering
30
- - Refresh threshold and expiry logic
31
- - Animation support
32
- - Prefix/suffix content slots
33
- - All event handlers
34
-
35
- ### What Changed
36
-
37
- - **Removed**: `PropTypes` (replaced with TypeScript types)
38
- - **Removed**: `defaultProps` (replaced with default parameters)
39
- - **Updated**: CSS class names now use CSS Modules pattern
40
- - **Added**: TypeScript type definitions in `types.ts`
41
- - **Added**: CSS Modules for scoped styling
42
-
43
- ## Usage
44
-
45
- ### Basic Usage (React ErrorBoundary Mode)
46
-
47
- ```tsx
48
- import CapErrorBoundary from '@capillarytech/blaze-ui/components/CapErrorBoundary';
49
-
50
- function App() {
51
- return (
52
- <CapErrorBoundary>
53
- <YourComponent />
54
- </CapErrorBoundary>
55
- );
56
- }
57
- ```
58
-
59
- ### With Custom Error Handler
60
-
61
- ```tsx
62
- <CapErrorBoundary
63
- errorHandler={(error) => {
64
- console.error('Error caught:', error);
65
- // Send to error tracking service
66
- }}
67
- >
68
- <YourComponent />
69
- </CapErrorBoundary>
70
- ```
71
-
72
- ### API Error Boundary Mode
73
-
74
- ```tsx
75
- <CapErrorBoundary
76
- isApiErrorBoundary
77
- isApiError={hasApiError}
78
- >
79
- <YourComponent />
80
- </CapErrorBoundary>
81
- ```
82
-
83
- ### With Slide Box
84
-
85
- ```tsx
86
- <CapErrorBoundary
87
- useSlideBox
88
- onCloseSlideBox={() => {
89
- console.log('Slide box closed');
90
- }}
91
- >
92
- <YourComponent />
93
- </CapErrorBoundary>
94
- ```
95
-
96
- ### With Custom Content
97
-
98
- ```tsx
99
- <CapErrorBoundary
100
- refreshText="Try Again"
101
- refreshTitle="Something went wrong"
102
- expiryTitle="Refresh limit reached"
103
- expiryDescription="Please contact support"
104
- prefix={<CustomHeader />}
105
- suffix={<CustomFooter />}
106
- >
107
- <YourComponent />
108
- </CapErrorBoundary>
109
- ```
110
-
111
- ## Props
112
-
113
- | Prop | Type | Default | Description |
114
- |------|------|---------|-------------|
115
- | `children` | `React.ReactNode` | - | Child components to wrap with error boundary |
116
- | `className` | `string` | `''` | Additional CSS class name |
117
- | `isExpired` | `boolean` | `false` | Whether the refresh action has expired |
118
- | `isApiError` | `boolean` | `false` | Whether to show API error state (only used when `isApiErrorBoundary` is true) |
119
- | `refreshText` | `string \| React.ReactNode` | `''` | Text to display for refresh action |
120
- | `expiryTitle` | `string \| React.ReactNode` | `''` | Title to display when refresh has expired |
121
- | `refreshTitle` | `string \| React.ReactNode` | `''` | Title to display for refresh action |
122
- | `useSlideBox` | `boolean` | `false` | Whether to display error in a slide box instead of inline |
123
- | `errorHandler` | `(error: Error) => void` | `() => {}` | Handler called when an error is caught |
124
- | `slideBoxProps` | `Record<string, unknown>` | `{}` | Props to pass to CapSlideBox when `useSlideBox` is true |
125
- | `onRefreshClick` | `() => void` | `() => {}` | Handler called when refresh button is clicked |
126
- | `onCloseSlideBox` | `() => void` | `() => {}` | Handler called when slide box is closed |
127
- | `refreshThreshold` | `number` | `3` | Number of refresh clicks before showing expired state |
128
- | `expiryDescription` | `string \| React.ReactNode` | `''` | Description to display when refresh has expired |
129
- | `isApiErrorBoundary` | `boolean` | `false` | Whether to use API error boundary mode (shows error based on `isApiError` prop instead of catching React errors) |
130
- | `showIllustrationImage` | `boolean` | `true` | Whether to show illustration image |
131
- | `prefix` | `string \| React.ReactNode` | `''` | Content to render before the error illustration |
132
- | `suffix` | `string \| React.ReactNode` | `''` | Content to render after the error illustration |
133
- | `showAnimation` | `boolean` | `true` | Whether to show animation when error illustration appears |
134
-
135
- ## Modes
136
-
137
- ### React ErrorBoundary Mode (Default)
138
-
139
- When `isApiErrorBoundary` is `false` (default), the component wraps children with React's `ErrorBoundary` from `react-error-boundary`. This catches JavaScript errors during rendering, in lifecycle methods, and in constructors of the whole tree below.
140
-
141
- ### API Error Boundary Mode
142
-
143
- When `isApiErrorBoundary` is `true`, the component does not use React's ErrorBoundary. Instead, it conditionally renders the error illustration based on the `isApiError` prop. This is useful for handling API errors that don't cause React component errors.
144
-
145
- ## Notes
146
-
147
- - The component uses `react-error-boundary` library for React error boundary functionality
148
- - When refresh is clicked in React ErrorBoundary mode, the component remounts the ErrorBoundary by updating its key
149
- - The refresh count is tracked internally and compared against `refreshThreshold` to determine expired state
150
- - All additional props passed to `CapErrorBoundary` are spread to `CapErrorStateIllustration`
@@ -1,222 +0,0 @@
1
- # CapErrorStateIllustration Migration Documentation
2
-
3
- ## Summary
4
-
5
- `CapErrorStateIllustration` has been migrated from `@capillarytech/cap-ui-library` (Ant Design v3) to `@capillarytech/blaze-ui` (Ant Design v6). The component displays error state illustrations with optional refresh functionality or expiry messages.
6
-
7
- ## Migration Changes
8
-
9
- ### Component Structure
10
-
11
- **Before (cap-ui-library):**
12
- - Used PropTypes for runtime type checking
13
- - Used defaultProps for default values
14
- - Used styled-components for styling
15
- - Function component with destructuring
16
-
17
- **After (blaze-ui):**
18
- - TypeScript types from `types.ts` (no PropTypes)
19
- - Default values in function argument destructuring (no defaultProps)
20
- - CSS Modules with SCSS (no styled-components)
21
- - Functional component with React.FC type
22
-
23
- ## Props
24
-
25
- ### Props Comparison
26
-
27
- | Prop | cap-ui-library | blaze-ui | Status |
28
- |------|----------------|----------|--------|
29
- | `showImage` | ✅ | ✅ | **Unchanged** |
30
- | `className` | ✅ | ✅ | **Unchanged** |
31
- | `refreshText` | ✅ | ✅ | **Unchanged** |
32
- | `expiryTitle` | ✅ | ✅ | **Unchanged** |
33
- | `refreshTitle` | ✅ | ✅ | **Unchanged** |
34
- | `onRefreshClick` | ✅ | ✅ | **Unchanged** |
35
- | `isRefreshExpired` | ✅ | ✅ | **Unchanged** |
36
- | `expiryDescription` | ✅ | ✅ | **Unchanged** |
37
- | `...rest` | ✅ | ✅ | **Unchanged** (HTML div attributes) |
38
-
39
- ### All Props
40
-
41
- #### `showImage`
42
- - **Type:** `boolean`
43
- - **Default:** `true`
44
- - **Description:** Whether to show the error state illustration image
45
- - **Example:**
46
- ```tsx
47
- <CapErrorStateIllustration showImage={false} />
48
- ```
49
-
50
- #### `className`
51
- - **Type:** `string`
52
- - **Default:** `''`
53
- - **Description:** Additional CSS class name
54
- - **Example:**
55
- ```tsx
56
- <CapErrorStateIllustration className="custom-class" />
57
- ```
58
-
59
- #### `refreshText`
60
- - **Type:** `string | React.ReactNode`
61
- - **Default:** `''`
62
- - **Description:** Text or node to display in the refresh button (when not expired)
63
- - **Example:**
64
- ```tsx
65
- <CapErrorStateIllustration refreshText="Refresh" />
66
- <CapErrorStateIllustration refreshText={<span>Custom Refresh</span>} />
67
- ```
68
-
69
- #### `expiryTitle`
70
- - **Type:** `string | React.ReactNode`
71
- - **Default:** `''`
72
- - **Description:** Title to display when refresh is expired
73
- - **Example:**
74
- ```tsx
75
- <CapErrorStateIllustration expiryTitle="Session Expired" isRefreshExpired />
76
- ```
77
-
78
- #### `refreshTitle`
79
- - **Type:** `string | React.ReactNode`
80
- - **Default:** `''`
81
- - **Description:** Title to display when refresh is available
82
- - **Example:**
83
- ```tsx
84
- <CapErrorStateIllustration refreshTitle="Something went wrong" />
85
- ```
86
-
87
- #### `onRefreshClick`
88
- - **Type:** `() => void`
89
- - **Default:** `() => {}`
90
- - **Description:** Callback function when refresh button is clicked
91
- - **Example:**
92
- ```tsx
93
- <CapErrorStateIllustration
94
- onRefreshClick={() => window.location.reload()}
95
- />
96
- ```
97
-
98
- #### `isRefreshExpired`
99
- - **Type:** `boolean`
100
- - **Default:** `false`
101
- - **Description:** Whether the refresh has expired
102
- - **Example:**
103
- ```tsx
104
- <CapErrorStateIllustration isRefreshExpired={true} />
105
- ```
106
-
107
- #### `expiryDescription`
108
- - **Type:** `string | React.ReactNode`
109
- - **Default:** `''`
110
- - **Description:** Description to display when refresh is expired
111
- - **Example:**
112
- ```tsx
113
- <CapErrorStateIllustration
114
- expiryDescription="Please refresh the page"
115
- isRefreshExpired
116
- />
117
- ```
118
-
119
- ## Usage Examples
120
-
121
- ### Basic Usage
122
-
123
- ```tsx
124
- import CapErrorStateIllustration from '@capillarytech/blaze-ui/CapErrorStateIllustration';
125
-
126
- <CapErrorStateIllustration
127
- refreshTitle="Something went wrong"
128
- refreshText="Refresh"
129
- onRefreshClick={() => window.location.reload()}
130
- />
131
- ```
132
-
133
- ### Expired State
134
-
135
- ```tsx
136
- <CapErrorStateIllustration
137
- isRefreshExpired={true}
138
- expiryTitle="Session Expired"
139
- expiryDescription="Please refresh the page"
140
- />
141
- ```
142
-
143
- ### Without Image
144
-
145
- ```tsx
146
- <CapErrorStateIllustration
147
- showImage={false}
148
- refreshTitle="Error occurred"
149
- refreshText="Try again"
150
- onRefreshClick={handleRefresh}
151
- />
152
- ```
153
-
154
- ### Custom Content
155
-
156
- ```tsx
157
- <CapErrorStateIllustration
158
- refreshTitle={<strong>Error</strong>}
159
- refreshText={<span>Click to <em>refresh</em></span>}
160
- onRefreshClick={handleRefresh}
161
- />
162
- ```
163
-
164
- ## Style Changes
165
-
166
- **Approach**: The component now uses CSS Modules with SCSS instead of styled-components. All styling is done through CSS classes.
167
-
168
- ### Removed Dependencies
169
- - `styled-components` - Replaced with CSS Modules
170
- - `prop-types` - Replaced with TypeScript types
171
-
172
- ### CSS Classes
173
-
174
- The component uses the following CSS classes:
175
- - `.cap-error-state-illustration` - Main container
176
- - `.error-state-image` - Image wrapper
177
- - `.error-state-refresh-button` - Refresh button
178
- - `.error-state-refresh-icon` - Refresh icon
179
- - `.refresh-button-text-container` - Refresh button text container
180
-
181
- ## Code Improvements
182
-
183
- 1. **Removed PropTypes**: Replaced with TypeScript types from `types.ts`
184
- 2. **Removed defaultProps**: Default values now in function argument destructuring
185
- 3. **Removed styled-components**: Converted to CSS Modules with SCSS
186
- 4. **Type safety**: Full TypeScript support with proper type exports
187
- 5. **Better maintainability**: CSS Modules provide better encapsulation
188
-
189
- ## What Stayed the Same
190
-
191
- - All props and their behavior
192
- - Component functionality and logic
193
- - Visual appearance (styling preserved)
194
- - API surface area (backward compatible)
195
-
196
- ## What Changed
197
-
198
- - **Removed**: `PropTypes` import and usage
199
- - **Removed**: `defaultProps` assignment
200
- - **Removed**: `styled-components` dependency
201
- - **Added**: TypeScript types in `types.ts`
202
- - **Added**: CSS Modules classes in `styles.scss`
203
- - **Changed**: Default values now in function arguments
204
-
205
- ## Migration Guide
206
-
207
- If you're migrating from the old version:
208
-
209
- 1. **No code changes required** - The component API is backward compatible
210
- 2. **TypeScript users**: You can now import types:
211
- ```tsx
212
- import type { CapErrorStateIllustrationProps } from '@capillarytech/blaze-ui/CapErrorStateIllustration';
213
- ```
214
- 3. **Styling**: If you were overriding styles, update selectors to use CSS Modules classes
215
-
216
- ## Related Components
217
-
218
- - `CapButton` - Used for the refresh button
219
- - `CapHeading` - Used for titles
220
- - `CapIcon` - Used for refresh icon
221
- - `CapImage` - Used for error illustrations
222
- - `CapRow` - Used for layout
@@ -1,33 +0,0 @@
1
- # Test Cases: CapErrorStateIllustration (Antd v3→v6)
2
-
3
- ## Component Analysis
4
- - **Component**: CapErrorStateIllustration
5
- - **Complexity**: simple
6
- - **Test Case Limit**: ≤10 test cases
7
-
8
- ## Generated Test Cases
9
-
10
- | ID | Use Case | Props/Config | Expected Visual/Behavior | Priority | Storybook Story | Notes |
11
- |----|----------|--------------|-------------------------|----------|-----------------|-------|
12
- | UC-001 | Default rendering | All default props (showImage: true, isRefreshExpired: false, empty strings) | Component renders with refresh illustration image, no visible text or button | P0 | Default | Basic rendering with default props |
13
- | UC-002 | Refresh state vs Expiry state | isRefreshExpired: false vs true | When false: shows refreshErrorStateIllustration, refreshTitle, refresh button. When true: shows expiryErrorStateIllustration, expiryTitle, expiryDescription | P0 | StateVariants | Grouped both state variants into single test |
14
- | UC-003 | Image visibility toggle | showImage: true vs false | When true: image renders. When false: no image displayed | P1 | ImageVisibility | Grouped both image states |
15
- | UC-004 | Content variants | refreshTitle, expiryTitle, expiryDescription, refreshText with various values (string, node, empty) | All text props render correctly. String and node types supported. Empty strings hide elements | P1 | ContentVariants | Grouped all text content props |
16
- | UC-005 | Refresh button interaction | refreshText: "Refresh", onRefreshClick: mock function | Button renders with refresh icon and text. Click triggers onRefreshClick handler | P0 | RefreshInteraction | Critical user interaction |
17
- | UC-006 | Custom styling | className: "custom-class" | Custom className applied to container element | P2 | CustomStyling | Basic styling support |
18
- | UC-007 | Edge cases - minimal content | Only showImage: true, all text props empty | Component renders with only image, no text or buttons | P1 | MinimalContent | Edge case for empty content |
19
- | UC-008 | HTML attributes passthrough | {...rest} props (data-testid, aria-label, etc.) | Additional HTML attributes passed to container element | P2 | AttributesPassthrough | Grouped all HTML/ARIA attributes |
20
- | UC-009 | Refresh button with node content | refreshText: <span>Custom Node</span> | Button accepts node type for refreshText and renders correctly | P1 | NodeContentSupport | Tests PropTypes.oneOfType support |
21
- | UC-010 | Complete refresh state | showImage: true, isRefreshExpired: false, refreshTitle: "Error", refreshText: "Retry", onRefreshClick: handler | All refresh state elements visible: image, title, button with icon and text | P0 | CompleteRefreshState | Full refresh state integration |
22
-
23
- ## Summary
24
- - **Total Test Cases**: 10
25
- - **P0 (Blocking)**: 3
26
- - **P1 (High)**: 5
27
- - **P2 (Medium)**: 2
28
-
29
- ## Grouping Rationale
30
- - State variants (UC-002): Combined refresh and expiry states as they're mutually exclusive
31
- - Content variants (UC-004): Grouped all text props since they follow similar patterns
32
- - Image visibility (UC-003): Simple boolean toggle grouped together
33
- - Attributes (UC-008): All HTML/ARIA attributes grouped as passthrough props
@@ -1,32 +0,0 @@
1
- # CapExpressionEditor
2
-
3
- Expression editor component with grammar validation, syntax highlighting, and autocomplete. Uses a jQuery-based expredit plugin for parsing and validation.
4
-
5
- ## Migration Notes (Antd v3 → v6)
6
-
7
- ### Changes Applied
8
-
9
- - **Runtime prop validation removed**: Replaced with TypeScript types from `types.ts`
10
- - **defaultProps removed**: Default values now use destructuring in function arguments
11
- - **Class → Functional component**: Converted to React.FC with hooks
12
- - **SCSS**: Hardcoded colors replaced with `$CAP_*` design tokens from `_variables.scss`
13
- - **No Antd overrides**: Component uses `CapInput.TextArea` (wraps Antd Input); no theme config changes required
14
-
15
- ### Props
16
-
17
- | Prop | Type | Default | Description |
18
- |------|------|---------|-------------|
19
- | `grammar` | `ExpressionGrammar` | defaultGrammar | Expression grammar configuration |
20
- | `expected` | `string[]` | `['boolean']` | Expected types for validation |
21
- | `typeSource` | `string` | - | Type source identifier |
22
- | `delims` | `string[]` | `['{{', '}}']` | Delimiters for expression parsing |
23
- | `expression` | `string` | `''` | Initial expression value |
24
- | `onChange` | `(expressionJSON, expression, isError) => void` | - | Callback when expression changes |
25
- | `className` | `string` | - | Additional CSS class |
26
- | `disabled` | `boolean` | - | Disable the editor |
27
- | ...rest | `CapInputTextAreaProps` | - | Passed through to underlying TextArea |
28
-
29
- ### Dependencies
30
-
31
- - **jquery** (^3.6.0): Required for expredit plugin
32
- - **rangy** (^1.3.2): Selection/range library used by expredit plugin