@loomhq/lens 10.23.0 → 10.25.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.
@@ -1,8 +1,8 @@
1
1
  import { Global, css } from '@emotion/core';
2
+ import { getAllCssVarsString, getThemeStylesString } from '../../css-variables';
2
3
  import { getColorValue, getTextSize } from '../../utilities';
3
4
  import React from 'react';
4
5
  import { cssUtilities } from '../../css-utilities';
5
- import { getAllCssVarsString, getThemeStylesString } from '../../css-variables';
6
6
  const buildGlobalStylesheet = (rootElement = ':root', bodyElement = 'body') => {
7
7
  return `
8
8
  ${rootElement} {
@@ -1,4 +1,3 @@
1
- import 'focus-visible/dist/focus-visible';
2
1
  import React from 'react';
3
2
  declare const ButtonWrapper: import("@emotion/styled-base").StyledComponent<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, ButtonWrapperProps, object>;
4
3
  declare const Button: ({ size, children, variant, hasFullWidth, icon, iconPosition, logoSrc, hasLoader, isDisabled, htmlTag, ...props }: ButtonProps & React.ComponentProps<typeof ButtonWrapper>) => JSX.Element;
@@ -9,13 +9,12 @@ var __rest = (this && this.__rest) || function (s, e) {
9
9
  }
10
10
  return t;
11
11
  };
12
- import { css } from '@emotion/core';
13
- import styled from '@emotion/styled';
14
- import 'focus-visible/dist/focus-visible';
15
- import React from 'react';
12
+ import { getColorValue, getFocusRing, getFontWeight, getRadius, getSize, getTextSize, u, } from '../../utilities';
16
13
  import Icon from '../icon/icon';
17
14
  import Loader from '../loader/loader';
18
- import { getFocusRing, getFontWeight, getRadius, getTextSize, u, getColorValue, getSize, } from '../../utilities';
15
+ import React from 'react';
16
+ import { css } from '@emotion/core';
17
+ import styled from '@emotion/styled';
19
18
  const sizesStyles = {
20
19
  small: {
21
20
  height: u(4),
@@ -126,11 +125,8 @@ const ButtonWrapper = styled.button `
126
125
  background-color: ${props => variantStyles[props.variant].active};
127
126
  }
128
127
 
129
- &:focus {
128
+ &:focus-visible {
130
129
  outline: none;
131
- }
132
-
133
- &.focus-visible {
134
130
  ${getFocusRing()};
135
131
  }
136
132
 
@@ -9,8 +9,8 @@ var __rest = (this && this.__rest) || function (s, e) {
9
9
  }
10
10
  return t;
11
11
  };
12
- import { getFocusRing, u, getColorValue } from '../../utilities';
13
12
  import React, { forwardRef, useEffect, useRef } from 'react';
13
+ import { getColorValue, getFocusRing, u } from '../../utilities';
14
14
  import styled from '@emotion/styled';
