import { computed, isRef } from 'vue';
import { useInjectSize } from '../SizeContext';
const useSize = customSize => {
  const size = useInjectSize();
  return computed(() => {
    var _a;
    const rawSize = size.value;
    if (!customSize) {
      return rawSize;
    }
    if (typeof customSize === 'function') {
      return customSize(rawSize);
    }
    if (isRef(customSize)) {
      return (_a = customSize.value) !== null && _a !== void 0 ? _a : rawSize;
    }
    return rawSize;
  });
};
export default useSize;