@whatisboom/boom-ui 0.1.0 → 0.3.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.
- package/dist/components/ErrorBoundary/DefaultErrorFallback.d.ts +7 -0
- package/dist/components/ErrorBoundary/DefaultErrorFallback.d.ts.map +1 -0
- package/dist/components/ErrorBoundary/ErrorBoundary.d.ts +13 -0
- package/dist/components/ErrorBoundary/ErrorBoundary.d.ts.map +1 -0
- package/dist/components/ErrorBoundary/ErrorBoundary.stories.d.ts +23 -0
- package/dist/components/ErrorBoundary/ErrorBoundary.stories.d.ts.map +1 -0
- package/dist/components/ErrorBoundary/ErrorBoundary.test.d.ts +2 -0
- package/dist/components/ErrorBoundary/ErrorBoundary.test.d.ts.map +1 -0
- package/dist/components/ErrorBoundary/ErrorBoundary.types.d.ts +57 -0
- package/dist/components/ErrorBoundary/ErrorBoundary.types.d.ts.map +1 -0
- package/dist/components/ErrorBoundary/index.d.ts +4 -0
- package/dist/components/ErrorBoundary/index.d.ts.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2449 -2356
- package/dist/index.js.map +1 -1
- package/dist/styles/index.css +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { FallbackProps } from './ErrorBoundary.types';
|
|
2
|
+
|
|
3
|
+
export declare const DefaultErrorFallback: {
|
|
4
|
+
({ error, errorInfo, resetError }: FallbackProps): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
displayName: string;
|
|
6
|
+
};
|
|
7
|
+
//# sourceMappingURL=DefaultErrorFallback.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DefaultErrorFallback.d.ts","sourceRoot":"","sources":["../../../src/components/ErrorBoundary/DefaultErrorFallback.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAmBtD,eAAO,MAAM,oBAAoB;uCAAsC,aAAa;;CAyCnF,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Component, ReactNode } from 'react';
|
|
2
|
+
import { ErrorBoundaryProps, ErrorBoundaryState } from './ErrorBoundary.types';
|
|
3
|
+
|
|
4
|
+
export declare class ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundaryState> {
|
|
5
|
+
static displayName: string;
|
|
6
|
+
constructor(props: ErrorBoundaryProps);
|
|
7
|
+
static getDerivedStateFromError(error: Error): Partial<ErrorBoundaryState>;
|
|
8
|
+
componentDidCatch(error: Error, errorInfo: React.ErrorInfo): void;
|
|
9
|
+
componentDidUpdate(prevProps: ErrorBoundaryProps): void;
|
|
10
|
+
reset: () => void;
|
|
11
|
+
render(): ReactNode;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=ErrorBoundary.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ErrorBoundary.d.ts","sourceRoot":"","sources":["../../../src/components/ErrorBoundary/ErrorBoundary.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAE7C,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAiB,MAAM,uBAAuB,CAAC;AAI9F,qBAAa,aAAc,SAAQ,SAAS,CAAC,kBAAkB,EAAE,kBAAkB,CAAC;IAClF,MAAM,CAAC,WAAW,SAAmB;gBAEzB,KAAK,EAAE,kBAAkB;IASrC,MAAM,CAAC,wBAAwB,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAO1E,iBAAiB,CAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,CAAC,SAAS,GAAG,IAAI;IAQjE,kBAAkB,CAAC,SAAS,EAAE,kBAAkB,GAAG,IAAI;IAUvD,KAAK,QAAO,IAAI,CAOd;IAEF,MAAM,IAAI,SAAS;CAkCpB"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { ErrorBoundary } from './ErrorBoundary';
|
|
3
|
+
|
|
4
|
+
declare const meta: {
|
|
5
|
+
title: string;
|
|
6
|
+
component: typeof ErrorBoundary;
|
|
7
|
+
tags: string[];
|
|
8
|
+
parameters: {
|
|
9
|
+
docs: {
|
|
10
|
+
description: {
|
|
11
|
+
component: string;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
export default meta;
|
|
17
|
+
type Story = StoryObj<typeof meta>;
|
|
18
|
+
export declare const Default: Story;
|
|
19
|
+
export declare const CustomFallback: Story;
|
|
20
|
+
export declare const CustomFallbackRender: Story;
|
|
21
|
+
export declare const WithErrorLogging: Story;
|
|
22
|
+
export declare const WithAutoReset: Story;
|
|
23
|
+
//# sourceMappingURL=ErrorBoundary.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ErrorBoundary.stories.d.ts","sourceRoot":"","sources":["../../../src/components/ErrorBoundary/ErrorBoundary.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAE5D,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAUhD,QAAA,MAAM,IAAI;;;;;;;;;;;CAY4B,CAAC;AAEvC,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAiBrB,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,KAc5B,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,KAelC,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,KAa9B,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,KAgB3B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ErrorBoundary.test.d.ts","sourceRoot":"","sources":["../../../src/components/ErrorBoundary/ErrorBoundary.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface FallbackProps {
|
|
4
|
+
/**
|
|
5
|
+
* The error that was caught
|
|
6
|
+
*/
|
|
7
|
+
error: Error;
|
|
8
|
+
/**
|
|
9
|
+
* Error info with component stack
|
|
10
|
+
* May be null if accessed before componentDidCatch completes
|
|
11
|
+
*/
|
|
12
|
+
errorInfo: React.ErrorInfo | null;
|
|
13
|
+
/**
|
|
14
|
+
* Function to reset the error boundary and retry
|
|
15
|
+
*/
|
|
16
|
+
resetError: () => void;
|
|
17
|
+
}
|
|
18
|
+
export interface ErrorBoundaryProps {
|
|
19
|
+
/**
|
|
20
|
+
* The content to render when there's no error
|
|
21
|
+
*/
|
|
22
|
+
children: ReactNode;
|
|
23
|
+
/**
|
|
24
|
+
* Custom fallback UI as ReactNode
|
|
25
|
+
* Takes precedence over fallbackRender
|
|
26
|
+
*/
|
|
27
|
+
fallback?: ReactNode;
|
|
28
|
+
/**
|
|
29
|
+
* Custom fallback UI as render function
|
|
30
|
+
* Receives error, errorInfo, and resetError
|
|
31
|
+
*/
|
|
32
|
+
fallbackRender?: (props: FallbackProps) => ReactNode;
|
|
33
|
+
/**
|
|
34
|
+
* Callback fired when an error is caught
|
|
35
|
+
* Use for logging to external services (e.g., Sentry)
|
|
36
|
+
*/
|
|
37
|
+
onError?: (error: Error, errorInfo: React.ErrorInfo) => void;
|
|
38
|
+
/**
|
|
39
|
+
* Callback fired when error boundary is reset
|
|
40
|
+
*/
|
|
41
|
+
onReset?: () => void;
|
|
42
|
+
/**
|
|
43
|
+
* When this key changes, the error boundary will reset
|
|
44
|
+
* Useful for resetting on route changes or data changes
|
|
45
|
+
*/
|
|
46
|
+
resetKey?: string | number;
|
|
47
|
+
/**
|
|
48
|
+
* Additional CSS class name
|
|
49
|
+
*/
|
|
50
|
+
className?: string;
|
|
51
|
+
}
|
|
52
|
+
export interface ErrorBoundaryState {
|
|
53
|
+
hasError: boolean;
|
|
54
|
+
error: Error | null;
|
|
55
|
+
errorInfo: React.ErrorInfo | null;
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=ErrorBoundary.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ErrorBoundary.types.d.ts","sourceRoot":"","sources":["../../../src/components/ErrorBoundary/ErrorBoundary.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,KAAK,EAAE,KAAK,CAAC;IAEb;;;OAGG;IACH,SAAS,EAAE,KAAK,CAAC,SAAS,GAAG,IAAI,CAAC;IAElC;;OAEG;IACH,UAAU,EAAE,MAAM,IAAI,CAAC;CACxB;AAED,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;IAEpB;;;OAGG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IAErB;;;OAGG;IACH,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,SAAS,CAAC;IAErD;;;OAGG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,CAAC,SAAS,KAAK,IAAI,CAAC;IAE7D;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IAErB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAE3B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IACpB,SAAS,EAAE,KAAK,CAAC,SAAS,GAAG,IAAI,CAAC;CACnC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/ErrorBoundary/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,YAAY,EAAE,kBAAkB,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -17,6 +17,7 @@ export { Toast, ToastProvider, useToast } from './components/Toast';
|
|
|
17
17
|
export { Badge } from './components/Badge';
|
|
18
18
|
export { Tooltip } from './components/Tooltip';
|
|
19
19
|
export { ThemeProvider, useTheme } from './components/ThemeProvider';
|
|
20
|
+
export { ErrorBoundary } from './components/ErrorBoundary';
|
|
20
21
|
export { Popover } from './components/primitives/Popover';
|
|
21
22
|
export { Modal } from './components/primitives/Modal';
|
|
22
23
|
export { Drawer } from './components/primitives/Drawer';
|
|
@@ -44,6 +45,7 @@ export type { TabsProps, TabListProps, TabProps, TabPanelProps } from './compone
|
|
|
44
45
|
export { Avatar } from './components/Avatar';
|
|
45
46
|
export type { AvatarProps, AvatarSize, AvatarStatus } from './components/Avatar';
|
|
46
47
|
export type { Theme, ResolvedTheme, ThemeProviderProps, ThemeProviderContextValue, } from './components/ThemeProvider';
|
|
48
|
+
export type { ErrorBoundaryProps, FallbackProps } from './components/ErrorBoundary';
|
|
47
49
|
export type { PopoverProps, ModalProps, DrawerProps, OverlayProps } from './components/primitives/types';
|
|
48
50
|
export type { PortalProps } from './components/primitives/Portal';
|
|
49
51
|
export type { Size, Variant, PolymorphicProps } from './types';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,oBAAoB,CAAC;AAG5B,O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