15
15
  const SvgCheckboxCheck = props => (React.createElement("svg", Object.assign({ width: 12, height: 9, viewBox: "0 0 12 9", fill: "none" }, props),
16
16
  React.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M11.707.293a1 1 0 010 1.414l-7 7a1 1 0 01-1.414 0l-3-3a1 1 0 011.414-1.414L4 6.586 10.293.293a1 1 0 011.414 0z", fill: "currentColor" })));
@@ -50,7 +50,7 @@ const CheckboxInput = styled.input `
50
50
  }
51
51
  }
52
52
 
53
- &.focus-visible ~ .CheckboxBox {
53
+ &:focus-visible ~ .CheckboxBox {
54
54
  ${getFocusRing()};
55
55
  }
56
56
 
@@ -1,15 +1,17 @@
1
1
  import React from 'react';
2
2
  export declare const IconButtonBox: import("@emotion/styled-base").StyledComponent<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, IconButtonBoxProps, object>;
3
- declare const IconButton: ({ altText, icon, onClick, iconColor, isDisabled, size, ...props }: IconButtonProps & React.ComponentProps<typeof IconButtonBox>) => JSX.Element;
3
+ declare const IconButton: ({ altText, icon, onClick, iconColor, isActive, isDisabled, size, ...props }: IconButtonProps & React.ComponentProps<typeof IconButtonBox>) => JSX.Element;
4
4
  declare type IconButtonProps = {
5
5
  altText: string;
6
6
  icon?: React.ReactNode;
7
7
  onClick?: React.ReactEventHandler;
8
8
  iconColor?: string;
9
+ isActive?: boolean;
9
10
  isDisabled?: boolean;
10
11
  size?: 'small' | 'medium';
11
12
  };
12
13
  declare type IconButtonBoxProps = {
13
14
  size?: 'small' | 'medium';
15
+ isActive?: boolean;
14
16
  };
15
17
  export default IconButton;
@@ -24,7 +24,7 @@ const sizeStyles = {
24
24
  },
25
25
  };
26
26
  export const IconButtonBox = styled.button `
27
- background-color: transparent;
27
+ background-color: ${props => props.isActive ? getColorValue('backgroundActive') : 'transparent'};
28
28
  border: none;
29
29
  appearance: none;
30
30
  cursor: pointer;
@@ -42,7 +42,7 @@ export const IconButtonBox = styled.button `
42
42
 
43
43
  &:hover {
44
44
  transition: 0.3s background-color;
45
- background-color: ${getColorValue('backgroundHover')};
45
+ background-color: ${props => getColorValue(props.isActive ? 'backgroundActive' : 'backgroundHover')};
46
46
  }
47
47
 
48
48
  &:active {
@@ -65,7 +65,7 @@ export const IconButtonBox = styled.button `
65
65
  ${getRadius('medium')};
66
66
  }
67
67
 
68
- &.focus-visible:before {
68
+ &:focus-visible:before {
69
69
  ${getFocusRing()};
70
70
  }
71
71
 
@@ -74,8 +74,8 @@ export const IconButtonBox = styled.button `
74
74
  }
75
75
  `;
76
76
  const IconButton = (_a) => {
77
- var { altText, icon, onClick, iconColor = 'body', isDisabled, size = 'medium' } = _a, props = __rest(_a, ["altText", "icon", "onClick", "iconColor", "isDisabled", "size"]);
78
- return (React.createElement(IconButtonBox, Object.assign({ "aria-label": altText, onClick: onClick, disabled: isDisabled, size: size }, props),
77
+ var { altText, icon, onClick, iconColor = 'body', isActive, isDisabled, size = 'medium' } = _a, props = __rest(_a, ["altText", "icon", "onClick", "iconColor", "isActive", "isDisabled", "size"]);
78
+ return (React.createElement(IconButtonBox, Object.assign({ "aria-label": altText, onClick: onClick, isActive: isActive, disabled: isDisabled, size: size }, props),
79
79
  React.createElement(Icon, { icon: icon, size: sizeStyles[size].iconSize, color: isDisabled ? 'disabledContent' : iconColor })));
80
80
  };
81
81
  export default IconButton;
@@ -1,4 +1,3 @@
1
- import 'focus-visible/dist/focus-visible';
2
1
  import React from 'react';
3
2
  declare const PillWrapper: import("@emotion/styled-base").StyledComponent<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, PillWrapperProps, object>;
4
3
  declare const Pill: ({ color, backgroundColor, children, icon, iconPosition, ...props }: PillProps & React.ComponentProps<typeof PillWrapper>) => JSX.Element;
@@ -9,12 +9,11 @@ var __rest = (this && this.__rest) || function (s, e) {
9
9
  }
10
10
  return t;
11
11
  };
12
- import 'focus-visible/dist/focus-visible';
13
- import { getFontWeight, getRadius, getSize, getTextSize, u, getColorValue, } from '../../utilities';
12
+ import { getColorValue, getFontWeight, getRadius, getSize, getTextSize, u, } from '../../utilities';
13
+ import Container from '../container/container';
14
14
  import Icon from '../icon/icon';
15
15
  import React from 'react';
16
16
  import styled from '@emotion/styled';
17
- import Container from '../container/container';
18
17
  const PillWrapper = styled.div `
19
18
  display: inline-grid;
20
19
  grid-auto-flow: column;
@@ -9,8 +9,8 @@ var __rest = (this && this.__rest) || function (s, e) {
9
9
  }
10
10
  return t;
11
11
  };
12
- import { getFocusRing, u, getColorValue } from '../../utilities';
13
12
  import React, { forwardRef } from 'react';
13
+ import { getColorValue, getFocusRing, u } from '../../utilities';
14
14
  import styled from '@emotion/styled';
15
15
  const RadioLabel = styled.label `
16
16
  display: block;
@@ -55,7 +55,7 @@ const RadioInput = styled.input `
55
55
  }
56
56
  }
57
57
 
58
- &.focus-visible ~ .RadioBox {
58
+ &:focus-visible ~ .RadioBox {
59
59
  ${getFocusRing()};
60
60
  }
61
61
  `;
@@ -37,8 +37,8 @@ const SplitWrapper = styled.div `
37
37
  ${props => getSizeStyles(props)};
38
38
  `;
39
39
  const SplitSectionWrapper = styled.div `
40
- ${props => props.grow && getResponsiveNumber('flex-grow', props.grow)};
41
- ${props => props.shrink && getResponsiveNumber('flex-shrink', props.shrink)};
40
+ ${props => getResponsiveNumber('flex-grow', props.grow)};
41
+ ${props => getResponsiveNumber('flex-shrink', props.shrink)};
42
42
  ${props => props.basis && getSize('flex-basis', props.basis)};
43
43
  margin-right: var(--gap);
44
44
  margin-bottom: var(--gap);
@@ -9,7 +9,7 @@ var __rest = (this && this.__rest) || function (s, e) {
9
9
  }
10
10
  return t;
11
11
  };
12
- import { getFocusRing, u, getColorValue } from '../../utilities';
12
+ import { getColorValue, getFocusRing, u } from '../../utilities';
13
13
  import React from 'react';
14
14
  import styled from '@emotion/styled';
15
15
  const switchHeight = 2;
@@ -47,7 +47,7 @@ const SwitchInput = styled.input `
47
47
  position: absolute;
48
48
  opacity: 0;
49
49
 
50
- &.focus-visible ~ .SwitchBox {
50
+ &:focus-visible ~ .SwitchBox {
51
51
  ${getFocusRing()};
52
52
  }
53
53
 
@@ -9,11 +9,11 @@ var __rest = (this && this.__rest) || function (s, e) {
9
9
  }
10
10
  return t;
11
11
  };
12
- import { getFocusRing, getFontWeight, getSize, getSizeValue, u, getColorValue, } from '../../utilities';
12
+ import { getColorValue, getFocusRing, getFontWeight, getSize, getSizeValue, u, } from '../../utilities';
13
+ import Container from '../container/container';
13
14
  import Icon from '../icon/icon';
14
15
  import React from 'react';
15
16
  import styled from '@emotion/styled';
16
- import Container from '../container/container';
17
17
  const negativeScrollOffset = scrollOffset => `calc(-1 * ${getSizeValue(scrollOffset)})`;
18
18
  const Wrapper = styled.div `
19
19
  ${props => props.scrollOffset &&
@@ -77,7 +77,7 @@ const TabWrapper = styled.button `
77
77
  transition: 0.3s color;
78
78
  }
79
79
 
80
- &.focus-visible {
80
+ &:focus-visible {
81
81
  ${getFocusRing(undefined, 'inset')};
82
82
  }
83
83
  `;
@@ -1,5 +1,4 @@
1
1
  import React from 'react';
2
- import 'focus-visible/dist/focus-visible';
3
2
  declare const TextButtonWrapper: import("@emotion/styled-base").StyledComponent<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, TextButtonWrapperProps, object>;
4
3
  declare const TextButton: ({ onClick, size, children, icon, iconPosition, isDisabled, htmlTag, offsetSide, ...props }: TextButtonProps & React.ComponentProps<typeof TextButtonWrapper>) => JSX.Element;
5
4
  declare type TextButtonProps = {
@@ -9,12 +9,11 @@ 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';
13
+ import Container from '../container/container';
14
+ import Icon from '../icon/icon';
12
15
  import React from 'react';
13
16
  import styled from '@emotion/styled';
14
- import { u, getTextSize, getRadius, getFontWeight, getFocusRing, getColorValue, } from '../../utilities';
15
- import Icon from '../icon/icon';
16
- import Container from '../container/container';
17
- import 'focus-visible/dist/focus-visible';
18
17
  const sizeStyles = {
19
18
  small: {
20
19
  textSize: 'small',
@@ -51,7 +50,7 @@ const TextButtonWrapper = styled.button `
51
50
  outline: none;
52
51
  }
53
52
 
54
- &.focus-visible {
53
+ &:focus-visible {
55
54
  ${getFocusRing()};
56
55
  }
57
56
 
@@ -9,10 +9,10 @@ var __rest = (this && this.__rest) || function (s, e) {
9
9
  }
10
10
  return t;
11
11
  };
12
- import Icon from '../icon/icon';
13
12
  import React, { forwardRef } from 'react';
13
+ import { getColorValue, getTextSize, u } from '../../utilities';
14
+ import Icon from '../icon/icon';
14
15
  import styled from '@emotion/styled';
15
- import { u, getColorValue, getTextSize } from '../../utilities';
16
16
  const sizesStyles = {
17
17
  small: {
18
18
  height: u(4),
@@ -51,6 +51,12 @@ const InputField = styled.input `
51
51
 
52
52
  ${props => getTextSize(sizesStyles[props.inputSize].textSize)};
53
53
 
54
+ &::-webkit-search-decoration,
55
+ &::-webkit-search-results-button,
56
+ &::-webkit-search-results-decoration {
57
+ -webkit-appearance: none;
58
+ }
59
+
54
60
  &:hover {
55
61
  box-shadow: inset 0 0 0 var(--lns-formFieldBorderWidthFocus)
56
62
  var(--lns-color-blurple);
@@ -97,12 +103,16 @@ const TextInput = forwardRef((_a, ref) => {
97
103
  inputField)) : (inputField);
98
104
  });
99
105
  export const availableTypes = [
106
+ 'datetime-local',
100
107
  'email',
108
+ 'month',
101
109
  'number',
102
110
  'password',
103
111
  'search',
104
112
  'tel',
105
113
  'text',
114
+ 'time',
106
115
  'url',
116
+ 'week',
107
117
  ];
108
118
  export default TextInput;
@@ -1,6 +1,6 @@
1
- import useMedia from '../hooks/use-media';
2
1
  import { breakpoints } from '../variables';
3
2
  import { getSizeValue } from './size';
3
+ import useMedia from '../hooks/use-media';
4
4
  export const getMediaCss = (widthType, breakpoint, declaration) => `@media(${widthType}: ${breakpoint}){${declaration}}`;
5
5
  export const arrayToBreakpoints = values => {
6
6
  const smallestBreakpoint = Object.values(breakpoints)[0];
@@ -56,7 +56,7 @@ export const getResponsiveBoolean = (property, valueArray, booleanValue) => {
56
56
  return `${property}: ${valueArray[0]};`;
57
57
  };
58
58
  export const getResponsiveNumber = (property, number) => {
59
- if (number) {
59
+ if (number || number === 0) {
60
60
  if (Array.isArray(number)) {
61
61
  const rulesetsArray = number.map(numberItem => {
62
62
  return `${property}: ${numberItem}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loomhq/lens",
3
- "version": "10.23.0",
3
+ "version": "10.25.0",
4
4
  "scripts": {
5
5
  "dev": "next",
6
6
  "build:next": "next build",
@@ -23,7 +23,6 @@
23
23
  },
24
24
  "dependencies": {
25
25
  "downshift": "^5.0.0",
26
- "focus-visible": "^5.0.2",
27
26
  "lodash": "^4.17.21",
28
27
  "react-color": "^2.19.3",
29
28
  "react-laag": "^2.0.3",
@@ -33,9 +32,9 @@
33
32
  "peerDependencies": {
34
33
  "@emotion/core": "^10.1.1",
35
34
  "@emotion/styled": "^10.0.27",
35
+ "@types/react": "^17.0.3",
36
36
  "react": "^16.12.0",
37
- "react-dom": "^16.12.0",
38
- "@types/react": "^17.0.3"
37
+ "react-dom": "^16.12.0"
39
38
  },
40
39
  "devDependencies": {
41
40
  "@babel/cli": "^7.8.4",