import { createVNode as _createVNode } from "vue";
import "./styles/toolbar.css";
import { computed } from "vue";
import { convertToUnit, pick, propsFactory } from "@veno-ui/utils";
import { defineComponent } from "../../utils";
import { makePaperProps, usePaper } from "../../composables/paper";
import { provideDefaults } from "../../composables/defaults";
import { ToolbarTitle } from "./toolbar-title";
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: () => [_createVNode("div", {
          "class": "ve-toolbar__wrapper",
          "style": {
            height: convertToUnit(props.height)
          }
        }, [slots.prepend && _createVNode("div", {
          "class": "ve-toolbar__prepend"
        }, [slots.prepend?.()]), hasTitle && _createVNode(ToolbarTitle, {
          "text": props.title
        }, {
          text: slots.title
        }), slots.default?.(), slots.append && _createVNode("div", {
          "class": "ve-toolbar__append"
        }, [slots.append?.()])])]
      });
    };
  }
});
export {
  Toolbar,
  filterToolbarProps,
  makeToolbarProps
};
//# sourceMappingURL=toolbar.mjs.map
