@loomhq/lens 10.40.0 → 10.42.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.
@@ -7,6 +7,8 @@ const buildGlobalStylesheet = (rootElement = ':root', bodyElement = 'body') => {
7
7
  return `
8
8
  ${rootElement} {
9
9
  font-size: 100%;
10
+ --lns-radius-thread-full: var(--lns-radius-medium);
11
+ --lns-radius-thread-large: var(--lns-radius-medium);
10
12
  }
11
13
  ${bodyElement} {
12
14
  font-family: circular, -apple-system, BlinkMacSystemFont, Segoe UI,
@@ -9,7 +9,7 @@ var __rest = (this && this.__rest) || function (s, e) {
9
9
  }
10
10
  return t;
11
11
  };
12
- import { getColorValue, getFocusRing, getFontWeight, getRadius, getSize, getTextSize, u, } from '../../utilities';
12
+ import { getColorValue, getFocusRing, getFontWeight, getSize, getTextSize, u, } from '../../utilities';
13
13
  import Icon from '../icon/icon';
14
14
  import Loader from '../loader/loader';
15
15
  import React from 'react';
@@ -102,7 +102,7 @@ const ButtonWrapper = styled.button `
102
102
  white-space: nowrap;
103
103
  border: 1px solid;
104
104
  ${getFontWeight('medium')};
105
- ${getRadius('medium')};
105
+ border-radius: var(--lns-radius-thread-full);
106
106
  ${props => props.hasFullWidth ? 'display: flex; width: 100%' : 'display: inline-flex'};
107
107
  height: ${props => sizesStyles[props.size].height};
108
108
  min-width: ${props => sizesStyles[props.size].height};
@@ -142,7 +142,8 @@ const IconSection = styled.span `
142
142
  const LogoImage = styled.img `
143
143
  max-width: 1.45em;
144
144
  max-height: 1.45em;
145
- height: auto;
145
+ height: ${props => sizesStyles[props.size].height};
146
+ width: ${props => sizesStyles[props.size].height};
146
147
  ${props => props.hasSpacing && `margin-right: 0.57em`};
147
148
  ${hasLoaderStyles};
148
149
  `;
@@ -157,12 +158,18 @@ const ChildrenSection = styled.span `
157
158
  const Button = (_a) => {
158
159
  var { size = 'medium', children, variant = 'neutral', hasFullWidth, icon, iconPosition = 'left', logoSrc, hasLoader, isDisabled, htmlTag = 'button' } = _a, props = __rest(_a, ["size", "children", "variant", "hasFullWidth", "icon", "iconPosition", "logoSrc", "hasLoader", "isDisabled", "htmlTag"]);
159
160
  const buttonIcon = (React.createElement(IconSection, { hasLoader: hasLoader, paddingLeft: children && iconPosition === 'right' && iconGap, paddingRight: children && iconPosition === 'left' && iconGap },
160
- React.createElement(Icon, { icon: icon, color: "currentColor", size: sizesStyles[size].iconSize, hasWidthOffset: true })));
161
+ React.createElement(Icon, { icon: icon, color: "currentColor", hasWidthOffset: true, size: sizesStyles[size].iconSize })));
161
162
  return (React.createElement(ButtonWrapper, Object.assign({ size: size, variant: variant, hasFullWidth: hasFullWidth, icon: icon, iconPosition: iconPosition, logoSrc: logoSrc, disabled: isDisabled, as: htmlTag, hasChildren: children }, props),
162
163
  hasLoader && (React.createElement(LoaderSection, null,
163
164
  React.createElement(Loader, { color: "currentColor" }))),
164
165
  icon && iconPosition === 'left' && buttonIcon,
165
- logoSrc && (React.createElement(LogoImage, { hasSpacing: children, src: logoSrc, size: size, hasLoader: hasLoader })),
166
+ logoSrc && (React.createElement(LogoImage
167
+ // Assumes image is only referencing information written within the button.
168
+ , {
169
+ // Assumes image is only referencing information written within the button.
170
+ alt: "", hasSpacing: children, src: logoSrc, size: size,
171
+ // Assumes all images are 1:1 aspectRatio
172
+ height: sizesStyles[size].height, width: sizesStyles[size].height, hasLoader: hasLoader })),
166
173
  React.createElement(ChildrenSection, { hasLoader: hasLoader }, children),
167
174
  icon && iconPosition === 'right' && buttonIcon));
