"use strict";

require("core-js/modules/es.object.define-property.js");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = exports.Basic = void 0;
require("core-js/modules/es.date.to-string.js");
var _react = require("react");
var _ = require(".");
var _button = require("../button");
var _uuid = require("uuid");
var _type = require("../icon/type");
var _jsxRuntime = require("react/jsx-runtime");
var meta = {
  title: 'Components/Toast',
  tags: ['autodocs'],
  argTypes: {
    size: {
      type: 'string',
      defaultValue: 'small'
    },
    content: {
      type: 'string',
      defaultValue: 'This is a toast message'
    },
    closable: {
      type: 'boolean',
      defaultValue: false
    },
    icon: {
      type: 'boolean',
      defaultValue: false
    },
    action: {
      type: 'boolean',
      defaultValue: false
    }
  },
  args: {
    size: 'small',
    content: 'This is a toast message',
    closable: false
  }
};
var Basic = exports.Basic = {
  render: function render(_ref) {
    var closable = _ref.closable,
      icon = _ref.icon,
      action = _ref.action,
      size = _ref.size,
      content = _ref.content;
    (0, _react.useEffect)(function () {
      document.body.classList.add(_.TOAST_ROOT_CLASS_NAME);
    }, []);
    return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
      style: {
        display: 'flex',
        flexDirection: 'column',
        gap: '20px',
        width: '100%',
        height: '100%'
      },
      children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
        children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_button.FcrButton, {
          onClick: function onClick() {
            _.FcrToastApi.open({
              id: (0, _uuid.v4)(),
              toastProps: {
                type: 'info',
                content: "test ".concat(new Date().getTime())
              }
            });
          },
          children: "show toast"
        }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_button.FcrButton, {
          onClick: function onClick() {
            _.FcrToastApi.open({
              id: (0, _uuid.v4)(),
              persist: true,
              duration: 15000,
              toastProps: {
                type: 'warn',
                content: "test ".concat(new Date().getTime()),
                closable: true
              }
            });
          },
          children: "show presist toast"
        })]
      }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_.FcrToast, {
        size: size,
        icon: icon ? _type.FcrIconType.FCR_HOST : undefined,
        action: action ? {
          onClick: function onClick() {},
          text: 'Learn more'
        } : undefined,
        type: "error",
        closable: closable,
        content: content
      }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_.FcrToast, {
        size: size,
        action: action ? {
          onClick: function onClick() {},
          text: 'Learn more'
        } : undefined,
        icon: icon ? _type.FcrIconType.FCR_HOST : undefined,
        closable: closable,
        type: "info",
        content: content
      }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_.FcrToast, {
        size: size,
        action: action ? {
          onClick: function onClick() {},
          text: 'Learn more'
        } : undefined,
        icon: icon ? _type.FcrIconType.FCR_HOST : undefined,
        closable: closable,
        type: "normal",
        content: content
      }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_.FcrToast, {
        size: size,
        action: action ? {
          onClick: function onClick() {},
          text: 'Learn more'
        } : undefined,
        icon: icon ? _type.FcrIconType.FCR_QUESTION : undefined,
        closable: closable,
        type: "warn",
        content: content
      })]
    });
  }
};
var _default = exports["default"] = meta;