@saas-ui/react 1.0.0-rc.10 → 1.0.0-rc.13

Sign up to get free protection for your applications and to get access to all the features.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,67 @@
1
1
  # @saas-ui/react
2
2
 
3
+ ## 1.0.0-rc.13
4
+
5
+ ### Patch Changes
6
+
7
+ - 1744543: Updated dependencies.
8
+ - Updated dependencies [1744543]
9
+ - Updated dependencies [1744543]
10
+ - @saas-ui/auth@1.0.0-rc.12
11
+ - @saas-ui/banner@1.0.0-rc.5
12
+ - @saas-ui/button@1.0.0-rc.5
13
+ - @saas-ui/card@1.0.0-rc.5
14
+ - @saas-ui/collapse@1.0.0-rc.4
15
+ - @saas-ui/data-table@1.0.0-rc.7
16
+ - @saas-ui/forms@1.0.0-rc.11
17
+ - @saas-ui/hooks@1.0.0-rc.4
18
+ - @saas-ui/hotkeys@1.0.0-rc.4
19
+ - @saas-ui/input-right-button@1.0.0-rc.5
20
+ - @saas-ui/layout@1.0.0-rc.7
21
+ - @saas-ui/list@1.0.0-rc.5
22
+ - @saas-ui/menu@1.0.0-rc.7
23
+ - @saas-ui/modals@1.0.0-rc.11
24
+ - @saas-ui/nprogress@1.0.0-rc.4
25
+ - @saas-ui/number-input@1.0.0-rc.4
26
+ - @saas-ui/palette@1.0.0-rc.4
27
+ - @saas-ui/password-input@1.0.0-rc.5
28
+ - @saas-ui/persona@1.0.0-rc.6
29
+ - @saas-ui/pin-input@1.0.0-rc.5
30
+ - @saas-ui/property@1.0.0-rc.6
31
+ - @saas-ui/provider@1.0.0-rc.7
32
+ - @saas-ui/radio@1.0.0-rc.4
33
+ - @saas-ui/search-input@1.0.0-rc.4
34
+ - @saas-ui/select@1.0.0-rc.4
35
+ - @saas-ui/snackbar@1.0.0-rc.4
36
+ - @saas-ui/stepper@1.0.0-rc.5
37
+ - @saas-ui/theme@1.0.0-rc.4
38
+
39
+ ## 1.0.0-rc.12
40
+
41
+ ### Patch Changes
42
+
43
+ - Added missing dependency.
44
+ - Updated dependencies
45
+ - @saas-ui/persona@1.0.0-rc.5
46
+
47
+ ## 1.0.0-rc.11
48
+
49
+ ### Patch Changes
50
+
51
+ - da3c4e4: Added ErrorBoundary component.
52
+ - bd3438d: FormStep now supports an onSubmit handler.
53
+ - 2ec8c91: Fixed vertical divider rendering incorrectly.
54
+ - Updated dependencies [bd3438d]
55
+ - Updated dependencies [ae47cbd]
56
+ - @saas-ui/forms@1.0.0-rc.10
57
+ - @saas-ui/property@1.0.0-rc.5
58
+ - @saas-ui/provider@1.0.0-rc.6
59
+ - @saas-ui/auth@1.0.0-rc.11
60
+ - @saas-ui/modals@1.0.0-rc.10
61
+ - @saas-ui/layout@1.0.0-rc.6
62
+ - @saas-ui/menu@1.0.0-rc.6
63
+ - @saas-ui/data-table@1.0.0-rc.6
64
+
3
65
  ## 1.0.0-rc.10
4
66
 
5
67
  ### Patch Changes
@@ -0,0 +1,22 @@
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
@@ -0,0 +1 @@
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 CHANGED
@@ -1,4 +1,5 @@
1
1
  export * from './typography';
2
+ export * from './error-boundary';
2
3
  export * from '@saas-ui/auth';
3
4
  export * from '@saas-ui/banner';
