UNPKG

@awsui/components-react

Version:

On July 19th, 2022, we launched [Cloudscape Design System](https://cloudscape.design). Cloudscape is an evolution of AWS-UI. It consists of user interface guidelines, front-end components, design resources, and development tools for building intuitive, en

22 lines 1.95 kB
import { __rest } from "tslib"; // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 import React from 'react'; import { getBaseProps } from '../internal/base-component'; import useBaseComponent from '../internal/hooks/use-base-component'; import { applyDisplayName } from '../internal/utils/apply-display-name'; import { InternalToggleButton } from './internal'; const ToggleButton = React.forwardRef((_a, ref) => { var { children, iconName, pressedIconName, iconUrl, pressedIconUrl, iconSvg, pressedIconSvg, variant = 'normal', loading = false, loadingText, disabled = false, disabledReason, wrapText = true, ariaLabel, ariaDescribedby, ariaControls, pressed = false, onChange } = _a, props = __rest(_a, ["children", "iconName", "pressedIconName", "iconUrl", "pressedIconUrl", "iconSvg", "pressedIconSvg", "variant", "loading", "loadingText", "disabled", "disabledReason", "wrapText", "ariaLabel", "ariaDescribedby", "ariaControls", "pressed", "onChange"]); const baseComponentProps = useBaseComponent('ToggleButton', { props: { iconName, pressedIconName, pressed, variant, wrapText }, metadata: { hasDisabledReason: Boolean(disabledReason), }, }); const baseProps = getBaseProps(props); return (React.createElement(InternalToggleButton, Object.assign({}, baseProps, baseComponentProps, { ref: ref, iconName: iconName, iconUrl: iconUrl, iconSvg: iconSvg, variant: variant, loading: loading, loadingText: loadingText, disabled: disabled, disabledReason: disabledReason, wrapText: wrapText, ariaLabel: ariaLabel, ariaDescribedby: ariaDescribedby, ariaControls: ariaControls, pressedIconName: pressedIconName, pressedIconUrl: pressedIconUrl, pressedIconSvg: pressedIconSvg, pressed: pressed, onChange: onChange }), children)); }); applyDisplayName(ToggleButton, 'ToggleButton'); export default ToggleButton; //# sourceMappingURL=index.js.map