@capillarytech/blaze-ui 5.11.6 → 5.11.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capillarytech/blaze-ui",
3
- "version": "5.11.6",
3
+ "version": "5.11.7",
4
4
  "description": "Capillary UI component library with Ant Design v6",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -49,7 +49,6 @@
49
49
  "rc-slider": "8.6.13",
50
50
  "react-datepicker": "^9.1.0",
51
51
  "react-draggable": "^4.5.0",
52
- "react-error-boundary": "^3.1.3",
53
52
  "react-intl": "2.7.2",
54
53
  "react-rnd": "^10.5.2",
55
54
  "react-virtuoso": "4.9.0",
@@ -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,10 +0,0 @@
1
- /**
2
- *
3
- * CapErrorBoundary
4
- *
5
- */
6
- import React from 'react';
7
- import { CapErrorBoundaryProps } from './types';
8
- declare const CapErrorBoundary: React.FC<CapErrorBoundaryProps>;
9
- export default CapErrorBoundary;
10
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../components/CapErrorBoundary/index.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAmB,MAAM,OAAO,CAAC;AAQxC,OAAO,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAEhD,QAAA,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CA2FrD,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
@@ -1,46 +0,0 @@
1
- import React from 'react';
2
- export interface CapErrorBoundaryProps {
3
- /** Child components to wrap with error boundary */
4
- children?: React.ReactNode;
5
- /** Additional CSS class name */
6
- className?: string;
7
- /** Whether the refresh action has expired */
8
- isExpired?: boolean;
9
- /** Whether to show API error state (only used when isApiErrorBoundary is true) */
10
- isApiError?: boolean;
11
- /** Text to display for refresh action */
12
- refreshText?: string | React.ReactNode;
13
- /** Title to display when refresh has expired */
14
- expiryTitle?: string | React.ReactNode;
15
- /** Title to display for refresh action */
16
- refreshTitle?: string | React.ReactNode;
17
- /** Whether to display error in a slide box instead of inline */
18
- useSlideBox?: boolean;
19
- /** Header for CapSlideBox when useSlideBox is true (takes precedence over slideBoxProps.header) */
20
- header?: string | React.ReactNode;
21
- /** Handler called when an error is caught */
22
- errorHandler?: (error: Error) => void;
23
- /** Props to pass to CapSlideBox when useSlideBox is true */
24
- slideBoxProps?: Record<string, unknown>;
25
- /** Handler called when refresh button is clicked */
26
- onRefreshClick?: () => void;
27
- /** Handler called when slide box is closed */
28
- onCloseSlideBox?: () => void;
29
- /** Number of refresh clicks before showing expired state */
30
- refreshThreshold?: number;
31
- /** Description to display when refresh has expired */
32
- expiryDescription?: string | React.ReactNode;
33
- /** Whether to use API error boundary mode (shows error based on isApiError prop instead of catching React errors) */
34
- isApiErrorBoundary?: boolean;
35
- /** Whether to show illustration image */
36
- showIllustrationImage?: boolean;
37
- /** Content to render before the error illustration */
38
- prefix?: string | React.ReactNode;
39
- /** Content to render after the error illustration */
40
- suffix?: string | React.ReactNode;
41
- /** Whether to show animation when error illustration appears */
42
- showAnimation?: boolean;
43
- /** Additional props to pass to CapErrorStateIllustration */
44
- [key: string]: unknown;
45
- }
46
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../components/CapErrorBoundary/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,WAAW,qBAAqB;IACpC,mDAAmD;IACnD,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,gCAAgC;IAChC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,6CAA6C;IAC7C,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,kFAAkF;IAClF,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,yCAAyC;IACzC,WAAW,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC;IACvC,gDAAgD;IAChD,WAAW,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC;IACvC,0CAA0C;IAC1C,YAAY,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC;IACxC,gEAAgE;IAChE,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,mGAAmG;IACnG,MAAM,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC;IAClC,6CAA6C;IAC7C,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACtC,4DAA4D;IAC5D,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACxC,oDAAoD;IACpD,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B,8CAA8C;IAC9C,eAAe,CAAC,EAAE,MAAM,IAAI,CAAC;IAC7B,4DAA4D;IAC5D,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,sDAAsD;IACtD,iBAAiB,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC;IAC7C,qHAAqH;IACrH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,yCAAyC;IACzC,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,sDAAsD;IACtD,MAAM,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC;IAClC,qDAAqD;IACrD,MAAM,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC;IAClC,gEAAgE;IAChE,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,4DAA4D;IAC5D,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB"}