@loomhq/lens 10.51.3 → 10.51.5

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.
@@ -26,6 +26,7 @@ declare type ModalProps = {
26
26
  };
27
27
  declare type ModalCardProps = {
28
28
  children?: React.ReactNode;
29
+ id?: string;
29
30
  isOpen?: boolean;
30
31
  onKeyDown?: React.ReactEventHandler;
31
32
  onCloseClick?: React.ReactEventHandler;
@@ -129,7 +129,7 @@ export const ModalCard = (_a) => {
129
129
  React.createElement(ModalCardChildrenSection, null, children))));
130
130
  };
131
131
  const Modal = React.forwardRef((_a, ref) => {
132
- var { children, isOpen, mainButton, secondaryButton, alternativeButton, title, noPadding, onCloseClick, onBackgroundClick, onKeyDown, hasDividers, maxWidth = 60, zIndex = 1000 } = _a, props = __rest(_a, ["children", "isOpen", "mainButton", "secondaryButton", "alternativeButton", "title", "noPadding", "onCloseClick", "onBackgroundClick", "onKeyDown", "hasDividers", "maxWidth", "zIndex"]);
132
+ var { children, id, isOpen, mainButton, secondaryButton, alternativeButton, title, noPadding, onCloseClick, onBackgroundClick, onKeyDown, hasDividers, maxWidth = 60, zIndex = 1000 } = _a, props = __rest(_a, ["children", "id", "isOpen", "mainButton", "secondaryButton", "alternativeButton", "title", "noPadding", "onCloseClick", "onBackgroundClick", "onKeyDown", "hasDividers", "maxWidth", "zIndex"]);
133
133
  const hasButtons = mainButton || secondaryButton || alternativeButton ? true : false;
134
134
  const closeClickHandler = e => {
135
135
  if (onBackgroundClick) {
@@ -144,7 +144,7 @@ const Modal = React.forwardRef((_a, ref) => {
144
144
  React.createElement(ModalCard, { ref: ref,
145
145
  // TODO: LNS-148: Add aria labelling for screenreader support
146
146
  // ariaLabelledBy={title}
147
- isOpen: isOpen, maxWidth: maxWidth, onCloseClick: onCloseClick },
147
+ id: id, isOpen: isOpen, maxWidth: maxWidth, onCloseClick: onCloseClick },
148
148
  React.createElement(ContentWrapper, { rows: `${title ? 'auto ' : ''} ${children ? '1fr ' : ''} ${hasButtons ? 'auto' : ''}` },
149
149
  title && (React.createElement(TitleSection, { bottom: children
150
150
  ? 'var(--lns-space-medium)'
@@ -11,7 +11,7 @@ var __rest = (this && this.__rest) || function (s, e) {
11
11
  };
12
12
  import Menu, { MenuItem } from '../menu/menu';
13
13
  import React, { useEffect, useState } from 'react';
14
- import { getColorValue, getSize, getSizeValue, u } from '../../utilities';
14
+ import { getColorValue, getSize, u } from '../../utilities';
15
15
  import Downshift from 'downshift';
16
16
  import Icon from '../icon/icon';
17
17
  import ResizeObserver from 'resize-observer-polyfill';
@@ -35,7 +35,7 @@ const SelectHeaderWrapper = styled.button `
35
35
  cursor: pointer;
36
36
  width: 100%;
37
37
  min-height: ${u(4.5)};
38
- padding: 0 ${u(1)} 0 ${props => props.paddingLeft};
38
+ padding: 0 ${u(1.5)} 0 var(--lns-formFieldHorizontalPadding);
39
39
  color: ${getColorValue('body')};
40
40
  border: none;
41
41
  background-color: ${getColorValue('formFieldBackground')};
@@ -93,7 +93,7 @@ const SelectHeader = ({ getToggleButtonProps, inputValue, selectedItem, selected
93
93
  event.nativeEvent.preventDownshiftDefault = true;
94
94
  }
95
95
  },
96
- }), { hasValue: inputValue || selectedOptionValue, disabled: isDisabled, columns: columns, paddingLeft: getSizeValue(hasIcon ? 'small' : 1.5) }),
96
+ }), { hasValue: inputValue || selectedOptionValue, disabled: isDisabled, columns: columns }),
97
97
  hasIcon && (React.createElement(Icon, { icon: getIcon({ options, selectedItem, selectedOptionValue }), color: color })),
98
98
  React.createElement(Text, { hasEllipsis: true, color: hasPlaceholder ? 'grey5' : 'inherit' }, getTitle({
99
99
  options,
@@ -46,7 +46,7 @@ const TextButtonWrapper = styled.button `
46
46
  ${props => getTextSize(sizeStyles[props.size].textSize)};
47
47
  padding: 0 ${props => sizeStyles[props.size].xSpace};
48
48
  ${props => props.offsetSide &&
49
- `margin-${props.offsetSide}: -${sizeStyles[props.size].xSpace}`};
49
+ `margin-${props.offsetSide}: calc(-1 * ${sizeStyles[props.size].xSpace})`};
50
50
 
51
51
  &:focus {
52
52
  outline: none;
@@ -16,16 +16,18 @@ import styled from '@emotion/styled';
16
16
  const sizesStyles = {
17
17
  small: {
18
18
  height: u(4),
19
+ width: u(5),
19
20
  iconSize: 2,
20
- padding: u(1.25),
21
- withIconPadding: u(4),
21
+ padding: u(1.75),
22
+ withIconPadding: u(4.5),
22
23
  textSize: 'small',
23
24
  },
24
25
  medium: {
25
- height: `var(--lns-formFieldHeight)`,
26
+ height: 'var(--lns-formFieldHeight)',
27
+ width: u(6),
26
28
  iconSize: 3,
27
29
  padding: 'var(--lns-formFieldHorizontalPadding)',
28
- withIconPadding: u(4.5),
30
+ withIconPadding: u(5.5),
29
31
  textSize: 'medium',
30
32
  },
31
33
  };
@@ -43,7 +45,9 @@ const InputField = styled.input `
43
45
  padding-left: ${props => props.icon
44
46
  ? sizesStyles[props.inputSize].withIconPadding
45
47
  : sizesStyles[props.inputSize].padding};
46
- padding-right: var(--lns-formFieldHorizontalPadding);
48
+ padding-right: ${props => props.icon
49
+ ? sizesStyles[props.inputSize].withIconPadding
50
+ : sizesStyles[props.inputSize].padding};
47
51
  border-radius: var(--lns-formFieldRadius);
48
52
  box-shadow: inset 0 0 0
49
53
  ${props => props.hasError
@@ -83,7 +87,8 @@ const InputFieldWrapper = styled.div `
83
87
  const IconSection = styled.div `
84
88
  position: absolute;
85
89
  pointer-events: none;
86
- width: ${props => sizesStyles[props.size].height};
90
+ width: ${props => sizesStyles[props.size].width};
91
+ // Width isn't equal to iconPadding because we want more space on the left than the right
87
92
  height: ${props => sizesStyles[props.size].height};
88
93
  display: flex;
89
94
  align-items: center;
@@ -14,11 +14,11 @@ import { getColorValue, getRadius, getTextSize, u } from '../../utilities';
14
14
  import styled from '@emotion/styled';
15
15
  const sizesStyles = {
16
16
  small: {
17
- padding: `${u(0.875)} ${u(1.25)}`,
17
+ padding: `${u(1.5)} ${u(1.75)}`,
18
18
  textSize: 'small',
19
19
  },
20
20
  medium: {
21
- padding: `${u(0.875)} var(--lns-formFieldHorizontalPadding)`,
21
+ padding: `${u(1.5)} var(--lns-formFieldHorizontalPadding)`,
22
22
  textSize: 'medium',
23
23
  },
24
24
  };
@@ -60,8 +60,8 @@ export const formFieldVariables = getCssVarsFromObject(undefined, {
60
60
  formFieldBorderWidth: '1px',
61
61
  formFieldBorderWidthFocus: '2px',
62
62
  formFieldHeight: u(4.5),
63
- formFieldRadius: 'var(--lns-radius-thread-xlarge)',
64
- formFieldHorizontalPadding: u(1.5),
63
+ formFieldRadius: 'var(--lns-radius-medium)',
64
+ formFieldHorizontalPadding: u(2),
65
65
  formFieldBorderShadow: `
66
66
  inset 0 0 0 var(--lns-formFieldBorderWidth) var(--lns-color-formFieldBorder)
67
67
  `,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loomhq/lens",
3
- "version": "10.51.3",
3
+ "version": "10.51.5",
4
4
  "scripts": {
5
5
  "dev": "next",
6
6
  "build:next": "next build",