var _excluded = ["label", "children"];
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(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
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