@loomhq/lens 10.43.8 → 10.45.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.
- package/dist/components/button/button.js +2 -2
- package/dist/components/color-picker/color-picker.js +2 -2
- package/dist/components/icon-button/icon-button.js +3 -3
- package/dist/components/menu/menu.js +2 -2
- package/dist/components/modal/modal.js +4 -4
- package/dist/components/pill/pill.js +1 -1
- package/dist/components/switch/switch.d.ts +6 -2
- package/dist/components/switch/switch.js +32 -18
- package/dist/components/text-button/text-button.js +2 -2
- package/dist/components/text-input/text-input.js +1 -6
- package/dist/components/textarea/textarea.js +2 -2
- package/dist/components/toast/toast.js +1 -1
- package/dist/components/tooltip/tooltip.js +1 -1
- package/package.json +1 -1
|
@@ -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
|
-
|
|
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
|
-
|
|
73
|
+
${getRadius('thdMediumToFull')};
|
|
74
74
|
background-color: ${props => props.color};
|
|
75
75
|
`;
|
|
76
76
|
const ButtonWrapper = styled.div `
|
|
@@ -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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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('
|
|
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:
|
|
42
|
-
right:
|
|
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('
|
|
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>,
|
|
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
|
|
12
|
+
import { getColorValue, getFocusRing } from '../../utilities';
|
|
13
13
|
import React from 'react';
|
|
14
14
|
import styled from '@emotion/styled';
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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(${
|
|
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: ${
|
|
81
|
-
height: ${
|
|
94
|
+
width: ${props => sizes[props.switchSize].switchWidth}px;
|
|
95
|
+
height: ${props => sizes[props.switchSize].switchHeight}px;
|
|
82
96
|
position: relative;
|
|
83
|
-
border-radius:
|
|
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: ${
|
|
91
|
-
left: ${
|
|
92
|
-
width: ${
|
|
93
|
-
height: ${
|
|
94
|
-
border-radius:
|
|
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
|
-
|
|
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)}`};
|
|
@@ -30,6 +30,7 @@ const sizesStyles = {
|
|
|
30
30
|
},
|
|
31
31
|
};
|
|
32
32
|
const InputField = styled.input `
|
|
33
|
+
-webkit-appearance: none;
|
|
33
34
|
font-family: inherit;
|
|
34
35
|
width: 100%;
|
|
35
36
|
height: ${props => sizesStyles[props.inputSize].height};
|
|
@@ -51,12 +52,6 @@ const InputField = styled.input `
|
|
|
51
52
|
|
|
52
53
|
${props => getTextSize(sizesStyles[props.inputSize].textSize)};
|
|
53
54
|
|
|
54
|
-
&::-webkit-search-decoration,
|
|
55
|
-
&::-webkit-search-results-button,
|
|
56
|
-
&::-webkit-search-results-decoration {
|
|
57
|
-
-webkit-appearance: none;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
55
|
&:hover {
|
|
61
56
|
box-shadow: inset 0 0 0 var(--lns-formFieldBorderWidthFocus)
|
|
62
57
|
var(--lns-color-blurple);
|
|
@@ -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
|
-
|
|
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('
|
|
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('
|
|
38
|
+
${getRadius('thdMediumToLarge')};
|
|
39
39
|
${getFontWeight('medium')};
|
|
40
40
|
${getTextSize('small')};
|
|
41
41
|
${getShadow('medium')};
|