{"ast":null,"code":"import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"children\", \"divider\"],\n  _excluded2 = [\"_text\", \"_hover\", \"_focus\", \"_pressed\"];\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\nfunction _extends() {\n  _extends = Object.assign || function (target) {\n    for (var i = 1; i < arguments.length; i++) {\n      var source = arguments[i];\n      for (var key in source) {\n        if (Object.prototype.hasOwnProperty.call(source, key)) {\n          target[key] = source[key];\n        }\n      }\n    }\n    return target;\n  };\n  return _extends.apply(this, arguments);\n}\nimport React, { memo, forwardRef } from 'react';\nimport { VStack } from \"../Stack\";\nimport { usePropsResolution } from \"../../../hooks/useThemeProps\";\nvar List = function List(_ref, ref) {\n  var children = _ref.children,\n    divider = _ref.divider,\n    props = _objectWithoutProperties(_ref, _excluded);\n  var _usePropsResolution = usePropsResolution('List', props),\n    _text = _usePropsResolution._text,\n    _hover = _usePropsResolution._hover,\n    _focus = _usePropsResolution._focus,\n    _pressed = _usePropsResolution._pressed,\n    resolvedProps = _objectWithoutProperties(_usePropsResolution, _excluded2);\n  children = React.Children.map(children, function (child, ind) {\n    var _child$props, _child$props2, _child$props3, _child$props4;\n    return React.cloneElement(child, {\n      index: ind,\n      _text: _objectSpread(_objectSpread({}, _text), (_child$props = child.props) === null || _child$props === void 0 ? void 0 : _child$props._text),\n      _hover: _objectSpread(_objectSpread({}, _hover), (_child$props2 = child.props) === null || _child$props2 === void 0 ? void 0 : _child$props2._hover),\n      _focus: _objectSpread(_objectSpread({}, _focus), (_child$props3 = child.props) === null || _child$props3 === void 0 ? void 0 : _child$props3._focus),\n      _pressed: _objectSpread(_objectSpread({}, _pressed), (_child$props4 = child.props) === null || _child$props4 === void 0 ? void 0 : _child$props4._pressed)\n    });\n  });\n  return React.createElement(VStack, _extends({\n    divider: divider,\n    ref: ref\n  }, resolvedProps), children);\n};\nexport default memo(forwardRef(List));","map":{"version":3,"sources":["List.tsx"],"names":["React","memo","forwardRef","VStack","usePropsResolution","List","children","divider","props","ref","_text","_hover","_focus","_pressed","resolvedProps","Children","map","child","ind","cloneElement","index"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,OAAOA,KAAP,IAAgBC,IAAhB,EAAsBC,UAAtB,QAAwC,OAAxC;AACA,SAASC,MAAT;AAEA,SAASC,kBAAT;AAEA,IAAMC,IAAI,GAAG,SAAPA,IAAI,CAAA,IAAA,EAAiDI,GAA9C,EAA4D;EAAA,IAAzDH,QAAF,GAAA,IAAA,CAAEA,QAAF;IAAYC,OAAZ,GAAA,IAAA,CAAYA,OAAZ;IAAwBC,KAAAA,GAAAA,wBAAAA,CAAAA,IAAAA,EAAAA,SAAAA;EACpC,IAAA,mBAAA,GAMIJ,kBAAkB,CAAC,MAAD,EAASI,KAAT,CAPiD;IAErEE,KADI,GAAA,mBAAA,CACJA,KADI;IAEJC,MAFI,GAAA,mBAAA,CAEJA,MAFI;IAGJC,MAHI,GAAA,mBAAA,CAGJA,MAHI;IAIJC,QAJI,GAAA,mBAAA,CAIJA,QAJI;IAKDC,aAAAA,GAAAA,wBAAAA,CAAAA,mBAAAA,EAAAA,UAAAA;EAILR,QAAQ,GAAG,KAAK,CAACS,QAAN,CAAeC,GAAf,CAAmBV,QAAnB,E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VStack } from '../Stack';\nimport type { IListProps, IListItemProps } from './types';\nimport { usePropsResolution } from '../../../hooks/useThemeProps';\n\nconst List = ({ children, divider, ...props }: IListProps, ref?: any) => {\n  const {\n    _text,\n    _hover,\n    _focus,\n    _pressed,\n    ...resolvedProps\n  } = usePropsResolution('List', props);\n\n  // add props to children\n  children = React.Children.map(children, (child: any, ind: number) => {\n    return React.cloneElement(child, {\n      index: ind,\n      _text: { ..._text, ...child.props?._text },\n      _hover: { ..._hover, ...child.props?._hover },\n      _focus: { ..._focus, ...child.props?._focus },\n      _pressed: { ..._pressed, ...child.props?._pressed },\n    });\n  });\n\n  return (\n    <VStack divider={divider} ref={ref} {...resolvedProps}>\n      {children}\n    </VStack>\n  );\n};\n\nexport type { IListProps, IListItemProps };\nexport default memo(forwardRef(List));\n"]},"metadata":{},"sourceType":"module"}