@blueprintjs/core
Version:
Core styles & components
25 lines • 1.23 kB
JavaScript
/*
* Copyright 2016 Palantir Technologies, Inc. All rights reserved.
*
* Licensed under the terms of the LICENSE file distributed with this project.
*/
// HACKHACK: these components should go in separate files
// tslint:disable max-classes-per-file
import * as React from "react";
import { DISPLAYNAME_PREFIX, removeNonHTMLProps } from "../../common/props";
import { AbstractButton } from "./abstractButton";
export class Button extends AbstractButton {
render() {
return (React.createElement("button", Object.assign({ type: "button" }, removeNonHTMLProps(this.props), this.getCommonButtonProps()), this.renderChildren()));
}
}
Button.displayName = `${DISPLAYNAME_PREFIX}.Button`;
export class AnchorButton extends AbstractButton {
render() {
const { href, tabIndex = 0 } = this.props;
const commonProps = this.getCommonButtonProps();
return (React.createElement("a", Object.assign({ role: "button" }, removeNonHTMLProps(this.props), commonProps, { href: commonProps.disabled ? undefined : href, tabIndex: commonProps.disabled ? -1 : tabIndex }), this.renderChildren()));
}
}
AnchorButton.displayName = `${DISPLAYNAME_PREFIX}.AnchorButton`;
//# sourceMappingURL=buttons.js.map