import c from "../../../rc-util/es/KeyCode.mjs";
import * as y from "react";
var p = globalThis && globalThis.__rest || function(t, l) {
  var o = {};
  for (var e in t)
    Object.prototype.hasOwnProperty.call(t, e) && l.indexOf(e) < 0 && (o[e] = t[e]);
  if (t != null && typeof Object.getOwnPropertySymbols == "function")
    for (var n = 0, e = Object.getOwnPropertySymbols(t); n < e.length; n++)
      l.indexOf(e[n]) < 0 && Object.prototype.propertyIsEnumerable.call(t, e[n]) && (o[e[n]] = t[e[n]]);
  return o;
};
const g = {
  border: 0,
  background: "transparent",
  padding: 0,
  lineHeight: "inherit",
  display: "inline-block"
}, O = /* @__PURE__ */ y.forwardRef((t, l) => {
  const o = (a) => {
    const {
      keyCode: s
    } = a;
    s === c.ENTER && a.preventDefault();
  }, e = (a) => {
    const {
      keyCode: s
    } = a, {
      onClick: i
    } = t;
    s === c.ENTER && i && i();
  }, {
    style: n,
    noStyle: f,
    disabled: b
  } = t, d = p(t, ["style", "noStyle", "disabled"]);
  let r = {};
  return f || (r = Object.assign({}, g)), b && (r.pointerEvents = "none"), r = Object.assign(Object.assign({}, r), n), /* @__PURE__ */ y.createElement("div", Object.assign({
    role: "button",
    tabIndex: 0,
    ref: l
  }, d, {
    onKeyDown: o,
    onKeyUp: e,
    style: r
  }));
}), m = O;
export {
  m as default
};
