{"ast":null,"code":"import _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nimport _objectDestructuringEmpty from \"@babel/runtime/helpers/objectDestructuringEmpty\";\nvar _excluded = [\"children\", \"direction\", \"reversed\", \"divider\", \"space\"];\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 { default as Box } from \"../Box\";\nimport getSpacedChildren from \"../../../utils/getSpacedChildren\";\nimport { usePropsResolution } from \"../../../hooks/useThemeProps\";\nimport { useNativeBaseConfig } from \"../../../core/NativeBaseContext\";\nimport { useToken } from \"../../../hooks\";\nvar Stack = function Stack(_ref, ref) {\n  var props = Object.assign({}, (_objectDestructuringEmpty(_ref), _ref));\n  var dir = props.direction;\n  var state = {\n    isDisabled: props.isDisabled,\n    isHovered: props.isHovered,\n    isFocused: props.isFocused,\n    isInvalid: props.isInvalid,\n    isReadOnly: props.isReadOnly\n  };\n  var _usePropsResolution = usePropsResolution('Stack', props, state, {\n      resolveResponsively: ['space', 'direction']\n    }),\n    children = _usePropsResolution.children,\n    direction = _usePropsResolution.direction,\n    reversed = _usePropsResolution.reversed,\n    divider = _usePropsResolution.divider,\n    space = _usePropsResolution.space,\n    resolvedProps = _objectWithoutProperties(_usePropsResolution, _excluded);\n  var isSSR = useNativeBaseConfig('NativeBase').isSSR;\n  var disableCSSMediaQueries = !isSSR;\n  var thumbAbsoluteSize = useToken('components.Stack.sizes', space);\n  return React.createElement(Box, _extends({\n    flexDirection: dir\n  }, resolvedProps, {\n    ref: ref,\n    gap: disableCSSMediaQueries ? undefined : thumbAbsoluteSize\n  }), getSpacedChildren(children, thumbAbsoluteSize, direction === 'row' ? 'X' : 'Y', reversed ? 'reverse' : 'normal', divider));\n};\nexport default memo(forwardRef(Stack));","map":{"version":3,"sources":["Stack.tsx"],"names":["React","memo","forwardRef","default","Box","getSpacedChildren","usePropsResolution","useNativeBaseConfig","useToken","Stack","props","ref","dir","direction","state","isDisabled","isHovered","isFocused","isInvalid","isReadOnly","children","reversed","divider","space","resolvedProps","resolveResponsively","isSSR","disableCSSMediaQueries","thumbAbsoluteSize","undefined"],"mappings":";;;;;;;;;;;;;;;;;AAAA,OAAOA,KAAP,IAAgBC,IAAhB,EAAsBC,UAAtB,QAAwC,OAAxC;AACA,SAASC,OAAO,IAAIC,GAApB;AACA,OAAOC,iBAAP;AACA,SAASC,kBAAT;AAEA,SAASC,mBAAT;AACA,SAASC,QAAT;AAgDA,IAAMC,KAAK,GAAG,SAARA,KAAK,CAAA,IAAA,EAA+BE,GAA5B,EAA0C;EAAA,IAApCD,KAAAA,GAAAA,MAAAA,CAAAA,MAAAA,MAAAA,yBAAAA,CAAAA,IAAAA,GAAAA,IAAAA;EAClB,IAAME,GAAG,GAAGF,KAAK,CAACG,SAAlB;EAEA,IAAMC,KAAK,GAAG;IACZC,UAAU,EAAEL,KAAK,CAACK,UADN;IAEZC,SAAS,EAAEN,KAAK,CAACM,SAFL;IAGZC,SAAS,EAAEP,KAAK,CAACO,SAHL;IAIZC,SAAS,EAAER,KAAK,CAACQ,SAJL;IAKZC,UAAU,EAAET,KAAK,CAACS;EALN,CAAd;EAQA,IAAA,mBAAA,GAOSb,kBAAkB,CAAC,OAAD,EAAUI,KAAV,EAAiBI,KAAjB,EAAwB;MACjDW,mBAAmB,EAAE,CAAC,OAAD,EAAU,WAAV;IAD4B,CAAxB,CAP3B;IACEL,QADI,GAAA,mBAAA,CACJA,QADI;IAEJP,SAFI,GAAA,mBAAA,CAEJA,SAFI;IAGJQ,QAHI,GAAA,mBAAA,CAGJA,QAHI;IAIJC,OAJI,GAAA,mBAAA,CAIJA,OAJI;IAKJC,KALI,GAAA,mBAAA,CAKJA,KALI;IAMDC,aAAAA,GAAAA,wBAAAA,CAAAA,mBAAAA,EAAAA,SAAAA;EAKL,IAAME,KAAK,GAAGnB,mBAAmB,CAAC,YAAD,CAAnBA,CAAkCmB,KAAhD;EACA,IAAMC,sBAAsB,GAAG,CAACD,KAAhC;EAEA,IAAME,iBAAiB,GAAGpB,QAAQ,CAAC,wBAAD,EAA2Be,KAA3B,CAzBoB;EAqCtD,OACE,KAAA,CAAA,aAAA,CAAC,GAAD,EAAA,QAAA,CAAA;IACE,aAAa,EAAEX;EADjB,CAAA,EAEMY,aAFN,EAAA;IAGE,GAAG,EAAEb,GAHP;IAKE,GAAG,EAAEgB,sBAAsB,GAAGE,SAAH,GAAeD;EAL5C,CAAA,CAAA,EAOGvB,iBAAiB,CAChBe,QADgB,EAEhBQ,iBAFgB,EAGhBf,SAAS,KAAK,KAAdA,GAAsB,GAAtBA,GAA4B,GAHZ,EAIhBQ,QAAQ,GAAG,SAAH,GAAe,QAJP,EAKhBC,OALgB,CAPpB,CADF;AAiBD,CAtDD;AAwDA,eAAerB,IAAI,CAACC,UAAU,CAACO,KAAD,CAAX,CAAnB","sourcesContent":["import React, { memo, forwardRef } from 'react';\nimport { default as Box, InterfaceBoxProps } from '../Box';\nimport getSpacedChildren from '../../../utils/getSpacedChildren';\nimport { usePropsResolution } from '../../../hooks/useThemeProps';\nimport type { CustomProps, ResponsiveValue, SpaceType } from '../../types';\nimport { useNativeBaseConfig } from '../../../core/NativeBaseContext';\nimport { useToken } from '../../../hooks';\n\nexport interface InterfaceStackProps extends InterfaceBoxProps<IStackProps> {\n  /**\n   * The divider element to use between elements.\n   */\n  divider?: JSX.Element;\n  /**\n   * The space between each stack item. Accepts Responsive values\n   */\n  space?: ResponsiveValue<\n    'gutter' | '2xs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | SpaceType\n  >;\n  /**\n   * Determines whether to reverse the direction of Stack Items.\n   */\n  reversed?: boolean;\n  /**\n   * The direction of the Stack Items.\n   * @default column\n   */\n  direction?: ResponsiveValue<\n    'column' | 'row' | 'column-reverse' | 'row-reverse'\n  >;\n  /**\n   * If true, the Stack will be in hovered state.\n   */\n  isHovered?: boolean;\n  /**\n   * If true, the Stack will be focused.\n   */\n  isFocused?: boolean;\n  /**\n   * If true, the Stack will be disabled.\n   */\n  isDisabled?: boolean;\n  /**\n   * If true, the Stack will be invalid.\n   */\n  isInvalid?: boolean;\n  /**\n   * If true, prevents the value of the children from being edited. Used with FormControls.\n   */\n  isReadOnly?: boolean;\n}\n\nexport type IStackProps = InterfaceStackProps & CustomProps<'Stack'>;\n\nconst Stack = ({ ...props }: IStackProps, ref?: any) => {\n  const dir = props.direction;\n\n  const state = {\n    isDisabled: props.isDisabled,\n    isHovered: props.isHovered,\n    isFocused: props.isFocused,\n    isInvalid: props.isInvalid,\n    isReadOnly: props.isReadOnly,\n  };\n\n  const {\n    children,\n    direction,\n    reversed,\n    divider,\n    space,\n    ...resolvedProps\n  }: any = usePropsResolution('Stack', props, state, {\n    resolveResponsively: ['space', 'direction'],\n  });\n\n  const isSSR = useNativeBaseConfig('NativeBase').isSSR;\n  const disableCSSMediaQueries = !isSSR;\n\n  const thumbAbsoluteSize = useToken('components.Stack.sizes', space);\n\n  // console.log(\n  //   space,\n  //   'hello size !!!!',\n  //   thumbAbsoluteSize,\n  //   unResolvedProps,\n  //   resolvedProps\n  // );\n\n  // console.log(direction, 'INTERNAL_themeStyle ***');\n\n  return (\n    <Box\n      flexDirection={dir}\n      {...resolvedProps}\n      ref={ref}\n      // @ts-ignore\n      gap={disableCSSMediaQueries ? undefined : thumbAbsoluteSize}\n    >\n      {getSpacedChildren(\n        children,\n        thumbAbsoluteSize,\n        direction === 'row' ? 'X' : 'Y',\n        reversed ? 'reverse' : 'normal',\n        divider\n      )}\n    </Box>\n  );\n};\n\nexport default memo(forwardRef(Stack));\n"]},"metadata":{},"sourceType":"module"}