@loomhq/lens 10.82.3 → 10.83.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.
@@ -20,6 +20,7 @@ export { default as FormField } from "./form-field/form-field";
20
20
  export { default as NotificationBar } from "./notification-bar/notification-bar";
21
21
  export { default as Toast } from "./toast/toast";
22
22
  export { default as Switch } from "./switch/switch";
23
+ export { default as SkeletonText } from "./skeleton-text/skeleton-text";
23
24
  export { default as Logo } from "./logo/logo";
24
25
  export { default as Radio } from "./radio/radio";
25
26
  export { default as Pill } from "./pill/pill";
@@ -28,6 +28,7 @@ export { default as Toast } from './toast/toast';
28
28
  export { default as Tooltip } from './tooltip/tooltip';
29
29
  export { TooltipBox } from './tooltip/tooltip';
30
30
  export { default as Switch } from './switch/switch';
31
+ export { default as SkeletonText } from './skeleton-text/skeleton-text';
31
32
  export { default as Logo } from './logo/logo';
32
33
  export { default as Radio } from './radio/radio';
33
34
  export { default as List } from './list/list';
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { SeverityLevels } from './types';
3
3
  declare const NotificationBarWrapper: import("@emotion/styled-base").StyledComponent<React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>, NotificationBarWrapperProps, object>;
4
- declare const NotificationBar: ({ children, onCloseClick, isOpen, severity, ...props }: NotificationBarProps & React.ComponentProps<typeof NotificationBarWrapper>) => JSX.Element;
4
+ declare const NotificationBar: ({ children, onCloseClick, isOpen, severity, id, }: NotificationBarProps & React.ComponentProps<typeof NotificationBarWrapper>) => JSX.Element;
5
5
  declare type NotificationBarProps = {
6
6
  children?: React.ReactNode;
7
7
  isOpen?: boolean;
@@ -12,6 +12,5 @@ declare type NotificationBarWrapperProps = {
12
12
  children?: React.ReactNode;
13
13
  isOpen?: boolean;
14
14
  severity: SeverityLevels;
15
- button: React.ReactNode;
16
15
  };
17
16
  export default NotificationBar;
@@ -1,14 +1,3 @@
1
- var __rest = (this && this.__rest) || function (s, e) {
2
- var t = {};
3
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
- t[p] = s[p];
5
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
- t[p[i]] = s[p[i]];
9
- }
10
- return t;
11
- };
12
1
  import React, { useEffect } from 'react';
13
2
  import { u } from '../../utilities';
14
3
  import styled from '@emotion/styled';
@@ -72,9 +61,8 @@ const NotificationBarWrapper = styled.aside `
72
61
  --alignItems: center;
73
62
  }
74
63
  `;
