@capillarytech/blaze-ui 5.21.0 → 5.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (177) hide show
  1. package/CapLanguageProvider/actions.js +125 -0
  2. package/CapLanguageProvider/actions.js.map +1 -0
  3. package/CapLanguageProvider/constants.js +37 -0
  4. package/CapLanguageProvider/constants.js.map +1 -0
  5. package/package.json +1 -1
  6. package/CapActionBar/README.md +0 -11
  7. package/CapAdvancedIcon/README.md +0 -185
  8. package/CapAdvancedIcon/use-cases.md +0 -44
  9. package/CapAlert/README.md +0 -144
  10. package/CapAppNotEnabled/README.md +0 -84
  11. package/CapAskAira/README.md +0 -328
  12. package/CapBanner/README.md +0 -4
  13. package/CapBlock/README.md +0 -175
  14. package/CapBorderedBox/Status.md +0 -40
  15. package/CapCSVFileUploader/README.md +0 -124
  16. package/CapCSVFileUploader/Status.md +0 -47
  17. package/CapCard/README.md +0 -85
  18. package/CapCard/Status.md +0 -41
  19. package/CapCardBox/README.md +0 -169
  20. package/CapCardBox/Status.md +0 -52
  21. package/CapCarousel/README.md +0 -190
  22. package/CapCarousel/Status.md +0 -73
  23. package/CapCheckbox/README.md +0 -254
  24. package/CapCheckbox/Status.md +0 -41
  25. package/CapColorPicker/README.md +0 -112
  26. package/CapColorPicker/Status.md +0 -52
  27. package/CapColorPicker/tests/USE_CASES_ANALYSIS.md +0 -92
  28. package/CapColoredTag/README.md +0 -167
  29. package/CapColoredTag/Status.md +0 -49
  30. package/CapConditionPreview/MIGRATION_ANALYSIS.md +0 -70
  31. package/CapConditionPreview/README.md +0 -40
  32. package/CapConditionPreview/tests/USE_CASES_CapConditionPreview.md +0 -65
  33. package/CapCustomCard/README.md +0 -182
  34. package/CapCustomCard/Status.md +0 -40
  35. package/CapCustomCarousel/Status.md +0 -69
  36. package/CapCustomCheckboxList/README.md +0 -178
  37. package/CapCustomCheckboxList/Status.md +0 -52
  38. package/CapCustomCheckboxList/tests/USE_CASES_ANALYSIS.md +0 -174
  39. package/CapCustomList/README.md +0 -117
  40. package/CapCustomList/Status.md +0 -77
  41. package/CapCustomList/tests/USE_CASES_ANALYSIS.md +0 -124
  42. package/CapCustomSelect/README.md +0 -38
  43. package/CapDatePicker/README.md +0 -139
  44. package/CapDateRangePicker/README.md +0 -159
  45. package/CapDateTimePicker/README.md +0 -136
  46. package/CapDateTimeRangePicker/README.md +0 -243
  47. package/CapDivider/README.md +0 -122
  48. package/CapDrawer/README.md +0 -207
  49. package/CapDrawer/Status.md +0 -52
  50. package/CapDrawer/tests/MISSING_USE_CASES.md +0 -170
  51. package/CapDropdown/README.md +0 -515
  52. package/CapDropdown/Status.md +0 -45
  53. package/CapDropdown/tests/USE_CASES_ANALYSIS.md +0 -137
  54. package/CapError/README.md +0 -88
  55. package/CapErrorBoundary/CapErrorBoundary-use-cases.md +0 -89
  56. package/CapErrorBoundary/README.md +0 -150
  57. package/CapErrorStateIllustration/README.md +0 -222
  58. package/CapErrorStateIllustration/USE_CASES.md +0 -33
  59. package/CapExpressionEditor/README.md +0 -32
  60. package/CapForm/README.md +0 -132
  61. package/CapForm/Status.md +0 -40
  62. package/CapForm/tests/PHASE1_UNFULFILLED_USE_CASES.md +0 -113
  63. package/CapForm/tests/USE_CASES_ANALYSIS.md +0 -119
  64. package/CapFormItem/README.md +0 -320
  65. package/CapFormItem/Status.md +0 -73
  66. package/CapFormItem/tests/USE_CASES_ANALYSIS.md +0 -84
  67. package/CapGraph/README.md +0 -69
  68. package/CapGraph/USE_CASES.md +0 -66
  69. package/CapHamburgerMenu/README.md +0 -234
  70. package/CapHamburgerMenu/USE_CASES.md +0 -48
  71. package/CapHeader/Status.md +0 -41
  72. package/CapHeading/README.md +0 -220
  73. package/CapHeading/Status.md +0 -41
  74. package/CapIcon/README.md +0 -207
  75. package/CapIllustration/Status.md +0 -41
  76. package/CapImage/README.md +0 -50
  77. package/CapImportMFEComponent/README.md +0 -121
  78. package/CapInfoNote/Status.md +0 -40
  79. package/CapInfoNote/tests/USE_CASES_ANALYSIS.md +0 -114
  80. package/CapInput/README.md +0 -196
  81. package/CapInput/Status.md +0 -123
  82. package/CapInput/tests/USE_CASES_ANALYSIS.md +0 -169
  83. package/CapLanguageProvider/CapLanguageProvider-use-cases.md +0 -56
  84. package/CapLanguageProvider/README.md +0 -206
  85. package/CapLevelGraphRenderer/CapLevelGraphRenderer-test-cases.md +0 -50
  86. package/CapLevelGraphRenderer/README.md +0 -123
  87. package/CapLevelGraphRenderer/Tooltip_MIGRATION_ANALYSIS.md +0 -120
  88. package/CapLink/README.md +0 -203
  89. package/CapLink/Status.md +0 -32
  90. package/CapLink/tests/CapLink.missingUseCases.md +0 -95
  91. package/CapList/README.md +0 -129
  92. package/CapList/Status.md +0 -69
  93. package/CapListLayout/README.md +0 -7
  94. package/CapLogin/README.md +0 -7
  95. package/CapMenu/README.md +0 -86
  96. package/CapModal/README.md +0 -357
  97. package/CapModal/Status.md +0 -52
  98. package/CapModal/tests/USE_CASES_GAPS.md +0 -207
  99. package/CapMultiSelect/README.md +0 -170
  100. package/CapMultiSelect/tests/USE_CASES_ANALYSIS.md +0 -29
  101. package/CapMultiSelectDatePicker/README.md +0 -11
  102. package/CapNavigation/README.md +0 -72
  103. package/CapNotification/README.md +0 -228
  104. package/CapNotificationDropdown/README.md +0 -5
  105. package/CapPopover/README.md +0 -234
  106. package/CapProgress/Status.md +0 -40
  107. package/CapRadio/Status.md +0 -54
  108. package/CapRadioButton/README.md +0 -152
  109. package/CapRadioButton/Status.md +0 -70
  110. package/CapRadioButton/tests/USE_CASES_ANALYSIS.md +0 -120
  111. package/CapRadioCard/README.md +0 -161
  112. package/CapRadioCard/Status.md +0 -78
  113. package/CapRadioGroup/README.md +0 -141
  114. package/CapRadioGroup/Status.md +0 -59
  115. package/CapReorderComponent/README.md +0 -179
  116. package/CapReorderComponent/Status.md +0 -41
  117. package/CapRoadMap/README.md +0 -126
  118. package/CapRoadMap/Status.md +0 -53
  119. package/CapRoadMap/tests/USE_CASE_GAPS.md +0 -92
  120. package/CapRow/README.md +0 -424
  121. package/CapSKUUploader/README.md +0 -189
  122. package/CapSKUUploader/Status.md +0 -66
  123. package/CapSecondaryTopBar/README.md +0 -7
  124. package/CapSelect/README.md +0 -243
  125. package/CapSelectFilter/README.md +0 -121
  126. package/CapShape/README.md +0 -96
  127. package/CapShape/Status.md +0 -36
  128. package/CapShape/tests/USE_CASES_ANALYSIS.md +0 -120
  129. package/CapSideBar/README.md +0 -298
  130. package/CapSideBar/Status.md +0 -5
  131. package/CapSlideBox/README.md +0 -68
  132. package/CapSlider/README.md +0 -423
  133. package/CapSlider/Status.md +0 -48
  134. package/CapSlider/tests/TEST_COVERAGE.md +0 -118
  135. package/CapSnackBar/README.md +0 -222
  136. package/CapSnackBar/Status.md +0 -41
  137. package/CapSomethingWentWrong/README.md +0 -97
  138. package/CapSplit/README.md +0 -19
  139. package/CapStatisticCard/README.md +0 -138
  140. package/CapStatus/README.md +0 -148
  141. package/CapStatus/Status.md +0 -40
  142. package/CapSteps/Status.md +0 -40
  143. package/CapStepsAccordian/README.md +0 -305
  144. package/CapStepsAccordian/Status.md +0 -48
  145. package/CapSupportVideosWrapper/README.md +0 -14
  146. package/CapSwitch/README.md +0 -351
  147. package/CapTab/README.md +0 -406
  148. package/CapTab/Status.md +0 -104
  149. package/CapTab/tests/USE_CASE_GAPS.md +0 -143
  150. package/CapTabV3/ANALYSIS.md +0 -60
  151. package/CapTabV3/README.md +0 -156
  152. package/CapTabV3/Status.md +0 -52
  153. package/CapTabV3/tests/USE_CASE_GAPS.md +0 -149
  154. package/CapTable/README.md +0 -160
  155. package/CapTable/Status.md +0 -41
  156. package/CapTag/README.md +0 -16
  157. package/CapTagDropdown/README.md +0 -171
  158. package/CapTagDropdown/Status.md +0 -55
  159. package/CapTimePicker/README.md +0 -170
  160. package/CapTooltip/README.md +0 -336
  161. package/CapTooltipWithInfo/Status.md +0 -75
  162. package/CapTopBar/README.md +0 -146
  163. package/CapTree/README.md +0 -124
  164. package/CapTree/Status.md +0 -48
  165. package/CapTree/tests/STATUS.md +0 -154
  166. package/CapTreeSelect/README.md +0 -217
  167. package/CapTreeSelect/Status.md +0 -52
  168. package/CapTruncateList/README.md +0 -13
  169. package/CapUnifiedSelect/README.md +0 -40
  170. package/CapUploader/README.md +0 -313
  171. package/CapUploader/Status.md +0 -76
  172. package/CapUploader/tests/USE_CASES_ANALYSIS.md +0 -225
  173. package/CapUserProfile/README.md +0 -105
  174. package/CapUserProfile/Status.md +0 -95
  175. package/CapVirtualList/README.md +0 -162
  176. package/CapVirtualList/Status.md +0 -71
  177. package/assets/HOCs/ComponentWithLabelHOC/README.md +0 -230
@@ -1,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
-