@loomhq/lens 10.43.9 → 10.46.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.
@@ -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, getSize, getTextSize, u, } from '../../utilities';
12
+ import { getColorValue, getFocusRing, getFontWeight, getRadius, 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
- border-radius: var(--lns-radius-thread-full);
105
+ ${getRadius('thdMediumToFull')};
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};
@@ -13,7 +13,7 @@ import React, { useState } from 'react';
13
13
  import { CustomPicker } from 'react-color';
14
14
  import { Saturation, Hue, EditableInput, } from 'react-color/lib/components/common';
15
15
  import styled from '@emotion/styled';
16
- import { u } from '../../utilities';
16
+ import { getRadius, u } from '../../utilities';
17
17
  const ColorPickerContainer = styled.div `
18
18
  position: relative;
19
19
  width: ${u(31)};
@@ -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: var(--lns-radius-thread-full);
73
+ ${getRadius('thdMediumToFull')};
74
74
  background-color: ${props => props.color};
75
75
  `;
76
76
  const ButtonWrapper = styled.div `
@@ -0,0 +1,2 @@
1
+ export default SvgEyeOff;
2
+ declare function SvgEyeOff(props: any): JSX.Element;
@@ -0,0 +1,8 @@
1
+ import * as React from 'react';
2
+ function SvgEyeOff(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: "M8.03143 6.61314C8.36661 7.05208 8.28249 7.67964 7.84355 8.01482C6.35752 9.14956 5.10854 10.5622 4.16503 12.1725C4.24759 12.3126 4.35007 12.4804 4.472 12.6692C4.85229 13.258 5.41523 14.0406 6.14535 14.8194C7.62224 16.3948 9.66508 17.8336 12.1785 17.8367C13.7531 17.8092 15.2778 17.2795 16.5304 16.3247C16.9697 15.9899 17.5971 16.0746 17.9319 16.5138C18.2668 16.9531 18.1821 17.5805 17.7429 17.9153C16.1486 19.1306 14.2073 19.8038 12.203 19.8366L12.1866 19.8367C8.87047 19.8367 6.3328 17.9436 4.68628 16.1873C3.8539 15.2994 3.21892 14.4154 2.79192 13.7542C2.5778 13.4227 2.41434 13.1446 2.30303 12.9468C2.24734 12.8477 2.20458 12.7686 2.17496 12.7126C2.16015 12.6846 2.14861 12.6624 2.14037 12.6464L2.13049 12.627L2.1274 12.6209L2.12632 12.6188C2.12632 12.6188 2.12556 12.6173 3.01998 12.17L2.12556 12.6173C1.98024 12.3266 1.98519 11.9835 2.13883 11.6972C3.24282 9.63982 4.77404 7.84231 6.62975 6.42526C7.06869 6.09008 7.69624 6.1742 8.03143 6.61314ZM11.1516 9.72165C11.5281 10.1257 11.5058 10.7585 11.1017 11.135C10.9543 11.2723 10.8361 11.4379 10.7541 11.6219C10.6722 11.8059 10.6281 12.0045 10.6245 12.2059C10.621 12.4073 10.658 12.6074 10.7335 12.7942C10.8089 12.981 10.9212 13.1506 11.0636 13.2931C11.2061 13.4355 11.3757 13.5478 11.5625 13.6232C11.7493 13.6987 11.9493 13.7357 12.1508 13.7322C12.3522 13.7286 12.5508 13.6845 12.7348 13.6025C12.9188 13.5206 13.0844 13.4024 13.2217 13.255C13.5982 12.8509 14.231 12.8286 14.635 13.2051C15.0391 13.5816 15.0614 14.2144 14.6849 14.6184C14.3645 14.9623 13.9781 15.2381 13.5488 15.4294C13.1194 15.6207 12.656 15.7236 12.186 15.7319C11.7161 15.7401 11.2493 15.6537 10.8135 15.4777C10.3777 15.3016 9.98177 15.0396 9.64941 14.7073C9.31706 14.3749 9.05505 13.979 8.87902 13.5432C8.70299 13.1074 8.61654 12.6406 8.62483 12.1707C8.63312 11.7007 8.73599 11.2372 8.92728 10.8079C9.11858 10.3786 9.39439 9.99219 9.73826 9.67176C10.1423 9.29526 10.7751 9.31759 11.1516 9.72165Z", fill: "currentColor" }),
5
+ React.createElement("path", { d: "M12.1679 6.50002C11.6563 6.49882 11.1463 6.5571 10.6481 6.6737C10.1104 6.79958 9.5724 6.46568 9.44653 5.92793C9.32065 5.39018 9.65454 4.85221 10.1923 4.72634C10.841 4.57449 11.5052 4.49855 12.1714 4.50002C15.487 4.50047 18.0243 6.39334 19.6706 8.14941C20.503 9.03728 21.1379 9.92133 21.5649 10.5825C21.7791 10.914 21.9425 11.1921 22.0538 11.39C22.1095 11.489 22.1523 11.5681 22.1819 11.6241L22.2313 11.7195C22.3764 12.0096 22.3717 12.352 22.2188 12.6381C21.6801 13.6458 21.0377 14.5946 20.302 15.4689C19.9464 15.8914 19.3156 15.9458 18.893 15.5902C18.4704 15.2346 18.4161 14.6038 18.7717 14.1812C19.3022 13.5507 19.7774 12.8762 20.1924 12.1652C20.1097 12.0249 20.0071 11.8568 19.8849 11.6675C19.5046 11.0787 18.9416 10.2961 18.2115 9.51729C16.733 7.94025 14.6874 6.50002 12.1702 6.50002L12.1679 6.50002Z", fill: "currentColor" }),
6
+ React.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M2.29289 2.29289C2.68342 1.90237 3.31658 1.90237 3.70711 2.29289L22.0404 20.6262C22.431 21.0167 22.431 21.6499 22.0404 22.0404C21.6499 22.431 21.0167 22.431 20.6262 22.0404L2.29289 3.70711C1.90237 3.31658 1.90237 2.68342 2.29289 2.29289Z", fill: "currentColor" })));
7
+ }
8
+ export default SvgEyeOff;
@@ -61,6 +61,7 @@ export { default as SvgExpand } from "./expand.js";
61
61
  export { default as SvgExtension } from "./extension.js";
62
62
  export { default as SvgExternalLink } from "./external-link.js";
63
63
  export { default as SvgEye } from "./eye.js";
64
+ export { default as SvgEyeOff } from "./eye-off.js";
64
65
  export { default as SvgFiberManualRecord } from "./fiber-manual-record.js";
65
66
  export { default as SvgFirstPage } from "./first-page.js";
66
67
  export { default as SvgFolder } from "./folder.js";
@@ -61,6 +61,7 @@ export { default as SvgExpand } from './expand.js';
61
61
  export { default as SvgExtension } from './extension.js';
62
62
  export { default as SvgExternalLink } from './external-link.js';
63
63
  export { default as SvgEye } from './eye.js';
64
+ export { default as SvgEyeOff } from './eye-off.js';
64
65
  export { default as SvgFiberManualRecord } from './fiber-manual-record.js';
65
66
  export { default as SvgFirstPage } from './first-page.js';
66
67
  export { default as SvgFolder } from './folder.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, u } from '../../utilities';
12
+ import { getColorValue, getFocusRing, getRadius, 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
- border-radius: var(--lns-radius-thread-full);
41
+ ${getRadius('thdMediumToFull')};
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
- border-radius: var(--lns-radius-thread-full);
66
+ ${getRadius('thdMediumToFull')};
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, getShadow, getSize, u } from '../../utilities';
12
+ import { getColorValue, getRadius, 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
- border-radius: var(--lns-radius-thread-large);
30
+ ${getRadius('thdMediumToLarge')};
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, getRadius, getShadow, getSize } from '../../utilities';
12
+ import { getColorValue, getRadius, getShadow, getSize, u, } from '../../utilities';
13
13
  import Backdrop from '../backdrop/backdrop';
14
14
  import Container from '../container/container';
15
15
  import IconButton from '../icon-button/icon-button';
@@ -30,7 +30,7 @@ const ModalCardWrapper = styled.div `
30
30
  top: 15vh;
