@loomhq/lens 10.36.0 → 10.37.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/README.md +15 -0
- package/dist/components/avatar/avatar.js +2 -2
- package/dist/components/container/container.d.ts +1 -1
- package/dist/components/container/container.js +1 -1
- package/dist/components/radio/radio.js +3 -3
- package/dist/variables.d.ts +13 -8
- package/dist/variables.js +4 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -7,11 +7,13 @@
|
|
|
7
7
|
## Installation
|
|
8
8
|
|
|
9
9
|
Add Lens to your app:
|
|
10
|
+
|
|
10
11
|
```
|
|
11
12
|
yarn add @loomhq/lens
|
|
12
13
|
```
|
|
13
14
|
|
|
14
15
|
Add dependencies:
|
|
16
|
+
|
|
15
17
|
```
|
|
16
18
|
yarn add @emotion/core
|
|
17
19
|
yarn add @emotion/styled
|
|
@@ -30,6 +32,7 @@ document.head.appendChild(style);
|
|
|
30
32
|
```
|
|
31
33
|
|
|
32
34
|
In some cases you might need to inject the CSS variables to a specific element. Pass a string argument to `getThemeStylesString()` and `getAllCssVarsString()`:
|
|
35
|
+
|
|
33
36
|
```
|
|
34
37
|
getThemeStylesString('.myGlobalElement')
|
|
35
38
|
getAllCssVarsString('.myGlobalElement')
|
|
@@ -48,11 +51,23 @@ document.head.appendChild(style);
|
|
|
48
51
|
```
|
|
49
52
|
|
|
50
53
|
## Running Locally
|
|
54
|
+
|
|
51
55
|
```
|
|
52
56
|
yarn
|
|
53
57
|
yarn dev
|
|
54
58
|
navigate to: http://localhost:3000
|
|
55
59
|
```
|
|
56
60
|
|
|
61
|
+
## Contributing
|
|
62
|
+
|
|
63
|
+
### Use conventional commits
|
|
64
|
+
|
|
65
|
+
Use [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/) to kick off publishing a new version of Lens when PR is merged. To upgrade Lens to the latest published version in the [main Loom repo](http://github.com/loomhq/loom), `cd src/client` and `pnpm up @loomhq/lens`.
|
|
66
|
+
|
|
67
|
+
### Add an icon to the icon set
|
|
68
|
+
|
|
69
|
+
Once you have the SVG of the new icon to be added, make sure all strokes are outlined. Set `<svg>` attributes to `viewBox="0 0 24 24" fill="none" {...props}` and `<path>` attributes to `fill="currentColor"`. Follow [this](https://github.com/loomhq/lens/pull/381/files) for an example PR or watch https://www.loom.com/share/26e36c6616be4db386192467b88edbc9 for a step-by-step walkthrough.
|
|
70
|
+
|
|
57
71
|
## Documentation
|
|
72
|
+
|
|
58
73
|
https://lens.loom.dev
|
|
@@ -9,7 +9,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
9
9
|
}
|
|
10
10
|
return t;
|
|
11
11
|
};
|
|
12
|
-
import { getSizeValue, u } from '../../utilities';
|
|
12
|
+
import { getRadius, getSizeValue, u } from '../../utilities';
|
|
13
13
|
import React from 'react';
|
|
14
14
|
import { css } from '@emotion/core';
|
|
15
15
|
import styled from '@emotion/styled';
|
|
@@ -39,7 +39,7 @@ const AvatarWrapper = styled.span `
|
|
|
39
39
|
display: block;
|
|
40
40
|
color: var(--lns-color-orangeDark);
|
|
41
41
|
background-color: var(--lns-color-background);
|
|
42
|
-
|
|
42
|
+
${getRadius('full')};
|
|
43
43
|
overflow: hidden;
|
|
44
44
|
display: flex;
|
|
45
45
|
align-items: center;
|
|
@@ -9,7 +9,7 @@ interface SharedProps {
|
|
|
9
9
|
backgroundColor?: string;
|
|
10
10
|
contentColor?: string;
|
|
11
11
|
borderColor?: string;
|
|
12
|
-
radius?: 'medium';
|
|
12
|
+
radius?: 'medium' | 'large' | 'xlarge' | 'full';
|
|
13
13
|
borderSide?: 'all' | 'left' | 'right' | 'top' | 'bottom';
|
|
14
14
|
shadow?: 'small' | 'medium' | 'large';
|
|
15
15
|
padding?: ResponsiveType<string | number>;
|
|
@@ -59,7 +59,7 @@ const Container = (_a) => {
|
|
|
59
59
|
return (React.createElement(ContainerWrapper, Object.assign({ backgroundColor: backgroundColor, contentColor: contentColor, borderColor: borderColor, radius: radius, borderSide: borderSide, shadow: shadow, padding: padding, paddingLeft: paddingX || paddingLeft, paddingRight: paddingX || paddingRight, paddingTop: paddingY || paddingTop, paddingBottom: paddingY || paddingBottom, margin: margin, marginLeft: marginX || marginLeft, marginRight: marginX || marginRight, marginTop: marginY || marginTop, marginBottom: marginY || marginBottom, width: width, height: height, minWidth: minWidth, minHeight: minHeight, maxWidth: maxWidth, maxHeight: maxHeight, as: htmlTag, position: position, top: top, bottom: bottom, left: left, right: right, overflow: overflow, zIndex: zIndex, borderWidth: borderWidth }, props), children));
|
|
60
60
|
};
|
|
61
61
|
export const availableBorderSides = ['all', 'left', 'right', 'top', 'bottom'];
|
|
62
|
-
export const availableRadii = ['medium'];
|
|
62
|
+
export const availableRadii = ['medium', 'large', 'xlarge', 'full'];
|
|
63
63
|
export const availableHtmlTags = [
|
|
64
64
|
'div',
|
|
65
65
|
'header',
|
|
@@ -10,7 +10,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
10
10
|
return t;
|
|
11
11
|
};
|
|
12
12
|
import React, { forwardRef } from 'react';
|
|
13
|
-
import { getColorValue, getFocusRing, u } from '../../utilities';
|
|
13
|
+
import { getColorValue, getFocusRing, getRadius, u } from '../../utilities';
|
|
14
14
|
import styled from '@emotion/styled';
|
|
15
15
|
const RadioLabel = styled.label `
|
|
16
16
|
display: block;
|
|
@@ -63,7 +63,7 @@ const RadioBox = styled.span `
|
|
|
63
63
|
cursor: pointer;
|
|
64
64
|
width: ${u(2.25)};
|
|
65
65
|
height: ${u(2.25)};
|
|
66
|
-
|
|
66
|
+
${getRadius('full')};
|
|
67
67
|
display: flex;
|
|
68
68
|
align-items: center;
|
|
69
69
|
justify-content: center;
|
|
@@ -73,7 +73,7 @@ const RadioBox = styled.span `
|
|
|
73
73
|
content: '';
|
|
74
74
|
width: ${u(1)};
|
|
75
75
|
height: ${u(1)};
|
|
76
|
-
|
|
76
|
+
${getRadius('full')};
|
|
77
77
|
background-color: ${getColorValue('white')};
|
|
78
78
|
}
|
|
79
79
|
`;
|
package/dist/variables.d.ts
CHANGED
|
@@ -45,14 +45,19 @@ export namespace fontWeights {
|
|
|
45
45
|
export namespace radii {
|
|
46
46
|
const medium_2: string;
|
|
47
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;
|
|
48
53
|
}
|
|
49
54
|
export namespace shadows {
|
|
50
55
|
const small_1: string;
|
|
51
56
|
export { small_1 as small };
|
|
52
57
|
const medium_3: string;
|
|
53
58
|
export { medium_3 as medium };
|
|
54
|
-
const
|
|
55
|
-
export {
|
|
59
|
+
const large_2: string;
|
|
60
|
+
export { large_2 as large };
|
|
56
61
|
}
|
|
57
62
|
export namespace spaces {
|
|
58
63
|
export const xsmall: number;
|
|
@@ -60,10 +65,10 @@ export namespace spaces {
|
|
|
60
65
|
export { small_2 as small };
|
|
61
66
|
const medium_4: number;
|
|
62
67
|
export { medium_4 as medium };
|
|
63
|
-
const
|
|
64
|
-
export {
|
|
65
|
-
const
|
|
66
|
-
export {
|
|
68
|
+
const large_3: number;
|
|
69
|
+
export { large_3 as large };
|
|
70
|
+
const xlarge_2: number;
|
|
71
|
+
export { xlarge_2 as xlarge };
|
|
67
72
|
const xxlarge_1: number;
|
|
68
73
|
export { xxlarge_1 as xxlarge };
|
|
69
74
|
}
|
|
@@ -74,6 +79,6 @@ export namespace breakpoints {
|
|
|
74
79
|
export { small_3 as small };
|
|
75
80
|
const medium_5: string;
|
|
76
81
|
export { medium_5 as medium };
|
|
77
|
-
const
|
|
78
|
-
export {
|
|
82
|
+
const large_4: string;
|
|
83
|
+
export { large_4 as large };
|
|
79
84
|
}
|
package/dist/variables.js
CHANGED
|
@@ -33,7 +33,10 @@ export const fontWeights = {
|
|
|
33
33
|
black: 900,
|
|
34
34
|
};
|
|
35
35
|
export const radii = {
|
|
36
|
-
medium: u(
|
|
36
|
+
medium: u(1),
|
|
37
|
+
large: u(2),
|
|
38
|
+
xlarge: u(4),
|
|
39
|
+
full: u(999),
|
|
37
40
|
};
|
|
38
41
|
export const shadows = {
|
|
39
42
|
small: `0 ${u(0.5)} ${u(1.25)} hsla(0, 0%, 0%, 0.05)`,
|