text: "use strict";
  
  Object.defineProperty(exports, "__esModule", {
    value: true
  });
  exports.default = void 0;
  
  var _color = _interopRequireDefault(require("color"));
  
  var React = _interopRequireWildcard(require("react"));
  
  var _reactNative = require("react-native");
  
  var _Text = _interopRequireDefault(require("../Typography/Text"));
  
  var _Divider = _interopRequireDefault(require("../Divider"));
  
  var _theming = require("../../core/theming");
  
  function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
  
  function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
  
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  
  function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
  
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
  
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
  
  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; }
  
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
  
  /**
   * A component to group content inside a navigation drawer.
   *
   * <div class="screenshots">
   *   <figure>
   *     <img class="medium" src="screenshots/drawer-section.png" />
   *   </figure>
   * </div>
   *
   * ## Usage
   * ```js
   * import * as React from 'react';
   * import { Drawer } from 'react-native-paper';
   *
   * const MyComponent = () => {
   *   const [active, setActive] = React.useState('');
   *
   *
   *   return (
   *     <Drawer.Section title="Some title">
   *       <Drawer.Item
   *         label="First Item"
   *         active={active === 'first'}
   *         onPress={() => setActive('first')}
   *       />
   *       <Drawer.Item
   *         label="Second Item"
   *         active={active === 'second'}
   *         onPress={() => setActive('second')}
   *       />
   *     </Drawer.Section>
   *   );
   * };
   *
   * export default MyComponent;
   * ```
   */
  class DrawerSection extends React.Component {
    render() {
      const _this$props = this.props,
            {
        children,
        title,
        theme,
        style
      } = _this$props,
            rest = _objectWithoutProperties(_this$props, ["children", "title", "theme", "style"]);
  
      const {
        colors,
        fonts
      } = theme;
      const titleColor = (0, _color.default)(colors.text).alpha(0.54).rgb().string();
      const font = fonts.medium;
      return /*#__PURE__*/React.createElement(_reactNative.View, _extends({
        style: [styles.container, style]
      }, rest), title && /*#__PURE__*/React.createElement(_reactNative.View, {
        style: styles.titleContainer
      }, /*#__PURE__*/React.createElement(_Text.default, {
        numberOfLines: 1,
        style: _objectSpread(_objectSpread({
          color: titleColor
        }, font), {}, {
          marginLeft: 16
        })
      }, title)), children, /*#__PURE__*/React.createElement(_Divider.default, {
        style: styles.divider
      }));
    }
  
  }
  
  _defineProperty(DrawerSection, "displayName", 'Drawer.Section');
  
  const styles = _reactNative.StyleSheet.create({
    container: {
      marginBottom: 4
    },
    titleContainer: {
      height: 40,
      justifyContent: 'center'
    },
    divider: {
      marginTop: 4
    }
  });
  
  var _default = (0, _theming.withTheme)(DrawerSection);
  
  exports.default = _default;
  //# sourceMappingURL=DrawerSection.js.map