@uxf/ui 1.0.0-beta.43 → 1.0.0-beta.44
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/button/button.d.ts +2 -2
- package/button/button.js +5 -5
- package/package.json +1 -1
package/button/button.d.ts
CHANGED
|
@@ -5,10 +5,10 @@ export declare type ButtonVariant = keyof ButtonVariants;
|
|
|
5
5
|
export declare type ButtonSize = keyof ButtonSizes;
|
|
6
6
|
export declare type ButtonColor = keyof ButtonColors;
|
|
7
7
|
export interface ButtonProps extends AnchorHTMLAttributes<HTMLAnchorElement>, UseAnchorProps {
|
|
8
|
-
variant?: ButtonVariant;
|
|
9
8
|
color?: ButtonColor;
|
|
10
|
-
size?: ButtonSize;
|
|
11
9
|
isFullWidth?: boolean;
|
|
10
|
+
size?: ButtonSize;
|
|
11
|
+
variant?: ButtonVariant;
|
|
12
12
|
}
|
|
13
13
|
declare const _default: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLAnchorElement>>;
|
|
14
14
|
export default _default;
|
package/button/button.js
CHANGED
|
@@ -3,19 +3,19 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const classes_1 = require("@uxf/core/constants/classes");
|
|
7
6
|
const useAnchorProps_1 = require("@uxf/core/hooks/useAnchorProps");
|
|
8
7
|
const cx_1 = require("@uxf/core/utils/cx");
|
|
9
8
|
const react_1 = __importDefault(require("react"));
|
|
10
9
|
const forward_ref_1 = require("../utils/forward-ref");
|
|
11
10
|
function Button(props, ref) {
|
|
12
|
-
|
|
13
|
-
const
|
|
11
|
+
// eslint-disable-next-line react/destructuring-assignment
|
|
12
|
+
const { color, isFullWidth, size, variant, ...restProps } = props;
|
|
13
|
+
const className = (0, cx_1.cx)("uxf-button", `uxf-button--color-${color !== null && color !== void 0 ? color : "default"}`, `uxf-button--size-${size !== null && size !== void 0 ? size : "default"}`, `uxf-button--variant-${variant !== null && variant !== void 0 ? variant : "default"}`, isFullWidth && "uxf-button--full-width", props.className);
|
|
14
14
|
const anchorProps = (0, useAnchorProps_1.useAnchorProps)({
|
|
15
|
-
...
|
|
15
|
+
...restProps,
|
|
16
16
|
className,
|
|
17
17
|
});
|
|
18
|
-
return (react_1.default.createElement("a", { ref: ref, ...anchorProps
|
|
18
|
+
return (react_1.default.createElement("a", { ref: ref, ...anchorProps },
|
|
19
19
|
typeof props.children === "string" ? (react_1.default.createElement("span", { className: "uxf-button__text" }, props.children)) : (props.children),
|
|
20
20
|
react_1.default.createElement("div", { className: "loader" })));
|
|
21
21
|
}
|