@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
21 lines • 1.73 kB
JavaScript
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
'use client';
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(({ children, iconName, pressedIconName, iconUrl, pressedIconUrl, iconSvg, pressedIconSvg, variant = 'normal', loading = false, loadingText, disabled = false, disabledReason, wrapText = true, ariaLabel, ariaDescribedby, ariaControls, pressed = false, nativeButtonAttributes, onChange, ...props }, ref) => {
const baseComponentProps = useBaseComponent('ToggleButton', {
props: { iconName, pressedIconName, pressed, variant, wrapText },
metadata: {
hasDisabledReason: Boolean(disabledReason),
},
});
const baseProps = getBaseProps(props);
return (React.createElement(InternalToggleButton, { ...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, nativeButtonAttributes: nativeButtonAttributes, onChange: onChange }, children));
});
applyDisplayName(ToggleButton, 'ToggleButton');
export default ToggleButton;
//# sourceMappingURL=internal-do-not-use-core.js.map