jcicl 0.0.52 → 0.0.54

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.
@@ -13,6 +13,7 @@ export type FlexProps = {
13
13
  padding?: string;
14
14
  gap?: string;
15
15
  styles?: CSSProperties;
16
+ id?: string;
16
17
  };
17
18
  declare const Flex: React.FC<FlexProps>;
18
19
  export default Flex;
@@ -0,0 +1,21 @@
1
+ import { default as React } from 'react';
2
+ export interface ErrorBoundaryProps {
3
+ title: string;
4
+ children: React.ReactNode;
5
+ showDetails?: boolean;
6
+ }
7
+ interface ErrorBoundaryState {
8
+ hasError: boolean;
9
+ error: any;
10
+ errorInfo: any;
11
+ }
12
+ declare class ErrorBoundary extends React.Component<ErrorBoundaryProps, ErrorBoundaryState> {
13
+ constructor(props: ErrorBoundaryProps);
14
+ static getDerivedStateFromError(error: any): {
15
+ hasError: boolean;
16
+ error: any;
17
+ };
18
+ componentDidCatch(error: any, errorInfo: any): void;
19
+ render(): string | number | boolean | Iterable<React.ReactNode> | import("react/jsx-runtime").JSX.Element | null | undefined;
20
+ }
21
+ export default ErrorBoundary;
@@ -0,0 +1,49 @@
1
+ import { jsxs as n, jsx as e } from "react/jsx-runtime";
2
+ import m from "react";
3
+ import { n as a } from "../../.chunks/emotion-styled.browser.esm.js";
4
+ import i from "../../base/Flex/Flex.js";
5
+ import s from "../../theme.js";
6
+ const h = a(i)`
7
+ width: 100%;
8
+ font-size: 24px;
9
+ color: ${s.colors.maroon};
10
+ background-color: ${s.colors.lightRed}aa;
11
+ padding: 16px;
12
+ border-radius: 8px;
13
+ box-shadow: 0 0 13px -3px ${s.colors.maroon} inset;
14
+ flex-direction: column;
15
+ p {
16
+ margin: 0;
17
+ }
18
+ `, u = a("p")`
19
+ font-size: 16px;
20
+ margin: 0 0 0 32px !important;
21
+ `;
22
+ class D extends m.Component {
23
+ constructor(r) {
24
+ super(r), this.state = { hasError: !1, error: null, errorInfo: null };
25
+ }
26
+ static getDerivedStateFromError(r) {
27
+ return { hasError: !0, error: r };
28
+ }
29
+ componentDidCatch(r, t) {
30
+ console.error("Error:", r), this.setState({ ...this.state, errorInfo: t });
31
+ }
32
+ render() {
33
+ const { title: r, children: t, showDetails: l = !0 } = this.props;
34
+ if (this.state.hasError) {
35
+ const { error: p, errorInfo: o } = this.state;
36
+ return /* @__PURE__ */ n(i, { column: !0, width: "100%", alignItems: "center", gap: "32px", padding: "16px 64px", children: [
37
+ /* @__PURE__ */ e("h1", { children: r }),
38
+ l && /* @__PURE__ */ n(h, { children: [
39
+ /* @__PURE__ */ e("p", { children: `${p}` }),
40
+ o == null ? void 0 : o.componentStack.split("at").map((c, d) => d > 0 && /* @__PURE__ */ e(u, { children: `at ${c}` }))
41
+ ] })
42
+ ] });
43
+ }
44
+ return t;
45
+ }
46
+ }
47
+ export {
48
+ D as default
49
+ };
@@ -0,0 +1 @@
1
+ export { default, type ErrorBoundaryProps } from './ErrorBoundary';
@@ -0,0 +1,4 @@
1
+ import { default as o } from "./ErrorBoundary.js";
2
+ export {
3
+ o as default
4
+ };
@@ -2,6 +2,7 @@ import { FlexProps } from '../../../../../../../../../src/components/base/Flex/F
2
2
  export interface WithLabelProps extends Omit<FlexProps, 'children'> {
3
3
  label: string;
4
4
  fontSize?: string;
5
+ gap?: string;
5
6
  component: JSX.Element;
6
7
  }
7
8
  declare const WithLabel: React.FC<WithLabelProps>;
