import { computed, createVNode } from "vue";
import "./styles/toolbar.scss";
import { makePaperProps, usePaper } from "../../composables/paper/index.mjs";
import { provideDefaults } from "../../composables/defaults/index.mjs";
import { ToolbarTitle } from "./toolbar-title.mjs";
import { propsFactory, convertToUnit, pick } from "../../utils/dist/index.mjs";
import { defineComponent } from "../../utils/define-component.mjs";
const makeToolbarProps = propsFactory({
  title: String,
  ...makePaperProps({
    tag: "header",
    height: 64
  })
}, "toolbar");
function filterToolbarProps(attrs) {
  return pick(attrs, Object.keys(Toolbar.props));
}
const Toolbar = defineComponent({
  name: "VeToolbar",
  props: makeToolbarProps(),
  setup(props, {
    slots
  }) {
    const {
      paperClasses,
      paperStyles
    } = usePaper(computed(() => ({
      ...props,
      height: void 0
    })));
    provideDefaults({
      VeButton: {
        variant: "text"
      }
    });
    return () => {
      const hasTitle = !!(props.title || slots.title);
      return createVNode(props.tag, {
        "class": ["ve-toolbar", paperClasses.value],
        "style": paperStyles.value
      }, {
        default: () => {
          var _a, _b, _c;
          return [createVNode("div", {
            "class": "ve-toolbar__wrapper",
            "style": {
              height: convertToUnit(props.height)
            }
          }, [slots.prepend && createVNode("div", {
            "class": "ve-toolbar__prepend"
          }, [(_a = slots.prepend) == null ? void 0 : _a.call(slots)]), hasTitle && createVNode(ToolbarTitle, {
            "text": props.title
          }, {
            text: slots.title
          }), (_b = slots.default) == null ? void 0 : _b.call(slots), slots.append && createVNode("div", {
            "class": "ve-toolbar__append"
          }, [(_c = slots.append) == null ? void 0 : _c.call(slots)])])];
        }
      });
    };
  }
});
export {
  Toolbar,
  filterToolbarProps,
  makeToolbarProps
};
//# sourceMappingURL=toolbar.mjs.map
