@loomhq/lens 10.98.2 → 10.99.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.
- package/dist/components/avatar/avatar.d.ts +2 -0
- package/dist/components/avatar/avatar.js +46 -20
- package/dist/components/icon/available-icons/index.d.ts +1 -0
- package/dist/components/icon/available-icons/index.js +1 -0
- package/dist/components/icon/available-icons/variables.d.ts +2 -0
- package/dist/components/icon/available-icons/variables.js +6 -0
- package/package.json +1 -1
|
@@ -11,29 +11,30 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
11
11
|
};
|
|
12
12
|
import { getRadius, getSizeValue, u } from '../../utilities';
|
|
13
13
|
import React from 'react';
|
|
14
|
-
import { css } from '@emotion/core';
|
|
15
14
|
import styled from '@emotion/styled';
|
|
16
15
|
const getLetterSize = wrapperSize => `calc(${wrapperSize} / 1.75)`;
|
|
17
16
|
const getAvatarSize = avatarSize => {
|
|
17
|
+
let width;
|
|
18
|
+
let height;
|
|
18
19
|
if (avatarSize === 'medium') {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
height: ${u(4)};
|
|
22
|
-
font-size: ${getLetterSize(u(4))};
|
|
23
|
-
`;
|
|
20
|
+
width = u(4);
|
|
21
|
+
height = u(4);
|
|
24
22
|
}
|
|
25
|
-
if (avatarSize === 'large') {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
height: ${u(7)};
|
|
29
|
-
font-size: ${getLetterSize(u(7))};
|
|
30
|
-
`;
|
|
23
|
+
else if (avatarSize === 'large') {
|
|
24
|
+
width = u(7);
|
|
25
|
+
height = u(7);
|
|
31
26
|
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
27
|
+
else {
|
|
28
|
+
const sizeValue = getSizeValue(avatarSize);
|
|
29
|
+
width = sizeValue;
|
|
30
|
+
height = sizeValue;
|
|
31
|
+
}
|
|
32
|
+
const fontSize = getLetterSize(width);
|
|
33
|
+
return {
|
|
34
|
+
width,
|
|
35
|
+
height,
|
|
36
|
+
fontSize,
|
|
37
|
+
};
|
|
37
38
|
};
|
|
38
39
|
const AvatarWrapper = styled.span `
|
|
39
40
|
display: block;
|
|
@@ -46,7 +47,18 @@ const AvatarWrapper = styled.span `
|
|
|
46
47
|
justify-content: center;
|
|
47
48
|
line-height: 1;
|
|
48
49
|
font-weight: var(--lns-fontWeight-bold);
|
|
49
|
-
${props =>
|
|
50
|
+
width: ${props => {
|
|
51
|
+
const { width } = getAvatarSize(props.size);
|
|
52
|
+
return width;
|
|
53
|
+
}};
|
|
54
|
+
height: ${props => {
|
|
55
|
+
const { height } = getAvatarSize(props.size);
|
|
56
|
+
return height;
|
|
57
|
+
}};
|
|
58
|
+
font-size: ${props => {
|
|
59
|
+
const { fontSize } = getAvatarSize(props.size);
|
|
60
|
+
return fontSize;
|
|
61
|
+
}};
|
|
50
62
|
position: relative;
|
|
51
63
|
z-index: 0;
|
|
52
64
|
|
|
@@ -64,7 +76,19 @@ const AvatarWrapper = styled.span `
|
|
|
64
76
|
}
|
|
65
77
|
`;
|
|
66
78
|
const AvatarImage = styled.img `
|
|
67
|
-
width: 100%;
|
|
79
|
+
max-width: 100%;
|
|
80
|
+
width: ${props => {
|
|
81
|
+
const { width } = getAvatarSize(props.size);
|
|
82
|
+
return width;
|
|
83
|
+
}};
|
|
84
|
+
height: ${props => {
|
|
85
|
+
const { height } = getAvatarSize(props.size);
|
|
86
|
+
return height;
|
|
87
|
+
}};
|
|
88
|
+
font-size: ${props => {
|
|
89
|
+
const { fontSize } = getAvatarSize(props.size);
|
|
90
|
+
return fontSize;
|
|
91
|
+
}};
|
|
68
92
|
`;
|
|
69
93
|
const Avatar = (_a) => {
|
|
70
94
|
var { altText = '', size = 4, letter, imageSrc, children } = _a, props = __rest(_a, ["altText", "size", "letter", "imageSrc", "children"]);
|
|
@@ -73,7 +97,9 @@ const Avatar = (_a) => {
|
|
|
73
97
|
return children;
|
|
74
98
|
}
|
|
75
99
|
if (imageSrc) {
|
|
76
|
-
|
|
100
|
+
const height = getAvatarSize(size).height;
|
|
101
|
+
const width = getAvatarSize(size).width;
|
|
102
|
+
return (React.createElement(AvatarImage, { size: size, alt: altText, src: imageSrc, height: height, width: width }));
|
|
77
103
|
}
|
|
78
104
|
if (letter) {
|
|
79
105
|
if (altText) {
|
|
@@ -258,3 +258,4 @@ export { default as SvgFolderPlus } from "./folder-plus.js";
|
|
|
258
258
|
export { default as SvgPower } from "./power.js";
|
|
259
259
|
export { default as SvgReplay } from "./replay.js";
|
|
260
260
|
export { default as SvgTranscript } from "./transcript";
|
|
261
|
+
export { default as SvgVariables } from "./variables";
|
|
@@ -258,3 +258,4 @@ export { default as SvgFolderPlus } from './folder-plus.js';
|
|
|
258
258
|
export { default as SvgPower } from './power.js';
|
|
259
259
|
export { default as SvgReplay } from './replay.js';
|
|
260
260
|
export { default as SvgTranscript } from './transcript';
|
|
261
|
+
export { default as SvgVariables } from './variables';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
function SvgVariables(props) {
|
|
3
|
+
return (React.createElement("svg", Object.assign({ viewBox: "0 0 25 24", fill: "none" }, props),
|
|
4
|
+
React.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M8.78181 3.75H8.25176C6.17193 3.75 4.87858 4.80682 4.87858 7.03977V9.46023C4.87858 10.5933 4.1437 11.026 3.18006 11.0448C3.16669 11.0443 3.15324 11.044 3.13973 11.044C2.60281 11.044 2.16754 11.4685 2.16754 11.9922C2.16754 12.5158 2.60281 12.9403 3.13973 12.9403C3.15965 12.9403 3.17943 12.9397 3.19905 12.9386C4.15333 12.9627 4.87858 13.3971 4.87858 14.5227V16.9432C4.87858 19.1761 6.17193 20.25 8.25176 20.25H8.79356V20.2485C9.27681 20.2423 9.66661 19.8584 9.66661 19.3856C9.66661 18.909 9.27047 18.5227 8.78181 18.5227C8.74712 18.5227 8.7129 18.5246 8.67925 18.5284H8.28671C7.41283 18.5284 6.8186 18.1193 6.8186 16.9943V14.1477C6.8186 13.0568 6.17193 12.2727 5.07084 12C6.1894 11.7102 6.8186 10.9261 6.8186 9.85227V6.98864C6.8186 5.86364 7.41283 5.47159 8.28671 5.47159H8.69332C8.72242 5.47441 8.75194 5.47585 8.78181 5.47585C9.27047 5.47585 9.66661 5.08951 9.66661 4.61293C9.66661 4.14017 9.27681 3.75621 8.79356 3.75007V3.75H8.78181ZM16.5514 3.75H17.0815C19.1613 3.75 20.4546 4.80682 20.4546 7.03977V9.46023C20.4546 10.5933 21.1895 11.026 22.1532 11.0448C22.1665 11.0443 22.18 11.044 22.1935 11.044C22.7304 11.044 23.1657 11.4685 23.1657 11.9922C23.1657 12.5158 22.7304 12.9403 22.1935 12.9403C22.1736 12.9403 22.1538 12.9397 22.1342 12.9386C21.1799 12.9627 20.4546 13.3971 20.4546 14.5227V16.9432C20.4546 19.1761 19.1613 20.25 17.0815 20.25H16.5397V20.2485C16.0564 20.2423 15.6666 19.8584 15.6666 19.3856C15.6666 18.909 16.0628 18.5227 16.5514 18.5227C16.5861 18.5227 16.6203 18.5246 16.654 18.5284H17.0465C17.9204 18.5284 18.5146 18.1193 18.5146 16.9943V14.1477C18.5146 13.0568 19.1613 12.2727 20.2624 12C19.1438 11.7102 18.5146 10.9261 18.5146 9.85227V6.98864C18.5146 5.86364 17.9204 5.47159 17.0465 5.47159H16.6399C16.6108 5.47441 16.5813 5.47585 16.5514 5.47585C16.0628 5.47585 15.6666 5.08951 15.6666 4.61293C15.6666 4.14017 16.0564 3.75621 16.5397 3.75007V3.75H16.5514ZM15.2579 12.352C15.4853 12.3376 15.6666 12.2878 15.6666 12.0546C15.6666 11.8244 15.4853 11.7746 15.255 11.7602C14.1698 11.6997 13.0258 10.4968 12.9625 9.41163C12.951 9.18135 12.9041 9 12.668 9C12.432 9 12.3822 9.18135 12.3707 9.41163C12.3074 10.4968 11.1634 11.6997 10.0782 11.7602C9.84796 11.7746 9.66661 11.8215 9.66661 12.0546C9.66661 12.2878 9.84796 12.3376 10.0782 12.352C11.1634 12.4124 12.3074 13.5032 12.3707 14.5855C12.3822 14.8187 12.4349 15 12.668 15C12.9012 15 12.951 14.8187 12.9625 14.5884C13.0258 13.5032 14.1698 12.4124 15.2579 12.352Z", fill: "currentColor" })));
|
|
5
|
+
}
|
|
6
|
+
export default SvgVariables;
|