"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.withIcon = exports.fromStatusLabel = exports.fromLink = exports.fromInlineElements = exports.fromButton = exports.fromBadge = exports.default = exports.basic = void 0;

var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));

var _uiIcons = require("@teamleader/ui-icons");

var _react = _interopRequireDefault(require("react"));

var _utils = require("../../../.storybook/utils");

var _sizes = require("../../constants/sizes");

var _index = require("../../index");

var _Tooltip = require("./Tooltip");

var sizes = [_sizes.SMALL, _sizes.MEDIUM, _sizes.LARGE];
var colors = ['white', 'neutral', 'mint', 'violet', 'ruby', 'gold', 'aqua', 'inverse'];
var TooltippedButton = (0, _index.Tooltip)(_index.Button);
var TooltippedBadge = (0, _index.Tooltip)(_index.Badge);
var TooltippedLink = (0, _index.Tooltip)(_index.Link);
var TooltippedStatusLabel = (0, _index.Tooltip)(_index.StatusLabel);
var TooltippedStrong = (0, _index.Tooltip)('strong');

var textBodyTooltipContent = /*#__PURE__*/_react.default.createElement(_index.TextBody, null, "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.");

var textSmallTooltipContent = /*#__PURE__*/_react.default.createElement(_index.TextSmall, null, "I am small sized tooltip text with lorem ipsum text and so many more!");

var defaultTooltipProps = {
  tooltipColor: 'white',
  tooltipPosition: 'horizontal',
  tooltipSize: 'medium',
  tooltipActive: null
};
var tooltipArgTypes = {
  tooltipColor: {
    control: 'select',
    options: colors
  },
  tooltipPosition: {
    control: 'select',
    options: _Tooltip.POSITIONS
  },
  tooltipSize: {
    control: 'select',
    options: sizes
  },
  tooltipActive: {
    control: 'select',
    options: [null, true, false]
  }
};
var _default = {
  component: _index.Tooltip,
  title: (0, _utils.addStoryInGroup)(_utils.LOW_LEVEL_BLOCKS, 'Tooltip'),
  parameters: {
    info: {
      propTablesExclude: [_index.TextSmall, _index.TextDisplay, _index.TextBody]
    }
  }
};
exports.default = _default;

var basic = function basic(args) {
  return /*#__PURE__*/_react.default.createElement(TooltippedButton, (0, _extends2.default)({}, args, {
    tooltip: textBodyTooltipContent
  }), "Hover me to see a tooltip");
};

exports.basic = basic;
basic.args = defaultTooltipProps;
basic.argTypes = tooltipArgTypes;

var withIcon = function withIcon(args) {
  return /*#__PURE__*/_react.default.createElement(_index.TextDisplay, null, /*#__PURE__*/_react.default.createElement(TooltippedStrong, (0, _extends2.default)({}, args, {
    tooltip: textSmallTooltipContent,
    tooltipIcon: /*#__PURE__*/_react.default.createElement(_uiIcons.IconHelpBadgedMediumOutline, null)
  }), "Hover me"));
};

exports.withIcon = withIcon;
withIcon.args = defaultTooltipProps;
withIcon.argTypes = tooltipArgTypes;

var fromBadge = function fromBadge(args) {
  return /*#__PURE__*/_react.default.createElement(_index.TextDisplay, null, "I'm display text with a", ' ', /*#__PURE__*/_react.default.createElement(TooltippedBadge, (0, _extends2.default)({}, args, {
    tooltip: textSmallTooltipContent
  }), "Hover me"), ' ', "tooltip action");
};

exports.fromBadge = fromBadge;
fromBadge.args = defaultTooltipProps;
fromBadge.argTypes = tooltipArgTypes;

var fromButton = function fromButton(args) {
  return /*#__PURE__*/_react.default.createElement(TooltippedButton, (0, _extends2.default)({}, args, {
    tooltip: textBodyTooltipContent
  }), "Hover me");
};

exports.fromButton = fromButton;
fromButton.args = defaultTooltipProps;
fromButton.argTypes = tooltipArgTypes;

var fromLink = function fromLink(args) {
  return /*#__PURE__*/_react.default.createElement(TooltippedLink, (0, _extends2.default)({}, args, {
    tooltip: textBodyTooltipContent,
    href: "#",
    inherit: false
  }), "Hover me");
};

exports.fromLink = fromLink;
fromLink.args = defaultTooltipProps;
fromLink.argTypes = tooltipArgTypes;

var fromStatusLabel = function fromStatusLabel(args) {
  return /*#__PURE__*/_react.default.createElement(TooltippedStatusLabel, (0, _extends2.default)({}, args, {
    tooltip: textSmallTooltipContent
  }), "Hover me");
};

exports.fromStatusLabel = fromStatusLabel;
fromStatusLabel.storyName = 'From StatusLabel';
fromStatusLabel.args = defaultTooltipProps;
fromStatusLabel.argTypes = tooltipArgTypes;

var fromInlineElements = function fromInlineElements(args) {
  return /*#__PURE__*/_react.default.createElement(_index.TextBody, null, "I'm body text with a", ' ', /*#__PURE__*/_react.default.createElement(TooltippedStrong, (0, _extends2.default)({}, args, {
    tooltip: textBodyTooltipContent
  }), "Hover me"), ' ', "tooltip action");
};

exports.fromInlineElements = fromInlineElements;
fromInlineElements.storyName = 'From inline elements';
fromInlineElements.args = defaultTooltipProps;
fromInlineElements.argTypes = tooltipArgTypes;