@loomhq/lens 10.82.4 → 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";
|
package/dist/components/index.js
CHANGED
|
@@ -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';
|
|
@@ -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;
|