4
5
  export * from '@saas-ui/button';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAE5B,cAAc,eAAe,CAAA;AAC7B,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"}
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,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.js CHANGED
@@ -1,2 +1,2 @@
1
- var e=require("react"),r=require("@chakra-ui/system"),t=require("@saas-ui/auth"),n=require("@saas-ui/banner"),u=require("@saas-ui/button"),o=require("@saas-ui/card"),a=require("@saas-ui/collapse"),s=require("@saas-ui/data-table"),c=require("@saas-ui/list"),i=require("@saas-ui/layout"),f=require("@saas-ui/forms"),p=require("@saas-ui/hooks"),b=require("@saas-ui/hotkeys"),y=require("@saas-ui/input-right-button"),O=require("@saas-ui/menu"),l=require("@saas-ui/modals"),d=require("@saas-ui/nprogress"),h=require("@saas-ui/number-input"),j=require("@saas-ui/palette"),P=require("@saas-ui/password-input"),x=require("@saas-ui/persona"),m=require("@saas-ui/pin-input"),k=require("@saas-ui/property"),g=require("@saas-ui/provider"),E=require("@saas-ui/radio"),q=require("@saas-ui/search-input"),w=require("@saas-ui/select"),v=require("@saas-ui/snackbar"),_=require("@saas-ui/stepper"),B=require("@saas-ui/theme");function D(e){if(e&&e.__esModule)return e;var r=Object.create(null);return e&&Object.keys(e).forEach(function(t){if("default"!==t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})}}),r.default=e,r}var M=/*#__PURE__*/D(e);exports.Br=function(e){/*#__PURE__*/return M.createElement(r.chakra.span,e,/*#__PURE__*/M.createElement("br",null))},Object.keys(t).forEach(function(e){"default"===e||exports.hasOwnProperty(e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return t[e]}})}),Object.keys(n).forEach(function(e){"default"===e||exports.hasOwnProperty(e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return n[e]}})}),Object.keys(u).forEach(function(e){"default"===e||exports.hasOwnProperty(e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return u[e]}})}),Object.keys(o).forEach(function(e){"default"===e||exports.hasOwnProperty(e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return o[e]}})}),Object.keys(a).forEach(function(e){"default"===e||exports.hasOwnProperty(e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return a[e]}})}),Object.keys(s).forEach(function(e){"default"===e||exports.hasOwnProperty(e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return s[e]}})}),Object.keys(c).forEach(function(e){"default"===e||exports.hasOwnProperty(e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return c[e]}})}),Object.keys(i).forEach(function(e){"default"===e||exports.hasOwnProperty(e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return i[e]}})}),Object.keys(f).forEach(function(e){"default"===e||exports.hasOwnProperty(e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return f[e]}})}),Object.keys(p).forEach(function(e){"default"===e||exports.hasOwnProperty(e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return p[e]}})}),Object.keys(b).forEach(function(e){"default"===e||exports.hasOwnProperty(e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return b[e]}})}),Object.keys(y).forEach(function(e){"default"===e||exports.hasOwnProperty(e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return y[e]}})}),Object.keys(O).forEach(function(e){"default"===e||exports.hasOwnProperty(e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return O[e]}})}),Object.keys(l).forEach(function(e){"default"===e||exports.hasOwnProperty(e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return l[e]}})}),Object.keys(d).forEach(function(e){"default"===e||exports.hasOwnProperty(e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return d[e]}})}),Object.keys(h).forEach(function(e){"default"===e||exports.hasOwnProperty(e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return h[e]}})}),Object.keys(j).forEach(function(e){"default"===e||exports.hasOwnProperty(e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return j[e]}})}),Object.keys(P).forEach(function(e){"default"===e||exports.hasOwnProperty(e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return P[e]}})}),Object.keys(x).forEach(function(e){"default"===e||exports.hasOwnProperty(e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return x[e]}})}),Object.keys(m).forEach(function(e){"default"===e||exports.hasOwnProperty(e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return m[e]}})}),Object.keys(k).forEach(function(e){"default"===e||exports.hasOwnProperty(e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return k[e]}})}),Object.keys(g).forEach(function(e){"default"===e||exports.hasOwnProperty(e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return g[e]}})}),Object.keys(E).forEach(function(e){"default"===e||exports.hasOwnProperty(e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return E[e]}})}),Object.keys(q).forEach(function(e){"default"===e||exports.hasOwnProperty(e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return q[e]}})}),Object.keys(w).forEach(function(e){"default"===e||exports.hasOwnProperty(e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return w[e]}})}),Object.keys(v).forEach(function(e){"default"===e||exports.hasOwnProperty(e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return v[e]}})}),Object.keys(_).forEach(function(e){"default"===e||exports.hasOwnProperty(e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return _[e]}})}),Object.keys(B).forEach(function(e){"default"===e||exports.hasOwnProperty(e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return B[e]}})});
1
+ var e=require("react"),r=require("@chakra-ui/system"),t=require("@saas-ui/auth"),n=require("@saas-ui/banner"),o=require("@saas-ui/button"),u=require("@saas-ui/card"),a=require("@saas-ui/collapse"),s=require("@saas-ui/data-table"),c=require("@saas-ui/list"),i=require("@saas-ui/layout"),f=require("@saas-ui/forms"),p=require("@saas-ui/hooks"),b=require("@saas-ui/hotkeys"),y=require("@saas-ui/input-right-button"),O=require("@saas-ui/menu"),l=require("@saas-ui/modals"),h=require("@saas-ui/nprogress"),d=require("@saas-ui/number-input"),j=require("@saas-ui/palette"),P=require("@saas-ui/password-input"),x=require("@saas-ui/persona"),m=require("@saas-ui/pin-input"),g=require("@saas-ui/property"),E=require("@saas-ui/provider"),k=require("@saas-ui/radio"),w=require("@saas-ui/search-input"),q=require("@saas-ui/select"),v=require("@saas-ui/snackbar"),_=require("@saas-ui/stepper"),C=require("@saas-ui/theme");function D(e){if(e&&e.__esModule)return e;var r=Object.create(null);return e&&Object.keys(e).forEach(function(t){if("default"!==t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})}}),r.default=e,r}var B=/*#__PURE__*/D(e);function S(e,r){return S=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,r){return e.__proto__=r,e},S(e,r)}var F=/*#__PURE__*/function(e){var r,t;function n(r){var t;return(t=e.call(this,r)||this).state=void 0,t.state={error:null},t}t=e,(r=n).prototype=Object.create(t.prototype),r.prototype.constructor=r,S(r,t),n.getDerivedStateFromError=function(e){return{error:e}};var o=n.prototype;return o.componentDidCatch=function(e,r){var t,n;null==(t=(n=this.context).onError)||t.call(n,e,r)},o.render=function(){return this.state.error?this.props.errorComponent||/*#__PURE__*/B.createElement("h1",null,"Something went wrong."):this.props.children},n}(B.Component);exports.Br=function(e){/*#__PURE__*/return B.createElement(r.chakra.span,e,/*#__PURE__*/B.createElement("br",null))},exports.ErrorBoundary=F,Object.keys(t).forEach(function(e){"default"===e||exports.hasOwnProperty(e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return t[e]}})}),Object.keys(n).forEach(function(e){"default"===e||exports.hasOwnProperty(e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return n[e]}})}),Object.keys(o).forEach(function(e){"default"===e||exports.hasOwnProperty(e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return o[e]}})}),Object.keys(u).forEach(function(e){"default"===e||exports.hasOwnProperty(e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return u[e]}})}),Object.keys(a).forEach(function(e){"default"===e||exports.hasOwnProperty(e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return a[e]}})}),Object.keys(s).forEach(function(e){"default"===e||exports.hasOwnProperty(e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return s[e]}})}),Object.keys(c).forEach(function(e){"default"===e||exports.hasOwnProperty(e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return c[e]}})}),Object.keys(i).forEach(function(e){"default"===e||exports.hasOwnProperty(e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return i[e]}})}),Object.keys(f).forEach(function(e){"default"===e||exports.hasOwnProperty(e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return f[e]}})}),Object.keys(p).forEach(function(e){"default"===e||exports.hasOwnProperty(e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return p[e]}})}),Object.keys(b).forEach(function(e){"default"===e||exports.hasOwnProperty(e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return b[e]}})}),Object.keys(y).forEach(function(e){"default"===e||exports.hasOwnProperty(e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return y[e]}})}),Object.keys(O).forEach(function(e){"default"===e||exports.hasOwnProperty(e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return O[e]}})}),Object.keys(l).forEach(function(e){"default"===e||exports.hasOwnProperty(e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return l[e]}})}),Object.keys(h).forEach(function(e){"default"===e||exports.hasOwnProperty(e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return h[e]}})}),Object.keys(d).forEach(function(e){"default"===e||exports.hasOwnProperty(e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return d[e]}})}),Object.keys(j).forEach(function(e){"default"===e||exports.hasOwnProperty(e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return j[e]}})}),Object.keys(P).forEach(function(e){"default"===e||exports.hasOwnProperty(e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return P[e]}})}),Object.keys(x).forEach(function(e){"default"===e||exports.hasOwnProperty(e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return x[e]}})}),Object.keys(m).forEach(function(e){"default"===e||exports.hasOwnProperty(e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return m[e]}})}),Object.keys(g).forEach(function(e){"default"===e||exports.hasOwnProperty(e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return g[e]}})}),Object.keys(E).forEach(function(e){"default"===e||exports.hasOwnProperty(e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return E[e]}})}),Object.keys(k).forEach(function(e){"default"===e||exports.hasOwnProperty(e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return k[e]}})}),Object.keys(w).forEach(function(e){"default"===e||exports.hasOwnProperty(e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return w[e]}})}),Object.keys(q).forEach(function(e){"default"===e||exports.hasOwnProperty(e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return q[e]}})}),Object.keys(v).forEach(function(e){"default"===e||exports.hasOwnProperty(e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return v[e]}})}),Object.keys(_).forEach(function(e){"default"===e||exports.hasOwnProperty(e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return _[e]}})}),Object.keys(C).forEach(function(e){"default"===e||exports.hasOwnProperty(e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return C[e]}})});
2
2
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../src/typography.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"],"names":["props","React","createElement","chakra","span"],"mappings":"6rCAGqD,SAACA,gBACpD,OACEC,EAACC,cAAAC,EAADA,OAAQC,KAASJ,eACfC,EAAAC,cAAA,KAAA"}
1
+ {"version":3,"file":"index.js","sources":["../src/error-boundary.tsx","../src/typography.tsx"],"sourcesContent":["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","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"],"names":["ErrorBoundary","_React$Component","props","_this","this","state","error","getDerivedStateFromError","componentDidCatch","React","errorInfo","context","onError","_this$context$onError","call","_this$context","_proto","render","errorComponent","createElement","children","Component","chakra","span"],"mappings":"2yCAcaA,mBAKX,SAAAC,WAAA,SAAAD,EAAYE,GAAyB,IAAAC,EAAA,OACnCA,cAAMD,IAANE,MALFC,WAIqC,EAEnCF,EAAKE,MAAQ,CAAEC,MAAO,UAFxBL,KAAAD,yEALFA,EAUSO,yBAAP,SAAgCD,GAC9B,MAAO,CAAEA,MAAAA,IAGXE,IAAAA,EAAAA,EAAAA,UAdiCC,OAcjCD,EAAAA,kBAAA,SAAkBF,EAAcI,WAC9B,OAAKC,GAAAA,EAAAA,KAAAA,SAAQC,UAAbC,EAAAC,KAAAC,EAAuBT,EAAOI,IAflCM,EAkBEC,OAAA,WACE,OAAIb,KAAKC,MAAMC,WACDJ,MAAMgB,6BAAkBT,EAAAU,cAAA,KAAA,KAAA,yBAG/Bf,KAAKF,MAAMkB,UAvBaX,EAKjC,CALiCA,EAAMY,sBCXY,SAACnB,gBACpD,OACEO,EAACU,cAAAG,EAADA,OAAQC,KAASrB,eACfO,EAAAU,cAAA,KAAA"}
@@ -1,2 +1,2 @@
1
- import*as r from"react";import{chakra as a}from"@chakra-ui/system";export*from"@saas-ui/auth";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 o=o=>/*#__PURE__*/r.createElement(a.span,o,/*#__PURE__*/r.createElement("br",null));export{o as Br};
1
+ import*as r from"react";import{chakra as o}from"@chakra-ui/system";export*from"@saas-ui/auth";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
2
  //# sourceMappingURL=index.modern.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.modern.mjs","sources":["../src/typography.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"],"names":["Br","props","React","createElement","chakra","span"],"mappings":"y5BAGaA,MAAAA,EAAyCC,gBAElDC,EAAAC,cAACC,EAAOC,KAASJ,eACfC,EADFC,cAAA,KAAA"}
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","ErrorBoundary","Component","constructor","super","this","state","error","static","componentDidCatch","errorInfo","context","onError","render","errorComponent","children"],"mappings":"y5BAGaA,MAAAA,EAAyCC,gBAElDC,EAAAC,cAACC,EAAOC,KAASJ,eACfC,EADFC,cAAA,KAAA,aCSSG,UAA2BJ,EAACK,UAKvCC,YAAYP,GACVQ,MAAMR,GAD6BS,KAJrCC,WAME,EAAAD,KAAKC,MAAQ,CAAEC,MAAO,MAGOC,gCAACD,GAC9B,MAAO,CAAEA,MAAAA,GAGXE,kBAAkBF,EAAcG,kBACzBC,GAAAA,EAAAA,KAAAA,SAAQC,mBAAUL,EAAOG,GAGhCG,SACE,OAAIR,KAAKC,MAAMC,WACDX,MAAMkB,6BAAkBjB,wDAG1BD,MAAMmB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@saas-ui/react",
3
- "version": "1.0.0-rc.10",
3
+ "version": "1.0.0-rc.13",
4
4
  "description": "Saas UI - The frontend stack for SaaS companies.",
