{"ast":null,"code":"import _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"children\", \"startColor\", \"endColor\", \"lines\", \"isLoaded\", \"_line\"];\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 { usePropsResolution } from \"../../../hooks\";\nimport { Stack } from \"../../primitives/Stack\";\nimport Skeleton from \"./Skeleton\";\nvar SkeletonText = function SkeletonText(props, ref) {\n  var _usePropsResolution = usePropsResolution('SkeletonText', props),\n    children = _usePropsResolution.children,\n    startColor = _usePropsResolution.startColor,\n    endColor = _usePropsResolution.endColor,\n    lines = _usePropsResolution.lines,\n    isLoaded = _usePropsResolution.isLoaded,\n    _line = _usePropsResolution._line,\n    resolvedProps = _objectWithoutProperties(_usePropsResolution, _excluded);\n  var computedChildren = [];\n  for (var i = 0; i < lines; i++) {\n    if (i === lines - 1 && lines !== 1) {\n      computedChildren.push(React.createElement(Skeleton, _extends({\n        key: i,\n        endColor: endColor,\n        startColor: startColor,\n        w: \"75%\"\n      }, _line)));\n    } else computedChildren.push(React.createElement(Skeleton, _extends({\n      key: i,\n      endColor: endColor,\n      startColor: startColor\n    }, _line)));\n  }\n  return isLoaded ? children : React.createElement(Stack, _extends({}, resolvedProps, {\n    ref: ref\n  }), computedChildren);\n};\nexport default memo(forwardRef(SkeletonText));","map":{"version":3,"sources":["SkeletonText.tsx"],"names":["React","memo","forwardRef","usePropsResolution","Stack","Skeleton","SkeletonText","props","ref","children","startColor","endColor","lines","isLoaded","_line","resolvedProps","computedChildren","i","push"],"mappings":";;;;;;;;;;;;;;;;AAAA,OAAOA,KAAP,IAAgBC,IAAhB,EAAsBC,UAAtB,QAAwC,OAAxC;AACA,SAASC,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,EAAA;IAA0B,GAAG,EAAEP;EAA/B,CAAA,CAAA,EACGQ,gBADH,CAHF;AAOD,CAhDD;AAkDA,eAAef,IAAI,CAACC,UAAU,CAACI,YAAD,CAAX,CAAnB","sourcesContent":["import React, { memo, forwardRef } from 'react';\nimport { usePropsResolution } from '../../../hooks';\nimport { Stack } from '../../primitives/Stack';\nimport Skeleton from './Skeleton';\nimport type { ISkeletonTextProps } from './types';\n\nconst SkeletonText = (\n  //@ts-ignore\n  props: ISkeletonTextProps,\n  ref: any\n) => {\n  // const { children, ...props } = allProps;\n  const {\n    children,\n    startColor,\n    endColor,\n    lines,\n    isLoaded,\n    _line,\n    ...resolvedProps\n  } = usePropsResolution('SkeletonText', props);\n\n  const computedChildren = [];\n  //generating an array of skeleton components (same length as noOfLines)\n  for (let i = 0; i < lines; i++) {\n    //check for last line (to change the width of last line)\n    if (i === lines - 1 && lines !== 1) {\n      computedChildren.push(\n        //Using Skeleton component with required props\n        <Skeleton\n          key={i}\n          endColor={endColor}\n          startColor={startColor}\n          w=\"75%\"\n          {..._line}\n        />\n      );\n    } else\n      computedChildren.push(\n        <Skeleton\n          key={i}\n          endColor={endColor}\n          startColor={startColor}\n          {..._line}\n        />\n      );\n  }\n  return isLoaded ? (\n    children\n  ) : (\n    <Stack {...resolvedProps} ref={ref}>\n      {computedChildren}\n    </Stack>\n  );\n};\n\nexport default memo(forwardRef(SkeletonText));\n"]},"metadata":{},"sourceType":"module"}