@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,351 +0,0 @@
1
- # CapSwitch
2
-
3
- Switch component for toggling between two states. Built on Ant Design v6 with Cap UI styling.
4
-
5
- ## Summary of Changes from cap-ui-library
6
-
7
- The `CapSwitch` component has been migrated from `cap-ui-library` to `blaze-ui` with the following updates:
8
-
9
- - **TypeScript**: Full TypeScript implementation with proper type definitions
10
- - **Ant Design v6**: Updated to use Ant Design v6 APIs
11
- - **Functional Component**: Converted from class component to functional component with `forwardRef` support
12
- - **SCSS Modules**: Converted from regular SCSS to SCSS modules
13
- - **Removed HOC**: Removed `ComponentWithLabelHOC` wrapper (use `CapLabel` component separately if needed)
14
- - **No Breaking Changes**: Fully backward compatible with `cap-ui-library` v8.x
15
-
16
- ## Props
17
-
18
- The component accepts all Ant Design v6 `Switch` props. Key props include:
19
-
20
- | Prop | Type | Default | Description |
21
- |------|------|---------|-------------|
22
- | `checked` | `boolean` | `false` | Whether the switch is checked (controlled mode) |
23
- | `defaultChecked` | `boolean` | `false` | Default checked state (uncontrolled mode) |
24
- | `disabled` | `boolean` | `false` | Whether the switch is disabled |
25
- | `size` | `'small' \| 'default'` | `'default'` | The size of the switch |
26
- | `loading` | `boolean` | `false` | Loading state of switch |
27
- | `autoFocus` | `boolean` | `false` | Get focus when component mounted |
28
- | `checkedChildren` | `React.ReactNode` | - | Content to be shown when the state is checked |
29
- | `unCheckedChildren` | `React.ReactNode` | - | Content to be shown when the state is unchecked |
30
- | `onChange` | `(checked: boolean, event: React.MouseEvent \| React.KeyboardEvent) => void` | - | Callback function when switch state changes |
31
- | `onClick` | `(checked: boolean, event: React.MouseEvent) => void` | - | Callback function when switch is clicked |
32
- | `className` | `string` | - | Additional CSS class name |
33
-
34
- **Note**: The component accepts all other Ant Design v6 `Switch` props. See [Ant Design Switch documentation](https://ant.design/components/switch) for complete prop list.
35
-
36
- ## API Changes
37
-
38
- ### Removed Props
39
-
40
- - **`children`**: Removed support for children prop. The original component wrapped children through `ComponentWithLabelHOC`, but this has been removed. Use `CapLabel` component separately if you need label functionality.
41
-
42
- ### Controlled vs Uncontrolled Mode
43
-
44
- The component supports both controlled and uncontrolled modes:
45
-
46
- **Controlled Mode:**
47
- ```tsx
48
- const [checked, setChecked] = useState(false);
49
-
50
- <CapSwitch
51
- checked={checked}
52
- onChange={(newChecked) => setChecked(newChecked)}
53
- />
54
- ```
55
-
56
- **Uncontrolled Mode:**
57
- ```tsx
58
- <CapSwitch
59
- defaultChecked={false}
60
- onChange={(checked) => console.log('Changed:', checked)}
61
- />
62
- ```
63
-
64
- ## Behavioral Changes
65
-
66
- ### No Breaking Changes
67
-
68
- The component maintains **100% backward compatibility** with `cap-ui-library` v8.x for all standard Switch props. All existing code will continue to work without modifications.
69
-
70
- ### Removed Features
71
-
72
- - **ComponentWithLabelHOC**: The original component was wrapped with `ComponentWithLabelHOC` which provided label functionality. This wrapper has been removed. If you need label functionality, use `CapLabel` component separately:
73
-
74
- **Before (cap-ui-library):**
75
- ```tsx
76
- <CapSwitch checked={true}>
77
- <span>Enable Feature</span>
78
- </CapSwitch>
79
- ```
80
-
81
- **After (blaze-ui):**
82
- ```tsx
83
- <CapRow align="middle" gap={12}>
84
- <CapColumn>
85
- <CapSwitch checked={true} />
86
- </CapColumn>
87
- <CapColumn>
88
- <CapLabel>Enable Feature</CapLabel>
89
- </CapColumn>
90
- </CapRow>
91
- ```
92
-
93
- ### Enhanced Features
94
-
95
- - **Ref Forwarding**: The component now supports ref forwarding using `React.forwardRef`
96
- - **TypeScript Support**: Full TypeScript type definitions for better developer experience
97
- - **Improved Styling**: Enhanced SCSS modules with better size consistency and visual alignment
98
-
99
- ## Migration Steps for Consumers
100
-
101
- ### Step 1: Update Imports
102
-
103
- **Before:**
104
- ```tsx
105
- import { CapSwitch } from '@capillarytech/cap-ui-library';
106
- ```
107
-
108
- **After:**
109
- ```tsx
110
- import { CapSwitch } from '@capillarytech/blaze-ui';
111
- ```
112
-
113
- ### Step 2: Update Label Usage (If Applicable)
114
-
115
- If you were using the `children` prop for labels, update to use `CapLabel` separately:
116
-
117
- **Before:**
118
- ```tsx
119
- <CapSwitch checked={isEnabled}>
120
- <span>Enable Notifications</span>
121
- </CapSwitch>
122
- ```
123
-
124
- **After:**
125
- ```tsx
126
- import { CapSwitch, CapLabel, CapRow, CapColumn } from '@capillarytech/blaze-ui';
127
-
128
- <CapRow align="middle" gap={12}>
129
- <CapColumn>
130
- <CapSwitch checked={isEnabled} />
131
- </CapColumn>
132
- <CapColumn>
133
- <CapLabel>Enable Notifications</CapLabel>
134
- </CapColumn>
135
- </CapRow>
136
- ```
137
-
138
- ### Step 3: No Other Changes Required
139
-
140
- All other props and usage patterns remain the same. The component is fully backward compatible.
141
-
142
- ## Code Examples
143
-
144
- ### Basic Usage
145
-
146
- ```tsx
147
- import { CapSwitch } from '@capillarytech/blaze-ui';
148
-
149
- function MyComponent() {
150
- const [enabled, setEnabled] = useState(false);
151
-
152
- return (
153
- <CapSwitch
154
- checked={enabled}
155
- onChange={setEnabled}
156
- />
157
- );
158
- }
159
- ```
160
-
161
- ### Uncontrolled Mode
162
-
163
- ```tsx
164
- <CapSwitch
165
- defaultChecked={false}
166
- onChange={(checked) => {
167
- console.log('Switch toggled:', checked);
168
- }}
169
- />
170
- ```
171
-
172
- ### With Text Content
173
-
174
- ```tsx
175
- <CapSwitch
176
- checked={true}
177
- checkedChildren="ON"
178
- unCheckedChildren="OFF"
179
- />
180
- ```
181
-
182
- ### With Custom Content
183
-
184
- ```tsx
185
- <CapSwitch
186
- checked={true}
187
- checkedChildren={<span style={{ color: 'green' }}>✓</span>}
188
- unCheckedChildren={<span style={{ color: 'red' }}>✗</span>}
189
- />
190
- ```
191
-
192
- ### Disabled State
193
-
194
- ```tsx
195
- <CapSwitch
196
- checked={true}
197
- disabled
198
- />
199
- ```
200
-
201
- ### Loading State
202
-
203
- ```tsx
204
- <CapSwitch
205
- checked={true}
206
- loading
207
- />
208
- ```
209
-
210
- ### Different Sizes
211
-
212
- ```tsx
213
- <CapSwitch size="default" checked={true} />
214
- <CapSwitch size="small" checked={true} />
215
- ```
216
-
217
- ### With Label (Using CapLabel)
218
-
219
- ```tsx
220
- import { CapSwitch, CapLabel, CapRow, CapColumn } from '@capillarytech/blaze-ui';
221
-
222
- <CapRow align="middle" gap={12}>
223
- <CapColumn>
224
- <CapSwitch checked={notificationsEnabled} />
225
- </CapColumn>
226
- <CapColumn>
227
- <CapLabel>Email Notifications</CapLabel>
228
- </CapColumn>
229
- </CapRow>
230
- ```
231
-
232
- ### Settings Panel Example
233
-
234
- ```tsx
235
- import { useState } from 'react';
236
- import { CapSwitch, CapRow, CapColumn } from '@capillarytech/blaze-ui';
237
-
238
- function SettingsPanel() {
239
- const [settings, setSettings] = useState({
240
- notifications: true,
241
- darkMode: false,
242
- autoSave: true,
243
- });
244
-
245
- const handleChange = (key: string) => (checked: boolean) => {
246
- setSettings(prev => ({ ...prev, [key]: checked }));
247
- };
248
-
249
- return (
250
- <CapRow gap={16} vertical>
251
- <CapColumn>
252
- <CapRow justify="space-between" align="middle">
253
- <CapColumn>Email Notifications</CapColumn>
254
- <CapColumn>
255
- <CapSwitch
256
- checked={settings.notifications}
257
- onChange={handleChange('notifications')}
258
- />
259
- </CapColumn>
260
- </CapRow>
261
- </CapColumn>
262
- <CapColumn>
263
- <CapRow justify="space-between" align="middle">
264
- <CapColumn>Dark Mode</CapColumn>
265
- <CapColumn>
266
- <CapSwitch
267
- checked={settings.darkMode}
268
- onChange={handleChange('darkMode')}
269
- />
270
- </CapColumn>
271
- </CapRow>
272
- </CapColumn>
273
- <CapColumn>
274
- <CapRow justify="space-between" align="middle">
275
- <CapColumn>Auto Save</CapColumn>
276
- <CapColumn>
277
- <CapSwitch
278
- checked={settings.autoSave}
279
- onChange={handleChange('autoSave')}
280
- />
281
- </CapColumn>
282
- </CapRow>
283
- </CapColumn>
284
- </CapRow>
285
- );
286
- }
287
- ```
288
-
289
- ### With Ref Forwarding
290
-
291
- ```tsx
292
- import { useRef } from 'react';
293
-
294
- function MyComponent() {
295
- const switchRef = useRef<HTMLButtonElement>(null);
296
-
297
- const handleFocus = () => {
298
- switchRef.current?.focus();
299
- };
300
-
301
- return (
302
- <div>
303
- <CapSwitch ref={switchRef} />
304
- <button onClick={handleFocus}>Focus Switch</button>
305
- </div>
306
- );
307
- }
308
- ```
309
-
310
- ## Import Examples
311
-
312
- ### Default Import
313
-
314
- ```tsx
315
- import CapSwitch from '@capillarytech/blaze-ui/components/CapSwitch';
316
- ```
317
-
318
- ### Named Import
319
-
320
- ```tsx
321
- import { CapSwitch } from '@capillarytech/blaze-ui';
322
- ```
323
-
324
- ### With TypeScript Types
325
-
326
- ```tsx
327
- import { CapSwitch } from '@capillarytech/blaze-ui';
328
- import type { CapSwitchProps } from '@capillarytech/blaze-ui';
329
-
330
- const props: CapSwitchProps = {
331
- checked: true,
332
- disabled: false,
333
- size: 'default',
334
- };
335
- ```
336
-
337
- ## Notes
338
-
339
- - **No Breaking Changes**: The component is fully backward compatible with `cap-ui-library` v8.x for all standard Switch props
340
- - **Label Support**: If you need label functionality, use `CapLabel` component separately with `CapRow`/`CapColumn` for layout
341
- - **Ref Forwarding**: The component supports ref forwarding to the underlying Switch element
342
- - **Controlled/Uncontrolled**: Supports both controlled (`checked` prop) and uncontrolled (`defaultChecked` prop) modes
343
- - **Styling**: Uses SCSS modules with consistent sizing and visual alignment
344
-
345
- ## Related Components
346
-
347
- - `CapLabel` - Label component for use with switches
348
- - `CapRow` / `CapColumn` - Layout components for arranging switches with labels
349
- - `CapCheckbox` - Checkbox component for similar use cases
350
- - `CapRadio` - Radio button component for selection
351
-