"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
Object.defineProperty(exports, "SegmentedControlItem", {
  enumerable: true,
  get: function get() {
    return _segmentedControlItem.SegmentedControlItem;
  }
});
exports.SegmentedControl = void 0;

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

var _segmentedControl = require("./segmented-control.proptypes");

var _box = require("../../../primitives/box");

var _segmentedControlItem = require("./segmented-control-item");

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }

var SegmentedControl = function SegmentedControl(_ref) {
  var value = _ref.value,
      onChange = _ref.onChange,
      children = _ref.children;
  var segmentedControlContextValues = {
    selectedValue: value,
    onItemClick: onChange
  };
  return _react["default"].createElement(_segmentedControl.SegmentedControlContext.Provider, {
    value: segmentedControlContextValues
  }, _react["default"].createElement(_box.Box, {
    stacked: "row"
  }, children));
};

exports.SegmentedControl = SegmentedControl;
SegmentedControl.displayName = 'SegmentedControl';