import React from "react";
import { storiesOf } from "@storybook/react";
import { action } from "@storybook/addon-actions";
import { withKnobs, text, boolean as _boolean } from "@storybook/addon-knobs";
import Tile from "./index";
import Col from "../Layout/Col";
import Row from "../Layout/Row";
import Container from "../Layout/Container";
import Dropdown from "../Dropdown";
var stories = storiesOf("Tile", module);
var dropdownItems = [React.createElement(Dropdown.ListItem, {
  key: 0,
  role: "separator"
}, "Percentage Rollout"), React.createElement(Dropdown.ListItem, {
  key: 1
}, React.createElement(Dropdown.BlockLink, {
  onClick: action("onClick move to top"),
  testSection: "dropdown-block-link-move"
}, React.createElement(Dropdown.BlockLinkText, {
  text: "Move to top"
}))), React.createElement(Dropdown.ListItem, {
  key: 2,
  removeBorderTop: true
}, React.createElement(Dropdown.BlockLink, {
  onClick: action("onClick duplicate"),
  testSection: "dropdown-block-link-duplicate"
}, React.createElement(Dropdown.BlockLinkText, {
  text: "Duplicate"
}))), React.createElement(Dropdown.ListItem, {
  key: 3,
  removeBorderTop: true
}, React.createElement(Dropdown.BlockLink, {
  onClick: action("onClick archive"),
  testSection: "dropdown-block-link-archive"
}, React.createElement(Dropdown.BlockLinkText, {
  text: "Archive"
}))), React.createElement(Dropdown.ListItem, {
  key: 4
}, React.createElement(Dropdown.BlockLink, {
  onClick: action("onClick delete"),
  testSection: "dropdown-block-link-delete"
}, React.createElement(Dropdown.BlockLinkText, {
  text: "Delete...",
  isDestructive: true
})))];
stories.addDecorator(withKnobs).addDecorator(function (story) {
  return React.createElement("div", {
    id: "root-preview"
  }, story());
});
stories.add("Interactive (content is a Button)", function () {
  return React.createElement(Container, null, React.createElement(Row, null, React.createElement(Col, {
    small: 6
  }, React.createElement(Tile, {
    name: "Alpha",
    description: "ID: 123456",
    onTileClick: action("onTileClick - Alpha"),
    isSelected: _boolean("isSelected", false),
    isDraggable: _boolean("isDraggable", false),
    hasWarning: _boolean("hasWarning", false),
    warningTitle: text("warningText", "This is a warning"),
    warningContent: React.createElement("p", null, "Warning details")
  })), React.createElement(Col, {
    small: 6
  }, React.createElement(Tile, {
    name: "Beta: We are buttons",
    description: "You can click us!",
    onTileClick: action("onTileClick - Beta"),
    isSelected: _boolean("isSelected", false),
    isDraggable: _boolean("isDraggable", false),
    hasWarning: _boolean("hasWarning", false),
    warningTitle: text("warningText", "This is a warning"),
    warningContent: React.createElement("p", null, "Warning details")
  }))));
}).add("Static (content is not a Button)", function () {
  return React.createElement(Tile, {
    name: "Alpha: I am not a button",
    description: "Clicking me will do nothing",
    isSelected: _boolean("isSelected", false),
    isDraggable: _boolean("isDraggable", false),
    hasWarning: _boolean("hasWarning", false),
    warningTitle: text("warningText", "This is a warning"),
    warningContent: React.createElement("p", null, "Warning details")
  });
}).add("With Monospace Name", function () {
  return React.createElement(Tile, {
    name: "amount",
    description: "double",
    usesMonospaceName: _boolean("usesMonospaceName", true),
    onTileClick: action("onTileClick"),
    isSelected: _boolean("isSelected", false),
    isDraggable: _boolean("isDraggable", false),
    hasWarning: _boolean("hasWarning", false),
    warningTitle: text("warningText", "This is a warning"),
    warningContent: React.createElement("p", null, "Warning details"),
    onCopy: action("onCopy called")
  });
}).add("Draggable, with a warning", function () {
  return React.createElement(Tile, {
    name: "Alpha",
    description: "ID:12345678",
    onTileClick: action("onTileClick"),
    isSelected: _boolean("isSelected", false),
    isDraggable: _boolean("isDraggable", true),
    hasWarning: _boolean("hasWarning", true),
    warningTitle: text("warningText", "This is a warning"),
    warningContent: React.createElement("p", null, "Warning details"),
    testSection: "with-warning"
  });
}).add("With Action Items on the right", function () {
  return React.createElement(Container, null, React.createElement(Row, null, React.createElement(Col, {
    small: 6
  }, React.createElement(Tile, {
    name: "Alpha",
    testSection: "alpha-tile",
    description: "ID:12345678",
    onTileClick: action("onTileClick"),
    isSelected: _boolean("isSelected", false),
    isDraggable: _boolean("isDraggable", false),
    hasWarning: _boolean("hasWarning", false),
    warningTitle: text("warningText", "This is a warning"),
    warningContent: React.createElement("p", null, "Warning details"),
    onDismiss: action("onDismiss called")
  }))), React.createElement(Row, null, React.createElement(Col, {
    small: 6
  }, React.createElement(Tile, {
    name: "Beta",
    testSection: "beta-tile",
    description: "isSelected is true here",
    onTileClick: action("onTileClick"),
    isSelected: true,
    isDraggable: _boolean("isDraggable", false),
    hasWarning: _boolean("hasWarning", false),
    warningTitle: text("warningText", "This is a warning"),
    warningContent: React.createElement("p", null, "Warning details"),
    status: "Archived",
    onDismiss: action("onDismiss called")
  }))), React.createElement(Row, null, React.createElement(Col, {
    small: 6
  }, React.createElement(Tile, {
    name: "Charlie",
    testSection: "charlie-tile",
    description: "ID:1357",
    onTileClick: action("onTileClick"),
    isSelected: _boolean("isSelected", false),
    isDraggable: _boolean("isDraggable", false),
    hasWarning: _boolean("hasWarning", false),
    warningTitle: text("warningText", "This is a warning"),
    warningContent: React.createElement("p", null, "Warning details"),
    onDismiss: action("onDismiss called"),
    onEdit: action("onEdit called")
  }))), React.createElement(Row, null, React.createElement(Col, {
    small: 6
  }, React.createElement(Tile, {
    name: "Delta",
    testSection: "delta-tile",
    description: "ID:2468",
    onTileClick: action("onTileClick"),
    isSelected: _boolean("isSelected", false),
    isDraggable: _boolean("isDraggable", false),
    hasWarning: _boolean("hasWarning", false),
    warningTitle: text("warningText", "This is a warning"),
    warningContent: React.createElement("p", null, "Warning details"),
    status: "Running",
    dropdownItems: dropdownItems
  }))), React.createElement(Row, null, React.createElement(Col, {
    small: 6
  }, React.createElement(Tile, {
    name: "Echo",
    testSection: "echo-tile",
    description: "Increase in unique conversions per visitor for Recurring deposit complete event",
    onTileClick: action("onTileClick"),
    isSelected: _boolean("isSelected", false),
    isDraggable: _boolean("isDraggable", false),
    hasWarning: _boolean("hasWarning", false),
    warningTitle: text("warningText", "This is a warning"),
    warningContent: React.createElement("p", null, "Warning details"),
    onCopy: action("onCopy called"),
    dropdownItems: dropdownItems
  }))), React.createElement(Row, null, React.createElement(Col, {
    small: 6
  }, React.createElement(Tile, {
    name: "Foxtrot",
    testSection: "foxtrot-tile",
    description: "All possibilities, as an example. Don't actually do this, please",
    onTileClick: action("onTileClick"),
    isSelected: _boolean("isSelected", false),
    isDraggable: _boolean("isDraggable", true),
    hasWarning: _boolean("hasWarning", false),
    warningTitle: text("warningText", "This is a warning"),
    warningContent: React.createElement("p", null, "Warning details"),
    status: "Active",
    onCopy: action("onCopy called"),
    onDismiss: action("onDismiss called"),
    onEdit: action("onEdit called"),
    dropdownItems: dropdownItems
  }))));
}).add("With Ordering", function () {
  return React.createElement(Container, null, React.createElement(Row, null, React.createElement(Col, {
    small: 6
  }, React.createElement(Tile, {
    name: "Alpha",
    testSection: "alpha-tile",
    description: "ID:12345678",
    order: 1,
    onTileClick: action("onTileClick"),
    isSelected: _boolean("isSelected", false),
    isDraggable: _boolean("isDraggable", true),
    hasWarning: _boolean("hasWarning", false),
    warningTitle: text("warningText", "This is a warning"),
    warningContent: React.createElement("p", null, "Warning details"),
    onDismiss: action("onDismiss called")
  }))), React.createElement(Row, null, React.createElement(Col, {
    small: 6
  }, React.createElement(Tile, {
    name: "Beta",
    testSection: "beta-tile",
    description: "isSelected is true here",
    order: 2,
    onTileClick: action("onTileClick"),
    isSelected: true,
    isDraggable: _boolean("isDraggable", true),
    hasWarning: _boolean("hasWarning", false),
    warningTitle: text("warningText", "This is a warning"),
    warningContent: React.createElement("p", null, "Warning details"),
    status: "Archived",
    onDismiss: action("onDismiss called")
  }))), React.createElement(Row, null, React.createElement(Col, {
    small: 6
  }, React.createElement(Tile, {
    name: "Charlie",
    testSection: "charlie-tile",
    description: "ID:1357",
    order: 3,
    onTileClick: action("onTileClick"),
    isSelected: _boolean("isSelected", false),
    isDraggable: _boolean("isDraggable", true),
    hasWarning: _boolean("hasWarning", false),
    warningTitle: text("warningText", "This is a warning"),
    warningContent: React.createElement("p", null, "Warning details"),
    onDismiss: action("onDismiss called"),
    onEdit: action("onEdit called")
  }))), React.createElement(Row, null, React.createElement(Col, {
    small: 6
  }, React.createElement(Tile, {
    name: "Delta",
    testSection: "delta-tile",
    description: "ID:2468",
    order: 4,
    onTileClick: action("onTileClick"),
    isSelected: _boolean("isSelected", false),
    isDraggable: _boolean("isDraggable", true),
    hasWarning: _boolean("hasWarning", false),
    warningTitle: text("warningText", "This is a warning"),
    warningContent: React.createElement("p", null, "Warning details"),
    status: "Running",
    dropdownItems: dropdownItems
  }))), React.createElement(Row, null, React.createElement(Col, {
    small: 6
  }, React.createElement(Tile, {
    name: "Zeta",
    testSection: "zeta-tile",
    description: "Increase in unique conversions per visitor for Recurring deposit complete event",
    order: 99,
    onTileClick: action("onTileClick"),
    isSelected: _boolean("isSelected", false),
    isDraggable: _boolean("isDraggable", true),
    hasWarning: _boolean("hasWarning", false),
    warningTitle: text("warningText", "This is a warning"),
    warningContent: React.createElement("p", null, "Warning details"),
    onCopy: action("onCopy called"),
    dropdownItems: dropdownItems
  }))));
});