import './demo1.css';
import Overlay from '..';
import React from 'react';
import ReactDOM from 'react-dom';
import { Button } from '../..';
class Demo extends React.Component {
    constructor() {
        super(...arguments);
        this.state = {
            visible: false,
        };
        this.onClick = () => {
            this.setState({
                visible: !this.state.visible,
            });
        };
        this.onClose = () => {
            this.setState({
                visible: false,
            });
        };
    }
    render() {
        return (React.createElement("div", null,
            React.createElement(Button, { onClick: this.onClick, ref: ref => {
                    this.btn = ref;
                } }, "Toggle visible"),
            React.createElement(Overlay, { visible: this.state.visible, target: () => this.btn, safeNode: () => this.btn, onRequestClose: this.onClose },
                React.createElement("span", { className: "overlay-demo" }, "Hello World From Overlay!"))));
    }
}
ReactDOM.render(React.createElement(Demo, null), document.getElementById('overlay-demo-1'));
