define(["require", "exports", "react", "@fluentui/react", "@fluentui/react-hooks", "@fluentui/react/lib/Button"], function (require, exports, React, react_1, react_hooks_1, Button_1) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    exports.CalloutDirectionalExample = void 0;
    var CalloutDirectionalExample = function () {
        var _a = react_hooks_1.useBoolean(false), isCalloutVisible = _a[0], toggleIsCalloutVisible = _a[1].toggle;
        var _b = react_hooks_1.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(react_1.DirectionalHint.bottomLeftEdge), directionalHint = _e[0], setDirectionalHint = _e[1];
        var buttonId = react_hooks_1.useId('callout-button');
        var labelId = react_hooks_1.useId('callout-label');
        var descriptionId = react_hooks_1.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(react_1.Stack, { tokens: { childrenGap: 10 }, className: styles.configArea },
                React.createElement(react_1.Toggle, { label: "Show beak", checked: isBeakVisible, onChange: onShowBeakChange }),
                React.createElement(react_1.Slider, { max: 30, label: "Gap space", min: 0, defaultValue: 0, onChange: onGapSliderChange }),
                isBeakVisible && (React.createElement(react_1.Slider, { max: 50, label: "Beak width", min: 10, defaultValue: 16, onChange: onBeakWidthSliderChange })),
                React.createElement(react_1.Dropdown, { label: "Directional hint", selectedKey: directionalHint, options: DIRECTION_OPTIONS, onChange: onDirectionalChanged })),
            React.createElement("div", { className: styles.buttonArea },
                React.createElement(Button_1.DefaultButton, { id: buttonId, className: styles.button, onClick: toggleIsCalloutVisible, text: isCalloutVisible ? 'Hide callout' : 'Show callout' })),
            isCalloutVisible ? (React.createElement(react_1.Callout, { ariaLabelledBy: labelId, ariaDescribedBy: descriptionId, className: styles.callout, gapSpace: gapSpace, target: "#" + buttonId, isBeakVisible: isBeakVisible, beakWidth: beakWidth, onDismiss: toggleIsCalloutVisible, directionalHint: directionalHint, setInitialFocus: true },
                React.createElement(react_1.Text, { block: true, variant: "xLarge", className: styles.title, id: labelId }, "Callout title here"),
                React.createElement(react_1.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(react_1.Link, { href: "http://microsoft.com", target: "_blank", className: styles.link }, "Sample link"))) : null));
    };
    exports.CalloutDirectionalExample = CalloutDirectionalExample;
    var DIRECTION_OPTIONS = [
        { key: react_1.DirectionalHint.topLeftEdge, text: 'Top left edge' },
        { key: react_1.DirectionalHint.topCenter, text: 'Top center' },
        { key: react_1.DirectionalHint.topRightEdge, text: 'Top right edge' },
        { key: react_1.DirectionalHint.topAutoEdge, text: 'Top auto edge' },
        { key: react_1.DirectionalHint.bottomLeftEdge, text: 'Bottom left edge' },
        { key: react_1.DirectionalHint.bottomCenter, text: 'Bottom center' },
        { key: react_1.DirectionalHint.bottomRightEdge, text: 'Bottom right edge' },
        { key: react_1.DirectionalHint.bottomAutoEdge, text: 'Bottom auto edge' },
        { key: react_1.DirectionalHint.leftTopEdge, text: 'Left top edge' },
        { key: react_1.DirectionalHint.leftCenter, text: 'Left center' },
        { key: react_1.DirectionalHint.leftBottomEdge, text: 'Left bottom edge' },
        { key: react_1.DirectionalHint.rightTopEdge, text: 'Right top edge' },
        { key: react_1.DirectionalHint.rightCenter, text: 'Right center' },
        { key: react_1.DirectionalHint.rightBottomEdge, text: 'Right bottom edge' },
    ];
    var styles = react_1.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: react_1.FontWeights.semilight,
        },
        link: {
            display: 'block',
            marginTop: 20,
        },
    });
});
//# sourceMappingURL=Callout.Directional.Example.js.map