import { createComponent, mergeProps as mergeProps$1 } from 'solid-js/web';
import { mergeProps } from 'solid-js';
import { Relative, Position } from '@cn-ui/core';
import { OriginComponent } from '@cn-ui/use';

const Card = OriginComponent(props => {
  props = mergeProps({}, props);
  const defaultPos = {
    left: '0',
    right: '0'
  };
  return createComponent(Relative, mergeProps$1({
    ref(r$) {
      const _ref$ = props.ref;
      typeof _ref$ === "function" ? _ref$(r$) : props.ref = r$;
    },

    get ["class"]() {
      return props.class('cn-card');
    }

  }, props, {
    get children() {
      return [createComponent(Position, mergeProps$1({
        "z-index": "0"
      }, defaultPos, {
        style: {
          height: '100%',
          overflow: 'hidden'
        },

        get children() {
          return props.background;
        }

      })), createComponent(Position, mergeProps$1({
        "z-index": "1"
      }, defaultPos, {
        full: true,

        get children() {
          return props.children;
        }

      }))];
    }

  }));
});

export { Card };