@@ -1,15 +1,15 @@
1
- import { jsxs as l, jsx as e } from "react/jsx-runtime";
2
- import m from "../../base/Flex/Flex.js";
3
- const h = ({
1
+ import { jsxs as m, jsx as e } from "react/jsx-runtime";
2
+ import t from "../../base/Flex/Flex.js";
3
+ const c = ({
4
4
  label: r,
5
- component: t,
6
- fontSize: i = "inherit",
7
- styles: n,
8
- ...s
9
- }) => /* @__PURE__ */ l(m, { gap: "0.5rem", alignItems: "center", styles: { ...n, fontSize: i }, ...s, children: [
10
- /* @__PURE__ */ e("div", { id: r, children: t }),
5
+ component: i,
6
+ fontSize: n = "inherit",
7
+ styles: s,
8
+ ...l
9
+ }) => /* @__PURE__ */ m(t, { gap: "0.5rem", alignItems: "center", styles: { ...s, fontSize: n }, ...l, children: [
10
+ /* @__PURE__ */ e(t, { id: r, children: i }),
11
11
  /* @__PURE__ */ e("label", { htmlFor: r, children: r })
12
12
  ] });
13
13
  export {
14
- h as default
14
+ c as default
15
15
  };
@@ -1,3 +1,4 @@
1
+ export { default as ErrorBoundary } from './ErrorBoundary';
1
2
  export { default as InfoCard } from './InfoCard';
2
3
  export { default as List } from './List';
3
4
  export { default as LogoLoop } from './LogoLoop';
@@ -1,12 +1,14 @@
1
- import { InfoCard as a } from "./InfoCard/InfoCard.js";
2
- import { default as e } from "./List/List.js";
3
- import { default as d } from "./LogoLoop/LogoLoop.js";
4
- import { default as l } from "./WithLabel/WithLabel.js";
5
- import { default as s } from "./WithLoading/WithLoading.js";
1
+ import { default as a } from "./ErrorBoundary/ErrorBoundary.js";
2
+ import { InfoCard as e } from "./InfoCard/InfoCard.js";
3
+ import { default as d } from "./List/List.js";
4
+ import { default as l } from "./LogoLoop/LogoLoop.js";
5
+ import { default as s } from "./WithLabel/WithLabel.js";
6
+ import { default as x } from "./WithLoading/WithLoading.js";
6
7
  export {
7
- a as InfoCard,
8
- e as List,
9
- d as LogoLoop,
10
- l as WithLabel,
11
- s as WithLoading
8
+ a as ErrorBoundary,
9
+ e as InfoCard,
10
+ d as List,
11
+ l as LogoLoop,
12
+ s as WithLabel,
13
+ x as WithLoading
12
14
  };
package/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export { ZoomEntrance } from './animation';
2
2
  export { Avatar, AvatarWithImage, Button, Divider, Flex, Grid, Icon, Input, LabeledValue, ListButton, Loading, ScrollContainer, } from './base';
3
- export { InfoCard, List, LogoLoop, WithLabel, WithLoading } from './composite';
3
+ export { ErrorBoundary, InfoCard, List, LogoLoop, WithLabel, WithLoading } from './composite';
4
4
  export { AppHeader, Nav } from './supercomposite';
5
5
  export { AppContainer } from './templates';
package/index.js CHANGED
@@ -8,37 +8,39 @@ import { Grid as i } from "./base/Grid/Grid.js";
8
8
  import { default as g } from "./base/Icon/Icon.js";
9
9
  import { Input as A } from "./base/Input/Input.js";
10
10
  import { LabeledValue as c } from "./base/LabeledValue/LabeledValue.js";
11
- import { default as C } from "./base/ListButton/ListButton.js";
12
- import { default as b } from "./base/Loading/Loading.js";
13
- import { default as D } from "./base/ScrollContainer/ScrollContainer.js";
14
- import { InfoCard as F } from "./composite/InfoCard/InfoCard.js";
15
- import { default as H } from "./composite/List/List.js";
16
- import { default as S } from "./composite/LogoLoop/LogoLoop.js";
17
- import { default as Z } from "./composite/WithLabel/WithLabel.js";
18
- import { default as k } from "./composite/WithLoading/WithLoading.js";
19
- import { default as w } from "./supercomposite/AppHeader/AppHeader.js";
20
- import { Nav as z } from "./supercomposite/Nav/Nav.js";
21
- import { default as K } from "./templates/AppContainer/AppContainer.js";
11
+ import { default as B } from "./base/ListButton/ListButton.js";
12
+ import { default as W } from "./base/Loading/Loading.js";
13
+ import { default as E } from "./base/ScrollContainer/ScrollContainer.js";
14
+ import { default as D } from "./composite/ErrorBoundary/ErrorBoundary.js";
15
+ import { InfoCard as G } from "./composite/InfoCard/InfoCard.js";
16
+ import { default as N } from "./composite/List/List.js";
17
+ import { default as V } from "./composite/LogoLoop/LogoLoop.js";
18
+ import { default as j } from "./composite/WithLabel/WithLabel.js";
19
+ import { default as q } from "./composite/WithLoading/WithLoading.js";
20
+ import { default as z } from "./supercomposite/AppHeader/AppHeader.js";
21
+ import { Nav as K } from "./supercomposite/Nav/Nav.js";
22
+ import { default as O } from "./templates/AppContainer/AppContainer.js";
22
23
  export {
23
- K as AppContainer,
24
- w as AppHeader,
24
+ O as AppContainer,
25
+ z as AppHeader,
25
26
  a as Avatar,
26
27
  p as AvatarWithImage,
27
28
  x as Button,
28
29
  l as Divider,
30
+ D as ErrorBoundary,
29
31
  s as Flex,
30
32
  i as Grid,
31
33
  g as Icon,
32
- F as InfoCard,
34
+ G as InfoCard,
33
35
  A as Input,
34
36
  c as LabeledValue,
35
- H as List,
36
- C as ListButton,
37
- b as Loading,
38
- S as LogoLoop,
39
- z as Nav,
40
- D as ScrollContainer,
41
- Z as WithLabel,
42
- k as WithLoading,
37
+ N as List,
38
+ B as ListButton,
39
+ W as Loading,
40
+ V as LogoLoop,
41
+ K as Nav,
42
+ E as ScrollContainer,
43
+ j as WithLabel,
44
+ q as WithLoading,
43
45
  t as ZoomEntrance
44
46
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "jcicl",
3
3
  "private": false,
4
- "version": "0.0.52",
4
+ "version": "0.0.54",
5
5
  "description": "Component library for the websites of Johnson County Iowa",
6
6
  "license": "MIT",
7
7
  "homepage": "https://devops.jc.net/JCIT/Business%20Solutions%20Delivery/_git/JCComponentLibrary?path=%2FREADME.md&version=GBmaster",