import { useMenuTriggerState as l } from "../../menu/dist/module.es.js";
import { useSingleSelectListState as n } from "../../list/dist/module.es.js";
import { useState as s } from "react";
function u(e) {
  let t = l(e), o = n({
    ...e,
    onSelectionChange: (c) => {
      e.onSelectionChange != null && e.onSelectionChange(c), t.close();
    }
  }), [i, a] = s(!1);
  return {
    ...o,
    ...t,
    open() {
      o.collection.size !== 0 && t.open();
    },
    toggle(c) {
      o.collection.size !== 0 && t.toggle(c);
    },
    isFocused: i,
    setFocused: a
  };
}
export {
  u as useSelectState
};
//# sourceMappingURL=module.es.js.map
