import { useState as f, useCallback as r, useMemo as i } from "react";
import { dataAttrs as m } from "../utils/dataAttributes.js";
function k({
  value: s,
  disabled: t = !1,
  readOnly: c = !1
}) {
  const [e, n] = f(!1), a = r(() => {
    !t && !c && n(!0);
  }, [t, c]), u = r(() => {
    n(!1);
  }, []), o = s != null && s !== "", l = i(
    () => m({
      active: e,
      complete: o,
      disabled: t
    }),
    [e, o, t]
  );
  return {
    isActive: e,
    isComplete: o,
    handlers: { onFocus: a, onBlur: u },
    trackDataAttributes: l
  };
}
export {
  k as useFloatingLabel
};
//# sourceMappingURL=useFloatingLabel.js.map
