@capillarytech/blaze-ui 5.11.1 → 5.11.6
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/.npmrc +2 -0
- package/CapErrorBoundary/CapErrorBoundary-use-cases.md +89 -0
- package/CapErrorBoundary/README.md +150 -0
- package/CapErrorBoundary/index.d.ts +10 -0
- package/CapErrorBoundary/index.d.ts.map +1 -0
- package/CapErrorBoundary/index.js +62 -127
- package/CapErrorBoundary/index.js.map +1 -1
- package/CapErrorBoundary/types.d.ts +46 -0
- package/CapErrorBoundary/types.d.ts.map +1 -0
- package/CapErrorStateIllustration/README.md +222 -0
- package/CapErrorStateIllustration/USE_CASES.md +33 -0
- package/CapErrorStateIllustration/index.d.ts +11 -0
- package/CapErrorStateIllustration/index.d.ts.map +1 -0
- package/CapErrorStateIllustration/index.js +22 -52
- package/CapErrorStateIllustration/index.js.map +1 -1
- package/CapErrorStateIllustration/types.d.ts +20 -0
- package/CapErrorStateIllustration/types.d.ts.map +1 -0
- package/index.d.ts +4 -0
- package/index.d.ts.map +1 -1
- package/index.js +372 -2
- package/index.js.map +1 -1
- package/package.json +2 -1
|
@@ -0,0 +1,46 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
# CapErrorStateIllustration Migration Documentation
|
|
2
|
+
|
|
3
|
+
## Summary
|
|
4
|
+
|
|
5
|
+
`CapErrorStateIllustration` has been migrated from `@capillarytech/cap-ui-library` (Ant Design v3) to `@capillarytech/blaze-ui` (Ant Design v6). The component displays error state illustrations with optional refresh functionality or expiry messages.
|
|
6
|
+
|
|
7
|
+
## Migration Changes
|
|
8
|
+
|
|
9
|
+
### Component Structure
|
|
10
|
+
|
|
11
|
+
**Before (cap-ui-library):**
|
|
12
|
+
- Used PropTypes for runtime type checking
|
|
13
|
+
- Used defaultProps for default values
|
|
14
|
+
- Used styled-components for styling
|
|
15
|
+
- Function component with destructuring
|
|
16
|
+
|
|
17
|
+
**After (blaze-ui):**
|
|
18
|
+
- TypeScript types from `types.ts` (no PropTypes)
|
|
19
|
+
- Default values in function argument destructuring (no defaultProps)
|
|
20
|
+
- CSS Modules with SCSS (no styled-components)
|
|
21
|
+
- Functional component with React.FC type
|
|
22
|
+
|
|
23
|
+
## Props
|
|
24
|
+
|
|
25
|
+
### Props Comparison
|
|
26
|
+
|
|
27
|
+
| Prop | cap-ui-library | blaze-ui | Status |
|
|
28
|
+
|------|----------------|----------|--------|
|
|
29
|
+
| `showImage` | ✅ | ✅ | **Unchanged** |
|
|
30
|
+
| `className` | ✅ | ✅ | **Unchanged** |
|
|
31
|
+
| `refreshText` | ✅ | ✅ | **Unchanged** |
|
|
32
|
+
| `expiryTitle` | ✅ | ✅ | **Unchanged** |
|
|
33
|
+
| `refreshTitle` | ✅ | ✅ | **Unchanged** |
|
|
34
|
+
| `onRefreshClick` | ✅ | ✅ | **Unchanged** |
|
|
35
|
+
| `isRefreshExpired` | ✅ | ✅ | **Unchanged** |
|
|
36
|
+
| `expiryDescription` | ✅ | ✅ | **Unchanged** |
|
|
37
|
+
| `...rest` | ✅ | ✅ | **Unchanged** (HTML div attributes) |
|
|
38
|
+
|
|
39
|
+
### All Props
|
|
40
|
+
|
|
41
|
+
#### `showImage`
|
|
42
|
+
- **Type:** `boolean`
|
|
43
|
+
- **Default:** `true`
|
|
44
|
+
- **Description:** Whether to show the error state illustration image
|
|
45
|
+
- **Example:**
|
|
46
|
+
```tsx
|
|
47
|
+
<CapErrorStateIllustration showImage={false} />
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
#### `className`
|
|
51
|
+
- **Type:** `string`
|
|
52
|
+
- **Default:** `''`
|
|
53
|
+
- **Description:** Additional CSS class name
|
|
54
|
+
- **Example:**
|
|
55
|
+
```tsx
|
|
56
|
+
<CapErrorStateIllustration className="custom-class" />
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
#### `refreshText`
|
|
60
|
+
- **Type:** `string | React.ReactNode`
|
|
61
|
+
- **Default:** `''`
|
|
62
|
+
- **Description:** Text or node to display in the refresh button (when not expired)
|
|
63
|
+
- **Example:**
|
|
64
|
+
```tsx
|
|
65
|
+
<CapErrorStateIllustration refreshText="Refresh" />
|
|
66
|
+
<CapErrorStateIllustration refreshText={<span>Custom Refresh</span>} />
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
#### `expiryTitle`
|
|
70
|
+
- **Type:** `string | React.ReactNode`
|
|
71
|
+
- **Default:** `''`
|
|
72
|
+
- **Description:** Title to display when refresh is expired
|
|
73
|
+
- **Example:**
|
|
74
|
+
```tsx
|
|
75
|
+
<CapErrorStateIllustration expiryTitle="Session Expired" isRefreshExpired />
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
#### `refreshTitle`
|
|
79
|
+
- **Type:** `string | React.ReactNode`
|
|
80
|
+
- **Default:** `''`
|
|
81
|
+
- **Description:** Title to display when refresh is available
|
|
82
|
+
- **Example:**
|
|
83
|
+
```tsx
|
|
84
|
+
<CapErrorStateIllustration refreshTitle="Something went wrong" />
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
#### `onRefreshClick`
|
|
88
|
+
- **Type:** `() => void`
|
|
89
|
+
- **Default:** `() => {}`
|
|
90
|
+
- **Description:** Callback function when refresh button is clicked
|
|
91
|
+
- **Example:**
|
|
92
|
+
```tsx
|
|
93
|
+
<CapErrorStateIllustration
|
|
94
|
+
onRefreshClick={() => window.location.reload()}
|
|
95
|
+
/>
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
#### `isRefreshExpired`
|
|
99
|
+
- **Type:** `boolean`
|
|
100
|
+
- **Default:** `false`
|
|
101
|
+
- **Description:** Whether the refresh has expired
|
|
102
|
+
- **Example:**
|
|
103
|
+
```tsx
|
|
104
|
+
<CapErrorStateIllustration isRefreshExpired={true} />
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
#### `expiryDescription`
|
|
108
|
+
- **Type:** `string | React.ReactNode`
|
|
109
|
+
- **Default:** `''`
|
|
110
|
+
- **Description:** Description to display when refresh is expired
|
|
111
|
+
- **Example:**
|
|
112
|
+
```tsx
|
|
113
|
+
<CapErrorStateIllustration
|
|
114
|
+
expiryDescription="Please refresh the page"
|
|
115
|
+
isRefreshExpired
|
|
116
|
+
/>
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
## Usage Examples
|
|
120
|
+
|
|
121
|
+
### Basic Usage
|
|
122
|
+
|
|
123
|
+
```tsx
|
|
124
|
+
import CapErrorStateIllustration from '@capillarytech/blaze-ui/CapErrorStateIllustration';
|
|
125
|
+
|
|
126
|
+
<CapErrorStateIllustration
|
|
127
|
+
refreshTitle="Something went wrong"
|
|
128
|
+
refreshText="Refresh"
|
|
129
|
+
onRefreshClick={() => window.location.reload()}
|
|
130
|
+
/>
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
### Expired State
|
|
134
|
+
|
|
135
|
+
```tsx
|
|
136
|
+
<CapErrorStateIllustration
|
|
137
|
+
isRefreshExpired={true}
|
|
138
|
+
expiryTitle="Session Expired"
|
|
139
|
+
expiryDescription="Please refresh the page"
|
|
140
|
+
/>
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
### Without Image
|
|
144
|
+
|
|
145
|
+
```tsx
|
|
146
|
+
<CapErrorStateIllustration
|
|
147
|
+
showImage={false}
|
|
148
|
+
refreshTitle="Error occurred"
|
|
149
|
+
refreshText="Try again"
|
|
150
|
+
onRefreshClick={handleRefresh}
|
|
151
|
+
/>
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
### Custom Content
|
|
155
|
+
|
|
156
|
+
```tsx
|
|
157
|
+
<CapErrorStateIllustration
|
|
158
|
+
refreshTitle={<strong>Error</strong>}
|
|
159
|
+
refreshText={<span>Click to <em>refresh</em></span>}
|
|
160
|
+
onRefreshClick={handleRefresh}
|
|
161
|
+
/>
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
## Style Changes
|
|
165
|
+
|
|
166
|
+
**Approach**: The component now uses CSS Modules with SCSS instead of styled-components. All styling is done through CSS classes.
|
|
167
|
+
|
|
168
|
+
### Removed Dependencies
|
|
169
|
+
- `styled-components` - Replaced with CSS Modules
|
|
170
|
+
- `prop-types` - Replaced with TypeScript types
|
|
171
|
+
|
|
172
|
+
### CSS Classes
|
|
173
|
+
|
|
174
|
+
The component uses the following CSS classes:
|
|
175
|
+
- `.cap-error-state-illustration` - Main container
|
|
176
|
+
- `.error-state-image` - Image wrapper
|
|
177
|
+
- `.error-state-refresh-button` - Refresh button
|
|
178
|
+
- `.error-state-refresh-icon` - Refresh icon
|
|
179
|
+
- `.refresh-button-text-container` - Refresh button text container
|
|
180
|
+
|
|
181
|
+
## Code Improvements
|
|
182
|
+
|
|
183
|
+
1. **Removed PropTypes**: Replaced with TypeScript types from `types.ts`
|
|
184
|
+
2. **Removed defaultProps**: Default values now in function argument destructuring
|
|
185
|
+
3. **Removed styled-components**: Converted to CSS Modules with SCSS
|
|
186
|
+
4. **Type safety**: Full TypeScript support with proper type exports
|
|
187
|
+
5. **Better maintainability**: CSS Modules provide better encapsulation
|
|
188
|
+
|
|
189
|
+
## What Stayed the Same
|
|
190
|
+
|
|
191
|
+
- All props and their behavior
|
|
192
|
+
- Component functionality and logic
|
|
193
|
+
- Visual appearance (styling preserved)
|
|
194
|
+
- API surface area (backward compatible)
|
|
195
|
+
|
|
196
|
+
## What Changed
|
|
197
|
+
|
|
198
|
+
- **Removed**: `PropTypes` import and usage
|
|
199
|
+
- **Removed**: `defaultProps` assignment
|
|
200
|
+
- **Removed**: `styled-components` dependency
|
|
201
|
+
- **Added**: TypeScript types in `types.ts`
|
|
202
|
+
- **Added**: CSS Modules classes in `styles.scss`
|
|
203
|
+
- **Changed**: Default values now in function arguments
|
|
204
|
+
|
|
205
|
+
## Migration Guide
|
|
206
|
+
|
|
207
|
+
If you're migrating from the old version:
|
|
208
|
+
|
|
209
|
+
1. **No code changes required** - The component API is backward compatible
|
|
210
|
+
2. **TypeScript users**: You can now import types:
|
|
211
|
+
```tsx
|
|
212
|
+
import type { CapErrorStateIllustrationProps } from '@capillarytech/blaze-ui/CapErrorStateIllustration';
|
|
213
|
+
```
|
|
214
|
+
3. **Styling**: If you were overriding styles, update selectors to use CSS Modules classes
|
|
215
|
+
|
|
216
|
+
## Related Components
|
|
217
|
+
|
|
218
|
+
- `CapButton` - Used for the refresh button
|
|
219
|
+
- `CapHeading` - Used for titles
|
|
220
|
+
- `CapIcon` - Used for refresh icon
|
|
221
|
+
- `CapImage` - Used for error illustrations
|
|
222
|
+
- `CapRow` - Used for layout
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Test Cases: CapErrorStateIllustration (Antd v3→v6)
|
|
2
|
+
|
|
3
|
+
## Component Analysis
|
|
4
|
+
- **Component**: CapErrorStateIllustration
|
|
5
|
+
- **Complexity**: simple
|
|
6
|
+
- **Test Case Limit**: ≤10 test cases
|
|
7
|
+
|
|
8
|
+
## Generated Test Cases
|
|
9
|
+
|
|
10
|
+
| ID | Use Case | Props/Config | Expected Visual/Behavior | Priority | Storybook Story | Notes |
|
|
11
|
+
|----|----------|--------------|-------------------------|----------|-----------------|-------|
|
|
12
|
+
| UC-001 | Default rendering | All default props (showImage: true, isRefreshExpired: false, empty strings) | Component renders with refresh illustration image, no visible text or button | P0 | Default | Basic rendering with default props |
|
|
13
|
+
| UC-002 | Refresh state vs Expiry state | isRefreshExpired: false vs true | When false: shows refreshErrorStateIllustration, refreshTitle, refresh button. When true: shows expiryErrorStateIllustration, expiryTitle, expiryDescription | P0 | StateVariants | Grouped both state variants into single test |
|
|
14
|
+
| UC-003 | Image visibility toggle | showImage: true vs false | When true: image renders. When false: no image displayed | P1 | ImageVisibility | Grouped both image states |
|
|
15
|
+
| UC-004 | Content variants | refreshTitle, expiryTitle, expiryDescription, refreshText with various values (string, node, empty) | All text props render correctly. String and node types supported. Empty strings hide elements | P1 | ContentVariants | Grouped all text content props |
|
|
16
|
+
| UC-005 | Refresh button interaction | refreshText: "Refresh", onRefreshClick: mock function | Button renders with refresh icon and text. Click triggers onRefreshClick handler | P0 | RefreshInteraction | Critical user interaction |
|
|
17
|
+
| UC-006 | Custom styling | className: "custom-class" | Custom className applied to container element | P2 | CustomStyling | Basic styling support |
|
|
18
|
+
| UC-007 | Edge cases - minimal content | Only showImage: true, all text props empty | Component renders with only image, no text or buttons | P1 | MinimalContent | Edge case for empty content |
|
|
19
|
+
| UC-008 | HTML attributes passthrough | {...rest} props (data-testid, aria-label, etc.) | Additional HTML attributes passed to container element | P2 | AttributesPassthrough | Grouped all HTML/ARIA attributes |
|
|
20
|
+
| UC-009 | Refresh button with node content | refreshText: <span>Custom Node</span> | Button accepts node type for refreshText and renders correctly | P1 | NodeContentSupport | Tests PropTypes.oneOfType support |
|
|
21
|
+
| UC-010 | Complete refresh state | showImage: true, isRefreshExpired: false, refreshTitle: "Error", refreshText: "Retry", onRefreshClick: handler | All refresh state elements visible: image, title, button with icon and text | P0 | CompleteRefreshState | Full refresh state integration |
|
|
22
|
+
|
|
23
|
+
## Summary
|
|
24
|
+
- **Total Test Cases**: 10
|
|
25
|
+
- **P0 (Blocking)**: 3
|
|
26
|
+
- **P1 (High)**: 5
|
|
27
|
+
- **P2 (Medium)**: 2
|
|
28
|
+
|
|
29
|
+
## Grouping Rationale
|
|
30
|
+
- State variants (UC-002): Combined refresh and expiry states as they're mutually exclusive
|
|
31
|
+
- Content variants (UC-004): Grouped all text props since they follow similar patterns
|
|
32
|
+
- Image visibility (UC-003): Simple boolean toggle grouped together
|
|
33
|
+
- Attributes (UC-008): All HTML/ARIA attributes grouped as passthrough props
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* CapErrorStateIllustration
|
|
4
|
+
*
|
|
5
|
+
*/
|
|
6
|
+
import React from 'react';
|
|
7
|
+
import type { CapErrorStateIllustrationProps } from './types';
|
|
8
|
+
declare const CapErrorStateIllustration: React.FC<CapErrorStateIllustrationProps>;
|
|
9
|
+
export default CapErrorStateIllustration;
|
|
10
|
+
export type { CapErrorStateIllustrationProps } from './types';
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../components/CapErrorStateIllustration/index.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,MAAM,OAAO,CAAC;AAW1B,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,SAAS,CAAC;AAE9D,QAAA,MAAM,yBAAyB,EAAE,KAAK,CAAC,EAAE,CAAC,8BAA8B,CA2CvE,CAAC;AAIF,eAAe,yBAAyB,CAAC;AACzC,YAAY,EAAE,8BAA8B,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -10894,13 +10894,15 @@ var ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ = __webpack_require__(31601);
|
|
|
10894
10894
|
var ___CSS_LOADER_API_IMPORT___ = __webpack_require__(76314);
|
|
10895
10895
|
var ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);
|
|
10896
10896
|
// Module
|
|
10897
|
-
___CSS_LOADER_EXPORT___.push([module.id, `.cap-error-state-illustration .error-state-image{padding-bottom:1.428rem}.cap-error-state-illustration .error-state-refresh-button{margin:.285rem}.cap-error-state-illustration .error-state-refresh-icon{font-size:1.143rem}`, ""]);
|
|
10897
|
+
___CSS_LOADER_EXPORT___.push([module.id, `.cap-error-state-illustration{width:100%;height:100%;display:flex;text-align:center;align-items:center;justify-content:center}.cap-error-state-illustration .error-state-image{padding-bottom:1.428rem}.cap-error-state-illustration .error-state-refresh-button{margin:.285rem}.cap-error-state-illustration .error-state-refresh-icon{font-size:1.143rem}.cap-error-state-illustration .error-state-illustration-content{display:flex;flex-direction:column;align-items:center;justify-content:center}.cap-error-state-illustration .refresh-button-text-container{display:flex;align-items:center;gap:.285rem;padding:.285rem;color:#2466ea}`, ""]);
|
|
10898
10898
|
// Exports
|
|
10899
10899
|
___CSS_LOADER_EXPORT___.locals = {
|
|
10900
10900
|
"cap-error-state-illustration": `cap-error-state-illustration`,
|
|
10901
10901
|
"error-state-image": `error-state-image`,
|
|
10902
10902
|
"error-state-refresh-button": `error-state-refresh-button`,
|
|
10903
|
-
"error-state-refresh-icon": `error-state-refresh-icon
|
|
10903
|
+
"error-state-refresh-icon": `error-state-refresh-icon`,
|
|
10904
|
+
"error-state-illustration-content": `error-state-illustration-content`,
|
|
10905
|
+
"refresh-button-text-container": `refresh-button-text-container`
|
|
10904
10906
|
};
|
|
10905
10907
|
module.exports = ___CSS_LOADER_EXPORT___;
|
|
10906
10908
|
|
|
@@ -13313,14 +13315,6 @@ var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js
|
|
|
13313
13315
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_1_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_1_use_2_styles_scss__WEBPACK_IMPORTED_MODULE_5___default()) && (_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_1_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_1_use_2_styles_scss__WEBPACK_IMPORTED_MODULE_5___default().locals) ? (_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_1_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_1_use_2_styles_scss__WEBPACK_IMPORTED_MODULE_5___default().locals) : undefined);
|
|
13314
13316
|
|
|
13315
13317
|
|
|
13316
|
-
/***/ }),
|
|
13317
|
-
|
|
13318
|
-
/***/ 76480:
|
|
13319
|
-
/***/ ((module) => {
|
|
13320
|
-
|
|
13321
|
-
"use strict";
|
|
13322
|
-
module.exports = require("styled-components");
|
|
13323
|
-
|
|
13324
13318
|
/***/ }),
|
|
13325
13319
|
|
|
13326
13320
|
/***/ 76903:
|
|
@@ -16446,9 +16440,7 @@ var exports = __webpack_exports__;
|
|
|
16446
16440
|
exports.__esModule = true;
|
|
16447
16441
|
exports["default"] = void 0;
|
|
16448
16442
|
var _classnames = _interopRequireDefault(__webpack_require__(46942));
|
|
16449
|
-
var _propTypes = _interopRequireDefault(__webpack_require__(43363));
|
|
16450
16443
|
var _react = _interopRequireDefault(__webpack_require__(9206));
|
|
16451
|
-
var _styledComponents = _interopRequireDefault(__webpack_require__(76480));
|
|
16452
16444
|
var _expiryErrorStateIllustration = _interopRequireDefault(__webpack_require__(67277));
|
|
16453
16445
|
var _refreshErrorStateIllustration = _interopRequireDefault(__webpack_require__(57291));
|
|
16454
16446
|
var _CapButton = _interopRequireDefault(__webpack_require__(80739));
|
|
@@ -16456,11 +16448,9 @@ var _CapHeading = _interopRequireDefault(__webpack_require__(7319));
|
|
|
16456
16448
|
var _CapIcon = _interopRequireDefault(__webpack_require__(65124));
|
|
16457
16449
|
var _CapImage = _interopRequireDefault(__webpack_require__(84446));
|
|
16458
16450
|
var _CapRow = _interopRequireDefault(__webpack_require__(69813));
|
|
16459
|
-
var
|
|
16460
|
-
__webpack_require__(72890);
|
|
16451
|
+
var _styles = _interopRequireDefault(__webpack_require__(72890));
|
|
16461
16452
|
var _jsxRuntime = __webpack_require__(74848);
|
|
16462
16453
|
const _excluded = ["showImage", "className", "refreshText", "expiryTitle", "refreshTitle", "onRefreshClick", "isRefreshExpired", "expiryDescription"];
|
|
16463
|
-
var _templateObject, _templateObject2;
|
|
16464
16454
|
/**
|
|
16465
16455
|
*
|
|
16466
16456
|
* CapErrorStateIllustration
|
|
@@ -16469,28 +16459,26 @@ var _templateObject, _templateObject2;
|
|
|
16469
16459
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
16470
16460
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
16471
16461
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
16472
|
-
function _taggedTemplateLiteralLoose(e, t) { return t || (t = e.slice(0)), e.raw = t, e; }
|
|
16473
|
-
const ErrorStateIllustrationContainer = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteralLoose(["\n width: 100%;\n height: 100%;\n display: flex;\n text-align: center;\n align-items: center;\n justify-content: center;\n"])));
|
|
16474
|
-
const RefreshButtonTextContainer = _styledComponents.default.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n gap: ", ";\n padding: ", ";\n color: ", ";\n"])), _variables.CAP_SPACE_04, _variables.CAP_SPACE_04, _variables.CAP_SECONDARY.base);
|
|
16475
16462
|
const CapErrorStateIllustration = _ref => {
|
|
16476
16463
|
let {
|
|
16477
|
-
showImage,
|
|
16478
|
-
className,
|
|
16479
|
-
refreshText,
|
|
16480
|
-
expiryTitle,
|
|
16481
|
-
refreshTitle,
|
|
16482
|
-
onRefreshClick,
|
|
16483
|
-
isRefreshExpired,
|
|
16484
|
-
expiryDescription
|
|
16464
|
+
showImage = true,
|
|
16465
|
+
className = '',
|
|
16466
|
+
refreshText = '',
|
|
16467
|
+
expiryTitle = '',
|
|
16468
|
+
refreshTitle = '',
|
|
16469
|
+
onRefreshClick = () => {},
|
|
16470
|
+
isRefreshExpired = false,
|
|
16471
|
+
expiryDescription = ''
|
|
16485
16472
|
} = _ref,
|
|
16486
16473
|
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
16487
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
16488
|
-
className: (0, _classnames.default)('cap-error-state-illustration', className)
|
|
16474
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", _extends({
|
|
16475
|
+
className: (0, _classnames.default)(_styles.default['cap-error-state-illustration'], className)
|
|
16489
16476
|
}, rest, {
|
|
16490
16477
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_CapRow.default, {
|
|
16478
|
+
className: _styles.default['error-state-illustration-content'],
|
|
16491
16479
|
children: [showImage && /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapImage.default, {
|
|
16492
16480
|
src: isRefreshExpired ? _expiryErrorStateIllustration.default : _refreshErrorStateIllustration.default,
|
|
16493
|
-
className:
|
|
16481
|
+
className: _styles.default['error-state-image']
|
|
16494
16482
|
}), !isRefreshExpired ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
16495
16483
|
children: [refreshTitle && /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapHeading.default, {
|
|
16496
16484
|
type: "h4",
|
|
@@ -16498,11 +16486,12 @@ const CapErrorStateIllustration = _ref => {
|
|
|
16498
16486
|
}), refreshText && /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapButton.default, {
|
|
16499
16487
|
type: "link",
|
|
16500
16488
|
onClick: onRefreshClick,
|
|
16501
|
-
className:
|
|
16502
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(
|
|
16489
|
+
className: _styles.default['error-state-refresh-button'],
|
|
16490
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
16491
|
+
className: _styles.default['refresh-button-text-container'],
|
|
16503
16492
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_CapIcon.default, {
|
|
16504
16493
|
type: "refresh",
|
|
16505
|
-
className:
|
|
16494
|
+
className: _styles.default['error-state-refresh-icon']
|
|
16506
16495
|
}), refreshText]
|
|
16507
16496
|
})
|
|
16508
16497
|
})]
|
|
@@ -16518,26 +16507,7 @@ const CapErrorStateIllustration = _ref => {
|
|
|
16518
16507
|
})
|
|
16519
16508
|
}));
|
|
16520
16509
|
};
|
|
16521
|
-
CapErrorStateIllustration.
|
|
16522
|
-
className: '',
|
|
16523
|
-
refreshText: '',
|
|
16524
|
-
expiryTitle: '',
|
|
16525
|
-
showImage: true,
|
|
16526
|
-
refreshTitle: '',
|
|
16527
|
-
expiryDescription: '',
|
|
16528
|
-
isRefreshExpired: false,
|
|
16529
|
-
onRefreshClick: () => {}
|
|
16530
|
-
};
|
|
16531
|
-
CapErrorStateIllustration.propTypes = {
|
|
16532
|
-
showImage: _propTypes.default.bool,
|
|
16533
|
-
className: _propTypes.default.string,
|
|
16534
|
-
onRefreshClick: _propTypes.default.func,
|
|
16535
|
-
isRefreshExpired: _propTypes.default.bool,
|
|
16536
|
-
refreshText: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.node]),
|
|
16537
|
-
expiryTitle: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.node]),
|
|
16538
|
-
refreshTitle: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.node]),
|
|
16539
|
-
expiryDescription: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.node])
|
|
16540
|
-
};
|
|
16510
|
+
CapErrorStateIllustration.displayName = 'CapErrorStateIllustration';
|
|
16541
16511
|
var _default = exports["default"] = CapErrorStateIllustration;
|
|
16542
16512
|
})();
|
|
16543
16513
|
|