168
175
  };
@@ -70,7 +70,7 @@ const ColorBox = styled.div `
70
70
  left: var(--lns-space-xsmall);
71
71
  top: var(--lns-space-xsmall);
72
72
  border: 1px solid rgba(0, 0, 0, 0.1);
73
- border-radius: 3px;
73
+ border-radius: var(--lns-radius-thread-full);
74
74
  background-color: ${props => props.color};
75
75
  `;
76
76
  const ButtonWrapper = styled.div `
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
- declare const Confetti: (props: any) => JSX.Element;
3
1
  export default Confetti;
2
+ declare function Confetti(props: any): JSX.Element;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- const Confetti = (props) => (React.createElement("svg", Object.assign({ viewBox: "0 0 24 24", fill: "none" }, props),
2
+ const Confetti = props => (React.createElement("svg", Object.assign({ viewBox: "0 0 24 24", fill: "none" }, props),
3
3
  React.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M3 5C3 4.44772 3.44772 4 4 4H6C6.55228 4 7 4.44772 7 5C7 5.55228 6.55228 6 6 6H4C3.44772 6 3 5.55228 3 5Z", fill: "currentColor" }),
4
4
  React.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M5 3C5.55228 3 6 3.44772 6 4V6C6 6.55228 5.55228 7 5 7C4.44772 7 4 6.55228 4 6V4C4 3.44772 4.44772 3 5 3Z", fill: "currentColor" }),
5
5
  React.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M11.7425 3.02985C12.2783 3.1638 12.6041 3.70673 12.4701 4.24253L11.9701 6.24253C11.8362 6.77832 11.2933 7.10408 10.7575 6.97013C10.2217 6.83619 9.8959 6.29325 10.0298 5.75746L10.5298 3.75746C10.6638 3.22166 11.2067 2.8959 11.7425 3.02985Z", fill: "currentColor" }),
@@ -43,6 +43,7 @@ export { default as SvgCode } from "./code.js";
43
43
  export { default as SvgCollapse } from "./collapse.js";
44
44
  export { default as SvgColorLens } from "./color-lens.js";
45
45
  export { default as SvgComment } from "./comment.js";
46
+ export { default as SvgConfetti } from "./confetti.js";
46
47
  export { default as SvgContactSupport } from "./contact-support.js";
47
48
  export { default as SvgCopy } from "./copy.js";
48
49
  export { default as SvgCreate } from "./create.js";
@@ -43,7 +43,7 @@ export { default as SvgCode } from './code.js';
43
43
  export { default as SvgCollapse } from './collapse.js';
44
44
  export { default as SvgColorLens } from './color-lens.js';
45
45
  export { default as SvgComment } from './comment.js';
46
- export { default as SvgConfetti } from './confetti.tsx';
46
+ export { default as SvgConfetti } from './confetti.js';
47
47
  export { default as SvgContactSupport } from './contact-support.js';
48
48
  export { default as SvgCopy } from './copy.js';
49
49
  export { default as SvgCreate } from './create.js';
@@ -9,7 +9,7 @@ var __rest = (this && this.__rest) || function (s, e) {
9
9
  }
10
10
  return t;
11
11
  };
12
- import { getColorValue, getFocusRing, getRadius, u } from '../../utilities';
12
+ import { getColorValue, getFocusRing, u } from '../../utilities';
13
13
  import Icon from '../icon/icon';
14
14
  import React from 'react';
15
15
  import styled from '@emotion/styled';
@@ -38,7 +38,7 @@ export const IconButtonBox = styled.button `
38
38
  justify-content: center;
39
39
  align-items: center;
