@loomhq/lens 10.77.0 → 10.77.2

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.
@@ -45,7 +45,7 @@ const AvatarWrapper = styled.span `
45
45
  align-items: center;
46
46
  justify-content: center;
47
47
  line-height: 1;
48
- font-weight: var(--lns-fontWeight-medium);
48
+ font-weight: var(--lns-fontWeight-bold);
49
49
  ${props => getAvatarSize(props.size)};
50
50
  position: relative;
51
51
  z-index: 0;
@@ -101,7 +101,7 @@ const ButtonWrapper = styled.button `
101
101
  vertical-align: middle;
102
102
  white-space: nowrap;
103
103
  border: 1px solid;
104
- ${getFontWeight('medium')};
104
+ ${getFontWeight('bold')};
105
105
  ${getRadius('full')};
106
106
  ${props => props.hasFullWidth ? 'display: flex; width: 100%' : 'display: inline-flex'};
107
107
  height: ${props => sizesStyles[props.size].height};
@@ -25,7 +25,7 @@ const PillWrapper = styled.div `
25
25
  background-color: ${props => getColorValue(props.backgroundColor)};
26
26
  ${getRadius('full')};
27
27
  ${getTextSize('small')};
28
- ${getFontWeight('medium')};
28
+ ${getFontWeight('bold')};
29
29
  ${getSize('gap', 'xsmall')};
30
30
  `;
