UNPKG

@pdftron/webviewer-react-toolkit

Version:

A React component library for integrating with PDFTron WebViewer API.

15 lines (14 loc) 1.06 kB
import { __assign, __rest } from "tslib"; import classnames from 'classnames'; import React, { forwardRef } from 'react'; import { useAccessibleFocus } from '../../hooks'; export var Button = forwardRef(function (_a, ref) { var _b = _a.buttonStyle, buttonStyle = _b === void 0 ? 'default' : _b, _c = _a.buttonSize, buttonSize = _c === void 0 ? 'default' : _c, _d = _a.type, type = _d === void 0 ? 'button' : _d, className = _a.className, children = _a.children, buttonProps = __rest(_a, ["buttonStyle", "buttonSize", "type", "className", "children"]); var isUserTabbing = useAccessibleFocus(); var buttonClass = classnames('ui__base ui__button', "ui__button--style-" + buttonStyle, "ui__button--size-" + buttonSize, { 'ui__button--disabled': buttonProps.disabled, 'ui__button--tabbing': isUserTabbing, }, className); return (React.createElement("button", __assign({}, buttonProps, { className: buttonClass, type: type, ref: ref }), React.createElement("div", { className: "ui__button__internal" }, children))); });