@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,196 +0,0 @@
1
- # CapInput Component
2
-
3
- An extended version of Ant Design Input component with additional features for error handling and verification states.
4
-
5
- ## Migration from cap-ui-library to blaze-ui
6
-
7
- ### Summary of Changes
8
-
9
- This component has been migrated from JavaScript to TypeScript with the following improvements:
10
-
11
- 1. **TypeScript Conversion**
12
- - Converted from JavaScript to TypeScript
13
- - Added comprehensive TypeScript interfaces in `CapInput.interfaces.ts`
14
- - Replaced PropTypes with TypeScript types
15
- - Proper ref typing with `InputRef` from Ant Design v6
16
-
17
- 2. **Modern React Patterns**
18
- - Converted to functional component with React hooks
19
- - Uses `React.forwardRef` for proper ref forwarding
20
- - Uses `useRef` and `useEffect` hooks for focus management
21
- - Better type safety with TypeScript
22
-
23
- 3. **Styling**
24
- - Converted to SCSS modules
25
- - Uses SCSS variables from `components/styled/variables.scss`
26
- - Icon styles for error and success states
27
- - Global styles for consistent input styling across the app
28
-
29
- 4. **Ant Design v6 Migration**
30
- - Updated to use `antd-v5` (Ant Design v6)
31
- - Uses `@ant-design-v5/icons` for icons
32
- - Proper TypeScript types from Ant Design v6
33
-
34
- ### Breaking Changes
35
-
36
- **No breaking changes from cap-ui-library v8.x**
37
-
38
- All props remain backward compatible. The component maintains the same API and behavior as the cap-ui-library version.
39
-
40
- ### Props
41
-
42
- | Prop Name | Type | Default | Description |
43
- |-----------|------|---------|-------------|
44
- | `alwaysShowFocus` | `boolean` | `undefined` | Whether to automatically focus the input when mounted |
45
- | `errorMessage` | `React.ReactNode` | `undefined` | Error message to display. When provided, shows error icon and sets input status to 'error' |
46
- | `isVerified` | `boolean` | `undefined` | Whether to show verified indicator (success icon) |
47
- | `showSuffix` | `boolean` | `true` | Whether to show suffix icons (error/verified icons) |
48
- | `size` | `'large' \| 'middle' \| 'small'` | `'large'` | The size of the input |
49
- | `suffix` | `React.ReactNode` | `undefined` | Custom suffix element |
50
- | `...rest` | `InputProps` | - | All standard Ant Design Input props |
51
-
52
- ### Behavioral Changes
53
-
54
- - The component uses Ant Design v6's `status` prop to indicate error state when `errorMessage` is provided
55
- - Error and success icons are displayed in the suffix area
56
- - When `showSuffix` is `false`, no suffix icons are displayed (including error/verified icons)
57
- - The component applies global styles to all Ant Design inputs for consistent styling
58
-
59
- ### Icon States
60
-
61
- - **Error State**: When `errorMessage` is provided, a red warning icon (`WarningOutlined`) is displayed
62
- - **Success State**: When `isVerified` is `true`, a green check icon (`CheckCircleOutlined`) is displayed
63
- - **Priority**: Error state takes precedence over verified state
64
-
65
- ### Usage Examples
66
-
67
- #### Basic Usage
68
-
69
- ```tsx
70
- import { CapInput } from '@capillarytech/blaze-ui';
71
-
72
- function MyComponent() {
73
- return (
74
- <CapInput
75
- placeholder="Enter your name"
76
- size="large"
77
- />
78
- );
79
- }
80
- ```
81
-
82
- #### With Error Message
83
-
84
- ```tsx
85
- import { CapInput } from '@capillarytech/blaze-ui';
86
-
87
- function MyComponent() {
88
- return (
89
- <CapInput
90
- placeholder="Enter email"
91
- errorMessage="This field is required"
92
- />
93
- );
94
- }
95
- ```
96
-
97
- #### With Verified State
98
-
99
- ```tsx
100
- import { CapInput } from '@capillarytech/blaze-ui';
101
-
102
- function MyComponent() {
103
- return (
104
- <CapInput
105
- placeholder="Enter username"
106
- isVerified={true}
107
- />
108
- );
109
- }
110
- ```
111
-
112
- #### With Custom Suffix
113
-
114
- ```tsx
115
- import { CapInput } from '@capillarytech/blaze-ui';
116
- import { UserOutlined } from '@ant-design-v5/icons';
117
-
118
- function MyComponent() {
119
- return (
120
- <CapInput
121
- placeholder="Enter username"
122
- suffix={<UserOutlined />}
123
- />
124
- );
125
- }
126
- ```
127
-
128
- #### Auto Focus
129
-
130
- ```tsx
131
- import { CapInput } from '@capillarytech/blaze-ui';
132
-
133
- function MyComponent() {
134
- return (
135
- <CapInput
136
- placeholder="Auto-focused input"
137
- alwaysShowFocus={true}
138
- />
139
- );
140
- }
141
- ```
142
-
143
- #### Hide Suffix Icons
144
-
145
- ```tsx
146
- import { CapInput } from '@capillarytech/blaze-ui';
147
-
148
- function MyComponent() {
149
- return (
150
- <CapInput
151
- placeholder="No suffix icons"
152
- showSuffix={false}
153
- errorMessage="Error message"
154
- />
155
- );
156
- }
157
- ```
158
-
159
- ### Deprecated
160
-
161
- - **`CapSearchBar`** — Deprecated. Use `CapInput.Search` or `CapInputSearch` from the main export instead. The alias `CapSearchBar` is still exported from `@capillarytech/blaze-ui` for backward compatibility but will be removed in a future version.
162
-
163
- ### Related Components
164
-
165
- - `CapInputSearch` - Search input variant
166
- - `CapInputTextArea` - Textarea input variant
167
- - `CapInputNumber` - Number input variant
168
-
169
- ### Import Examples
170
-
171
- ```tsx
172
- // Default import
173
- import CapInput from '@capillarytech/blaze-ui/components/CapInput';
174
-
175
- // Named import
176
- import { CapInput } from '@capillarytech/blaze-ui';
177
-
178
- // With type
179
- import { CapInput } from '@capillarytech/blaze-ui';
180
- import type { CapInputProps } from '@capillarytech/blaze-ui';
181
-
182
- // Related components
183
- import {
184
- CapInput,
185
- CapInputSearch,
186
- CapInputTextArea,
187
- CapInputNumber
188
- } from '@capillarytech/blaze-ui';
189
- ```
190
-
191
- ### Notes
192
-
193
- - The component applies global styles to all Ant Design inputs for consistent styling
194
- - Error and verified states are mutually exclusive - error state takes precedence
195
- - The component uses Ant Design v6's built-in error status styling
196
- - All standard Ant Design Input props are supported through spread props
@@ -1,123 +0,0 @@
1
- # Migration Status: CapInput
2
-
3
- **Last Updated**: 2026-01-16 08:56:19
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 2**: Migration Prompt 2 (Storybook support)
10
- - [x] **Step 3**: Migration Prompt 3 (Unit tests)
11
- - [x] **Step 4**: Linting (ESLint)
12
- - [x] **Step 5**: Pre-build Validation
13
- - [x] **Step 6**: Build blaze-ui
14
- - [x] **Step 7**: Visual Testing
15
- - [x] **Step 8**: CSS Analysis (if mismatches found)
16
- - [x] **Step 8.5**: CSS Fixes Applied (if mismatches found)
17
- - [x] **Step 9**: Git Commit & Push to branch
18
- - [x] **Step 10**: Create Pull Request
19
-
20
- ## Visual Testing Results
21
-
22
- **Last Test**: 2026-01-16 08:56:01
23
- **Maximum Mismatch**: 2.16%
24
-
25
- ### Mismatched Variants:
26
- - ✅ All variants match perfectly!
27
-
28
-
29
- ## CSS Fix Analysis
30
-
31
- **Last Analysis**: 2026-01-16 08:56:01
32
- **Analysis File**: `/Users/sarahkhader/repos/migration/blaze-ui/tools/visual-testing/report/CapInput/css-fix-analysis.md`
33
-
34
- ```
35
-
36
- ## Summary
37
-
38
- - 12/12 variants failing (1.53%–2.16% mismatch)
39
- - Root cause: width differences (100% of mismatches)
40
- - Primary issue: padding values don't match target widths
41
-
42
- ## Findings
43
-
44
- 1. Base inputs: 27px width difference (197px target vs 170px current)
45
- - Need 13.5px padding per side, but may need to account for 1px borders
46
- - Current: `0.964rem` (13.5px) → Try: `0.893rem` (12.5px) if borders are included
47
-
48
- 2. Affix wrapper:
49
- - Prefix: 24px difference → needs 12px per side (`0.857rem`) — already set
50
- - Suffix: 5px difference → needs 2.5px end padding (`0.179rem`) — missing
51
-
52
- 3. Small size: 31px difference → needs 15.5px per side (`1.107rem`) — already set
53
-
54
- 4. Addon variants: ~30px difference → need ~15px per side (`1.071rem`) — missing
55
-
56
- ## Specific CSS fixes
57
-
58
- ### Fix 1: Adjust base input padding (accounts for borders)
59
-
60
- ```scss
61
- .ant-input,
62
- .ant-input-number,
63
- .ant-input-textarea {
64
- // Change from 0.964rem to 0.893rem to account for 1px borders
65
- padding-inline-start: 0.893rem; // 12.5px (was 13.5px)
66
- padding-inline-end: 0.893rem; // 12.5px (was 13.5px)
67
- }
68
- ```
69
-
70
- ### Fix 2: Add suffix-only padding rule
71
-
72
- ```scss
73
- .ant-input-affix-wrapper {
74
- padding-inline-start: 0.857rem; // 12px (for prefix)
75
- padding-inline-end: 0.857rem; // 12px base
76
-
77
- // Add this for suffix-only case
78
- &:not(:has(.ant-input-prefix)):has(.ant-input-suffix) {
79
- padding-inline-end: 0.179rem; // 2.5px
80
- }
81
- }
82
- ```
83
-
84
- ### Fix 3: Add addon variant styles
85
-
86
- ```scss
87
- .ant-input-group-wrapper,
88
- .ant-input-group {
89
- .ant-input,
90
- .ant-input-affix-wrapper {
91
- padding-inline-start: 1.071rem; // ~15px
92
- padding-inline-end: 1.071rem; // ~15px
93
- }
94
- }
95
- ```
96
-
97
- ## Priority
98
-
99
- - High (>2%): readonly (2.16%), with-addon-before (2.10%), with-value (2.06%)
100
- - Medium (1.8–2%): password, with-prefix, with-addon-after, large, with-suffix
101
- - Low (<1.8%): small, default, textarea, disabled
102
-
103
- ## Expected outcome
104
-
105
- After fixes:
106
- - Width differences: 27px → <2px
107
- - Visual mismatch: 1.5–2.2% → <0.5%
108
- - All variants should pass (<1% threshold)
109
-
110
- Detailed analysis and complete CSS code are in:
111
- - `/tools/visual-testing/report/CapInput/SPECIFIC_CSS_FIXES.md`
112
- - `/tools/visual-testing/report/CapInput/CSS_FIXES_ANALYSIS.md`
113
-
114
- Should I apply these CSS fixes to `styles.scss`?
115
- ```
116
-
117
- _See full analysis in: `/Users/sarahkhader/repos/migration/blaze-ui/tools/visual-testing/report/CapInput/css-fix-analysis.md`_
118
-
119
-
120
- ## Notes
121
-
122
- _No notes yet._
123
-
@@ -1,169 +0,0 @@
1
- # CapInput Use Cases Analysis
2
-
3
- ## Component Overview
4
- CapInput is a wrapper around Ant Design v5 Input component that adds:
5
- - Custom error/verified state indicators
6
- - Auto-focus capability
7
- - Customizable suffix display
8
- - Default size of 'large'
9
-
10
- ## Use Cases NOT Currently Fulfilled
11
-
12
- ### 1. Error Message Display
13
- **Issue**: The `errorMessage` prop only displays a warning icon and sets the error status, but the actual error message text is never rendered to the user.
14
-
15
- **Current Behavior**:
16
- - Shows `WarningOutlined` icon when `errorMessage` is provided
17
- - Sets `status="error"` on the Input component
18
- - The error message text itself is not displayed
19
-
20
- **Expected Behavior** (if required):
21
- - Display the error message text below or near the input
22
- - Or show it in a tooltip on hover/focus
23
-
24
- **Recommendation**: If error message text display is required, consider:
25
- - Adding a helper text area below the input
26
- - Using Ant Design's Form.Item with `help` prop
27
- - Adding a tooltip to the error icon
28
-
29
- ### 2. Warning Status Support
30
- **Issue**: Component only supports error status, not warning status.
31
-
32
- **Current Behavior**:
33
- - Only `errorMessage` prop exists (maps to error status)
34
- - No `warningMessage` prop
35
-
36
- **Expected Behavior** (if required):
37
- - Support for warning state with warning icon
38
- - Similar to error but with different styling
39
-
40
- ### 3. Success Status Support
41
- **Issue**: Component has `isVerified` which shows a checkmark icon, but no explicit success status.
42
-
43
- **Current Behavior**:
44
- - `isVerified` shows `CheckCircleOutlined` icon
45
- - No `status="success"` is set on the Input
46
-
47
- **Expected Behavior** (if required):
48
- - Set `status="success"` when `isVerified` is true
49
- - Or add a separate `successMessage` prop
50
-
51
- ### 4. Ref Handling with alwaysShowFocus
52
- **Issue**: When an external ref is provided, `alwaysShowFocus` uses the internal ref which may not be the same as the external ref.
53
-
54
- **Current Behavior**:
55
- ```typescript
56
- ref={ref || inputRef} // Uses external ref if provided
57
- // But alwaysShowFocus uses inputRef
58
- if (alwaysShowFocus && inputRef.current) {
59
- inputRef.current.focus();
60
- }
61
- ```
62
-
63
- **Expected Behavior** (if required):
64
- - If external ref is provided, use it for focus
65
- - If no external ref, use internal ref
66
-
67
- **Recommendation**: Update the focus logic to use the same ref that's passed to Input:
68
- ```typescript
69
- useEffect(() => {
70
- if (alwaysShowFocus) {
71
- const refToUse = ref || inputRef;
72
- if (refToUse && 'current' in refToUse && refToUse.current) {
73
- refToUse.current.focus();
74
- }
75
- }
76
- }, [alwaysShowFocus, ref]);
77
- ```
78
-
79
- ### 5. Input Validation Helpers
80
- **Issue**: No built-in validation or formatting helpers.
81
-
82
- **Current Behavior**:
83
- - Component is a presentational wrapper
84
- - No validation logic
85
-
86
- **Expected Behavior** (if required):
87
- - Email validation
88
- - Phone number formatting
89
- - Credit card formatting
90
- - Custom validation rules
91
-
92
- **Recommendation**: Keep validation logic separate (in Form.Item or custom hooks) to maintain component simplicity.
93
-
94
- ### 6. Input Groups (Deprecated)
95
- **Issue**: Ant Design v5 deprecated `addonBefore` and `addonAfter` props in favor of `Space.Compact`.
96
-
97
- **Current Behavior**:
98
- - These props are passed through but deprecated
99
-
100
- **Expected Behavior** (if required):
101
- - Document that these are deprecated
102
- - Provide examples using `Space.Compact` instead
103
-
104
- ### 7. Accessibility - Error Message Announcement
105
- **Issue**: Error messages are not announced to screen readers.
106
-
107
- **Current Behavior**:
108
- - Error icon is present but no aria-describedby linking to error message
109
- - Error message text is not in the DOM
110
-
111
- **Expected Behavior** (if required):
112
- - Add `aria-describedby` pointing to error message
113
- - Ensure error message is accessible to screen readers
114
-
115
- ### 8. Loading State
116
- **Issue**: No loading/spinner state support.
117
-
118
- **Current Behavior**:
119
- - No loading prop
120
-
121
- **Expected Behavior** (if required):
122
- - Show spinner icon when loading
123
- - Disable input during loading
124
-
125
- ### 9. Character Count
126
- **Issue**: No built-in character count display.
127
-
128
- **Current Behavior**:
129
- - No character count feature
130
-
131
- **Expected Behavior** (if required):
132
- - Show "X / Y characters" when maxLength is set
133
- - Or add a `showCount` prop similar to TextArea
134
-
135
- ### 10. Password Visibility Toggle
136
- **Issue**: Component doesn't have built-in password visibility toggle (though Ant Design Input.Password exists).
137
-
138
- **Current Behavior**:
139
- - Can use `type="password"` but no visibility toggle
140
-
141
- **Expected Behavior** (if required):
142
- - Use `Input.Password` from Ant Design or create `CapInputPassword` variant
143
-
144
- ## Test Coverage Summary
145
-
146
- The comprehensive test suite covers:
147
- ✅ Default rendering
148
- ✅ All size variants (small, middle, large)
149
- ✅ All variant types (outlined, borderless, filled, underlined)
150
- ✅ Disabled and readOnly states
151
- ✅ Value and placeholder handling
152
- ✅ Prefix support
153
- ✅ Suffix priority logic (error > verified > custom > null)
154
- ✅ Error message handling (icon and status)
155
- ✅ User interactions (typing, clicking, focusing, blurring)
156
- ✅ All callbacks (onChange, onFocus, onBlur, onPressEnter, onClick)
157
- ✅ Ref forwarding
158
- ✅ Focus behavior with alwaysShowFocus
159
- ✅ Edge cases (empty values, long text, combinations)
160
- ✅ Accessibility (keyboard navigation, ARIA)
161
- ✅ Ant Design InputProps passthrough
162
- ✅ Snapshot tests for all major variations
163
-
164
- ## Recommendations
165
-
166
- 1. **High Priority**: Fix ref handling for `alwaysShowFocus` when external ref is provided
167
- 2. **Medium Priority**: Consider displaying error message text if that's a requirement
168
- 3. **Low Priority**: Add warning status support if needed
169
- 4. **Low Priority**: Improve accessibility with aria-describedby for error messages
@@ -1,56 +0,0 @@
1
- # Test Cases: CapLanguageProvider (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**: CapLanguageProvider
8
- - **Complexity**: medium (≤20 test cases)
9
- - **Source**: blaze-ui/components/CapLanguageProvider/
10
-
11
- ## Use Cases
12
-
13
- | ID | Use Case | Props/Config | Expected Visual/Behavior | Priority | Storybook Story | Notes |
14
- |----|----------|--------------|-------------------------|----------|-----------------|-------|
15
- | UC-001 | Basic rendering with children | children: ReactNode, actions: {getSupportedLocales, getLocizeMessage}, language: {locale: 'en'}, messages: {} | Component renders child content wrapped in ConfigProvider and IntlProvider. Calls getSupportedLocales on mount. | P0 | BasicRendering | Essential baseline test |
16
- | UC-002 | All locale source variants | user.iso_lang: 'en_US' \| 'en-US' \| 'fr-FR', localStorage.locale: 'en_US' \| 'fr-FR', supportedLocales: [{locale, locize_locale}] | Locale loaded from user.iso_lang (priority 1), falls back to localStorage.locale (priority 2), defaults to 'en-US'. Correctly converts hyphen/underscore formats. | P0 | LocaleSources | Grouped all locale source scenarios |
17
- | UC-003 | Locale format conversion | lang: 'en-US' \| 'en_US' \| 'fr-FR' \| 'fr_FR' | Converts to antd format (en_US), react-intl format (en), and locize format (en-US). Handles both hyphen and underscore separators. | P0 | LocaleConversion | Grouped all format conversion scenarios |
18
- | UC-004 | Spinner visibility states | spinnerVisible: true \| false, language.localeLoading: 'REQUEST' \| 'IDLE' \| 'COMPLETE', supportedLocalesDetails.fetchSupportedLocalesStatus: 'REQUEST' \| 'IDLE' \| 'COMPLETE', isLoginPage: true \| false | Spinner shows when spinnerVisible=true AND not on login page AND (localeLoading='REQUEST' OR fetchSupportedLocalesStatus='REQUEST'). Hidden otherwise. | P1 | SpinnerStates | Grouped all spinner visibility conditions |
19
- | UC-005 | Login page skip behavior | window.location.pathname includes '/login' | getSupportedLocales and getLocizeMessage called with isSkip=true. Spinner never shows on login page regardless of loading state. | P1 | LoginPageSkip | Critical for login UX |
20
- | UC-006 | Messages prop variants | messages: {} \| {key: 'value'} \| undefined, language.messages: {} \| {key: 'value'} \| undefined | Uses language.messages if available, falls back to messages prop. Passes to IntlProvider. Empty object handled gracefully. | P1 | MessagesVariants | Grouped messages prop scenarios |
21
- | UC-007 | Supported locales loading | supportedLocalesDetails: {} \| {supportedLocales: [], fetchSupportedLocalesStatus: 'REQUEST'/'IDLE'/'COMPLETE'} | Waits for supportedLocales before calling getLocizeMessage. Handles empty/missing supportedLocales array. | P1 | SupportedLocalesLoading | Critical for locale initialization |
22
- | UC-008 | Locale update on user/supportedLocales change | user: {} → {iso_lang: 'en_US'}, supportedLocalesDetails: {} → {supportedLocales: [...]} | Calls updateLocale() when both user and supportedLocales become available. Updates antd locale, react-intl locale, moment locale, and dayjs locale. | P0 | LocaleUpdate | Core functionality |
23
- | UC-009 | Antd locale dynamic import | antdLocale: 'en_US' \| 'fr_FR' \| 'invalid_locale' | Dynamically imports antd-v5/locale/{antdLocale}. On error, falls back to en_US. Updates state.locale with imported module. | P1 | AntdLocaleImport | Critical for antd localization |
24
- | UC-010 | Moment and dayjs locale sync | locale: 'en-US' \| 'fr-FR' \| 'de-DE' | Calls moment.locale(locale) and dayjs.locale(locale) when locale updates. Keeps both libraries in sync. | P1 | MomentDayjsSync | Ensures date library consistency |
25
- | UC-011 | Locize locale mapping | supportedLocales: [{locale: 'en_US', locize_locale: 'en-US'}, {locale: 'fr-FR', locize_locale: 'fr-FR'}] | Maps user locale to locize_locale from supportedLocales. Calls getLocizeMessage with correct locize locale. | P1 | LocizeMapping | Critical for translation loading |
26
- | UC-012 | Styling props | className: string \| undefined | Applies className to CapSpin wrapper. Does not break layout when undefined. | P2 | StylingProps | Simple styling test |
27
- | UC-013 | API configuration props | supportedLocalesApi: string \| undefined, locizeApi: string \| undefined | Passes supportedLocalesApi to getSupportedLocales, locizeApi to getLocizeMessage. Handles undefined gracefully. | P2 | ApiConfigProps | Grouped API config props |
28
- | UC-014 | Empty/missing user data | user: {} \| undefined, localStorage.user: '' \| invalid JSON | Handles empty user object, missing iso_lang, invalid localStorage JSON. Falls back to localStorage.locale or default. | P1 | EmptyUserData | Edge case handling |
29
- | UC-015 | Empty/missing supported locales | supportedLocalesDetails: {} \| {supportedLocales: []} \| {supportedLocales: undefined} | Handles empty/missing supportedLocales array. Does not call getLocizeMessage until supportedLocales available. | P1 | EmptySupportedLocales | Edge case handling |
30
- | UC-016 | React.Children.only constraint | children: single child \| multiple children \| no children | Wraps children with React.Children.only(). Should handle single child correctly. Multiple children may cause error (expected behavior). | P2 | ChildrenOnly | React API constraint |
31
- | UC-017 | IntlProvider configuration | locale: 'en' \| 'fr' \| 'de', messages: {}, key: locale | IntlProvider receives correct locale, messages, and key prop based on language.locale. Defaults to 'en' if locale missing. | P1 | IntlProviderConfig | Critical for i18n |
32
- | UC-018 | ConfigProvider locale | state.locale: Locale object | ConfigProvider receives state.locale (antd Locale object). Updates when antd locale module loads. Defaults to enUS initially. | P1 | ConfigProviderLocale | Critical for antd i18n |
33
- | UC-019 | Component lifecycle | componentDidMount, componentDidUpdate | Calls getSupportedLocales on mount. Calls updateLocale in componentDidUpdate when user and supportedLocales become available. Prevents duplicate calls. | P1 | ComponentLifecycle | Core lifecycle behavior |
34
- | UC-020 | Migration parity (v3→v6) | ConfigProvider from antd-v5, IntlProvider from react-intl | ConfigProvider and IntlProvider behavior matches v3 expectations. Locale loading, message passing, and error handling work identically. | P0 | MigrationParity | Critical for migration validation |
35
-
36
- ## Summary
37
- - **Total Test Cases**: 20 (within medium complexity limit)
38
- - **P0 (Blocking)**: 4 cases
39
- - **P1 (High)**: 13 cases
40
- - **P2 (Medium)**: 3 cases
41
-
42
- ## Grouping Rationale
43
- - **UC-002**: Grouped all locale source scenarios (user.iso_lang, localStorage, defaults)
44
- - **UC-003**: Grouped all locale format conversion scenarios (hyphen/underscore handling)
45
- - **UC-004**: Grouped all spinner visibility conditions (loading states, login page check)
46
- - **UC-006**: Grouped messages prop scenarios (language.messages vs messages prop)
47
- - **UC-012**: Grouped styling props (className)
48
- - **UC-013**: Grouped API configuration props (supportedLocalesApi, locizeApi)
49
-
50
- ## Notes
51
- - Component uses Redux connect (HOC pattern) - test with mocked store/actions
52
- - Requires localStorage mocking for locale/user data tests
53
- - Dynamic imports require jest.mock for antd locale modules
54
- - Login page detection uses window.location.pathname - mock for tests
55
- - Component syncs moment and dayjs locales - verify both libraries update
56
- - React.Children.only constraint means only single child supported