@loomhq/lens 10.89.2 → 10.91.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.
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ interface ErrorContainerProps {
3
+ children: React.ReactNode;
4
+ errorActive: boolean;
5
+ errorMessage?: string;
6
+ }
7
+ declare const ErrorContainer: ({ children, errorActive, errorMessage, }: ErrorContainerProps) => JSX.Element;
8
+ export default ErrorContainer;
@@ -0,0 +1,35 @@
1
+ import React from 'react';
2
+ import Arrange from '../arrange/arrange';
3
+ import Icon from '../icon/icon';
4
+ import { SvgAlertTriangle } from '../icon/available-icons';
5
+ import Text from '../text/text';
6
+ import styled from '@emotion/styled';
7
+ // the border below is a stand-alone component to avoid messing with the layout of the children
8
+ // the calculations in width, height, top, and left are to add padding between the border and the children
9
+ // pointer-events: none is to allow the children to be clickable
10
+ const ErrorContainerBorder = styled.div `
11
+ position: relative;
12
+ ::before {
13
+ content: '';
14
+ width: calc(100% + var(--lns-space-medium));
15
+ height: calc(100% + var(--lns-space-medium));
16
+ position: absolute;
17
+ top: calc(-1 * var(--lns-space-small));
18
+ left: calc(-1 * var(--lns-space-small));
19
+ outline: 1px solid var(--lns-color-danger);
20
+ border-radius: var(--lns-radius-large);
21
+ pointer-events: none;
22
+ }
23
+ `;
24
+ const ErrorContainer = ({ children, errorActive, errorMessage = "Oops, that didn't work. Try again.", }) => {
25
+ if (!errorActive) {
26
+ return React.createElement(React.Fragment, null, children);
27
+ }
28
+ return (React.createElement(ErrorContainerBorder, null,
29
+ React.createElement(Arrange, { autoFlow: "row", gap: "small" },
30
+ children,
31
+ errorMessage ? (React.createElement(Arrange, { gap: "xsmall" },
32
+ React.createElement(Icon, { icon: React.createElement(SvgAlertTriangle, null), size: 2, color: "danger" }),
33
+ React.createElement(Text, { size: "body-sm", color: "danger" }, errorMessage))) : null)));
34
+ };
35
+ export default ErrorContainer;
@@ -6,6 +6,7 @@ export { default as Icon } from "./icon/icon";
6
6
  export { default as TextInput } from "./text-input/text-input";
7
7
  export { default as Distribute } from "./distribute/distribute";
8
8
  export { default as Container } from "./container/container";
9
+ export { default as ErrorContainer } from "./error-container/error-container";
9
10
  export { default as Layout } from "./layout/layout";
10
11
  export { default as Loader } from "./loader/loader";
11
12
  export { default as Checkbox } from "./checkbox/checkbox";
@@ -7,6 +7,7 @@ export { default as Icon } from './icon/icon';
7
7
  export { default as TextInput } from './text-input/text-input';
8
8
  export { default as Distribute } from './distribute/distribute';
9
9
  export { default as Container } from './container/container';
10
+ export { default as ErrorContainer } from './error-container/error-container';
10
11
  export { default as Layout } from './layout/layout';
11
12
  export { default as IconButton } from './icon-button/icon-button';
12
13
  export { IconButtonBox } from './icon-button/icon-button';
@@ -1,7 +1,8 @@
1
1
  import React from 'react';
2
2
  declare const LogoLoaderWrapper: import("@emotion/styled-base").StyledComponent<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, LogoLoaderProps, object>;
3
- declare const LogoLoader: ({ animation, }: LogoLoaderProps & React.ComponentProps<typeof LogoLoaderWrapper>) => JSX.Element;
3
+ declare const LogoLoader: ({ animation, brand, }: LogoLoaderProps & React.ComponentProps<typeof LogoLoaderWrapper>) => JSX.Element;
4
4
  declare type LogoLoaderProps = {
5
5
  animation?: string;
6
+ brand?: 'loom' | 'ai';
6
7
  };
7
8
  export default LogoLoader;
@@ -3,13 +3,12 @@ import styled from '@emotion/styled';
3
3
  import { LENS_CDN } from '../../constants/routes';
4
4
  const LogoLoaderWrapper = styled.span `
5
5
  animation: ${props => props.animation};
6
- background-image: url(${LENS_CDN}/logo-loader.svg);
6
+ background-image: url(${LENS_CDN}/${props => props.brand}-loader.svg);
7
7
  background-size: cover;
8
8
  background-position: left center;
9
9
  display: block;
10
10
  height: 80px;
11
11
  width: 80px;
12
- transform: rotate(4deg);
13
12
 
14
13
  @keyframes spin {
15
14
  100% {
@@ -17,7 +16,7 @@ const LogoLoaderWrapper = styled.span `
17
16
  }
18
17
  }
19
18
  `;
20
- const LogoLoader = ({ animation = 'spin 2s infinite steps(49) forwards', }) => {
21
- return React.createElement(LogoLoaderWrapper, { animation: animation });
19
+ const LogoLoader = ({ animation = 'spin 2s infinite steps(49) forwards', brand = 'loom', }) => {
20
+ return React.createElement(LogoLoaderWrapper, { animation: animation, brand: brand });
22
21
  };
23
22
  export default LogoLoader;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loomhq/lens",
3
- "version": "10.89.2",
3
+ "version": "10.91.0",
4
4
  "scripts": {
5
5
  "dev": "next",
6
6
  "build:next": "next build",