import * as React from 'react';
import { Callout, DirectionalHint, Dropdown, Toggle, Slider, mergeStyleSets, FontWeights, Link, Text, Stack, } from '@fluentui/react';
import { useBoolean, useId } from '@fluentui/react-hooks';
import { DefaultButton } from '@fluentui/react/lib/Button';
export var CalloutDirectionalExample = function () {
    var _a = useBoolean(false), isCalloutVisible = _a[0], toggleIsCalloutVisible = _a[1].toggle;
    var _b = useBoolean(true), isBeakVisible = _b[0], toggleIsBeakVisible = _b[1].toggle;
    var _c = React.useState(), gapSpace = _c[0], setGapSpace = _c[1];
    var _d = React.useState(), beakWidth = _d[0], setBeakWidth = _d[1];
    var _e = React.useState(DirectionalHint.bottomLeftEdge), directionalHint = _e[0], setDirectionalHint = _e[1];
    var buttonId = useId('callout-button');
    var labelId = useId('callout-label');
    var descriptionId = useId('callout-description');
    var onDirectionalChanged = function (event, option) {
        setDirectionalHint(option.key);
    };
    var onGapSliderChange = function (value) {
        setGapSpace(value);
    };
    var onBeakWidthSliderChange = function (value) {
        setBeakWidth(value);
    };
    var onShowBeakChange = function () {
        toggleIsBeakVisible();
        setBeakWidth(10);
    };
    return (React.createElement(React.Fragment, null,
        React.createElement(Stack, { tokens: { childrenGap: 10 }, className: styles.configArea },
            React.createElement(Toggle, { label: "Show beak", checked: isBeakVisible, onChange: onShowBeakChange }),
            React.createElement(Slider, { max: 30, label: "Gap space", min: 0, defaultValue: 0, onChange: onGapSliderChange }),
            isBeakVisible && (React.createElement(Slider, { max: 50, label: "Beak width", min: 10, defaultValue: 16, onChange: onBeakWidthSliderChange })),
            React.createElement(Dropdown, { label: "Directional hint", selectedKey: directionalHint, options: DIRECTION_OPTIONS, onChange: onDirectionalChanged })),
        React.createElement("div", { className: styles.buttonArea },
            React.createElement(DefaultButton, { id: buttonId, className: styles.button, onClick: toggleIsCalloutVisible, text: isCalloutVisible ? 'Hide callout' : 'Show callout' })),
        isCalloutVisible ? (React.createElement(Callout, { ariaLabelledBy: labelId, ariaDescribedBy: descriptionId, className: styles.callout, gapSpace: gapSpace, target: "#" + buttonId, isBeakVisible: isBeakVisible, beakWidth: beakWidth, onDismiss: toggleIsCalloutVisible, directionalHint: directionalHint, setInitialFocus: true },
            React.createElement(Text, { block: true, variant: "xLarge", className: styles.title, id: labelId }, "Callout title here"),
            React.createElement(Text, { block: true, variant: "small", id: descriptionId }, "Message body is optional. If help documentation is available, consider adding a link to learn more at the bottom."),
            React.createElement(Link, { href: "http://microsoft.com", target: "_blank", className: styles.link }, "Sample link"))) : null));
};
var DIRECTION_OPTIONS = [
    { key: DirectionalHint.topLeftEdge, text: 'Top left edge' },
    { key: DirectionalHint.topCenter, text: 'Top center' },
    { key: DirectionalHint.topRightEdge, text: 'Top right edge' },
    { key: DirectionalHint.topAutoEdge, text: 'Top auto edge' },
    { key: DirectionalHint.bottomLeftEdge, text: 'Bottom left edge' },
    { key: DirectionalHint.bottomCenter, text: 'Bottom center' },
    { key: DirectionalHint.bottomRightEdge, text: 'Bottom right edge' },
    { key: DirectionalHint.bottomAutoEdge, text: 'Bottom auto edge' },
    { key: DirectionalHint.leftTopEdge, text: 'Left top edge' },
    { key: DirectionalHint.leftCenter, text: 'Left center' },
    { key: DirectionalHint.leftBottomEdge, text: 'Left bottom edge' },
    { key: DirectionalHint.rightTopEdge, text: 'Right top edge' },
    { key: DirectionalHint.rightCenter, text: 'Right center' },
    { key: DirectionalHint.rightBottomEdge, text: 'Right bottom edge' },
];
var styles = mergeStyleSets({
    buttonArea: {
        verticalAlign: 'top',
        display: 'inline-block',
        textAlign: 'center',
        margin: '0 100px',
        minWidth: 130,
        height: 32,
    },
    configArea: {
        width: 300,
        display: 'inline-block',
    },
    button: {
        width: 130,
    },
    callout: {
        width: 320,
        padding: '20px 24px',
    },
    title: {
        marginBottom: 12,
        fontWeight: FontWeights.semilight,
    },
    link: {
        display: 'block',
        marginTop: 20,
    },
});
//# sourceMappingURL=Callout.Directional.Example.js.map