5
5
  "source": "src/index.ts",
6
6
  "exports": {
@@ -55,35 +55,35 @@
55
55
  "url": "https://storybook.saas-ui.dev"
56
56
  },
57
57
  "dependencies": {
58
- "@chakra-ui/system": "^2.1.3",
59
- "@saas-ui/auth": "1.0.0-rc.10",
60
- "@saas-ui/banner": "1.0.0-rc.4",
61
- "@saas-ui/button": "1.0.0-rc.4",
62
- "@saas-ui/card": "1.0.0-rc.4",
63
- "@saas-ui/collapse": "1.0.0-rc.3",
64
- "@saas-ui/data-table": "1.0.0-rc.5",
65
- "@saas-ui/forms": "1.0.0-rc.9",
66
- "@saas-ui/hooks": "1.0.0-rc.3",
67
- "@saas-ui/hotkeys": "1.0.0-rc.3",
68
- "@saas-ui/input-right-button": "1.0.0-rc.4",
69
- "@saas-ui/layout": "1.0.0-rc.5",
70
- "@saas-ui/list": "1.0.0-rc.4",
71
- "@saas-ui/menu": "1.0.0-rc.5",
72
- "@saas-ui/modals": "1.0.0-rc.9",
73
- "@saas-ui/nprogress": "1.0.0-rc.3",
74
- "@saas-ui/number-input": "1.0.0-rc.3",
75
- "@saas-ui/palette": "1.0.0-rc.3",
76
- "@saas-ui/password-input": "1.0.0-rc.4",
77
- "@saas-ui/persona": "1.0.0-rc.4",
78
- "@saas-ui/pin-input": "1.0.0-rc.4",
79
- "@saas-ui/property": "1.0.0-rc.4",
80
- "@saas-ui/provider": "1.0.0-rc.5",
81
- "@saas-ui/radio": "1.0.0-rc.3",
82
- "@saas-ui/search-input": "1.0.0-rc.3",
83
- "@saas-ui/select": "1.0.0-rc.3",
84
- "@saas-ui/snackbar": "1.0.0-rc.3",
85
- "@saas-ui/stepper": "1.0.0-rc.4",
86
- "@saas-ui/theme": "1.0.0-rc.3"
58
+ "@chakra-ui/system": "^2.2.0",
59
+ "@saas-ui/auth": "1.0.0-rc.12",
60
+ "@saas-ui/banner": "1.0.0-rc.5",
61
+ "@saas-ui/button": "1.0.0-rc.5",
62
+ "@saas-ui/card": "1.0.0-rc.5",
63
+ "@saas-ui/collapse": "1.0.0-rc.4",
64
+ "@saas-ui/data-table": "1.0.0-rc.7",
65
+ "@saas-ui/forms": "1.0.0-rc.11",
66
+ "@saas-ui/hooks": "1.0.0-rc.4",
67
+ "@saas-ui/hotkeys": "1.0.0-rc.4",
68
+ "@saas-ui/input-right-button": "1.0.0-rc.5",
69
+ "@saas-ui/layout": "1.0.0-rc.7",
70
+ "@saas-ui/list": "1.0.0-rc.5",
71
+ "@saas-ui/menu": "1.0.0-rc.7",
72
+ "@saas-ui/modals": "1.0.0-rc.11",
73
+ "@saas-ui/nprogress": "1.0.0-rc.4",
74
+ "@saas-ui/number-input": "1.0.0-rc.4",
75
+ "@saas-ui/palette": "1.0.0-rc.4",
76
+ "@saas-ui/password-input": "1.0.0-rc.5",
77
+ "@saas-ui/persona": "1.0.0-rc.6",
78
+ "@saas-ui/pin-input": "1.0.0-rc.5",
79
+ "@saas-ui/property": "1.0.0-rc.6",
80
+ "@saas-ui/provider": "1.0.0-rc.7",
81
+ "@saas-ui/radio": "1.0.0-rc.4",
82
+ "@saas-ui/search-input": "1.0.0-rc.4",
83
+ "@saas-ui/select": "1.0.0-rc.4",
84
+ "@saas-ui/snackbar": "1.0.0-rc.4",
85
+ "@saas-ui/stepper": "1.0.0-rc.5",
86
+ "@saas-ui/theme": "1.0.0-rc.4"
87
87
  },
88
88
  "peerDependencies": {
89
89
  "@chakra-ui/react": ">=2.1.0",
@@ -0,0 +1,40 @@
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/index.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export * from './typography'
2
-
2
+ export * from './error-boundary'
3
3
  export * from '@saas-ui/auth'
4
4
  export * from '@saas-ui/banner'
5
5
  export * from '@saas-ui/button'