"use strict";

function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = exports.WithValueControlledBehavior = exports.WithSelectedInitially = exports.WithFourFilterChips = exports.WithDisabled = exports.SustainabilityVariant = exports.OnlyLabel = exports.OnlyIcon = exports.EmojiVariant = exports.BrandVariant = exports.BothIconAndLabel = exports.AnotherIconAndLabel = void 0;
var _react = _interopRequireWildcard(require("react"));
var _addonActions = require("@storybook/addon-actions");
var _ = require("../..");
var _FilterChip = require("./FilterChip");
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
var meta = {
  component: _FilterChip.FilterChip,
  title: 'Molecules / FilterChip'
};
var _default = exports.default = meta;
var onChange = (0, _addonActions.action)('on change triggered');
var Template = function Template(args) {
  return _react.default.createElement("div", {
    style: {
      padding: '10px',
      backgroundColor: 'white'
    }
  }, _react.default.createElement(_FilterChip.FilterChip, args));
};
var OnlyLabel = exports.OnlyLabel = {
  render: Template,
  args: {
    label: 'Default'
  }
};
var OnlyIcon = exports.OnlyIcon = {
  render: Template,
  args: {
    icon: _react.default.createElement(_.Icon.Money16, null)
  }
};
var BothIconAndLabel = exports.BothIconAndLabel = {
  render: Template,
  args: {
    icon: _react.default.createElement(_.Icon.MonthlySavings16, null),
    label: 'Default'
  }
};
var AnotherIconAndLabel = exports.AnotherIconAndLabel = {
  render: Template,
  args: {
    icon: _react.default.createElement(_.Icon.Money16, null),
    label: 'Another label yqPomå'
  }
};
var WithSelectedInitially = exports.WithSelectedInitially = {
  render: Template,
  args: {
    icon: _react.default.createElement(_.Icon.Money16, null),
    selectedInitially: true
  }
};
var WithDisabled = exports.WithDisabled = {
  render: Template,
  args: {
    icon: _react.default.createElement(_.Icon.Money16, null),
    label: 'disabled',
    disabled: true
  }
};
var SustainabilityVariant = exports.SustainabilityVariant = function SustainabilityVariant() {
  return _react.default.createElement(_.Card, null, _react.default.createElement(_.Box, {
    p: 3
  }, _react.default.createElement(_FilterChip.FilterChip, {
    label: "Sustainable",
    value: "Sustainable",
    icon: _react.default.createElement(_.Icon.Sustainable16, null),
    variant: "sustainability"
  })));
};
var BrandVariant = exports.BrandVariant = function BrandVariant() {
  return _react.default.createElement(_.Card, null, _react.default.createElement(_.Box, {
    p: 3
  }, _react.default.createElement(_FilterChip.FilterChip, {
    label: "brand",
    value: "brand",
    icon: _react.default.createElement(_.Icon.Sustainable16, null),
    variant: "brand"
  })));
};
var EmojiVariant = exports.EmojiVariant = function EmojiVariant() {
  return _react.default.createElement(_.Card, null, _react.default.createElement(_.Box, {
    p: 3
  }, _react.default.createElement(_FilterChip.FilterChip, {
    label: "Title",
    value: "Title",
    icon: "\uD83C\uDF3B",
    variant: "brand"
  })));
};
var WithFourFilterChips = exports.WithFourFilterChips = function WithFourFilterChips() {
  return _react.default.createElement(_.Card, null, _react.default.createElement(_.Box, {
    p: 2
  }, _react.default.createElement(_.Flexbox, {
    container: true,
    gap: 1
  }, _react.default.createElement(_FilterChip.FilterChip, {
    icon: _react.default.createElement(_.Icon.MonthlySavings16, null),
    value: "1"
  }), ' ', _react.default.createElement(_FilterChip.FilterChip, {
    icon: _react.default.createElement(_.Icon.MonthlySavings16, null),
    label: "\xA0",
    value: "1"
  }), ' ', _react.default.createElement(_FilterChip.FilterChip, {
    icon: _react.default.createElement(_.Icon.MonthlySavings16, null),
    label: "label",
    value: "1"
  }), ' ', _react.default.createElement(_FilterChip.FilterChip, {
    label: "Label one next to icon one",
    value: "0"
  }))));
};
var WithValueControlledBehaviorExample = function WithValueControlledBehaviorExample() {
  var _useState = (0, _react.useState)(false),
    _useState2 = _slicedToArray(_useState, 2),
    isChecked = _useState2[0],
    setIsChecked = _useState2[1];
  return _react.default.createElement(_.Card, null, _react.default.createElement(_FilterChip.FilterChip, {
    label: "Controlled selection card",
    value: "This component is controlled",
    selected: isChecked,
    onChange: onChange
  }), _react.default.createElement("button", {
    type: "button",
    onClick: function onClick() {
      return setIsChecked(true);
    }
  }, "Selected"), _react.default.createElement("button", {
    type: "button",
    onClick: function onClick() {
      return setIsChecked(false);
    }
  }, "Not selected"), "value: ", isChecked.toString());
};
var WithValueControlledBehavior = exports.WithValueControlledBehavior = {
  render: function render() {
    return _react.default.createElement(WithValueControlledBehaviorExample, null);
  }
};