@loomhq/lens 10.20.1 → 10.22.1

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/colors.js CHANGED
@@ -136,7 +136,7 @@ const themeSharedColors = {
136
136
  // This object has a specific spread order for documentation purposes
137
137
  export const themeColors = {
138
138
  light: Object.assign(Object.assign({ body: hslaGreys.grey8, bodyDimmed: alpha(saturate(hslaGreys.grey8, 264), bodyDimmedAlpha), background: hslaGreys.white, backgroundHover: alpha(hslaGreys.grey7, 0.1), backgroundActive: alpha(hslaGreys.grey7, 0.3), backgroundSecondary: alpha(hslaGreys.grey7, 0.04), backgroundSecondary2: { h: 45, s: 34, l: 78, a: 0.2 }, overlay: hslaGreys.white, border: alpha(hslaGreys.grey6, borderAlpha) }, themeSharedColors), { disabledBackground: hslaGreys.grey2, formFieldBorder: hslaGreys.grey3, formFieldBackground: hslaGreys.white, buttonBorder: alpha(hslaGreys.grey6, buttonBorderAlpha), upgrade: { h: 206, s: 100, l: 93, a: 1 }, upgradeHover: darken({ h: 206, s: 100, l: 93, a: 1 }, 9), upgradeActive: darken({ h: 206, s: 100, l: 93, a: 1 }, 17), tabBackground: alpha(hslaGreys.grey6, tabBackgroundAlpha), discoveryBackground: { h: 206, s: 100, l: 93, a: 1 }, discoveryLightBackground: { h: 206, s: 100, l: 97, a: 1 }, discoveryTitle: hslaGreys.grey8, discoveryHighlight: { h: 206, s: 100, l: 77, a: 0.3 } }),
139
- dark: Object.assign(Object.assign({ body: hslaGreys.grey1, bodyDimmed: alpha(saturate(hslaGreys.grey1, 472), bodyDimmedAlpha), background: hslaGreys.grey8, backgroundHover: alpha(hslaGreys.white, 0.1), backgroundActive: alpha(darken(hslaGreys.grey6, 100), 0.2), backgroundSecondary: alpha(hslaGreys.white, 0.04), backgroundSecondary2: { h: 45, s: 13, l: 44, a: 0.2 }, overlay: lighten(hslaGreys.grey8, 50), border: alpha(hslaGreys.grey4, borderAlpha) }, themeSharedColors), { disabledBackground: darken(hslaGreys.grey6, 50), formFieldBorder: hslaGreys.grey6, formFieldBackground: hslaGreys.grey8, buttonBorder: alpha(hslaGreys.white, buttonBorderAlpha), upgrade: { h: 206, s: 92, l: 81, a: 1 }, upgradeHover: darken({ h: 206, s: 92, l: 81, a: 1 }, 9), upgradeActive: darken({ h: 206, s: 92, l: 81, a: 1 }, 17), tabBackground: alpha(hslaGreys.white, tabBackgroundAlpha), discoveryBackground: { h: 206, s: 92, l: 81, a: 1 }, discoveryLightBackground: hslaGreys.grey8, discoveryTitle: hslaBaseColors.blue, discoveryHighlight: { h: 206, s: 100, l: 77, a: 0.3 } }),
139
+ dark: Object.assign(Object.assign({ body: hslaGreys.grey1, bodyDimmed: alpha(saturate(hslaGreys.grey1, 472), bodyDimmedAlpha), background: hslaGreys.grey8, backgroundHover: alpha(hslaGreys.white, 0.1), backgroundActive: alpha(hslaGreys.white, 0.2), backgroundSecondary: alpha(hslaGreys.white, 0.04), backgroundSecondary2: { h: 45, s: 13, l: 44, a: 0.2 }, overlay: lighten(hslaGreys.grey8, 50), border: alpha(hslaGreys.grey4, borderAlpha) }, themeSharedColors), { disabledBackground: darken(hslaGreys.grey6, 50), formFieldBorder: hslaGreys.grey6, formFieldBackground: hslaGreys.grey8, buttonBorder: alpha(hslaGreys.white, buttonBorderAlpha), upgrade: { h: 206, s: 92, l: 81, a: 1 }, upgradeHover: darken({ h: 206, s: 92, l: 81, a: 1 }, 9), upgradeActive: darken({ h: 206, s: 92, l: 81, a: 1 }, 17), tabBackground: alpha(hslaGreys.white, tabBackgroundAlpha), discoveryBackground: { h: 206, s: 92, l: 81, a: 1 }, discoveryLightBackground: hslaGreys.grey8, discoveryTitle: hslaBaseColors.blue, discoveryHighlight: { h: 206, s: 100, l: 77, a: 0.3 } }),
140
140
  };
141
141
  export const hslaColors = Object.assign(Object.assign({}, hslaBaseColors), hslaGreys);
142
142
  export const colorsNames = [
@@ -1,5 +1,5 @@
1
+ import { ResponsiveGridSections, ResponsiveType } from '../../types';
1
2
  import React from 'react';
2
- import { ResponsiveType, ResponsiveGridSections } from '../../types';
3
3
  declare const ArrangeWrapper: import("@emotion/styled-base").StyledComponent<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, ArrangeProps, object>;
4
4
  declare type ArrangeProps = {
5
5
  children?: React.ReactNode;
@@ -11,6 +11,8 @@ declare type ArrangeProps = {
11
11
  maxHeight?: ResponsiveType<string | number>;
12
12
  gap?: ResponsiveType<string | number>;
13
13
  alignItems?: ResponsiveType<'start' | 'end' | 'center' | 'stretch'>;
14
+ justifyItems?: ResponsiveType<'start' | 'end' | 'center' | 'stretch'>;
15
+ alignContent?: ResponsiveType<'start' | 'end' | 'center' | 'stretch' | 'space-around' | 'space-between' | 'space-evenly'>;
14
16
  justifyContent?: ResponsiveType<'start' | 'end' | 'center' | 'stretch' | 'space-around' | 'space-between' | 'space-evenly'>;
15
17
  autoFlow?: ResponsiveType<'column' | 'row'>;
16
18
  columns?: ResponsiveGridSections;
@@ -18,5 +20,5 @@ declare type ArrangeProps = {
18
20
  className?: never;
19
21
  style?: never;
20
22
  };
21
- declare const Arrange: ({ children, width, height, minWidth, minHeight, maxWidth, maxHeight, gap, columns, rows, alignItems, justifyContent, autoFlow, className, style, ...props }: ArrangeProps & React.ComponentProps<typeof ArrangeWrapper>) => JSX.Element;
23
+ declare const Arrange: ({ children, width, height, minWidth, minHeight, maxWidth, maxHeight, gap, columns, rows, alignItems, justifyContent, justifyItems, alignContent, autoFlow, className, style, ...props }: ArrangeProps & React.ComponentProps<typeof ArrangeWrapper>) => JSX.Element;
22
24
  export default Arrange;
@@ -11,13 +11,17 @@ var __rest = (this && this.__rest) || function (s, e) {
11
11
  };
12
12
  import { getResponsiveOneOf, getSize } from '../../utilities';
13
13
  import React from 'react';
14
+ import { customStylesWarning } from '../../console-messages';
14
15
  import { getResponsiveGridSections } from '../../utilities/responsive';
15
16
  import styled from '@emotion/styled';
16
- import { customStylesWarning } from '../../console-messages';
17
17
  const ArrangeWrapper = styled.div `
18
18
  display: grid;
19
19
  ${props => getResponsiveOneOf('align-items', props.alignItems)};
20
20
  ${props => getResponsiveOneOf('justify-content', props.justifyContent)};
21
+ ${props => props.justifyItems &&
22
+ getResponsiveOneOf('justify-items', props.justifyItems)};
23
+ ${props => props.alignContent &&
24
+ getResponsiveOneOf('align-content', props.alignContent)};
21
25
  ${props => !props.columns &&
22
26
  !props.rows &&
23
27
  !props.autoFlow &&
@@ -38,10 +42,10 @@ const ArrangeWrapper = styled.div `
38
42
  getResponsiveOneOf('grid-auto-flow', props.autoFlow)};
39
43
  `;
40
44
  const Arrange = (_a) => {
41
- var { children, width, height, minWidth, minHeight, maxWidth, maxHeight, gap, columns, rows, alignItems = 'center', justifyContent = 'start', autoFlow, className, style } = _a, props = __rest(_a, ["children", "width", "height", "minWidth", "minHeight", "maxWidth", "maxHeight", "gap", "columns", "rows", "alignItems", "justifyContent", "autoFlow", "className", "style"]);
45
+ var { children, width, height, minWidth, minHeight, maxWidth, maxHeight, gap, columns, rows, alignItems = 'center', justifyContent = 'start', justifyItems, alignContent, autoFlow, className, style } = _a, props = __rest(_a, ["children", "width", "height", "minWidth", "minHeight", "maxWidth", "maxHeight", "gap", "columns", "rows", "alignItems", "justifyContent", "justifyItems", "alignContent", "autoFlow", "className", "style"]);
42
46
  if (className || style) {
43
47
  console.warn(customStylesWarning);
44
48
  }
45
- return (React.createElement(ArrangeWrapper, Object.assign({ alignItems: alignItems, justifyContent: justifyContent, gap: gap, columns: columns, rows: rows, width: width, height: height, minWidth: minWidth, minHeight: minHeight, maxWidth: maxWidth, maxHeight: maxHeight, autoFlow: autoFlow }, props), children));
49
+ return (React.createElement(ArrangeWrapper, Object.assign({ alignItems: alignItems, justifyContent: justifyContent, justifyItems: justifyItems, alignContent: alignContent, gap: gap, columns: columns, rows: rows, width: width, height: height, minWidth: minWidth, minHeight: minHeight, maxWidth: maxWidth, maxHeight: maxHeight, autoFlow: autoFlow }, props), children));
46
50
  };
47
51
  export default Arrange;
@@ -29,13 +29,13 @@ const Icon = (_a) => {
29
29
  var { altText, icon, color = 'body', size = defaultIconSize, hasWidthOffset } = _a, props = __rest(_a, ["altText", "icon", "color", "size", "hasWidthOffset"]);
30
30
  const ref = React.useRef(null);
31
31
  const defaultIconSizePx = defaultIconSize * unit;
32
- React.useLayoutEffect(() => {
32
+ React.useEffect(() => {
33
33
  if (!hasWidthOffset) {
34
34
  return;
35
35
  }
36
36
  const svg = ref.current.querySelector('svg');
37
37
  const bBox = svg.getBBox();
38
- svg.setAttribute('viewBox', `${bBox.x} 0 ${bBox.width} ${defaultIconSizePx}`);
38
+ svg.setAttribute('viewBox', `${bBox.x} 0 ${bBox.width || defaultIconSizePx} ${defaultIconSizePx}`);
39
39
  }, []);
40
40
  return (React.createElement(IconWrapper, Object.assign({ ref: ref, "aria-label": altText, color: color, size: size, hasWidthOffset: hasWidthOffset }, props), icon));
41
41
  };
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
- declare const IconButtonWrapper: import("@emotion/styled-base").StyledComponent<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, IconButtonWrapperProps, object>;
3
- declare const IconButton: ({ altText, icon, onClick, iconColor, isDisabled, size, ...props }: IconButtonProps & React.ComponentProps<typeof IconButtonWrapper>) => JSX.Element;
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;
4
4
  declare type IconButtonProps = {
5
5
  altText: string;
6
6
  icon?: React.ReactNode;
@@ -9,7 +9,7 @@ declare type IconButtonProps = {
9
9
  isDisabled?: boolean;
10
10
  size?: 'small' | 'medium';
11
11
  };
12
- declare type IconButtonWrapperProps = {
12
+ declare type IconButtonBoxProps = {
13
13
  size?: 'small' | 'medium';
14
14
  };
15
15
  export default IconButton;
@@ -9,10 +9,10 @@ var __rest = (this && this.__rest) || function (s, e) {
9
9
  }
10
10
  return t;
11
11
  };
12
+ import { getColorValue, getFocusRing, getRadius, u } from '../../utilities';
13
+ import Icon from '../icon/icon';
12
14
  import React from 'react';
13
15
  import styled from '@emotion/styled';
14
- import { u, getFocusRing, getRadius, getColorValue } from '../../utilities';
15
- import Icon from '../icon/icon';
16
16
  const sizeStyles = {
17
17
  small: {
18
18
  size: u(3),
@@ -23,7 +23,7 @@ const sizeStyles = {
23
23
  iconSize: 3,
24
24
  },
25
25
  };
26
- const IconButtonWrapper = styled.button `
26
+ export const IconButtonBox = styled.button `
27
27
  background-color: transparent;
28
28
  border: none;
29
29
  appearance: none;
@@ -75,7 +75,7 @@ const IconButtonWrapper = styled.button `
75
75
  `;
76
76
  const IconButton = (_a) => {
77
77
  var { altText, icon, onClick, iconColor = 'body', isDisabled, size = 'medium' } = _a, props = __rest(_a, ["altText", "icon", "onClick", "iconColor", "isDisabled", "size"]);
78
- return (React.createElement(IconButtonWrapper, Object.assign({ "aria-label": altText, onClick: onClick, disabled: isDisabled, size: size }, props),
78
+ return (React.createElement(IconButtonBox, Object.assign({ "aria-label": altText, onClick: onClick, 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;
@@ -7,7 +7,6 @@ export { default as TextInput } from "./text-input/text-input";
7
7
  export { default as Distribute } from "./distribute/distribute";
8
8
  export { default as Container } from "./container/container";
9
9
  export { default as Layout } from "./layout/layout";
10
- export { default as IconButton } from "./icon-button/icon-button";
11
10
  export { default as Loader } from "./loader/loader";
12
11
  export { default as Checkbox } from "./checkbox/checkbox";
13
12
  export { default as TextButton } from "./text-button/text-button";
@@ -28,6 +27,7 @@ export { default as Arrange } from "./arrange/arrange";
28
27
  export { default as ColorPicker } from "./color-picker/color-picker";
29
28
  export * from "./icon/available-icons";
30
29
  export { default as BaseStyles, buildGlobalStylesheet } from "./base-styles/base-styles";
30
+ export { default as IconButton, IconButtonBox } from "./icon-button/icon-button";
31
31
  export { default as Menu, MenuItem } from "./menu/menu";
32
32
  export { default as Modal, ModalCard } from "./modal/modal";
33
33
  export { default as Tooltip, TooltipBox } from "./tooltip/tooltip";
@@ -9,6 +9,7 @@ export { default as Distribute } from './distribute/distribute';
9
9
  export { default as Container } from './container/container';
10
10
  export { default as Layout } from './layout/layout';
11
11
  export { default as IconButton } from './icon-button/icon-button';
12
+ export { IconButtonBox } from './icon-button/icon-button';
12
13
  export { default as Loader } from './loader/loader';
13
14
  export { default as Checkbox } from './checkbox/checkbox';
14
15
  export { default as TextButton } from './text-button/text-button';
@@ -3,7 +3,7 @@ import { ResponsiveType } from '../../types';
3
3
  declare const SplitWrapper: import("@emotion/styled-base").StyledComponent<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, SplitProps, object>;
4
4
  declare const SplitSectionWrapper: import("@emotion/styled-base").StyledComponent<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, SplitSectionProps, object>;
5
5
  export declare const SplitSection: ({ children, grow, shrink, basis, width, height, minWidth, minHeight, maxWidth, maxHeight, className, style, ...props }: SplitSectionProps & React.ComponentProps<typeof SplitSectionWrapper>) => JSX.Element;
6
- declare const Split: ({ children, gap, alignItems, justifyContent, wrap, width, height, minWidth, minHeight, maxWidth, maxHeight, className, style, ...props }: SplitProps & React.ComponentProps<typeof SplitWrapper>) => JSX.Element;
6
+ declare const Split: ({ children, gap, alignItems, justifyContent, alignContent, wrap, width, height, minWidth, minHeight, maxWidth, maxHeight, className, style, ...props }: SplitProps & React.ComponentProps<typeof SplitWrapper>) => JSX.Element;
7
7
  interface SharedProps {
8
8
  width?: ResponsiveType<number | string>;
9
9
  height?: ResponsiveType<number | string>;
@@ -16,6 +16,7 @@ interface SharedProps {
16
16
  interface SplitProps extends SharedProps {
17
17
  alignItems?: ResponsiveType<'stretch' | 'flex-start' | 'flex-end' | 'center' | 'baseline'>;
18
18
  justifyContent?: ResponsiveType<'flex-start' | 'flex-end' | 'center' | 'space-between' | 'space-around' | 'space-evenly'>;
19
+ alignContent?: 'flex-start' | 'flex-end' | 'center' | 'space-between' | 'space-around' | 'space-evenly' | 'stretch' | 'start' | 'end' | 'baseline';
19
20
  wrap?: ResponsiveType<'nowrap' | 'wrap' | 'wrap-reverse'>;
20
21
  gap?: ResponsiveType<number | string>;
21
22
  direction?: ResponsiveType<'column' | 'row'>;
@@ -25,9 +25,12 @@ const getSizeStyles = props => css `
25
25
  const SplitWrapper = styled.div `
26
26
  display: flex;
27
27
  ${props => getResponsiveOneOf('align-items', props.alignItems)};
28
- ${props => getResponsiveOneOf('justify-content', props.justifyContent)};
28
+ ${props => props.justifyContent &&
29
+ getResponsiveOneOf('justify-content', props.justifyContent)};
30
+ ${props => props.alignContent &&
31
+ getResponsiveOneOf('align-content', props.alignContent)};
29
32
  ${props => getResponsiveOneOf('flex-wrap', props.wrap)};
30
- ${props => getResponsiveOneOf('flex-direction', props.direction)};
33
+ ${props => props.direction && getResponsiveOneOf('flex-direction', props.direction)};
31
34
  ${props => props.gap && getSize('--gap', props.gap)};
32
35
  margin-right: calc(-1 * var(--gap));
33
36
  margin-bottom: calc(-1 * var(--gap));
@@ -49,7 +52,7 @@ export const SplitSection = (_a) => {
49
52
  return (React.createElement(SplitSectionWrapper, Object.assign({ grow: grow, shrink: shrink, basis: basis, width: width, height: height, minWidth: minWidth, minHeight: minHeight, maxWidth: maxWidth, maxHeight: maxHeight }, props), children));
50
53
  };
51
54
  const Split = (_a) => {
52
- var { children, gap = 'initial', alignItems = 'center', justifyContent, wrap = 'wrap', width, height, minWidth, minHeight, maxWidth, maxHeight, className, style } = _a, props = __rest(_a, ["children", "gap", "alignItems", "justifyContent", "wrap", "width", "height", "minWidth", "minHeight", "maxWidth", "maxHeight", "className", "style"]);
55
+ var { children, gap = 'initial', alignItems = 'center', justifyContent, alignContent, wrap = 'wrap', width, height, minWidth, minHeight, maxWidth, maxHeight, className, style } = _a, props = __rest(_a, ["children", "gap", "alignItems", "justifyContent", "alignContent", "wrap", "width", "height", "minWidth", "minHeight", "maxWidth", "maxHeight", "className", "style"]);
53
56
  React.Children.forEach(children, child => {
54
57
  if ((child && !React.isValidElement(child)) ||
55
58
  (React.isValidElement(child) && child.type !== SplitSection)) {
@@ -59,6 +62,6 @@ const Split = (_a) => {
59
62
  if (className || style) {
60
63
  console.warn(customStylesWarning);
61
64
  }
62
- return (React.createElement(SplitWrapper, Object.assign({ gap: gap, alignItems: alignItems, justifyContent: justifyContent, wrap: wrap, width: width, height: height, minWidth: minWidth, minHeight: minHeight, maxWidth: maxWidth, maxHeight: maxHeight }, props), children));
65
+ return (React.createElement(SplitWrapper, Object.assign({ gap: gap, alignItems: alignItems, justifyContent: justifyContent, alignContent: alignContent, wrap: wrap, width: width, height: height, minWidth: minWidth, minHeight: minHeight, maxWidth: maxWidth, maxHeight: maxHeight }, props), children));
63
66
  };
64
67
  export default Split;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loomhq/lens",
3
- "version": "10.20.1",
3
+ "version": "10.22.1",
4
4
  "scripts": {
5
5
  "dev": "next",
6
6
  "build:next": "next build",