@loomhq/lens 10.40.1 → 10.41.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.
|
@@ -142,7 +142,8 @@ const IconSection = styled.span `
|
|
|
142
142
|
const LogoImage = styled.img `
|
|
143
143
|
max-width: 1.45em;
|
|
144
144
|
max-height: 1.45em;
|
|
145
|
-
height:
|
|
145
|
+
height: ${props => sizesStyles[props.size].height};
|
|
146
|
+
width: ${props => sizesStyles[props.size].height};
|
|
146
147
|
${props => props.hasSpacing && `margin-right: 0.57em`};
|
|
147
148
|
${hasLoaderStyles};
|
|
148
149
|
`;
|
|
@@ -157,12 +158,18 @@ const ChildrenSection = styled.span `
|
|
|
157
158
|
const Button = (_a) => {
|
|
158
159
|
var { size = 'medium', children, variant = 'neutral', hasFullWidth, icon, iconPosition = 'left', logoSrc, hasLoader, isDisabled, htmlTag = 'button' } = _a, props = __rest(_a, ["size", "children", "variant", "hasFullWidth", "icon", "iconPosition", "logoSrc", "hasLoader", "isDisabled", "htmlTag"]);
|
|
159
160
|
const buttonIcon = (React.createElement(IconSection, { hasLoader: hasLoader, paddingLeft: children && iconPosition === 'right' && iconGap, paddingRight: children && iconPosition === 'left' && iconGap },
|
|
160
|
-
React.createElement(Icon, { icon: icon, color: "currentColor", size: sizesStyles[size].iconSize
|
|
161
|
+
React.createElement(Icon, { icon: icon, color: "currentColor", hasWidthOffset: true, size: sizesStyles[size].iconSize })));
|
|
161
162
|
return (React.createElement(ButtonWrapper, Object.assign({ size: size, variant: variant, hasFullWidth: hasFullWidth, icon: icon, iconPosition: iconPosition, logoSrc: logoSrc, disabled: isDisabled, as: htmlTag, hasChildren: children }, props),
|
|
162
163
|
hasLoader && (React.createElement(LoaderSection, null,
|
|
163
164
|
React.createElement(Loader, { color: "currentColor" }))),
|
|
164
165
|
icon && iconPosition === 'left' && buttonIcon,
|
|
165
|
-
logoSrc && (React.createElement(LogoImage
|
|
166
|
+
logoSrc && (React.createElement(LogoImage
|
|
167
|
+
// Assumes image is only referencing information written within the button.
|
|
168
|
+
, {
|
|
169
|
+
// Assumes image is only referencing information written within the button.
|
|
170
|
+
alt: "", hasSpacing: children, src: logoSrc, size: size,
|
|
171
|
+
// Assumes all images are 1:1 aspectRatio
|
|
172
|
+
height: sizesStyles[size].height, width: sizesStyles[size].height, hasLoader: hasLoader })),
|
|
166
173
|
React.createElement(ChildrenSection, { hasLoader: hasLoader }, children),
|
|
167
174
|
icon && iconPosition === 'right' && buttonIcon));
|
|
168
175
|
};
|