@saas-ui/react 1.9.1 → 2.0.0-next.0
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +37 -7
- package/README.md +1 -1
- package/dist/index.d.ts +8 -32
- package/dist/index.js +63 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +13 -31
- package/src/index.ts +6 -29
- package/dist/error-boundary.d.ts +0 -22
- package/dist/error-boundary.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.modern.mjs +0 -2
- package/dist/index.modern.mjs.map +0 -1
- package/dist/typography.d.ts +0 -4
- package/dist/typography.d.ts.map +0 -1
- package/src/error-boundary.tsx +0 -40
- package/src/typography.tsx +0 -10
package/CHANGELOG.md
CHANGED
@@ -1,14 +1,44 @@
|
|
1
1
|
# @saas-ui/react
|
2
2
|
|
3
|
-
##
|
3
|
+
## 2.0.0-next.0
|
4
4
|
|
5
|
-
###
|
5
|
+
### Major Changes
|
6
|
+
|
7
|
+
- 772c9868: Updated to Tanstack ReactTable V8
|
8
|
+
- d7c87a31: Moved form resolvers into a separate package.
|
9
|
+
- f1e99198: BREAKING: createPalette no longer exported from @saas-ui/react
|
10
|
+
- 8b82d945: Renamed List to StructuredList
|
11
|
+
- 8b82d945: Removed button package.
|
12
|
+
- f34de7af: Moved Supabase and Magic auth services to separate packages.
|
13
|
+
- 3a15e8c8: Improve StructuredList API.
|
14
|
+
- f1e99198: Restructured packages.
|
15
|
+
- f3b09191: Removed Card component in favor of the new Chakra UI Card component.
|
16
|
+
|
17
|
+
### Minor Changes
|
6
18
|
|
7
|
-
-
|
8
|
-
-
|
9
|
-
|
10
|
-
|
11
|
-
|
19
|
+
- e94ca3c0: Added TimeLine to core components.
|
20
|
+
- 7ce390e9: Added Sidebar to core packages.
|
21
|
+
|
22
|
+
### Patch Changes
|
23
|
+
|
24
|
+
- f1e99198: Migrated from microbundle to tsup for builds
|
25
|
+
- Updated dependencies [772c9868]
|
26
|
+
- Updated dependencies [d7c87a31]
|
27
|
+
- Updated dependencies [e94ca3c0]
|
28
|
+
- Updated dependencies [f1e99198]
|
29
|
+
- Updated dependencies [8b82d945]
|
30
|
+
- Updated dependencies [f34de7af]
|
31
|
+
- Updated dependencies [3a15e8c8]
|
32
|
+
- Updated dependencies [f1e99198]
|
33
|
+
- @saas-ui/data-table@2.0.0-next.0
|
34
|
+
- @saas-ui/forms@2.0.0-next.0
|
35
|
+
- @saas-ui/core@2.0.0-next.0
|
36
|
+
- @saas-ui/auth@2.0.0-next.0
|
37
|
+
- @saas-ui/hooks@2.0.0-next.0
|
38
|
+
- @saas-ui/hotkeys@2.0.0-next.0
|
39
|
+
- @saas-ui/modals@2.0.0-next.0
|
40
|
+
- @saas-ui/nprogress@2.0.0-next.0
|
41
|
+
- @saas-ui/theme@2.0.0-next.0
|
12
42
|
|
13
43
|
## 1.9.0
|
14
44
|
|
package/README.md
CHANGED
package/dist/index.d.ts
CHANGED
@@ -1,32 +1,8 @@
|
|
1
|
-
export * from '
|
2
|
-
export * from '
|
3
|
-
export * from '@saas-ui/
|
4
|
-
export * from '@saas-ui/
|
5
|
-
export * from '@saas-ui/
|
6
|
-
export * from '@saas-ui/
|
7
|
-
export * from '@saas-ui/
|
8
|
-
export * from '@saas-ui/
|
9
|
-
export * from '@saas-ui/data-table';
|
10
|
-
export * from '@saas-ui/list';
|
11
|
-
export * from '@saas-ui/layout';
|
12
|
-
export * from '@saas-ui/forms';
|
13
|
-
export * from '@saas-ui/hooks';
|
14
|
-
export * from '@saas-ui/hotkeys';
|
15
|
-
export * from '@saas-ui/input-right-button';
|
16
|
-
export * from '@saas-ui/menu';
|
17
|
-
export * from '@saas-ui/modals';
|
18
|
-
export * from '@saas-ui/nprogress';
|
19
|
-
export * from '@saas-ui/number-input';
|
20
|
-
export * from '@saas-ui/palette';
|
21
|
-
export * from '@saas-ui/password-input';
|
22
|
-
export * from '@saas-ui/persona';
|
23
|
-
export * from '@saas-ui/pin-input';
|
24
|
-
export * from '@saas-ui/property';
|
25
|
-
export * from '@saas-ui/provider';
|
26
|
-
export * from '@saas-ui/radio';
|
27
|
-
export * from '@saas-ui/search-input';
|
28
|
-
export * from '@saas-ui/select';
|
29
|
-
export * from '@saas-ui/snackbar';
|
30
|
-
export * from '@saas-ui/stepper';
|
31
|
-
export * from '@saas-ui/theme';
|
32
|
-
//# sourceMappingURL=index.d.ts.map
|
1
|
+
export * from '@saas-ui/core';
|
2
|
+
export * from '@saas-ui/hooks';
|
3
|
+
export * from '@saas-ui/theme';
|
4
|
+
export * from '@saas-ui/nprogress';
|
5
|
+
export * from '@saas-ui/modals';
|
6
|
+
export * from '@saas-ui/data-table';
|
7
|
+
export * from '@saas-ui/hotkeys';
|
8
|
+
export * from '@saas-ui/forms';
|
package/dist/index.js
CHANGED
@@ -1,2 +1,63 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
var core = require('@saas-ui/core');
|
4
|
+
var hooks = require('@saas-ui/hooks');
|
5
|
+
var theme = require('@saas-ui/theme');
|
6
|
+
var nprogress = require('@saas-ui/nprogress');
|
7
|
+
var modals = require('@saas-ui/modals');
|
8
|
+
var dataTable = require('@saas-ui/data-table');
|
9
|
+
var hotkeys = require('@saas-ui/hotkeys');
|
10
|
+
var forms = require('@saas-ui/forms');
|
11
|
+
|
12
|
+
|
13
|
+
|
14
|
+
Object.keys(core).forEach(function (k) {
|
15
|
+
if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, {
|
16
|
+
enumerable: true,
|
17
|
+
get: function () { return core[k]; }
|
18
|
+
});
|
19
|
+
});
|
20
|
+
Object.keys(hooks).forEach(function (k) {
|
21
|
+
if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, {
|
22
|
+
enumerable: true,
|
23
|
+
get: function () { return hooks[k]; }
|
24
|
+
});
|
25
|
+
});
|
26
|
+
Object.keys(theme).forEach(function (k) {
|
27
|
+
if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, {
|
28
|
+
enumerable: true,
|
29
|
+
get: function () { return theme[k]; }
|
30
|
+
});
|
31
|
+
});
|
32
|
+
Object.keys(nprogress).forEach(function (k) {
|
33
|
+
if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, {
|
34
|
+
enumerable: true,
|
35
|
+
get: function () { return nprogress[k]; }
|
36
|
+
});
|
37
|
+
});
|
38
|
+
Object.keys(modals).forEach(function (k) {
|
39
|
+
if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, {
|
40
|
+
enumerable: true,
|
41
|
+
get: function () { return modals[k]; }
|
42
|
+
});
|
43
|
+
});
|
44
|
+
Object.keys(dataTable).forEach(function (k) {
|
45
|
+
if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, {
|
46
|
+
enumerable: true,
|
47
|
+
get: function () { return dataTable[k]; }
|
48
|
+
});
|
49
|
+
});
|
50
|
+
Object.keys(hotkeys).forEach(function (k) {
|
51
|
+
if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, {
|
52
|
+
enumerable: true,
|
53
|
+
get: function () { return hotkeys[k]; }
|
54
|
+
});
|
55
|
+
});
|
56
|
+
Object.keys(forms).forEach(function (k) {
|
57
|
+
if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, {
|
58
|
+
enumerable: true,
|
59
|
+
get: function () { return forms[k]; }
|
60
|
+
});
|
61
|
+
});
|
62
|
+
//# sourceMappingURL=out.js.map
|
63
|
+
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc","sourcesContent":["export * from '@saas-ui/core'\nexport * from '@saas-ui/hooks'\nexport * from '@saas-ui/theme'\nexport * from '@saas-ui/nprogress'\nexport * from '@saas-ui/modals'\nexport * from '@saas-ui/data-table'\nexport * from '@saas-ui/hotkeys'\nexport * from '@saas-ui/forms'\n"]}
|
package/dist/index.mjs
ADDED
@@ -0,0 +1,10 @@
|
|
1
|
+
export * from '@saas-ui/core';
|
2
|
+
export * from '@saas-ui/hooks';
|
3
|
+
export * from '@saas-ui/theme';
|
4
|
+
export * from '@saas-ui/nprogress';
|
5
|
+
export * from '@saas-ui/modals';
|
6
|
+
export * from '@saas-ui/data-table';
|
7
|
+
export * from '@saas-ui/hotkeys';
|
8
|
+
export * from '@saas-ui/forms';
|
9
|
+
//# sourceMappingURL=out.js.map
|
10
|
+
//# sourceMappingURL=index.mjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc","sourcesContent":["export * from '@saas-ui/core'\nexport * from '@saas-ui/hooks'\nexport * from '@saas-ui/theme'\nexport * from '@saas-ui/nprogress'\nexport * from '@saas-ui/modals'\nexport * from '@saas-ui/data-table'\nexport * from '@saas-ui/hotkeys'\nexport * from '@saas-ui/forms'\n"]}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@saas-ui/react",
|
3
|
-
"version": "
|
3
|
+
"version": "2.0.0-next.0",
|
4
4
|
"description": "Saas UI - The frontend stack for SaaS companies.",
|
5
5
|
"source": "src/index.ts",
|
6
6
|
"exports": {
|
@@ -17,7 +17,7 @@
|
|
17
17
|
"types": "./dist/index.d.ts",
|
18
18
|
"scripts": {
|
19
19
|
"clean": "rimraf --no-glob ./dist",
|
20
|
-
"build": "
|
20
|
+
"build": "tsup src/index.ts --config tsup.config.ts",
|
21
21
|
"lint": "eslint src --ext .ts,.tsx,.js,.jsx --config ../../.eslintrc.js",
|
22
22
|
"lint:staged": "lint-staged --allow-empty --config ../../lint-staged.config.js",
|
23
23
|
"typecheck": "tsc --noEmit"
|
@@ -55,36 +55,18 @@
|
|
55
55
|
"url": "https://storybook.saas-ui.dev"
|
56
56
|
},
|
57
57
|
"dependencies": {
|
58
|
+
"@chakra-ui/react-utils": "^2.0.11",
|
58
59
|
"@chakra-ui/system": "^2.3.8",
|
59
|
-
"@
|
60
|
-
"@saas-ui/auth": "
|
61
|
-
"@saas-ui/
|
62
|
-
"@saas-ui/
|
63
|
-
"@saas-ui/
|
64
|
-
"@saas-ui/
|
65
|
-
"@saas-ui/
|
66
|
-
"@saas-ui/
|
67
|
-
"@saas-ui/
|
68
|
-
"@saas-ui/
|
69
|
-
"@saas-ui/input-right-button": "1.4.0",
|
70
|
-
"@saas-ui/layout": "1.4.1",
|
71
|
-
"@saas-ui/list": "1.4.0",
|
72
|
-
"@saas-ui/menu": "1.4.1",
|
73
|
-
"@saas-ui/modals": "1.5.5",
|
74
|
-
"@saas-ui/nprogress": "1.4.0",
|
75
|
-
"@saas-ui/number-input": "1.4.0",
|
76
|
-
"@saas-ui/palette": "1.3.0",
|
77
|
-
"@saas-ui/password-input": "1.4.0",
|
78
|
-
"@saas-ui/persona": "1.4.0",
|
79
|
-
"@saas-ui/pin-input": "1.4.0",
|
80
|
-
"@saas-ui/property": "1.4.0",
|
81
|
-
"@saas-ui/provider": "1.2.1",
|
82
|
-
"@saas-ui/radio": "1.4.1",
|
83
|
-
"@saas-ui/search-input": "1.4.0",
|
84
|
-
"@saas-ui/select": "1.4.0",
|
85
|
-
"@saas-ui/snackbar": "1.2.0",
|
86
|
-
"@saas-ui/stepper": "1.4.0",
|
87
|
-
"@saas-ui/theme": "1.8.0"
|
60
|
+
"@chakra-ui/utils": "^2.0.14",
|
61
|
+
"@saas-ui/auth": "2.0.0-next.0",
|
62
|
+
"@saas-ui/core": "2.0.0-next.0",
|
63
|
+
"@saas-ui/data-table": "2.0.0-next.0",
|
64
|
+
"@saas-ui/forms": "2.0.0-next.0",
|
65
|
+
"@saas-ui/hooks": "2.0.0-next.0",
|
66
|
+
"@saas-ui/hotkeys": "2.0.0-next.0",
|
67
|
+
"@saas-ui/modals": "2.0.0-next.0",
|
68
|
+
"@saas-ui/nprogress": "2.0.0-next.0",
|
69
|
+
"@saas-ui/theme": "2.0.0-next.0"
|
88
70
|
},
|
89
71
|
"peerDependencies": {
|
90
72
|
"@chakra-ui/react": ">=2.4.0",
|
package/src/index.ts
CHANGED
@@ -1,31 +1,8 @@
|
|
1
|
-
export * from '
|
2
|
-
export * from './error-boundary'
|
3
|
-
export * from '@saas-ui/auth'
|
4
|
-
export * from '@saas-ui/app-shell'
|
5
|
-
export * from '@saas-ui/banner'
|
6
|
-
export * from '@saas-ui/button'
|
7
|
-
export * from '@saas-ui/card'
|
8
|
-
export * from '@saas-ui/collapse'
|
9
|
-
export * from '@saas-ui/data-table'
|
10
|
-
export * from '@saas-ui/list'
|
11
|
-
export * from '@saas-ui/layout'
|
12
|
-
export * from '@saas-ui/forms'
|
1
|
+
export * from '@saas-ui/core'
|
13
2
|
export * from '@saas-ui/hooks'
|
14
|
-
export * from '@saas-ui/hotkeys'
|
15
|
-
export * from '@saas-ui/input-right-button'
|
16
|
-
export * from '@saas-ui/menu'
|
17
|
-
export * from '@saas-ui/modals'
|
18
|
-
export * from '@saas-ui/nprogress'
|
19
|
-
export * from '@saas-ui/number-input'
|
20
|
-
export * from '@saas-ui/palette'
|
21
|
-
export * from '@saas-ui/password-input'
|
22
|
-
export * from '@saas-ui/persona'
|
23
|
-
export * from '@saas-ui/pin-input'
|
24
|
-
export * from '@saas-ui/property'
|
25
|
-
export * from '@saas-ui/provider'
|
26
|
-
export * from '@saas-ui/radio'
|
27
|
-
export * from '@saas-ui/search-input'
|
28
|
-
export * from '@saas-ui/select'
|
29
|
-
export * from '@saas-ui/snackbar'
|
30
|
-
export * from '@saas-ui/stepper'
|
31
3
|
export * from '@saas-ui/theme'
|
4
|
+
export * from '@saas-ui/nprogress'
|
5
|
+
export * from '@saas-ui/modals'
|
6
|
+
export * from '@saas-ui/data-table'
|
7
|
+
export * from '@saas-ui/hotkeys'
|
8
|
+
export * from '@saas-ui/forms'
|
package/dist/error-boundary.d.ts
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
import * as React from 'react';
|
2
|
-
import { SaasContext } from '@saas-ui/provider';
|
3
|
-
export interface ErrorBoundaryProps {
|
4
|
-
errorComponent?: React.ReactNode;
|
5
|
-
children: React.ReactNode;
|
6
|
-
}
|
7
|
-
interface ErrorBoundaryState {
|
8
|
-
error?: Error | null;
|
9
|
-
errorInfo?: any;
|
10
|
-
}
|
11
|
-
export declare class ErrorBoundary extends React.Component<ErrorBoundaryProps> {
|
12
|
-
state: ErrorBoundaryState;
|
13
|
-
context: React.ContextType<typeof SaasContext>;
|
14
|
-
constructor(props: ErrorBoundaryProps);
|
15
|
-
static getDerivedStateFromError(error: Error): {
|
16
|
-
error: Error;
|
17
|
-
};
|
18
|
-
componentDidCatch(error: Error, errorInfo: any): void;
|
19
|
-
render(): string | number | boolean | React.ReactFragment | JSX.Element | null | undefined;
|
20
|
-
}
|
21
|
-
export {};
|
22
|
-
//# sourceMappingURL=error-boundary.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"error-boundary.d.ts","sourceRoot":"","sources":["../src/error-boundary.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAE/C,MAAM,WAAW,kBAAkB;IACjC,cAAc,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAChC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAC1B;AAED,UAAU,kBAAkB;IAC1B,KAAK,CAAC,EAAE,KAAK,GAAG,IAAI,CAAA;IACpB,SAAS,CAAC,EAAE,GAAG,CAAA;CAChB;AAED,qBAAa,aAAc,SAAQ,KAAK,CAAC,SAAS,CAAC,kBAAkB,CAAC;IACpE,KAAK,EAAE,kBAAkB,CAAA;IAEjB,OAAO,EAAE,KAAK,CAAC,WAAW,CAAC,OAAO,WAAW,CAAC,CAAA;gBAE1C,KAAK,EAAE,kBAAkB;IAKrC,MAAM,CAAC,wBAAwB,CAAC,KAAK,EAAE,KAAK;;;IAI5C,iBAAiB,CAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG;IAI9C,MAAM;CAOP"}
|
package/dist/index.d.ts.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,kBAAkB,CAAA;AAChC,cAAc,eAAe,CAAA;AAC7B,cAAc,oBAAoB,CAAA;AAClC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,eAAe,CAAA;AAC7B,cAAc,mBAAmB,CAAA;AACjC,cAAc,qBAAqB,CAAA;AACnC,cAAc,eAAe,CAAA;AAC7B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,kBAAkB,CAAA;AAChC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,eAAe,CAAA;AAC7B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,oBAAoB,CAAA;AAClC,cAAc,uBAAuB,CAAA;AACrC,cAAc,kBAAkB,CAAA;AAChC,cAAc,yBAAyB,CAAA;AACvC,cAAc,kBAAkB,CAAA;AAChC,cAAc,oBAAoB,CAAA;AAClC,cAAc,mBAAmB,CAAA;AACjC,cAAc,mBAAmB,CAAA;AACjC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,uBAAuB,CAAA;AACrC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,mBAAmB,CAAA;AACjC,cAAc,kBAAkB,CAAA;AAChC,cAAc,gBAAgB,CAAA"}
|
package/dist/index.modern.mjs
DELETED
@@ -1,2 +0,0 @@
|
|
1
|
-
import*as r from"react";import{chakra as o}from"@chakra-ui/system";export*from"@saas-ui/auth";export*from"@saas-ui/app-shell";export*from"@saas-ui/banner";export*from"@saas-ui/button";export*from"@saas-ui/card";export*from"@saas-ui/collapse";export*from"@saas-ui/data-table";export*from"@saas-ui/list";export*from"@saas-ui/layout";export*from"@saas-ui/forms";export*from"@saas-ui/hooks";export*from"@saas-ui/hotkeys";export*from"@saas-ui/input-right-button";export*from"@saas-ui/menu";export*from"@saas-ui/modals";export*from"@saas-ui/nprogress";export*from"@saas-ui/number-input";export*from"@saas-ui/palette";export*from"@saas-ui/password-input";export*from"@saas-ui/persona";export*from"@saas-ui/pin-input";export*from"@saas-ui/property";export*from"@saas-ui/provider";export*from"@saas-ui/radio";export*from"@saas-ui/search-input";export*from"@saas-ui/select";export*from"@saas-ui/snackbar";export*from"@saas-ui/stepper";export*from"@saas-ui/theme";const s=s=>/*#__PURE__*/r.createElement(o.span,s,/*#__PURE__*/r.createElement("br",null));class t extends r.Component{constructor(r){super(r),this.state=void 0,this.state={error:null}}static getDerivedStateFromError(r){return{error:r}}componentDidCatch(r,o){var s,t;null==(s=(t=this.context).onError)||s.call(t,r,o)}render(){return this.state.error?this.props.errorComponent||/*#__PURE__*/r.createElement("h1",null,"Something went wrong."):this.props.children}}export{s as Br,t as ErrorBoundary};
|
2
|
-
//# sourceMappingURL=index.modern.mjs.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.modern.mjs","sources":["../src/typography.tsx","../src/error-boundary.tsx"],"sourcesContent":["import * as React from 'react'\nimport { chakra, HTMLChakraProps } from '@chakra-ui/system'\n\nexport const Br: React.FC<HTMLChakraProps<'span'>> = (props) => {\n return (\n <chakra.span {...props}>\n <br />\n </chakra.span>\n )\n}\n","import * as React from 'react'\n\nimport { SaasContext } from '@saas-ui/provider'\n\nexport interface ErrorBoundaryProps {\n errorComponent?: React.ReactNode\n children: React.ReactNode\n}\n\ninterface ErrorBoundaryState {\n error?: Error | null\n errorInfo?: any\n}\n\nexport class ErrorBoundary extends React.Component<ErrorBoundaryProps> {\n state: ErrorBoundaryState\n\n declare context: React.ContextType<typeof SaasContext>\n\n constructor(props: ErrorBoundaryProps) {\n super(props)\n this.state = { error: null }\n }\n\n static getDerivedStateFromError(error: Error) {\n return { error }\n }\n\n componentDidCatch(error: Error, errorInfo: any) {\n this.context.onError?.(error, errorInfo)\n }\n\n render() {\n if (this.state.error) {\n return this.props.errorComponent || <h1>Something went wrong.</h1>\n }\n\n return this.props.children\n }\n}\n"],"names":["Br","props","React","createElement","chakra","span","Component","constructor","super","this","state","error","static","componentDidCatch","errorInfo","_this$context$onError","_this$context","context","onError","render","errorComponent","children"],"mappings":"y7BAGaA,MAAAA,EAAyCC,gBAElDC,EAAAC,cAACC,EAAOC,KAASJ,eACfC,EACFC,cAAA,KAAA,OCOS,gBAAsBD,EAAMI,UAKvCC,YAAYN,GACVO,MAAMP,GAAMQ,KALdC,aAMED,KAAKC,MAAQ,CAAEC,MAAO,KACxB,CAEAC,gCAAgCD,GAC9B,MAAO,CAAEA,QACX,CAEAE,kBAAkBF,EAAcG,kBAC1BC,GAAAC,EAAAP,KAACQ,SAAQC,UAAbH,EAAuBJ,KAAAA,EAAAA,EAAOG,EAChC,CAEAK,SACE,OAAIV,KAAKC,MAAMC,MACFF,KAACR,MAAMmB,6BAAkBlB,EAAIC,cAAA,KAAA,KAAA,8BAG9BF,MAAMoB,QACpB"}
|
package/dist/typography.d.ts
DELETED
package/dist/typography.d.ts.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"typography.d.ts","sourceRoot":"","sources":["../src/typography.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAU,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAE3D,eAAO,MAAM,EAAE,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAAC,MAAM,CAAC,CAMhD,CAAA"}
|
package/src/error-boundary.tsx
DELETED
@@ -1,40 +0,0 @@
|
|
1
|
-
import * as React from 'react'
|
2
|
-
|
3
|
-
import { SaasContext } from '@saas-ui/provider'
|
4
|
-
|
5
|
-
export interface ErrorBoundaryProps {
|
6
|
-
errorComponent?: React.ReactNode
|
7
|
-
children: React.ReactNode
|
8
|
-
}
|
9
|
-
|
10
|
-
interface ErrorBoundaryState {
|
11
|
-
error?: Error | null
|
12
|
-
errorInfo?: any
|
13
|
-
}
|
14
|
-
|
15
|
-
export class ErrorBoundary extends React.Component<ErrorBoundaryProps> {
|
16
|
-
state: ErrorBoundaryState
|
17
|
-
|
18
|
-
declare context: React.ContextType<typeof SaasContext>
|
19
|
-
|
20
|
-
constructor(props: ErrorBoundaryProps) {
|
21
|
-
super(props)
|
22
|
-
this.state = { error: null }
|
23
|
-
}
|
24
|
-
|
25
|
-
static getDerivedStateFromError(error: Error) {
|
26
|
-
return { error }
|
27
|
-
}
|
28
|
-
|
29
|
-
componentDidCatch(error: Error, errorInfo: any) {
|
30
|
-
this.context.onError?.(error, errorInfo)
|
31
|
-
}
|
32
|
-
|
33
|
-
render() {
|
34
|
-
if (this.state.error) {
|
35
|
-
return this.props.errorComponent || <h1>Something went wrong.</h1>
|
36
|
-
}
|
37
|
-
|
38
|
-
return this.props.children
|
39
|
-
}
|
40
|
-
}
|
package/src/typography.tsx
DELETED