UNPKG

@awsui/components-react

Version:

AWS UI is a collection of [React](https://reactjs.org/) components that help create intuitive, responsive, and accessible user experiences for web applications. It is developed by Amazon Web Services (AWS). This work is available under the terms of the [A

13 lines (12 loc) 1.41 kB
import { __assign, __rest } from "tslib"; import React from 'react'; import { getBaseProps } from '../internal/base-component'; import { InternalButton } from './internal'; import { useTelemetry } from '../internal/hooks/use-telemetry'; var Button = React.forwardRef(function (_a, ref) { var children = _a.children, iconName = _a.iconName, _b = _a.iconAlign, iconAlign = _b === void 0 ? 'left' : _b, iconUrl = _a.iconUrl, iconAlt = _a.iconAlt, _c = _a.variant, variant = _c === void 0 ? 'normal' : _c, _d = _a.loading, loading = _d === void 0 ? false : _d, _e = _a.disabled, disabled = _e === void 0 ? false : _e, _f = _a.wrapText, wrapText = _f === void 0 ? true : _f, href = _a.href, target = _a.target, formAction = _a.formAction, ariaLabel = _a.ariaLabel, onClick = _a.onClick, props = __rest(_a, ["children", "iconName", "iconAlign", "iconUrl", "iconAlt", "variant", "loading", "disabled", "wrapText", "href", "target", "formAction", "ariaLabel", "onClick"]); useTelemetry('Button'); var baseProps = getBaseProps(props); return (React.createElement(InternalButton, __assign({}, baseProps, { ref: ref, iconName: iconName, iconAlign: iconAlign, iconUrl: iconUrl, iconAlt: iconAlt, variant: variant, loading: loading, disabled: disabled, wrapText: wrapText, href: href, target: target, formAction: formAction, ariaLabel: ariaLabel, onClick: onClick }), children)); }); export default Button;