@loomhq/lens 10.21.0 → 10.22.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,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
declare const
|
|
3
|
-
declare const IconButton: ({ altText, icon, onClick, iconColor, isDisabled, size, ...props }: IconButtonProps & React.ComponentProps<typeof
|
|
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
|
|
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
|
|
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(
|
|
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";
|
package/dist/components/index.js
CHANGED
|
@@ -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';
|