@conveyorhq/arrow-ds 1.166.0 → 1.167.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.
- package/package.json +1 -1
- package/public/components/Button/Button.d.ts +2 -1
- package/public/components/Button/Button.js +6 -2
- package/public/css/styles.css +2 -8
- package/public/css/styles.min.css +1 -1
- package/public/css/styles.min.css.map +1 -1
- package/src/components/Button/Button.stories.mdx +28 -0
- package/src/components/Button/Button.tsx +25 -9
- package/src/components/Button/index.css +2 -9
package/package.json
CHANGED
|
@@ -42,6 +42,7 @@ var BUTTON_VARIANT;
|
|
|
42
42
|
BUTTON_VARIANT["UTILITY"] = "utility";
|
|
43
43
|
BUTTON_VARIANT["DANGER"] = "danger";
|
|
44
44
|
BUTTON_VARIANT["MINIMAL"] = "minimal";
|
|
45
|
+
BUTTON_VARIANT["PLAIN"] = "plain";
|
|
45
46
|
})(BUTTON_VARIANT || (exports.BUTTON_VARIANT = BUTTON_VARIANT = {}));
|
|
46
47
|
var BUTTON_SIZE;
|
|
47
48
|
(function (BUTTON_SIZE) {
|
|
@@ -74,7 +75,7 @@ const Button = (0, react_1.forwardRef)(({ as: Component = "button", children, cl
|
|
|
74
75
|
const themeContext = (0, react_1.useContext)(contexts_1.ThemeContext);
|
|
75
76
|
const theme = themeProp || themeContext;
|
|
76
77
|
const buttonClassNames = (0, classnames_1.default)((0, bem_1.bem)(cn), (0, bem_1.bem)(cn, { m: variant }), (0, bem_1.bem)(cn, { m: theme }), block && (0, bem_1.bem)(cn, { m: "block" }), getButtonSizeClasses(size, icon, children), depressed && (0, bem_1.bem)(cn, { m: "depressed" }), isDisabled && (0, bem_1.bem)(cn, { m: "disabled" }), className);
|
|
77
|
-
const iconClassNames = (0, classnames_1.default)((0, bem_1.bem)(cn, { e: "icon" }),
|
|
78
|
+
const iconClassNames = (0, classnames_1.default)((0, bem_1.bem)(cn, { e: "icon" }), isLoading && (0, bem_1.bem)(cn, { e: "icon", m: "invisible" }));
|
|
78
79
|
const iconProps = icon
|
|
79
80
|
? {
|
|
80
81
|
icon,
|
|
@@ -89,9 +90,12 @@ const Button = (0, react_1.forwardRef)(({ as: Component = "button", children, cl
|
|
|
89
90
|
type = "button";
|
|
90
91
|
}
|
|
91
92
|
const propsIfLink = Component === Link_1.Link ? { noStyles: true } : {};
|
|
93
|
+
if (variant === BUTTON_VARIANT.PLAIN) {
|
|
94
|
+
return (react_1.default.createElement(Component, { type: type, className: className, disabled: disabled, ref: ref, ...rest }, children));
|
|
95
|
+
}
|
|
92
96
|
return (react_1.default.createElement(Component, { type: type, className: buttonClassNames, disabled: isDisabled, ref: ref, ...propsIfLink, ...rest },
|
|
93
97
|
icon && iconProps && iconPosition === BUTTON_ICON_POSITION.LEFT && (react_1.default.createElement(Icon_1.Icon, { ...iconProps })),
|
|
94
|
-
react_1.default.createElement("span", { className: (0, classnames_1.default)((0, bem_1.bem)(cn, { e: "content" }), isLoading && (0, bem_1.bem)(cn, { e: "content", m: "invisible" })) }, children),
|
|
98
|
+
children && (react_1.default.createElement("span", { className: (0, classnames_1.default)((0, bem_1.bem)(cn, { e: "content" }), isLoading && (0, bem_1.bem)(cn, { e: "content", m: "invisible" })) }, children)),
|
|
95
99
|
icon && iconProps && iconPosition === BUTTON_ICON_POSITION.RIGHT && (react_1.default.createElement(Icon_1.Icon, { ...iconProps })),
|
|
96
100
|
isLoading && (react_1.default.createElement(Icon_1.Icon, { className: (0, bem_1.bem)(cn, { e: "loader" }), icon: Icon_1.ICON_TYPE.CIRCLE_NOTCH, spin: true }))));
|
|
97
101
|
});
|
package/public/css/styles.css
CHANGED
|
@@ -2069,19 +2069,13 @@ override built-in Image component classes */
|
|
|
2069
2069
|
display: inline-flex;
|
|
2070
2070
|
align-items: center;
|
|
2071
2071
|
justify-content: center;
|
|
2072
|
+
-webkit-column-gap: 8px;
|
|
2073
|
+
column-gap: 8px;
|
|
2072
2074
|
border-width: 1px;
|
|
2073
2075
|
font-weight: 500;
|
|
2074
2076
|
transition-duration: 200ms;
|
|
2075
2077
|
}
|
|
2076
2078
|
|
|
2077
|
-
.ads-Button-icon--left {
|
|
2078
|
-
margin-right: 8px;
|
|
2079
|
-
}
|
|
2080
|
-
|
|
2081
|
-
.ads-Button-icon--right {
|
|
2082
|
-
margin-left: 8px;
|
|
2083
|
-
}
|
|
2084
|
-
|
|
2085
2079
|
.ads-Button-icon--invisible {
|
|
2086
2080
|
visibility: hidden;
|
|
2087
2081
|
}
|