var _excluded = ["label", "children"];
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _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(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
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(r) { if (Array.isArray(r)) return r; }
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
import React from 'react';
import { Box } from '../Box/Box';
import { Dropdown } from '../Dropdown/Dropdown';
import { DropdownFlyout } from '../DropdownFlyout/DropdownFlyout';
import { MultiSelect } from '../MultiSelect/MultiSelect';
import { PillSelect } from '../PillSelect/PillSelect';
import { Search } from '../Search/Search';
import { Select } from '../Select/Select';
import { SuperSelect } from '../SuperSelect/SuperSelect';
import { TieredSelect } from '../TieredSelect/TieredSelect';
import { Typeahead } from '../Typeahead';
function Field(_ref) {
  var label = _ref.label,
    children = _ref.children,
    props = _objectWithoutProperties(_ref, _excluded);
  return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("b", null, /*#__PURE__*/React.createElement("label", null, label))), children);
}
var idLabelOptions = [{
  id: 1,
  label: 'One'
}, {
  id: 2,
  label: 'Two'
}, {
  id: 3,
  label: 'Three'
}];
export function EscapefulFieldSet() {
  var _React$useState = React.useState(''),
    _React$useState2 = _slicedToArray(_React$useState, 2),
    typeaheadV = _React$useState2[0],
    setTyeahead = _React$useState2[1];
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("b", null, "Things with Esc key:"), /*#__PURE__*/React.createElement(Field, {
    label: "Search"
  }, /*#__PURE__*/React.createElement(Search, null)), /*#__PURE__*/React.createElement(Field, {
    label: "Typeahead"
  }, /*#__PURE__*/React.createElement(Typeahead, {
    value: typeaheadV,
    onChange: setTyeahead
  })), /*#__PURE__*/React.createElement(Field, {
    label: "Select"
  }, /*#__PURE__*/React.createElement(Box, {
    margin: "none xs none none",
    display: "inline-block"
  }, "Default"), /*#__PURE__*/React.createElement(Select, null, idLabelOptions.map(function (_ref2) {
    var id = _ref2.id,
      label = _ref2.label;
    return /*#__PURE__*/React.createElement(Select.Option, {
      value: id
    }, label);
  })), /*#__PURE__*/React.createElement(Box, {
    margin: "none xs none md",
    display: "inline-block"
  }, "Search"), /*#__PURE__*/React.createElement(Select, {
    onSearch: console.log
  }, idLabelOptions.map(function (_ref3) {
    var id = _ref3.id,
      label = _ref3.label;
    return /*#__PURE__*/React.createElement(Select.Option, {
      value: id
    }, label);
  }), ' ')), /*#__PURE__*/React.createElement(Field, {
    label: "PillSelect"
  }, /*#__PURE__*/React.createElement(Box, {
    margin: "none xs none none",
    display: "inline-block"
  }, "Default"), /*#__PURE__*/React.createElement(PillSelect, {
    options: idLabelOptions,
    onChange: console.log,
    value: null
  }), /*#__PURE__*/React.createElement(Box, {
    margin: "none xs none md",
    display: "inline-block"
  }, "Search"), /*#__PURE__*/React.createElement(PillSelect, {
    options: idLabelOptions,
    onChange: console.log,
    onSearch: console.log,
    value: null
  })), /*#__PURE__*/React.createElement(Field, {
    label: "MultiSelect"
  }, /*#__PURE__*/React.createElement(MultiSelect, {
    options: idLabelOptions
  })), /*#__PURE__*/React.createElement(Field, {
    label: "Dropdown"
  }, /*#__PURE__*/React.createElement(Box, {
    margin: "none xs none none",
    display: "inline-block"
  }, "Default"), /*#__PURE__*/React.createElement(Dropdown, null, idLabelOptions.map(function (_ref4) {
    var id = _ref4.id,
      label = _ref4.label;
    return /*#__PURE__*/React.createElement(Dropdown.Item, {
      item: id
    }, label);
  })), /*#__PURE__*/React.createElement(Box, {
    margin: "none xs none md",
    display: "inline-block"
  }, "Search"), /*#__PURE__*/React.createElement(Dropdown, {
    onSearch: console.log
  }, idLabelOptions.map(function (_ref5) {
    var id = _ref5.id,
      label = _ref5.label;
    return /*#__PURE__*/React.createElement(Dropdown.Item, {
      item: id
    }, label);
  })), /*#__PURE__*/React.createElement(Box, {
    margin: "none xs none md",
    display: "inline-block"
  }, "Restore"), /*#__PURE__*/React.createElement(Dropdown, {
    restoreFocusOnHide: true
  }, idLabelOptions.map(function (_ref6) {
    var id = _ref6.id,
      label = _ref6.label;
    return /*#__PURE__*/React.createElement(Dropdown.Item, {
      item: id
    }, label);
  })), /*#__PURE__*/React.createElement(Box, {
    margin: "none xs none md",
    display: "inline-block"
  }, "Restore w/ search"), /*#__PURE__*/React.createElement(Dropdown, {
    onSearch: console.log,
    restoreFocusOnHide: true
  }, idLabelOptions.map(function (_ref7) {
    var id = _ref7.id,
      label = _ref7.label;
    return /*#__PURE__*/React.createElement(Dropdown.Item, {
      item: id
    }, label);
  })), /*#__PURE__*/React.createElement(Box, {
    margin: "none xs none md",
    display: "inline-block"
  }, "DropdownFlyout"), /*#__PURE__*/React.createElement(DropdownFlyout, {
    style: {
      display: 'inline-block'
    },
    options: [{
      value: 1,
      label: 'wow'
    }, {
      value: 'Animals',
      label: 'Long complicated label that takes space',
      children: [{
        value: 'Amphibians',
        label: 'Amphibians',
        children: [{
          value: 1,
          label: 'Frogs'
        }, {
          value: 2,
          label: 'Salamanders'
        }]
      }, {
        value: 'Birds',
        label: 'Long complicated label that takes space',
        children: [{
          value: 3,
          label: 'Chickens'
        }, {
          value: 4,
          label: 'Falcons'
        }, {
          value: 5,
          label: 'Owls'
        }, {
          value: 6,
          label: 'Parrots'
        }]
      }]
    }]
  })), /*#__PURE__*/React.createElement(Field, {
    label: "Tiered"
  }, /*#__PURE__*/React.createElement(TieredSelect, {
    options: [{
      id: 1,
      groupId: null,
      nextGroupId: 10,
      label: 'Apple Farm',
      disabled: true
    }, {
      id: 17,
      groupId: 10,
      nextGroupId: 100,
      label: 'Granny Smith'
    }, {
      id: 2,
      groupId: null,
      nextGroupId: 20,
      label: "Tim's Trees"
    }]
  })), /*#__PURE__*/React.createElement(Field, {
    label: "Tiered leaf only"
  }, /*#__PURE__*/React.createElement(TieredSelect, {
    selectableTiers: false,
    options: [{
      id: 1,
      groupId: null,
      nextGroupId: 10,
      label: 'Apple Farm',
      disabled: true
    }, {
      id: 17,
      groupId: 10,
      nextGroupId: 100,
      label: 'Granny Smith'
    }, {
      id: 2,
      groupId: null,
      nextGroupId: 20,
      label: "Tim's Trees"
    }]
  })), /*#__PURE__*/React.createElement(Field, {
    label: "SuperSelect"
  }, /*#__PURE__*/React.createElement(SuperSelect, {
    onChange: console.log,
    options: [{
      value: '1',
      label: 'some label one'
    }, {
      value: '2',
      label: 'two 2'
    }, {
      value: '3',
      label: 'three three three'
    }],
    emptyMessage: "E m p t y"
  })));
}
//# sourceMappingURL=storyHelpers.js.map