31
31
  const Pill = (_a) => {
@@ -63,7 +63,7 @@ const TabWrapper = styled.button `
63
63
  color: inherit;
64
64
  text-decoration: none;
65
65
  flex-shrink: 0;
66
- ${getFontWeight('medium')};
66
+ ${getFontWeight('bold')};
67
67
  transition: 0.6s color;
68
68
  white-space: nowrap;
69
69
  color: ${props => getColorValue(props.isActive ? 'body' : 'bodyDimmed')};
@@ -11,12 +11,13 @@ export declare const lineHeightToPx: (size: any) => number;
11
11
  declare const TextWrapper: import("@emotion/styled-base").StyledComponent<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, TextWrapperProps, object>;
12
12
  declare const Text: ({ children, size, color, isInline, isDimmed, fontWeight, hasEllipsis, ellipsisLines, variant, htmlTag, alignment, sizeMinMax, ...props }: TextProps & React.ComponentProps<typeof TextWrapper>) => JSX.Element;
13
13
  export declare const availableSizes: string[];
14
+ export declare const deprecatedSizes: string[];
14
15
  export declare const availableFontWeights: string[];
15
16
  export declare const availableHtmlTags: string[];
16
17
  export declare const alignments: string[];
17
18
  interface TextProps {
18
- size?: 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge' | 'xxxlarge';
19
- fontWeight?: 'regular' | 'medium' | 'bold' | 'black';
19
+ size?: 'body-sm' | 'body-md' | 'body-lg' | 'heading-sm' | 'heading-md' | 'heading-lg' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge' | 'xxxlarge';
20
+ fontWeight?: 'book' | 'bold';
20
21
  variant?: 'body' | 'title' | 'mainTitle';
21
22
  alignment?: 'left' | 'right' | 'center';
22
23
  color?: string;
@@ -17,16 +17,16 @@ import { textIsDimmedDeprecated } from '../../console-messages';
17
17
  export const dimAmount = 0.6;
18
18
  export const variants = {
19
19
  body: {
20
- size: 'medium',
21
- fontWeight: 'regular',
20
+ size: 'body-md',
21
+ fontWeight: 'book',
22
22
  },
23
23
  title: {
24
- size: 'large',
24
+ size: 'body-lg',
25
25
  fontWeight: 'bold',
26
26
  },
27
27
  mainTitle: {
28
- size: 'xxlarge',
29
- fontWeight: 'black',
28
+ size: 'heading-md',
29
+ fontWeight: 'bold',
30
30
  },
31
31
  };
32
32
  const getTextPxSize = size => textSizes[size].fontSize * unit;
@@ -77,13 +77,21 @@ const TextWrapper = styled.span `
77
77
  `}
78
78
  `;
79
79
  const Text = (_a) => {
80
- var { children, size = 'medium', color, isInline, isDimmed, fontWeight = 'regular', hasEllipsis, ellipsisLines, variant, htmlTag = 'span', alignment, sizeMinMax } = _a, props = __rest(_a, ["children", "size", "color", "isInline", "isDimmed", "fontWeight", "hasEllipsis", "ellipsisLines", "variant", "htmlTag", "alignment", "sizeMinMax"]);
80
+ var { children, size = 'body-md', color, isInline, isDimmed, fontWeight = 'book', hasEllipsis, ellipsisLines, variant, htmlTag = 'span', alignment, sizeMinMax } = _a, props = __rest(_a, ["children", "size", "color", "isInline", "isDimmed", "fontWeight", "hasEllipsis", "ellipsisLines", "variant", "htmlTag", "alignment", "sizeMinMax"]);
81
81
  if (isDimmed) {
82
82
  console.warn(textIsDimmedDeprecated);
83
83
  }
84
84
  return (React.createElement(TextWrapper, Object.assign({ size: variant ? variants[variant].size : size, color: color, isInline: isInline, isDimmed: isDimmed, fontWeight: variant ? variants[variant].fontWeight : fontWeight, hasEllipsis: hasEllipsis, ellipsisLines: ellipsisLines, variant: variant, as: htmlTag, alignment: alignment, sizeMinMax: sizeMinMax }, props), children));
85
85
  };
86
86
  export const availableSizes = [
87
+ 'body-sm',
88
+ 'body-md',
89
+ 'body-lg',
90
+ 'heading-sm',
91
+ 'heading-md',
92
+ 'heading-lg',
93
+ ];
94
+ export const deprecatedSizes = [
87
95
  'small',
88
96
  'medium',
89
97
  'large',
@@ -91,7 +99,7 @@ export const availableSizes = [
91
99
  'xxlarge',
92
100
  'xxxlarge',
93
101
  ];
94
- export const availableFontWeights = ['regular', 'medium'];
102
+ export const availableFontWeights = ['book', 'bold'];
95
103
  export const availableHtmlTags = ['h1', 'h2', 'h3', 'h4', 'p', 'span', 'div'];
96
104
  export const alignments = ['left', 'right', 'center'];
97
105
  export default Text;
@@ -41,7 +41,7 @@ const TextButtonWrapper = styled.button `
41
41
  cursor: pointer;
42
42
  transition: 0.6s background-color;
43
43
  color: ${getColorValue('body')};
44
- ${getFontWeight('medium')};
44
+ ${getFontWeight('bold')};
45
45
  ${getRadius('full')};
46
46
  ${props => getTextSize(sizeStyles[props.size].textSize)};
47
47
  padding: 0 ${props => sizeStyles[props.size].xSpace};
@@ -38,7 +38,7 @@ const TooltipBoxWrapper = styled.div `
38
38
  background-color: ${getColorValue('background')};
39
39
  color: ${getColorValue('body')};
40
40
  ${getRadius('large')};
41
- ${getFontWeight('medium')};
41
+ ${getFontWeight('bold')};
42
42
  ${getTextSize('small')};
43
43
  ${getShadow('medium')};
44
44
  ${props => getSize('max-width', props.maxWidth)};
@@ -50,7 +50,7 @@ const ShortcutWrapper = styled.div `
50
50
  background-color: ${getColorValue('backgroundActive')};
51
51
  border-radius: 3px;
52
52
  color: ${getColorValue('grey3')};
53
- ${getFontWeight('medium')};
53
+ ${getFontWeight('bold')};
54
54
  ${getTextSize('small')};
55
55
  padding-left: ${u(0.5)};
56
56
  padding-right: ${u(0.5)};
@@ -149,7 +149,7 @@ const Tooltip = (_a) => {
149
149
  renderLayer(React.createElement("div", Object.assign({}, layerProps, { style: Object.assign(Object.assign({}, layerProps.style), { zIndex }) }),
150
150
  React.createElement(TooltipBox, Object.assign({ maxWidth: maxWidth, onMouseEnter: () => setIsOverTooltip(true), onMouseLeave: () => setIsOverTooltip(false) }, rest),
151
151
  React.createElement(Arrange, { gap: "small" },
152
- React.createElement(Text, { size: "small", fontWeight: "medium" }, content),
152
+ React.createElement(Text, { size: "small", fontWeight: "bold" }, content),
153
153
  shortcut && (React.createElement(Arrange, { gap: "xsmall" }, shortcut.map((char, index) => (React.createElement(ShortcutBox, { key: index }, char)))))))))));
154
154
  };
155
155
  export const availablePlacements = Object.keys(placements);
@@ -1,84 +1,90 @@
1
1
  export const unit: 8;
2
- export namespace textSizes {
3
- namespace small {
4
- const fontSize: number;
5
- const lineHeight: number;
6
- }
7
- namespace medium {
8
- const fontSize_1: number;
9
- export { fontSize_1 as fontSize };
10
- const lineHeight_1: number;
11
- export { lineHeight_1 as lineHeight };
12
- }
13
- namespace large {
14
- const fontSize_2: number;
15
- export { fontSize_2 as fontSize };
16
- const lineHeight_2: number;
17
- export { lineHeight_2 as lineHeight };
18
- }
19
- namespace xlarge {
20
- const fontSize_3: number;
21
- export { fontSize_3 as fontSize };
22
- const lineHeight_3: number;
23
- export { lineHeight_3 as lineHeight };
24
- }
25
- namespace xxlarge {
26
- const fontSize_4: number;
27
- export { fontSize_4 as fontSize };
28
- const lineHeight_4: number;
29
- export { lineHeight_4 as lineHeight };
30
- }
31
- namespace xxxlarge {
32
- const fontSize_5: number;
33
- export { fontSize_5 as fontSize };
34
- const lineHeight_5: number;
35
- export { lineHeight_5 as lineHeight };
36
- }
37
- }
2
+ export const textSizes: {
3
+ small: {
4
+ fontSize: number;
5
+ lineHeight: number;
6
+ };
7
+ 'body-sm': {
8
+ fontSize: number;
9
+ lineHeight: number;
10
+ };
11
+ medium: {
12
+ fontSize: number;
13
+ lineHeight: number;
14
+ };
15
+ 'body-md': {
16
+ fontSize: number;
17
+ lineHeight: number;
18
+ };
19
+ large: {
20
+ fontSize: number;
21
+ lineHeight: number;
22
+ };
23
+ 'body-lg': {
24
+ fontSize: number;
25
+ lineHeight: number;
26
+ };
27
+ xlarge: {
28
+ fontSize: number;
29
+ lineHeight: number;
30
+ };
31
+ 'heading-sm': {
32
+ fontSize: number;
33
+ lineHeight: number;
34
+ };
35
+ xxlarge: {
36
+ fontSize: number;
37
+ lineHeight: number;
38
+ };
39
+ 'heading-md': {
40
+ fontSize: number;
41
+ lineHeight: number;
42
+ };
43
+ xxxlarge: {
44
+ fontSize: number;
45
+ lineHeight: number;
46
+ };
47
+ 'heading-lg': {
48
+ fontSize: number;
49
+ lineHeight: number;
50
+ };
51
+ };
38
52
  export namespace fontWeights {
39
- export const regular: number;
40
- const medium_1: number;
41
- export { medium_1 as medium };
42
- export const bold: number;
43
- export const black: number;
53
+ const book: number;
54
+ const bold: number;
44
55
  }
45
56
  export namespace radii {
46
- const medium_2: string;
47
- export { medium_2 as medium };
48
- const large_1: string;
49
- export { large_1 as large };
50
- const xlarge_1: string;
51
- export { xlarge_1 as xlarge };
52
- export const full: string;
57
+ const medium: string;
58
+ const large: string;
59
+ const xlarge: string;
60
+ const full: string;
53
61
  }
54
62
  export namespace shadows {
55
- const small_1: string;
56
- export { small_1 as small };
57
- const medium_3: string;
58
- export { medium_3 as medium };
59
- const large_2: string;
60
- export { large_2 as large };
63
+ export const small: string;
64
+ const medium_1: string;
65
+ export { medium_1 as medium };
66
+ const large_1: string;
67
+ export { large_1 as large };
61
68
  }
62
69
  export namespace spaces {
63
70
  export const xsmall: number;
64
- const small_2: number;
65
- export { small_2 as small };
66
- const medium_4: number;
67
- export { medium_4 as medium };
68
- const large_3: number;
69
- export { large_3 as large };
70
- const xlarge_2: number;
71
- export { xlarge_2 as xlarge };
72
- const xxlarge_1: number;
73
- export { xxlarge_1 as xxlarge };
71
+ const small_1: number;
72
+ export { small_1 as small };
73
+ const medium_2: number;
74
+ export { medium_2 as medium };
75
+ const large_2: number;
76
+ export { large_2 as large };
77
+ const xlarge_1: number;
78
+ export { xlarge_1 as xlarge };
79
+ export const xxlarge: number;
74
80
  }
75
81
  export namespace breakpoints {
76
82
  const xsmall_1: string;
77
83
  export { xsmall_1 as xsmall };
78
- const small_3: string;
79
- export { small_3 as small };
80
- const medium_5: string;
81
- export { medium_5 as medium };
82
- const large_4: string;
83
- export { large_4 as large };
84
+ const small_2: string;
85
+ export { small_2 as small };
86
+ const medium_3: string;
87
+ export { medium_3 as medium };
88
+ const large_3: string;
89
+ export { large_3 as large };
84
90
  }
package/dist/variables.js CHANGED
@@ -5,32 +5,54 @@ export const textSizes = {
5
5
  fontSize: 1.5,
6
6
  lineHeight: 1.5,
7
7
  },
8
+ 'body-sm': {
9
+ fontSize: 1.5,
10
+ lineHeight: 1.5,
11
+ },
8
12
  medium: {
9
13
  fontSize: 1.75,
10
14
  lineHeight: 1.6,
11
15
  },
16
+ 'body-md': {
17
+ fontSize: 1.75,
18
+ lineHeight: 1.6,
19
+ },
12
20
  large: {
13
21
  fontSize: 2.25,
14
22
  lineHeight: 1.45,
15
23
  },
24
+ 'body-lg': {
25
+ fontSize: 2.25,
26
+ lineHeight: 1.45,
27
+ },
16
28
  xlarge: {
17
29
  fontSize: 3,
18
30
  lineHeight: 1.35,
19
31
  },
32
+ 'heading-sm': {
33
+ fontSize: 3,
34
+ lineHeight: 1.35,
35
+ },
20
36
  xxlarge: {
21
37
  fontSize: 4,
22
38
  lineHeight: 1.2,
23
39
  },
40
+ 'heading-md': {
41
+ fontSize: 4,
42
+ lineHeight: 1.2,
43
+ },
24
44
  xxxlarge: {
25
45
  fontSize: 6,
26
46
  lineHeight: 1.15,
27
47
  },
48
+ 'heading-lg': {
49
+ fontSize: 6,
50
+ lineHeight: 1.15,
51
+ },
28
52
  };
29
53
  export const fontWeights = {
30
- regular: 400,
31
- medium: 500,
54
+ book: 400,
32
55
  bold: 700,
33
- black: 900,
34
56
  };
35
57
  export const radii = {
36
58
  medium: u(1),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loomhq/lens",
3
- "version": "10.77.0",
3
+ "version": "10.77.2",
4
4
  "scripts": {
5
5
  "dev": "next",
6
6
  "build:next": "next build",