31
31
  background-color: ${getColorValue('overlay')};
32
32
  ${getShadow('large')};
33
- ${getRadius('medium')};
33
+ ${getRadius('thdMediumToXlarge')};
34
34
  ${props => getSize('max-width', props.maxWidth)};
35
35
  margin: 0 auto;
36
36
  position: relative;
@@ -38,8 +38,8 @@ const ModalCardWrapper = styled.div `
38
38
  `;
39
39
  const CloseIconSection = styled.div `
40
40
  position: absolute;
41
- top: 0;
42
- right: 0;
41
+ top: ${u(1.5)};
42
+ right: ${u(1.5)};
43
43
  z-index: 1;
44
44
  `;
45
45
  const RightButtonsSection = styled.div `
@@ -23,7 +23,7 @@ const PillWrapper = styled.div `
23
23
  min-height: ${u(3.25)};
24
24
  color: ${props => getColorValue(props.color)};
25
25
  background-color: ${props => getColorValue(props.backgroundColor)};
26
- ${getRadius('medium')};
26
+ ${getRadius('thdMediumToFull')};
27
27
  ${getTextSize('small')};
28
28
  ${getFontWeight('medium')};
29
29
  ${getSize('gap', 'xsmall')};
@@ -1,9 +1,13 @@
1
1
  import React from 'react';