40
40
  vertical-align: middle;
41
- ${getRadius('medium')};
41
+ border-radius: var(--lns-radius-thread-full);
42
42
  font: inherit;
43
43
 
44
44
  &:hover {
@@ -63,7 +63,7 @@ export const IconButtonBox = styled.button `
63
63
  display: block;
64
64
  position: absolute;
65
65
  top: 0;
66
- ${getRadius('medium')};
66
+ border-radius: var(--lns-radius-thread-full);
67
67
  }
68
68
 
69
69
  &:focus-visible:before {
@@ -9,7 +9,7 @@ var __rest = (this && this.__rest) || function (s, e) {
9
9
  }
10
10
  return t;
11
11
  };
12
- import { getColorValue, getRadius, getShadow, getSize, u, } from '../../utilities';
12
+ import { getColorValue, getShadow, getSize, u } from '../../utilities';
13
13
  import Icon from '../icon/icon';
14
14
  import React from 'react';
15
15
  import { SvgCheck } from '../icon/available-icons';
@@ -27,7 +27,7 @@ const MenuWrapper = styled.ul `
27
27
  overflow: auto;
28
28
  border: 1px solid ${getColorValue('border')};
29
29
  ${getShadow('medium')};
30
- ${getRadius('medium')};
30
+ border-radius: var(--lns-radius-thread-large);
31
31
  `;
32
32
  const MenuItemWrapper = styled.li `
33
33
  display: grid;
@@ -9,7 +9,7 @@ var __rest = (this && this.__rest) || function (s, e) {
9
9
  }
10
10
  return t;
11
11
  };
12
- import { getColorValue, getFocusRing, getFontWeight, getRadius, getTextSize, u, } from '../../utilities';
12
+ import { getColorValue, getFocusRing, getFontWeight, getTextSize, u, } from '../../utilities';
13
13
  import Container from '../container/container';
14
14
  import Icon from '../icon/icon';
15
15
  import React from 'react';
@@ -41,7 +41,7 @@ const TextButtonWrapper = styled.button `
41
41
  transition: 0.6s background-color;
42
42
  color: ${getColorValue('body')};
43
43
  ${getFontWeight('medium')};
44
- ${getRadius('medium')};
44
+ border-radius: var(--lns-radius-thread-full);
45
45
  ${props => getTextSize(sizeStyles[props.size].textSize)};
46
46
  padding: 0 ${u(xSpace)};
47
47
  ${props => props.offsetSide && `margin-${props.offsetSide}: ${u(-xSpace)}`};
@@ -30,7 +30,7 @@ const TextareaWrapper = styled.textarea `
30
30
  background-color: ${getColorValue('formFieldBackground')};
31
31
  transition: 0.3s box-shadow;
32
32
  padding: ${props => sizesStyles[props.size].padding};
33
- border-radius: var(--lns-formFieldRadius);
33
+ border-radius: var(--lns-radius-thread-large);
34
34
  box-shadow: inset 0 0 0 var(--lns-formFieldBorderWidth)
35
35
  var(--lns-color-formFieldBorder);
36
36
  ${props => getTextSize(sizesStyles[props.size].textSize)};
@@ -60,7 +60,7 @@ export const formFieldVariables = getCssVarsFromObject(undefined, {
60
60
  formFieldBorderWidth: '1px',
61
61
  formFieldBorderWidthFocus: '2px',
62
62
  formFieldHeight: u(4.5),
63
- formFieldRadius: 'var(--lns-radius-medium)',
63
+ formFieldRadius: 'var(--lns-radius-thread-full)',
64
64
  formFieldHorizontalPadding: u(1.5),
65
65
  formFieldBorderShadow: `
66
66
  inset 0 0 0 var(--lns-formFieldBorderWidth) var(--lns-color-formFieldBorder)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loomhq/lens",
3
- "version": "10.40.0",
3
+ "version": "10.42.0",
4
4
  "scripts": {
5
5
  "dev": "next",
6
6
  "build:next": "next build",