@loomhq/lens 10.25.0 → 10.29.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.
@@ -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, getColorValue, getSizeValue, } from '../../utilities';
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,2 @@
1
+ export default SvgArrowRightAlt;
2
+ declare function SvgArrowRightAlt(props: any): JSX.Element;
@@ -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";
@@ -210,3 +210,5 @@ export { default as SvgRepeat } from "./repeat.js";
210
210
  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
+ 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';
@@ -210,3 +210,5 @@ export { default as SvgRepeat } from './repeat.js';
210
210
  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
+ export { default as SvgReplay } from './replay.js';
214
+ export { default as SvgBell } from './bell.js';
@@ -0,0 +1,2 @@
1
+ export default SvgReplay;
2
+ declare function SvgReplay(props: any): JSX.Element;
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ const SvgReplay = props => (React.createElement("svg", Object.assign({ viewBox: "0 0 24 24", fill: "none" }, props),
3
+ React.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M6.78306 0.566915C7.31653 0.709856 7.63311 1.25819 7.49017 1.79166L6.7049 4.72234C8.49852 3.41365 10.6667 2.85091 12.7825 3.03412C13.6117 3.10538 14.4088 3.28907 15.1584 3.56987C16.328 4.00704 17.4249 4.69588 18.3654 5.63641C19.2011 6.47209 19.8381 7.43123 20.2764 8.45511C20.7432 9.54315 21.0017 10.7418 21.0017 12.0007C21.0017 13.3939 20.6851 14.7132 20.12 15.8906C19.818 16.5208 19.4384 17.1231 18.9812 17.6833C18.5894 18.1639 18.1489 18.6034 17.6673 18.994C17.1314 19.4292 16.5572 19.7936 15.9571 20.0872C14.7632 20.6723 13.4208 21.0007 12.0017 21.0007C10.6825 21.0007 9.42964 20.7169 8.30077 20.207C7.44004 19.8191 6.62781 19.2888 5.89965 18.6163C4.11775 16.9719 3.00171 14.6166 3.00171 12.0007C3.00171 11.4484 3.44942 11.0007 4.00171 11.0007C4.55399 11.0007 5.00171 11.4484 5.00171 12.0007C5.00171 13.9336 5.78509 15.6835 7.05166 16.9502C7.1301 17.0287 7.21 17.1048 7.29116 17.1787C7.81679 17.6572 8.41556 18.0567 9.06872 18.3585C11.0182 19.2575 13.296 19.2122 15.2124 18.2226C15.5894 18.0277 15.9463 17.7995 16.2795 17.542C16.5127 17.3614 16.7372 17.1642 16.9512 16.9501C17.1573 16.744 17.3479 16.5282 17.523 16.3042C17.8046 15.9434 18.0516 15.5543 18.2591 15.1418C19.1888 13.2906 19.2453 11.113 18.4285 9.22207C17.6657 7.46001 16.1994 6.07343 14.3837 5.41645C13.8441 5.2216 13.2853 5.09519 12.7208 5.03721C12.4844 5.01308 12.2445 5.00072 12.0017 5.00072C11.9934 5.00072 11.985 5.00062 11.9767 5.00042C10.378 5.00603 8.78084 5.55593 7.48702 6.65011L10.8091 7.54027C11.3426 7.68321 11.6592 8.23155 11.5162 8.76501C11.3733 9.29848 10.825 9.61506 10.2915 9.47212L4.79178 7.99848C4.25832 7.85554 3.94174 7.3072 4.08468 6.77373L5.55832 1.27402C5.70126 0.740555 6.2496 0.423973 6.78306 0.566915ZM6.27535 6.32544L6.28616 6.28507L6.34527 6.34418L6.27535 6.32544Z", fill: "currentColor" })));
4
+ export default SvgReplay;
@@ -1,4 +1,5 @@
1
1
  export { default as Avatar } from "./avatar/avatar";
2
+ export { default as SetUnit } from "./set-unit/set-unit";
2
3
  export { default as Button } from "./button/button";
3
4
  export { default as Text } from "./text/text";
4
5
  export { default as Spacer } from "./spacer/spacer";
@@ -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,6 @@
1
+ import React from 'react';
2
+ declare const SetUnit: ({ children, unit, }: {
3
+ children: React.ReactNode;
4
+ unit: string;
5
+ }) => JSX.Element;
6
+ export default SetUnit;
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import { getSizingCssVarsDeclarations } from '../../css-variables';
3
+ import { getTextSize } from '../../utilities';
4
+ import styled from '@emotion/styled';
5
+ const Wrapper = styled.div `
6
+ ${getSizingCssVarsDeclarations()};
7
+ ${props => props.unit && `--lns-unit: ${props.unit}`};
8
+ ${getTextSize('medium')};
9
+ `;
10
+ const SetUnit = ({ children, unit, }) => {
11
+ return (React.createElement(Wrapper, { unit: unit, "data-name": "SetUnit" }, children));
12
+ };
13
+ 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
- const result = {};
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: '6px',
36
+ medium: u(0.75),
36
37
  };
37
38
  export const shadows = {
38
- small: '0 4px 10px hsla(0, 0%, 0%, 0.05)',
39
- medium: '0 4px 10px hsla(0, 0%, 0%, 0.1)',
40
- large: '0 6px 24px hsla(0, 0%, 0%, 0.1)',
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,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loomhq/lens",
3
- "version": "10.25.0",
3
+ "version": "10.29.0",
4
4
  "scripts": {
5
5
  "dev": "next",
6
6
  "build:next": "next build",