2
- declare const SwitchInput: import("@emotion/styled-base").StyledComponent<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, Pick<React.ClassAttributes<HTMLInputElement> & React.InputHTMLAttributes<HTMLInputElement>, keyof React.InputHTMLAttributes<HTMLInputElement>>, object>;
3
- declare const Switch: ({ isActive, isDisabled, onChange, ...props }: SwitchProps & React.ComponentProps<typeof SwitchInput>) => JSX.Element;
2
+ declare const SwitchInput: import("@emotion/styled-base").StyledComponent<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, SwitchInputProps, object>;
3
+ declare const Switch: ({ isActive, isDisabled, onChange, size, ...props }: SwitchProps & Omit<React.ComponentProps<typeof SwitchInput>, 'size'>) => JSX.Element;
4
4
  declare type SwitchProps = {
5
5
  isActive?: boolean;
6
6
  isDisabled?: boolean;
7
7
  onChange?: React.ReactEventHandler;
8
+ size?: 'medium' | 'large';
9
+ };
10
+ declare type SwitchInputProps = {
11
+ switchSize?: 'medium' | 'large';
8
12
  };
9
13
  export default Switch;
@@ -9,14 +9,21 @@ var __rest = (this && this.__rest) || function (s, e) {
9
9
  }
10
10
  return t;
11
11
  };
12
- import { getColorValue, getFocusRing, u } from '../../utilities';
12
+ import { getColorValue, getFocusRing } from '../../utilities';
13
13
  import React from 'react';
14
14
  import styled from '@emotion/styled';
15
- const switchHeight = 2;
16
- const switchWidth = 4;
17
- const knobOffset = 0.25;
18
- const knobSize = switchHeight - knobOffset * 2;
19
- const knobTravel = switchWidth - switchHeight;
15
+ const sizes = {
16
+ medium: {
17
+ switchHeight: 16,
18
+ switchWidth: 32,
19
+ knobOffset: 2,
20
+ },
21
+ large: {
22
+ switchHeight: 28,
23
+ switchWidth: 56,
24
+ knobOffset: 4,
25
+ },
26
+ };
20
27
  const colorStyles = {
21
28
  knob: {
22
29
  active: {
@@ -39,6 +46,13 @@ const colorStyles = {
39
46
  },
40
47
  },
41
48
  };
49
+ const getKnobTravel = props => {
50
+ return (sizes[props.switchSize].switchWidth - sizes[props.switchSize].switchHeight);
51
+ };
52
+ const getKnobSize = props => {
53
+ return (sizes[props.switchSize].switchHeight -
54
+ sizes[props.switchSize].knobOffset * 2);
55
+ };
42
56
  const SwitchLabel = styled.label `
43
57
  display: block;
44
58
  position: relative;
@@ -68,7 +82,7 @@ const SwitchInput = styled.input `
68
82
  background-color: ${colorStyles.track.active.disabled};
69
83
  }
70
84
  & + .SwitchBox:after {
71
- transform: translateX(${u(knobTravel)});
85
+ transform: translateX(${props => getKnobTravel(props)}px);
72
86
  }
73
87
  }
74
88
 
@@ -77,21 +91,21 @@ const SwitchInput = styled.input `
77
91
  }
78
92
  `;
