@loomhq/lens 10.28.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.
@@ -19,7 +19,6 @@ export { default as SvgReplay5 } from "./replay-5.js";
19
19
  export { default as SvgBack5 } from "./back5.js";
20
20
  export { default as SvgForward5 } from "./forward-5.js";
21
21
  export { default as SvgBarChart } from "./bar-chart.js";
22
- export { default as SvgBell } from "./bell.js";
23
22
  export { default as SvgBorderColor } from "./border-color.js";
24
23
  export { default as SvgBulb } from "./bulb.js";
25
24
  export { default as SvgCallToAction } from "./call-to-action.js";
@@ -212,3 +211,4 @@ export { default as PictureInPicture } from "./picture-in-picture.js";
212
211
  export { default as FolderPlus } from "./folder-plus.js";
213
212
  export { default as SvgPower } from "./power.js";
214
213
  export { default as SvgReplay } from "./replay.js";
214
+ export { default as SvgBell } from "./bell.js";
@@ -19,7 +19,6 @@ export { default as SvgReplay5 } from './replay-5.js';
19
19
  export { default as SvgBack5 } from './back5.js';
20
20
  export { default as SvgForward5 } from './forward-5.js';
21
21
  export { default as SvgBarChart } from './bar-chart.js';
22
- export { default as SvgBell } from './bell.js';
23
22
  export { default as SvgBorderColor } from './border-color.js';
24
23
  export { default as SvgBulb } from './bulb.js';
25
24
  export { default as SvgCallToAction } from './call-to-action.js';
@@ -212,3 +211,4 @@ export { default as PictureInPicture } from './picture-in-picture.js';
212
211
  export { default as FolderPlus } from './folder-plus.js';
213
212
  export { default as SvgPower } from './power.js';
214
213
  export { default as SvgReplay } from './replay.js';
214
+ export { default as SvgBell } from './bell.js';
@@ -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.28.0",
3
+ "version": "10.29.0",
4
4
  "scripts": {
5
5
  "dev": "next",
6
6
  "build:next": "next build",