@loomhq/lens 10.26.0 → 10.29.1
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/container/container.d.ts +8 -1
- package/dist/components/container/container.js +8 -3
- package/dist/components/icon/available-icons/arrow-left-alt.d.ts +2 -0
- package/dist/components/icon/available-icons/arrow-left-alt.js +7 -0
- package/dist/components/icon/available-icons/index.d.ts +2 -1
- package/dist/components/icon/available-icons/index.js +2 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +1 -0
- package/dist/components/set-unit/set-unit.d.ts +7 -0
- package/dist/components/set-unit/set-unit.js +25 -0
- package/dist/css-variables/index.d.ts +2 -0
- package/dist/css-variables/index.js +16 -3
- package/dist/variables.js +5 -4
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ResponsiveType } from '../../types';
|
|
3
3
|
declare const ContainerWrapper: import("@emotion/styled-base").StyledComponent<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, ContainerWrapperProps, object>;
|
|
4
|
-
declare const Container: ({ children, backgroundColor, contentColor, borderColor, radius, borderSide, borderWidth, shadow, padding, paddingX, paddingY, paddingLeft, paddingRight, paddingTop, paddingBottom, width, height, minWidth, minHeight, maxWidth, maxHeight, htmlTag, position, overflow, zIndex, top, bottom, left, right, ...props }: ContainerProps & React.ComponentProps<typeof ContainerWrapper>) => JSX.Element;
|
|
4
|
+
declare const Container: ({ children, backgroundColor, contentColor, borderColor, radius, borderSide, borderWidth, shadow, padding, paddingX, paddingY, paddingLeft, paddingRight, paddingTop, paddingBottom, margin, marginX, marginY, marginLeft, marginRight, marginTop, marginBottom, width, height, minWidth, minHeight, maxWidth, maxHeight, htmlTag, position, overflow, zIndex, top, bottom, left, right, ...props }: ContainerProps & React.ComponentProps<typeof ContainerWrapper>) => JSX.Element;
|
|
5
5
|
export declare const availableBorderSides: string[];
|
|
6
6
|
export declare const availableRadii: string[];
|
|
7
7
|
export declare const availableHtmlTags: string[];
|
|
@@ -19,6 +19,13 @@ interface SharedProps {
|
|
|
19
19
|
paddingRight?: ResponsiveType<string | number>;
|
|
20
20
|
paddingTop?: ResponsiveType<string | number>;
|
|
21
21
|
paddingBottom?: ResponsiveType<string | number>;
|
|
22
|
+
margin?: ResponsiveType<string | number>;
|
|
23
|
+
marginX?: ResponsiveType<string | number>;
|
|
24
|
+
marginY?: ResponsiveType<string | number>;
|
|
25
|
+
marginLeft?: ResponsiveType<string | number>;
|
|
26
|
+
marginRight?: ResponsiveType<string | number>;
|
|
27
|
+
marginTop?: ResponsiveType<string | number>;
|
|
28
|
+
marginBottom?: ResponsiveType<string | number>;
|
|
22
29
|
width?: ResponsiveType<string | number>;
|
|
23
30
|
height?: ResponsiveType<string | number>;
|
|
24
31
|
minWidth?: ResponsiveType<string | number>;
|
|
@@ -9,7 +9,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
9
9
|
}
|
|
10
10
|
return t;
|
|
11
11
|
};
|
|
12
|
-
import { getRadius, getShadow, getSize,
|
|
12
|
+
import { getColorValue, getRadius, getShadow, getSize, getSizeValue, } from '../../utilities';
|
|
13
13
|
import React from 'react';
|
|
14
14
|
import styled from '@emotion/styled';
|
|
15
15
|
const getBorderSideAndColor = (side, color, width) => {
|
|
@@ -43,6 +43,11 @@ const ContainerWrapper = styled.div `
|
|
|
43
43
|
${props => getSize('padding-right', props.paddingRight)};
|
|
44
44
|
${props => getSize('padding-bottom', props.paddingBottom)};
|
|
45
45
|
${props => getSize('padding-left', props.paddingLeft)};
|
|
46
|
+
${props => getSize('margin', props.margin)};
|
|
47
|
+
${props => getSize('margin-top', props.marginTop)};
|
|
48
|
+
${props => getSize('margin-right', props.marginRight)};
|
|
49
|
+
${props => getSize('margin-bottom', props.marginBottom)};
|
|
50
|
+
${props => getSize('margin-left', props.marginLeft)};
|
|
46
51
|
${props => getSize('top', props.top)};
|
|
47
52
|
${props => getSize('right', props.right)};
|
|
48
53
|
${props => getSize('bottom', props.bottom)};
|
|
@@ -50,8 +55,8 @@ const ContainerWrapper = styled.div `
|
|
|
50
55
|
${props => props.zIndex && `z-index: ${props.zIndex}`};
|
|
51
56
|
`;
|
|
52
57
|
const Container = (_a) => {
|
|
53
|
-
var { children, backgroundColor, contentColor, borderColor, radius, borderSide, borderWidth = '1px', shadow, padding, paddingX, paddingY, paddingLeft, paddingRight, paddingTop, paddingBottom, width, height, minWidth, minHeight, maxWidth, maxHeight, htmlTag = 'div', position, overflow, zIndex, top, bottom, left, right } = _a, props = __rest(_a, ["children", "backgroundColor", "contentColor", "borderColor", "radius", "borderSide", "borderWidth", "shadow", "padding", "paddingX", "paddingY", "paddingLeft", "paddingRight", "paddingTop", "paddingBottom", "width", "height", "minWidth", "minHeight", "maxWidth", "maxHeight", "htmlTag", "position", "overflow", "zIndex", "top", "bottom", "left", "right"]);
|
|
54
|
-
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, 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));
|
|
58
|
+
var { children, backgroundColor, contentColor, borderColor, radius, borderSide, borderWidth = '1px', shadow, padding, paddingX, paddingY, paddingLeft, paddingRight, paddingTop, paddingBottom, margin, marginX, marginY, marginLeft, marginRight, marginTop, marginBottom, width, height, minWidth, minHeight, maxWidth, maxHeight, htmlTag = 'div', position, overflow, zIndex, top, bottom, left, right } = _a, props = __rest(_a, ["children", "backgroundColor", "contentColor", "borderColor", "radius", "borderSide", "borderWidth", "shadow", "padding", "paddingX", "paddingY", "paddingLeft", "paddingRight", "paddingTop", "paddingBottom", "margin", "marginX", "marginY", "marginLeft", "marginRight", "marginTop", "marginBottom", "width", "height", "minWidth", "minHeight", "maxWidth", "maxHeight", "htmlTag", "position", "overflow", "zIndex", "top", "bottom", "left", "right"]);
|
|
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));
|
|
55
60
|
};
|
|
56
61
|
export const availableBorderSides = ['all', 'left', 'right', 'top', 'bottom'];
|
|
57
62
|
export const availableRadii = ['medium'];
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
function SvgArrowRightAlt(props) {
|
|
3
|
+
return (React.createElement("svg", Object.assign({ viewBox: "0 0 24 24", fill: "none" }, props),
|
|
4
|
+
React.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M 20,12 A -1,1 0 0 0 19,11 H 5 a -1,1 0 1 0 0,2 h 14 a -1,1 0 0 0 1,-1 z", fill: "currentColor" }),
|
|
5
|
+
React.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "m 9.707,7.293 a -1,1 0 0 0 -1.414,0 l -4,4 a -1,1 0 0 0 0,1.414 l 4,4 A -1,1 0 0 0 9.707,15.293 L 6.414,12 9.707,8.707 a -1,1 0 0 0 0,-1.414 z", fill: "currentColor" })));
|
|
6
|
+
}
|
|
7
|
+
export default SvgArrowRightAlt;
|
|
@@ -13,12 +13,12 @@ export { default as SvgArrowDropUp } from "./arrow-drop-up.js";
|
|
|
13
13
|
export { default as SvgArrowForward } from "./arrow-forward.js";
|
|
14
14
|
export { default as SvgArrowLeft } from "./arrow-left.js";
|
|
15
15
|
export { default as SvgArrowRight } from "./arrow-right.js";
|
|
16
|
+
export { default as SvgArrowLeftAlt } from "./arrow-left-alt.js";
|
|
16
17
|
export { default as SvgArrowRightAlt } from "./arrow-right-alt.js";
|
|
17
18
|
export { default as SvgReplay5 } from "./replay-5.js";
|
|
18
19
|
export { default as SvgBack5 } from "./back5.js";
|
|
19
20
|
export { default as SvgForward5 } from "./forward-5.js";
|
|
20
21
|
export { default as SvgBarChart } from "./bar-chart.js";
|
|
21
|
-
export { default as SvgBell } from "./bell.js";
|
|
22
22
|
export { default as SvgBorderColor } from "./border-color.js";
|
|
23
23
|
export { default as SvgBulb } from "./bulb.js";
|
|
24
24
|
export { default as SvgCallToAction } from "./call-to-action.js";
|
|
@@ -211,3 +211,4 @@ export { default as PictureInPicture } from "./picture-in-picture.js";
|
|
|
211
211
|
export { default as FolderPlus } from "./folder-plus.js";
|
|
212
212
|
export { default as SvgPower } from "./power.js";
|
|
213
213
|
export { default as SvgReplay } from "./replay.js";
|
|
214
|
+
export { default as SvgBell } from "./bell.js";
|
|
@@ -13,12 +13,12 @@ export { default as SvgArrowDropUp } from './arrow-drop-up.js';
|
|
|
13
13
|
export { default as SvgArrowForward } from './arrow-forward.js';
|
|
14
14
|
export { default as SvgArrowLeft } from './arrow-left.js';
|
|
15
15
|
export { default as SvgArrowRight } from './arrow-right.js';
|
|
16
|
+
export { default as SvgArrowLeftAlt } from './arrow-left-alt.js';
|
|
16
17
|
export { default as SvgArrowRightAlt } from './arrow-right-alt.js';
|
|
17
18
|
export { default as SvgReplay5 } from './replay-5.js';
|
|
18
19
|
export { default as SvgBack5 } from './back5.js';
|
|
19
20
|
export { default as SvgForward5 } from './forward-5.js';
|
|
20
21
|
export { default as SvgBarChart } from './bar-chart.js';
|
|
21
|
-
export { default as SvgBell } from './bell.js';
|
|
22
22
|
export { default as SvgBorderColor } from './border-color.js';
|
|
23
23
|
export { default as SvgBulb } from './bulb.js';
|
|
24
24
|
export { default as SvgCallToAction } from './call-to-action.js';
|
|
@@ -211,3 +211,4 @@ export { default as PictureInPicture } from './picture-in-picture.js';
|
|
|
211
211
|
export { default as FolderPlus } from './folder-plus.js';
|
|
212
212
|
export { default as SvgPower } from './power.js';
|
|
213
213
|
export { default as SvgReplay } from './replay.js';
|
|
214
|
+
export { default as SvgBell } from './bell.js';
|
package/dist/components/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { default as Avatar } from './avatar/avatar';
|
|
2
2
|
export { default as BaseStyles, buildGlobalStylesheet, } from './base-styles/base-styles';
|
|
3
|
+
export { default as SetUnit } from './set-unit/set-unit';
|
|
3
4
|
export { default as Button } from './button/button';
|
|
4
5
|
export { default as Text } from './text/text';
|
|
5
6
|
export { default as Spacer } from './spacer/spacer';
|
|
@@ -0,0 +1,25 @@
|
|
|
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
|
+
import React from 'react';
|
|
13
|
+
import { getSizingCssVarsDeclarations } from '../../css-variables';
|
|
14
|
+
import { getTextSize } from '../../utilities';
|
|
15
|
+
import styled from '@emotion/styled';
|
|
16
|
+
const Wrapper = styled.div `
|
|
17
|
+
${getSizingCssVarsDeclarations()};
|
|
18
|
+
${props => props.unit && `--lns-unit: ${props.unit}`};
|
|
19
|
+
${getTextSize('medium')};
|
|
20
|
+
`;
|
|
21
|
+
const SetUnit = (_a) => {
|
|
22
|
+
var { unit, children } = _a, props = __rest(_a, ["unit", "children"]);
|
|
23
|
+
return (React.createElement(Wrapper, Object.assign({ unit: unit, "data-name": "SetUnit" }, props), children));
|
|
24
|
+
};
|
|
25
|
+
export default SetUnit;
|
|
@@ -7,9 +7,11 @@ export declare const radiusVariables: VarsObject;
|
|
|
7
7
|
export declare const shadowVariables: VarsObject;
|
|
8
8
|
export declare const spaceVariables: VarsObject;
|
|
9
9
|
export declare const formFieldVariables: VarsObject;
|
|
10
|
+
export declare const getSizingVariablesCssVarsObject: () => VarsObject;
|
|
10
11
|
export declare const getVariablesCssVarsObject: () => VarsObject;
|
|
11
12
|
export declare const getColorsCssVarsObject: () => VarsObject;
|
|
12
13
|
export declare const getThemeStylesString: (customRootElement?: string) => string;
|
|
13
14
|
export declare const getThemeStyles: () => void;
|
|
15
|
+
export declare const getSizingCssVarsDeclarations: () => string;
|
|
14
16
|
export declare const getAllCssVarsString: (customRootElement: any) => string;
|
|
15
17
|
export {};
|
|
@@ -72,10 +72,19 @@ export const formFieldVariables = getCssVarsFromObject(undefined, {
|
|
|
72
72
|
});
|
|
73
73
|
const colorVariables = getCssVarsFromObject('color', getColorsObject());
|
|
74
74
|
const themeColorVariables = getCssVarsFromObject(undefined, getThemeColorsObject());
|
|
75
|
+
const sizingVariables = [
|
|
76
|
+
unitVariables,
|
|
77
|
+
textSizeVariables,
|
|
78
|
+
radiusVariables,
|
|
79
|
+
shadowVariables,
|
|
80
|
+
spaceVariables,
|
|
81
|
+
formFieldVariables,
|
|
82
|
+
];
|
|
83
|
+
export const getSizingVariablesCssVarsObject = () => {
|
|
84
|
+
return Object.assign({}, ...sizingVariables);
|
|
85
|
+
};
|
|
75
86
|
export const getVariablesCssVarsObject = () => {
|
|
76
|
-
|
|
77
|
-
Object.assign(result, unitVariables, fontWeightVariables, textSizeVariables, radiusVariables, shadowVariables, spaceVariables, formFieldVariables);
|
|
78
|
-
return result;
|
|
87
|
+
return Object.assign({}, fontWeightVariables, ...sizingVariables);
|
|
79
88
|
};
|
|
80
89
|
export const getColorsCssVarsObject = () => {
|
|
81
90
|
return Object.assign(Object.assign({}, colorVariables), themeColorVariables);
|
|
@@ -104,6 +113,10 @@ export const getThemeStyles = () => {
|
|
|
104
113
|
style.innerHTML = getThemeStylesString();
|
|
105
114
|
document.head.appendChild(style);
|
|
106
115
|
};
|
|
116
|
+
export const getSizingCssVarsDeclarations = () => {
|
|
117
|
+
const result = Object.entries(getSizingVariablesCssVarsObject()).map(cssVar => `${cssVar[0]}:${cssVar[1]};`);
|
|
118
|
+
return result.join('');
|
|
119
|
+
};
|
|
107
120
|
export const getAllCssVarsString = customRootElement => {
|
|
108
121
|
const result = [];
|
|
109
122
|
const rootElement = customRootElement || ':root';
|
package/dist/variables.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { u } from './utilities';
|
|
1
2
|
export const unit = 8;
|
|
2
3
|
export const textSizes = {
|
|
3
4
|
small: {
|
|
@@ -32,12 +33,12 @@ export const fontWeights = {
|
|
|
32
33
|
black: 900,
|
|
33
34
|
};
|
|
34
35
|
export const radii = {
|
|
35
|
-
medium:
|
|
36
|
+
medium: u(0.75),
|
|
36
37
|
};
|
|
37
38
|
export const shadows = {
|
|
38
|
-
small:
|
|
39
|
-
medium:
|
|
40
|
-
large:
|
|
39
|
+
small: `0 ${u(0.5)} ${u(1.25)} hsla(0, 0%, 0%, 0.05)`,
|
|
40
|
+
medium: `0 ${u(0.5)} ${u(1.25)} hsla(0, 0%, 0%, 0.1)`,
|
|
41
|
+
large: `0 ${u(0.75)} ${u(3)} hsla(0, 0%, 0%, 0.1)`,
|
|
41
42
|
};
|
|
42
43
|
export const spaces = {
|
|
43
44
|
xsmall: 0.5,
|