79
93
  const SwitchBox = styled.div `
80
- width: ${u(switchWidth)};
81
- height: ${u(switchHeight)};
94
+ width: ${props => sizes[props.switchSize].switchWidth}px;
95
+ height: ${props => sizes[props.switchSize].switchHeight}px;
82
96
  position: relative;
83
- border-radius: ${u(switchHeight)};
97
+ border-radius: var(--lns-radius-full);
84
98
  transition: 0.2s;
85
99
  cursor: ${props => (props.isDisabled ? 'default' : 'pointer')};
86
100
 
87
101
  &:after {
88
102
  content: '';
89
103
  position: absolute;
90
- top: ${u(knobOffset)};
91
- left: ${u(knobOffset)};
92
- width: ${u(knobSize)};
93
- height: ${u(knobSize)};
94
- border-radius: ${u(switchHeight)};
104
+ top: ${props => sizes[props.switchSize].knobOffset}px;
105
+ left: ${props => sizes[props.switchSize].knobOffset}px;
106
+ width: ${props => getKnobSize(props)}px;
107
+ height: ${props => getKnobSize(props)}px;
108
+ border-radius: var(--lns-radius-full);
95
109
  transition: 0.15s;
96
110
  background-color: ${props => props.isDisabled
97
111
  ? colorStyles.knob.active.disabled
@@ -99,9 +113,9 @@ const SwitchBox = styled.div `
99
113
  }
100
114
  `;
101
115
  const Switch = (_a) => {
102
- var { isActive, isDisabled, onChange } = _a, props = __rest(_a, ["isActive", "isDisabled", "onChange"]);
116
+ var { isActive, isDisabled, onChange, size = 'medium' } = _a, props = __rest(_a, ["isActive", "isDisabled", "onChange", "size"]);
103
117
  return (React.createElement(SwitchLabel, null,
104
- React.createElement(SwitchInput, Object.assign({}, props, { checked: isActive, disabled: isDisabled, onChange: onChange, type: "checkbox" })),
105
- React.createElement(SwitchBox, { className: "SwitchBox", isDisabled: isDisabled, isActive: isActive })));
118
+ React.createElement(SwitchInput, Object.assign({}, props, { checked: isActive, disabled: isDisabled, onChange: onChange, type: "checkbox", switchSize: size })),
119
+ React.createElement(SwitchBox, { className: "SwitchBox", isDisabled: isDisabled, isActive: isActive, switchSize: size })));
106
120
  };
107
121
  export default Switch;
@@ -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, getTextSize, u, } from '../../utilities';
12
+ import { getColorValue, getFocusRing, getFontWeight, getRadius, 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
- border-radius: var(--lns-radius-thread-full);
44
+ ${getRadius('thdMediumToFull')};
45
45
  ${props => getTextSize(sizeStyles[props.size].textSize)};
46
46
  padding: 0 ${u(xSpace)};
47
47
  ${props => props.offsetSide && `margin-${props.offsetSide}: ${u(-xSpace)}`};
@@ -10,7 +10,7 @@ var __rest = (this && this.__rest) || function (s, e) {
10
10
  return t;
11
11
  };
12
12
  import React from 'react';
13
- import { getColorValue, getTextSize, u } from '../../utilities';
13
+ import { getColorValue, getRadius, getTextSize, u } from '../../utilities';
14
14
  import styled from '@emotion/styled';
15
15
  const sizesStyles = {
16
16
  small: {
@@ -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-radius-thread-large);
33
+ ${getRadius('thdMediumToLarge')};
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)};
@@ -40,7 +40,7 @@ const ToastWrapper = styled.div `
40
40
  background-color: ${getColorValue('background')};
41
41
  color: ${getColorValue('body')};
42
42
  ${getShadow('large')};
43
- ${getRadius('medium')};
43
+ ${getRadius('thdMediumToLarge')};
44
44
  width: calc(100% - var(--lns-space-medium));
45
45
  min-width: ${u(35)};
46
46
  max-width: ${u(50)};
@@ -35,7 +35,7 @@ const tooltipYPadding = (tooltipMinHeight - textHeight) / 2;
35
35
  const TooltipBoxWrapper = styled.div `
36
36
  background-color: ${getColorValue('grey8')};
37
37
  color: ${getColorValue('grey1')};
38
- ${getRadius('medium')};
38
+ ${getRadius('thdMediumToLarge')};
39
39
  ${getFontWeight('medium')};
40
40
  ${getTextSize('small')};
41
41
  ${getShadow('medium')};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loomhq/lens",
3
- "version": "10.43.9",
3
+ "version": "10.46.0",
4
4
  "scripts": {
5
5
  "dev": "next",
6
6
  "build:next": "next build",