75
- const NotificationBar = (_a) => {
76
- var _b, _c, _d;
77
- var { children, onCloseClick, isOpen, severity = 'info' } = _a, props = __rest(_a, ["children", "onCloseClick", "isOpen", "severity"]);
64
+ const NotificationBar = ({ children, onCloseClick, isOpen, severity = 'info', id, }) => {
65
+ var _a, _b, _c;
78
66
  useEffect(() => {
79
67
  if (!isOpen) {
80
68
  return;
@@ -93,16 +81,16 @@ const NotificationBar = (_a) => {
93
81
  usePushPageDown(isOpen);
94
82
  // NOTE: The UI for internal alert is slightly different.
95
83
  const isInternalAlert = severity === 'internal';
96
- return isOpen ? (React.createElement(NotificationBarWrapper, Object.assign({ isOpen: isOpen, severity: severity }, props),
84
+ return isOpen ? (React.createElement(NotificationBarWrapper, { isOpen: isOpen, severity: severity, id: id },
97
85
  React.createElement(Arrange, { alignItems: { default: 'start', small: 'center' }, justifyContent: "space-between", autoFlow: isInternalAlert ? 'column' : undefined, columns: !isInternalAlert ? ['1fr auto'] : undefined },
98
86
  React.createElement(Container, { paddingY: { default: 'xsmall', xsmall: 0 },
99
87
  // Visually offsets the close X so that text appears centre-aligned
100
88
  paddingLeft: !isInternalAlert ? { default: 0, medium: u(3.5) } : undefined, width: "100%" },
101
89
  React.createElement(Arrange, { autoFlow: "column", gap: isInternalAlert ? 'medium' : 'small', justifyContent: "center" },
102
- ((_b = severityStyles[severity]) === null || _b === void 0 ? void 0 : _b.icon) ? (React.createElement(Align, { alignment: "topLeft" },
103
- React.createElement(Icon, { icon: severityStyles[severity].icon, color: (_c = severityStyles[severity].color) !== null && _c !== void 0 ? _c : 'var(--lns-color-white)' }))) : null,
90
+ ((_a = severityStyles[severity]) === null || _a === void 0 ? void 0 : _a.icon) ? (React.createElement(Align, { alignment: "topLeft" },
91
+ React.createElement(Icon, { icon: severityStyles[severity].icon, color: (_b = severityStyles[severity].color) !== null && _b !== void 0 ? _b : 'var(--lns-color-white)' }))) : null,
104
92
  ' ',
105
93
  children))),
106
- React.createElement(IconButton, { iconColor: (_d = severityStyles[severity].color) !== null && _d !== void 0 ? _d : 'var(--lns-color-white)', tabIndex: 0, altText: "Close", icon: React.createElement(SvgClose, null), onClick: onCloseClick }))) : null;
94
+ React.createElement(IconButton, { iconColor: (_c = severityStyles[severity].color) !== null && _c !== void 0 ? _c : 'var(--lns-color-white)', tabIndex: 0, altText: "Close", icon: React.createElement(SvgClose, null), onClick: onCloseClick }))) : null;
107
95
  };
108
96
  export default NotificationBar;
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ declare const SkeletonTextWrapper: import("@emotion/styled-base").StyledComponent<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, SkeletonTextProps, object>;
3
+ declare const SkeletonText: ({ size, lines, }: SkeletonTextProps & React.ComponentProps<typeof SkeletonTextWrapper>) => JSX.Element;
4
+ declare type SkeletonTextProps = {
5
+ size?: 'body-sm' | 'body-md' | 'body-lg' | 'heading-sm' | 'heading-md' | 'heading-lg';
6
+ lines?: number;
7
+ };
8
+ export default SkeletonText;
@@ -0,0 +1,32 @@
1
+ import React from 'react';
2
+ import styled from '@emotion/styled';
3
+ import { getTextSize } from '../../utilities';
4
+ const SkeletonTextWrapper = styled.div `
5
+ ${props => getTextSize(props.size)};
6
+ color: transparent;
7
+ position: relative;
8
+ &::after {
9
+ content '';
10
+ position: absolute;
11
+ background-color: var(--lns-color-disabledBackground);
12
+ border-radius: var(--lns-radius-full);
13
+ width: 100%;
14
+ display: block;
15
+ height: 71.45%;
16
+ top: .2em;
17
+ }
18
+ ${props => props.lines > 1 &&
19
+ `
20
+ &:nth-of-type(3n+1) {
21
+ width: calc(100% - 2.25rem);
22
+ }
23
+ &:nth-of-type(3n) {
24
+ width: calc(100% - 4.125rem);
25
+ }
26
+ }
27
+ `};
28
+ `;
29
+ const SkeletonText = ({ size = 'body-md', lines = 1, }) => {
30
+ return (React.createElement(React.Fragment, null, [...Array(lines)].map((_, i) => (React.createElement(SkeletonTextWrapper, { key: i, size: size, lines: lines }, "Loading")))));
31
+ };
32
+ export default SkeletonText;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loomhq/lens",
3
- "version": "10.82.3",
3
+ "version": "10.83.0",
4
4
  "scripts": {
5
5
  "dev": "next",
6
6
  "build:next": "next build",